• Dorixona” web ilovasini testlash va olingan xulosalar
  • Buxoro davlat universiteti axborot texnologiyalari fakulteti




    Download 1,48 Mb.
    bet9/10
    Sana31.05.2024
    Hajmi1,48 Mb.
    #258354
    1   2   3   4   5   6   7   8   9   10
    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 "";
    echo "";
    echo "";
    echo "";
    while ($row = mysqli_fetch_array($res)) {
    echo "";
    echo "";
    echo "";
    echo "";
    echo "";
    }
    echo "
    DRUGDESCRIPTIONAVAILABLITY
    ".$row['drug_name']."".$row['description']."".$row['availability']."
    ";

    }
    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 "";
    echo "";
    echo "";
    echo "";
    echo "";
    echo "";
    echo "";
    echo "";
    while ($row = mysqli_fetch_array($res)) {
    echo "";
    echo "";
    echo "";
    echo "";
    echo "";
    echo "";
    echo "";
    echo "";

    echo "";
    }
    echo "
    PRESCRIPTION-IDCUSTOMER NAMEAGESEXADDRESSPHONE NODATE
    ".$row['pres_id']."".$row['cust_name']."".$row['Age']."".$row['sex']."".$row['address']."".$row['Phone']."".$row['date']."
    ";

    }
    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:

    Download 1,48 Mb.
    1   2   3   4   5   6   7   8   9   10




    Download 1,48 Mb.

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    Buxoro davlat universiteti axborot texnologiyalari fakulteti

    Download 1,48 Mb.