D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
home
/
shubmkcj
/
urbane.createerp.com
/
Filename :
manufacturer.php
back
Copy
<?php session_start(); // ob_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']; } function getSaleAmount($conn, $id){ $sql = "SELECT * FROM `manufacturer` where id='$id'"; $result = mysqli_query($conn,$sql); $row = mysqli_fetch_array($result); $currency = $row['currency']; //currency rate $query_c="SELECT * FROM `conversion_rate` ORDER BY `conversion_rate`.`id` DESC LIMIT 1"; $result_c = mysqli_query($conn, $query_c); $row_c = mysqli_fetch_assoc($result_c); $last_rmb = $row_c["rmb"]; $amount = 0.00; $amount_paid= 0.00; $sqlGetSaleAmount = "SELECT `amount_paind` FROM `purchase_order` WHERE `manufacturer` = '$id' AND data_delete != 'yes' "; $resultGetSaleAmount = mysqli_query($conn, $sqlGetSaleAmount); if($resultGetSaleAmount){ if(mysqli_num_rows($resultGetSaleAmount) > 0){ while($rowGetSaleAmount = mysqli_fetch_assoc($resultGetSaleAmount)){ $ee = $rowGetSaleAmount["amount_paind"]; $amt_in_usd = $rowGetSaleAmount['amt_in_usd']; if($currency=='RMB'){ $last_rmb=$last_rmb; }else{ $last_rmb=1; } if($amt_in_usd==''){ $amount_paid=$ee/$last_rmb; }else{ $amount_paid=$amt_in_usd; } $amount += $amount_paid; } } } $amount = sprintf('%0.2f', $amount); return $amount; } ?> <!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" /> </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">Manage Manufacturer</h4> <ol class="breadcrumb float-right"> <li class="breadcrumb-item ">Manufacturer Manager</li> <li class="breadcrumb-item active">All Manufacturer</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="datatable" class="table table-bordered"> <thead> <tr class="theme-bg"> <th>Manufacturer</th> <th>Manufacturer Display Name</th> <th class="text-center">Address</th> <th class="text-center">Total amount <small>(in USD)</small></th> <th class="text-center">Actions</th> </tr> </thead> <tbody> <?php $sql = "SELECT * FROM manufacturer where data_delete != 'yes' AND source_id = '$source_id' order by id desc"; $result = mysqli_query($conn,$sql); while( $row = mysqli_fetch_array($result)){ $currency = $row['currency']; ?> <tr class="gradeX"> <td class="company-name"><?php echo $row['manufacturer'] ?></td> <td><?php echo $row['manufacturer_display_name'] ?></td> <td><?php echo $row['address'] ?></td> <td class="text-center"><?php echo getSaleAmount($conn, $row['id']); ?></td> <td class="actions text-center"> <button type="button" class="btn btn-sm btn-danger" data-toggle="tooltip" data-placement="top" title="" data-original-title="Delete" value="<?php echo $row['id'] ?>" onclick="deletemanu(this)"><i class="fa fa-trash-o"></i></button> <a href="view-manufacturer.php?id=<?php echo $row['id'] ?>" class="btn btn-sm btn-warning" data-toggle="tooltip" data-placement="top" title="" data-original-title="View"><i class="fa fa-eye"></i></a> </td> </tr> <?php } ?> </tbody> </table> </div> </div> <!-- end: page --> </div> </div> <!-- container --> </div> <!-- content --> <?php include 'copyrignt.php' ?> </div> <!-- ============================================================== --> <!-- End Right content here --> <!-- ============================================================== --> </div> <!-- END wrapper --> </body> <script src="assets/js/modernizr.min.js"></script> <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 --> <!-- 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() { $('#datatable').DataTable(); //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("ManufacturerAdded") == "true") { successMessage("Manufacturer Successfully Added."); localStorage.setItem("ManufacturerAdded", "false"); } if (localStorage.getItem("ManufacturerUpdate") == "true") { successMessage("Manufacturer Successfully Update."); localStorage.setItem("ManufacturerUpdate", "false"); } if (localStorage.getItem("manuDeleted") == "true") { successMessage("Manufacturer Successfully Deleted."); localStorage.setItem("manuDeleted", "false"); } }); function successMessage(msg){ swal({ title: 'Success!', text: msg, type: 'success', confirmButtonColor: '#4fa7f3' }); } function deletemanu(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=DeleteManu&manuId="+itemId, method : "POST", async : false, success : function(response){ if(response == "DELETED"){ localStorage.setItem("manuDeleted", "true"); location.replace('manufacturer.php'); } else{ errorMessage("Item could not be deleted."); } }, error : function(error){ errorMessage("Item could not be deleted."); } }); }); } $(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"); } if (localStorage.getItem("PaymentAdded") == "true") { successMessage("Payment Successfully Saved."); localStorage.setItem("PaymentAdded", "false"); } }); </script> </html>