Exemple #1
0
         if ($size_id == $row['size_id']) {
             $size = $row['size_name'];
             break;
         }
     }
     $noproduct = $_POST['no_of_products'];
     $pproduct = $_POST['price_product'];
     $total_bill = $pproduct * $noproduct;
     $date = date("d/m/Y");
     $que = "insert into purchase(bill_id,product_name,product_size,purchase_date,number_of_products,price_product,total_bill) values     ('{$bill_id}','{$product}','{$size}','{$date}','{$noproduct}','{$pproduct}','{$total_bill}')";
     if (mysql_query($que)) {
         echo "<script>alert('Purchase is added to Bill No. " . $bill_id . " !')</script>";
     }
 }
 $productHTML = listproduct($_POST['listproduct']);
 $sizeHTML = listsize($_POST['listproduct']);
 ?>
 <!DOCTYPE.php>
 <!-- Website template by freewebsitetemplates.com -->
 <html>
     <head>
         <meta charset="UTF-8" />
         <title>Purchase of Products</title>
         <link rel="stylesheet" type="text/css" href="../css/style.css" />
         <!--[if IE 9]>
                 <link rel="stylesheet" type="text/css" href="css/ie9.css" />
         <![endif]-->
         <!--[if IE 8]>
                 <link rel="stylesheet" type="text/css" href="css/ie8.css" />
         <![endif]-->
         <!--[if IE 7]>
    }
    $noproduct = $_POST['no_of_products'];
    $pproduct = $_POST['price_product'];
    $total_bill = $pproduct * $noproduct;
    $tatal_cost = $cost * $noproduct;
    $date = date("d/m/Y");
    if (isset($_POST['btnedit'])) {
        $query = "update  sales set product_name = '{$product}',product_size='{$size}',number_of_products='{$noproduct}',price_product = '{$pproduct}',total_bill = '{$total_bill}',product_cost='{$tatal_cost}' where sale_id = '{$sale_id}'";
        $new = $bill_id . '/' . $page_id;
        if (mysql_query($query)) {
            header("location:edit_customer_bill.php?var={$new}");
        }
    }
}
$productHTML = listproduct($pro_id);
$sizeHTML = listsize($pro_id);
?>
<!DOCTYPE.php>
<!-- Website template by freewebsitetemplates.com -->
<html>
    <head>
        <meta charset="UTF-8" />
        <title>Update Sale</title>
        <link rel="stylesheet" type="text/css" href="../css/style.css" />
        <!--[if IE 9]>
                <link rel="stylesheet" type="text/css" href="css/ie9.css" />
        <![endif]-->
        <!--[if IE 8]>
                <link rel="stylesheet" type="text/css" href="css/ie8.css" />
        <![endif]-->
        <!--[if IE 7]>