D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
shubmkcj
/
urbane.createerp.com
/
Filename :
view-purchase-order.php
back
Copy
<?php ob_start(); session_start(); include 'config.php'; $login = $_SESSION['login_email']; if($login == ''){ echo '<script>location.replace("index.php")</script>'; } $id = $_GET['id']; if(isset($_SESSION["source_id"])){ $source_id = $_SESSION['source_id']; } $companyd = mysqli_query($conn,"SELECT * FROM `company_details`"); $companyrow = mysqli_fetch_assoc($companyd); $contact_person = $companyrow['contact_person']; $company_name = $companyrow['company_name']; $company_logo = $companyrow['company_logo']; $GSTIN = $companyrow['GSTIN']; $phone = $companyrow['phone']; $eb_email = $companyrow['email']; $address = $companyrow['address']; $city = $companyrow['city']; $state = $companyrow['state']; $country = $companyrow['country']; $account_name = $companyrow['account_name']; $account_no = $companyrow['account_no']; $bank_name = $companyrow['bank_name']; $ifsc = $companyrow['ifsc']; $shift = $companyrow['shift']; $branch = $companyrow['branch']; $company_color = $companyrow['company_color']; $currency = $companyrow['currency']; $invoice_prifix = $companyrow['invoice_prifix']; $default_invoice = $companyrow['default_invoice']; $signature = $companyrow['signature']; $invoice_note = $companyrow['invoice_note']; ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Invoice Management | Invoice</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <meta content="A fully featured admin theme which can be used to build CRM, CMS, etc." name="description" /> <meta content="Coderthemes" name="author" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <!-- Font Awsome --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <!-- App favicon --> <link rel="shortcut icon" href="assets/images/favicon.png"> <!-- Pie Chart Css --> <!--<link href="assets/pie charts/style.css" rel="stylesheet" type="text/css" />--> <!-- App css --> <link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <link href="assets/css/icons.css" rel="stylesheet" type="text/css" /> <link href="assets/css/metismenu.min.css" rel="stylesheet" type="text/css" /> <link href="assets/css/style.css" rel="stylesheet" type="text/css" /> <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.5/css/select2.min.css'> <script src="assets/js/modernizr.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script type="text/javascript" src="script.js"></script> <link href="plugins/sweet-alert2/sweetalert2.min.css" rel="stylesheet" type="text/css"> <link href="plugins/jquery-toastr/jquery.toast.min.css" rel="stylesheet" /> <style> .table td, .table th { padding: .75rem; vertical-align: top; border-top: 0px solid #dee2e6; border-bottom: 1px solid #dee2e6; } </style> </head> <body> <!-- Begin page --> <div id="wrapper"> <!-- Top Bar Start --> <?php include 'top-header.php'; ?> <!-- Top Bar End --> <!-- ========== Left Sidebar Start ========== --> <?php include 'left-sidebar.php'; ?> <!-- Left Sidebar End --> <!-- ============================================================== --> <!-- Start right Content here --> <!-- ============================================================== --> <div class="content-page"> <!-- Start content --> <div class="content"> <div class="container-fluid"> <div class="row"> <div class="col-12"> <div class="page-title-box"> <h4 class="page-title float-left">View Purchase order</h4> <ol class="breadcrumb float-right"> <li class="breadcrumb-item"><a href="#">Sales</a></li> <li class="breadcrumb-item ">All Purchase order</li> <li class="breadcrumb-item active">View Purchase order</li> </ol> <div class="clearfix"></div> </div> </div> </div> <!-- end row --> <?php $companyId =""; $sql = " SELECT * FROM purchase_order where id = '$id'"; $result = mysqli_query($conn,$sql); while( $row = mysqli_fetch_array($result)){ $manufacturer_id = $row['manufacturer']; $po_id = $row['po_id']; $order_date = $row['order_date']; $proforma_id = $row['proforma_id']; $receive_info = $row['receive_info']; $delivery_address = $row['delivery_address']; $delivery_type = $row['delivery_type']; $delivery_terms = $row['delivery_terms']; $type = $row['type']; $payment_terms = $row['payment_terms']; $comment = $row['comment']; $subtotal_price = $row['subtotal_price']; $bank_charges = $row['bank_charges']; $amount_paind = $row['amount_paind']; $date_creation = $row['date_creation']; ?> <div class="card-box"> <div class="col-md-12"> <div class="row" > <div class="col-md-12 mt-3 mb-3"> <h3 class="text-center" style="color:<?php echo $row['company_color'] ?>;"><b>Purchase order</b></h3> </div> </div> <div class="row"> <div class="col-md-8"> <h3 class="mb-0"><?php echo $company_name ?></h3> <p class="mb-0"><?php echo $address.','.$city.','.$state.','.$country; ?></p> <p class="mb-0">Contact Person : <?php echo $contact_person ?></p> <p class="mb-0">Contact Number : <?php echo $phone ?></p> <p class="mb-0">Email : <?php echo $eb_email ?></p> </div> <div class="col-md-4 text-right"> <p class="mb-0"><b>Purchase Order : <?php echo $po_id ?></b></p> <p class="mb-0">Proforma No. : <?php echo $proforma_id ?> <p> <p class="mb-0">Order Date : <?php echo $order_date ?></p> </div> </div> <hr> <?php $contactsql = mysqli_query($conn,"SELECT * FROM `manufacturer` where id='$manufacturer_id'"); $contactrow = mysqli_fetch_assoc($contactsql); $customer_type = $contactrow['customer_type']; $manufacturer_display_name = $contactrow['manufacturer_display_name']; $contact_person_name = $contactrow['contact_person_name']; $manu_phone = $contactrow['phone']; $manu_email = $contactrow['email']; $currency = $contactrow['currency']; $address_get = $contactrow['address'] .', '. $contactrow['city'] .', '. $contactrow['state'] .', '. $contactrow['country']; ?> <div class="row"> <div class="col-md-8"> <p><b>Manufacturer :</b></p> <p class="mb-0"> <b><?php echo $manufacturer_display_name ?></b> </p> <p class="mb-0"> <?php echo $address_get ?></p> <p class="mb-0">Contact Person: <?php echo $contact_person_name ?></p> <p class="mb-0">Contact No.: <?php echo $manu_phone ?></p> <p class="mb-0">Contact Email.: <?php echo $manu_email ?></p> </div> <div class="col-md-4 text-right"> <p class="mb-0">Delivery Terms :<?php echo $delivery_terms ?></p> <p class="mb-0">Delivery Type : <?php echo $delivery_type ?></p> <p class="mb-0">Payment Terms : <?php echo $payment_terms ?></p> </div> </div> <hr> <br> </div> <div class="row" > <table class="table table-responsive"> <thead> <tr style="width:100%"> <th>Item Code</th> <th>Image</th> <th>Item Name</th> <th>Size</th> <th>Color</th> <th>Qty.</th> <th>Unit</th> <th>Price (<?php echo $currency ?>)</th> <th>Total (<?php echo $currency ?>)</th> </tr> </thead> <tbody id="itemsadd"> <?php $getitemsql = mysqli_query($conn,"SELECT * FROM po_item a left join inventory b on a.item_id = b.id where a.purchase_order_id = '$id'"); while($item_row = mysqli_fetch_assoc($getitemsql)){ $item_image = $item_row['item_image']; ?> <tr style="width:100%"> <td style="width:10%"><?php echo $item_row['item_code'] ?></td> <td style="width:5%"><img src="inventory/<?php echo $item_image ?>" width="50"></td> <td style="width:15%"><?php echo $item_row['name'] ?> / <?php echo $item_row['item_name_ch'] ?></td> <td style="width:10%"><?php echo $item_row['size'] ?></td> <td style="width:10%"><?php echo $item_row['color'] ?> / <?php echo $item_row['item_color_ch'] ?></td> <td style="width:5%"><?php echo $item_row['qty'] ?></td> <td style="width:5%"><?php echo $item_row['unit_of_measure'] ?></td> <td style="width:10%"><?php echo $item_row['price'] ?></td> <td style="width:10%"><?php echo $item_row['row_total'] ?></td> </tr> <?php }?> </tbody> </table> </div> <div class="row"> <div class="col-md-8"> <div class="form-group"> <p><b>Comment : </b> <?php echo $comment ?></p> </div> </div> <div class="col-md-4"> <div class="form-group row"> <p class="col-9 mb-0 ">Sub Total </label> <div class="col-3"> <p class="mb-0 "><?php echo $currency ?> <?php echo $subtotal_price?> </p> </div> </div> <div class="form-group row"> <p class="col-9 mb-0 "> Amount Paid </label> <div class="col-3"> <p class="mb-0 "><?php echo $currency ?> <?php echo $amount_paind?> </p> </div> </div> </div> <div class="col-md-8"> </div> <?php $sql_proforma = "SELECT SUM(qty) AS item_qty FROM proforma_item WHERE proforma_id = '$proforma_id'"; $sql_proforma_item = mysqli_query($conn,$sql_proforma); $sql_proforma_r = mysqli_fetch_assoc($sql_proforma_item); $total_proforma_qty = $sql_proforma_r['item_qty']; ?> <?php $sql_c = "SELECT SUM(qty) AS item_qty FROM invoice_item WHERE proforma_id = '$proforma_id'"; $sql_c_i = mysqli_query($conn,$sql_c); $sql_c_r = mysqli_fetch_assoc($sql_c_i); $total_invoice_qty = $sql_c_r['item_qty']; ?> <div class="col-md-12"> <a href="edit-purchase.php?id=<?php echo $id ?>" class="btn w-md waves-effect waves-light btn-info" data-toggle="tooltip" data-placement="top" title="" data-original-title="Edit"><i class="fa fa-pencil"></i> Edit</a> <button type="button" class="btn w-md waves-effect waves-light btn-danger" value="<?php echo $id ?>" data-toggle="tooltip" data-placement="top" title="" data-original-title="Delete" id="btnDelete" onclick="deletePurchase(this)"><i class="fa fa-trash-o"></i> Delete</button> <a href="print-purchase.php?id=<?php echo $id ?>" target="blank" class="btn w-md waves-effect waves-light btn-success" data-toggle="tooltip" data-placement="top" title="" data-original-title="Print"><i class="fa fa-print"></i> Print</a> </div> </div> </div> <?php } ?> </div> </div> <!-- container --> </div> <!-- content --> <?php include 'copyrignt.php' ?> </div> <!-- ============================================================== --> <!-- End Right content here --> <!-- ============================================================== --> </div> <!-- END wrapper --> <!-- /.modal --> <script src="assets/js/jquery.min.js"></script> <script src="assets/js/popper.min.js"></script><!-- Popper for Bootstrap --> <script src="assets/js/bootstrap.min.js"></script> <script src="assets/js/metisMenu.min.js"></script> <!--<script src="assets/js/waves.js"></script>--> <script src="assets/js/jquery.slimscroll.js"></script> <!-- Dashboard init --> <!-- <script src="assets/pages/jquery.dashboard.js"></script> --> <!-- App js --> <script src="assets/js/jquery.core.js"></script> <script src="assets/js/jquery.app.js"></script> <!-- Chart Js --> <!-- <script src="assets/pie charts/script.js"></script>--> <!-- <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js'></script> --> <!-- <script src='https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.5/js/select2.min.js'></script> --> <script src="plugins/sweet-alert2/sweetalert2.min.js"></script> <script src="plugins/jquery-toastr/jquery.toast.min.js" type="text/javascript"></script> <script> function deletePurchase(button){ var itemId = $(button).val(); swal({ title: 'Are you sure?', text: "Do you really want to restore this Item??", type: 'warning', showCancelButton: true, confirmButtonColor: '#4fa7f3', cancelButtonColor: '#d57171', confirmButtonText: "Yes, I'm Sure!" }).then(function () { $.ajax({ url : "PHP/response.php", data : "action=deletePurchase&purchaseId="+itemId, method : "POST", async : false, success : function(response){ if(response == "DELETED"){ localStorage.setItem("deletePurchase", "true"); location.replace('purchase-order.php'); } else{ errorMessage("Item could not be deleted."); } }, error : function(error){ errorMessage("Item could not be deleted."); } }); }); } </script> </body> </html>