|
Buxoro davlat universiteti axborot texnologiyalari fakulteti
|
bet | 9/10 | Sana | 31.05.2024 | Hajmi | 1,48 Mb. | | #258354 |
Bog'liq Kurs ishi.1// Include config file
require_once "config.php";
// Initialize the session
session_start();
// Check if the user is logged in, if not then redirect him to login page
if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){
header("location: login.php");
exit;
}
$sql = "SELECT * FROM drugs WHERE availability='yes'";
if ($res = mysqli_query($link, $sql)) {
if (mysqli_num_rows($res) > 0) {
echo "";
echo "";
echo "DRUG | ";
echo "DESCRIPTION | ";
echo "AVAILABLITY | ";
echo " ";
while ($row = mysqli_fetch_array($res)) {
echo "";
echo "".$row['drug_name']." | ";
echo "".$row['description']." | ";
echo "".$row['availability']." | ";
echo " ";
}
echo " ";
}
else {
echo "NO DRUGS AVAILABLE NOW DUE TO CORONA.";
}
}
else {
echo "ERROR: Could not able to execute $sql. "
.mysqli_error($link);
}
Mavjud dorilar ro’yxati.
// Include config file
require_once "config.php";
// Initialize the session
session_start();
// Check if the user is logged in, if not then redirect him to login page
if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){
header("location: login.php");
exit;
}
$sql = "SELECT * FROM prescription";
if ($res = mysqli_query($link, $sql)) {
if (mysqli_num_rows($res) > 0) {
echo "";
echo "";
echo "PRESCRIPTION-ID | ";
echo "CUSTOMER NAME | ";
echo "AGE | ";
echo "SEX | ";
echo "ADDRESS | ";
echo "PHONE NO | ";
echo "DATE | ";
echo " ";
while ($row = mysqli_fetch_array($res)) {
echo "";
echo "".$row['pres_id']." | ";
echo "".$row['cust_name']." | ";
echo "".$row['Age']." | ";
echo "".$row['sex']." | ";
echo "".$row['address']." | ";
echo "".$row['Phone']." | ";
echo "".$row['date']." | ";
echo " ";
}
echo " ";
}
else {
echo "No matching records are found.";
}
}
else {
echo "ERROR: Could not able to execute $sql. "
.mysqli_error($link);
}
mysqli_close($link);
?>
Mijozlar jadvali.
if(isset($_POST['insert_btn'])){
$stock_id=$_POST['stock_id'];
$drug_name=$_POST['drug_name'];
$date_supplied=$_POST['date_supplied'];
$description=$_POST['description'];
$supplier=$_POST['supplier'];
$quantity=$_POST['quantity'];
$cost=$_POST['cost'];
$availability=$_POST['availability'];
if($stock_id=="" || $drug_name=="" || $date_supplied=="" || $description=="" || $supplier=="" || $quantity=="" || $cost==""|| $availability=="")
{
echo '';
}
else{
$query = "insert into stock values($stock_id,'$drug_name','$date_supplied','$description', '$supplier',$quantity,$cost,'$availability')";
$query_run=mysqli_query($link,$query);
if($query_run)
{
echo '';
}
else{
echo '';
}
}
}
else if(isset($_POST['update_btn']))
{
if($_POST['stock_id']=="" || $_POST['drug_name']=="" || $_POST['date_supplied']=="" || $_POST['description']=="" || $_POST['supplier']=="" || $_POST['quantity']=="" || $_POST['cost']=="" || $_POST['availability']=="")
{
echo '';
}
else{
$stock_id=$_POST['stock_id'];
$drug_name=$_POST['drug_name'];
$date_supplied=$_POST['date_supplied'];
$description=$_POST['description'];
$supplier=$_POST['supplier'];
$quantity=$_POST['quantity'];
$cost=$_POST['cost'];
$availability=$_POST['availability'];
$query = "update stock
SET stock_id='$stock_id', drug_name='$drug_name', date_supplied='$date_supplied', description='$description', supplier='$supplier', quantity='$quantity', cost='$cost', availability='$availability'
WHERE stock_id=$stock_id";
$query_run = mysqli_query($link,$query);
if($query_run)
{
echo '';
}
else{
echo '';
}
}
}
else if(isset($_POST['delete_btn']))
{
if($_POST['stock_id']=="")
{
echo '';
}
else{
$stock_id = $_POST['stock_id'];
$query = "delete from stock
WHERE stock_id=$stock_id";
$query_run = mysqli_query($link,$query);
if($query_run)
{
echo '';
}
else{
echo '';
}
}
}
?>
Mahsulotlar kiritish bo’limi.
“Dorixona” web ilovasini testlash va olingan xulosalar
Dasturiy mahsulotni testlash jarayoni quyidagi bosqichlardan iborat bo'lishi mumkin:
|
| |