D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
home
/
shubmkcj
/
urbane.createerp.com
/
Filename :
fetch-purchase-orders-details.php
back
Copy
<?php ob_start(); session_start(); include 'config.php'; $login = $_SESSION['login_email']; if($login == ''){ echo '<script>location.replace("index.php")</script>'; } if(isset($_SESSION["source_id"])){ $source_id = $_SESSION['source_id']; } $manufacturer_id=$_GET['id']; // echo $manufacturer_id; $sql = "SELECT * FROM `manufacturer` WHERE `manufacturer`.`id`=$manufacturer_id"; $result = mysqli_query($conn,$sql); if (mysqli_num_rows($result) > 0) { while( $row = mysqli_fetch_array($result)){ $manufacturer_display_name = $row['manufacturer_display_name']; } } function create_slug($string){ $slug=strtolower(preg_replace('/[^A-Za-z0-9-]+/', '-', $string)); return $slug; } ?> <!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" /> <!-- DataTables --> <link href="plugins/datatables/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css" /> <link href="plugins/datatables/buttons.bootstrap4.min.css" rel="stylesheet" type="text/css" /> <!-- Responsive datatable examples --> <link href="plugins/datatables/responsive.bootstrap4.min.css" rel="stylesheet" type="text/css" /> <script src="assets/js/modernizr.min.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" /> <link href="https://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet"> </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"><?php echo $manufacturer_display_name;?> Manufacturer </h4> <ol class="breadcrumb float-right"> <li class="breadcrumb-item"><a href="#">Purchase Order</a></li> <li class="breadcrumb-item active">Show Manufacturer Details </li> </ol> <div class="clearfix"></div> </div> </div> </div> <!-- end row --> <div class="row"> <div class="col-sm-12"> <div class="card-box table-responsive"> <table id="invoiceTablesdks" class="table table-bordered"> <thead> <tr class="theme-bg"> <th>Sr.</th> <th>Manufacturer Name</th> <th>Purchase Order Id</th> <th>Order Date</th> <th class="text-center">Total Amount</th> </tr> </thead> <tbody> <?php $srNO=0; $totalPaidAmt = 0.00; $queryz = "SELECT * FROM `purchase_order` WHERE `purchase_order`.`manufacturer`='$manufacturer_id' AND `data_delete`='NO' ORDER BY `purchase_order`.`id` DESC"; $resultz = mysqli_query($conn, $queryz); if (mysqli_num_rows($resultz) > 0) { while($row1z = mysqli_fetch_assoc($resultz)) { $po_id= $row1z['po_id']; $order_date= $row1z['order_date']; $totalPaidAmtz= $row1z['amount_paind']; $totalPaidAmt=$totalPaidAmt+$totalPaidAmtz; // $totalamtsPaid = sprintf('%0.2f', $totalPaidAmt); // die; ?> <tr class="gradeX" style='font-size:13px'> <td><?php echo $srNO+=1; ?></td> <td><?php echo $manufacturer_display_name; ?></td> <td><?php echo $po_id; ?></td> <td><?php echo $order_date; ?></td> <td class="text-center"><?php echo $totalPaidAmtz;?> </td> </tr> <?php } }?> </tbody> <tfoot> <tr class="theme-bg"> <th></th> <th></th> <th></th> <th style="text-align:right; font-weight:800; font-size: 16px;">Total</th> <th style="text-align:center; font-weight:800; font-size: 16px;"><?php echo $totalPaidAmt;?></th> </tr> </tfoot> </table> </div> </div> <!-- end: page --> </div> </div> <!-- container --> </div> <!-- content --> <?php include 'copyrignt.php' ?> </div> <!-- ============================================================== --> <!-- End Right content here --> <!-- ============================================================== --> </div> <!-- END wrapper --> <!-- Chart Js --> <script src='https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js'></script> <script src='https://cdnjs.cloudflare.com/ajax/libs/c3/0.4.11/c3.min.js'></script> <script src='https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.3/Chart.js'></script> <!-- jQuery --> <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-validate/1.17.0/jquery.validate.js"></script> <!-- <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js'></script> --> <script src="https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script> <!-- Required datatable js --> <script src="plugins/datatables/jquery.dataTables.min.js"></script> <script src="plugins/datatables/dataTables.bootstrap4.min.js"></script> <!-- Buttons examples --> <script src="plugins/datatables/dataTables.buttons.min.js"></script> <script src="plugins/datatables/buttons.bootstrap4.min.js"></script> <script src="plugins/datatables/jszip.min.js"></script> <script src="plugins/datatables/pdfmake.min.js"></script> <script src="plugins/datatables/vfs_fonts.js"></script> <script src="plugins/datatables/buttons.html5.min.js"></script> <script src="plugins/datatables/buttons.print.min.js"></script> <script src="plugins/datatables/buttons.colVis.min.js"></script> <!-- Responsive examples --> <script src="plugins/datatables/dataTables.responsive.min.js"></script> <script src="plugins/datatables/responsive.bootstrap4.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 type="text/javascript"> $(document).ready(function() { $('#invoiceTablesdks').DataTable( { dom: "<'row'<'col-sm-4'l><'col-sm-4 text-center'B><'col-sm-4'f>>tp", "lengthMenu": [ [10, 25, 50, -1], [10, 25, 50, "All"] ], buttons: [{ extend: 'copy', footer: true, title: '<?php echo create_slug('Manufacturer');?>', className: 'btn-sm' }, { extend: 'csv', footer: true, title: '<?php echo create_slug('Manufacturer');?>', className: 'btn-sm' }, { extend: 'excel', footer: true, title: '<?php echo create_slug('Manufacturer');?>', className: 'btn-sm' }, { extend: 'pdf', footer: true, title: '<?php echo create_slug('Manufacturer');?>', className: 'btn-sm' }, { extend: 'print', footer: true, title: '<?php echo create_slug('Manufacturer');?>', className: 'btn-sm' } ], "footerCallback": function ( row, data, start, end, display ) { var api = this.api(), data; // Remove the formatting to get integer data for summation var intVal = function ( i ) { return typeof i === 'string' ? i.replace(/[\$,]/g, '')*1 : typeof i === 'number' ? i : 0; }; // // Total over all pages // total = api // .column( 5 ) // .data() // .reduce( function (a, b) { // return intVal(a) + intVal(b); // }, 0 ); // // Total over this page // pageTotal = api // .column( 5, { page: 'current'} ) // .data() // .reduce( function (a, b) { // return intVal(a) + intVal(b); // }, 0 ); // // Update footer // $( api.column( 5 ).footer() ).html( // '$ '+"<?php echo $totatAmt;?>" // ); } } ); } ); $(document).ready(function() { $('#datatable').DataTable({ ordering:false }); //Buttons examples var table = $('#datatable-buttons').DataTable({ lengthChange: false, buttons: ['copy', 'excel', 'pdf', 'colvis'] }); table.buttons().container() .appendTo('#datatable-buttons_wrapper .col-md-6:eq(0)'); }); $(document).ready(function(){ if (localStorage.getItem("poInserted") == "true") { successMessage("Purchase Order Successfully Created."); localStorage.setItem("poInserted", "false"); } if (localStorage.getItem("deletePurchase") == "true") { successMessage("Purchase Order Successfully Deleted."); localStorage.setItem("deletePurchase", "false"); } }); function errorToast(msg){ $.toast({ heading: 'Error!', text: msg, position: 'top-right', loaderBg: '#bf441d', icon: 'error', hideAfter: 3000, stack: 1 }); } function successMessage(msg){ swal({ title: 'Success!', text: msg, type: 'success', confirmButtonColor: '#4fa7f3' }); } function errorMessage(msg){ swal({ title: 'Error!', text: msg, type: 'error', confirmButtonColor: '#4fa7f3' }); } $(document).ready(function() { $("#payment_date").datepicker({ dateFormat: 'dd MM yy' }); $("#payment_date").datepicker("setDate", new Date()); }); </script> </body> </html>