D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
shubmkcj
/
urbane.createerp.com
/
Filename :
tracking-proforma.php
back
Copy
<?php ob_start(); session_start(); include 'config.php'; $login = $_SESSION['login_email']; if($login == ''){ echo '<script>location.replace("index.php")</script>'; } $clientId = ""; if(isset($_GET["clientId"])){ $clientId = $_GET["clientId"]; } if(isset($_SESSION["source_id"])){ $source_id = $_SESSION['source_id']; } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title> Tracking By Proforma | Proforma</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"> <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 href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" /> <!--<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.5/css/select2.min.css'>--> <link href="https://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet"> <link href="plugins/sweet-alert2/sweetalert2.min.css" rel="stylesheet" type="text/css"> <link href="plugins/jquery-toastr/jquery.toast.min.css" rel="stylesheet" /> <!-- 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" /> <style> .chatTable p{ margin-bottom:0; } .chatTable{ width:100%; } .chatTable tr:nth-child(odd) td{ text-align:left; color:#000; } .chatTable tr:nth-child(odd) td .chatInner{ background-color: #eaeaea; color:#000; margin-bottom:3px; } .chatTable tr:nth-child(even) td{ text-align:right; } .chatTable tr td .chatInner{ padding:5px; } .charDetails{ padding-left:15px; } .chatUser{ text-decoration: underline; } .chatUser em{ font-weight:800; } .table th, .table td{ text-align:center; } .table td:nth-child(1){ width:5%; } .table td:nth-child(2){ width:10%; } .table td:nth-child(3){ width:15%; } .table td:nth-child(4){ width:20%; } .table td:nth-child(5){ width:10%; } .table td:nth-child(6){ width:35%; } .table td:last-child{ width:5%; vertical-align: middle; } .comment_butn{ font-size: 10px; padding: 5px !important; } </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">Track Proforma</h4> <ol class="breadcrumb float-right"> <li class="breadcrumb-item ">Sales</li> <li class="breadcrumb-item active">Track Proforma</li> </ol> <div class="clearfix"></div> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="card-box table-responsive"> <table id="view_proforma_tracking" class="table table-bordered table-striped"> <thead> <tr class="theme-bg"> <th>#</th> <th>Proforma Id</th> <th>Date</th> <th>Client Name</th> <th>Total No Of Items</th> <th>Comments</th> <th></th> </tr> </thead> <tbody> <?php $serNo=0; $sqlTc = "SELECT * FROM `proforma` WHERE `proforma`.`data_delete` = 'NO' AND `proforma_id` NOT IN (SELECT `proforma_id` FROM `generate_invoice`) ORDER BY `proforma`.`id` DESC"; $resultTc = mysqli_query($conn,$sqlTc); if(mysqli_num_rows($resultTc) > 0){ while($rowTc = mysqli_fetch_array($resultTc)){ $bproforma_id = $rowTc["proforma_id"]; $ba_id = $rowTc["id"]; $ba_bill_pay_name = $rowTc["bill_pay_name"]; $ba_date = $rowTc["date"]; //for client name $contactsql = mysqli_query($conn,"SELECT * FROM `contact` where id='$ba_bill_pay_name' and data_delete ='no'"); $contactrow = mysqli_fetch_assoc($contactsql); $bill_display_name = $contactrow['bill_display_name']; //for count total item $cQuery="SELECT COUNT(`proforma_id`) AS `item_count` FROM `proforma_item` where `proforma_id` = '$bproforma_id'"; $getItem=mysqli_query($conn,$cQuery); $item_rows = mysqli_fetch_assoc($getItem); $item_count = $item_rows['item_count']; // $getitemsql = mysqli_query($conn,"SELECT * FROM proforma_item a left join inventory b on a.item_id = b.id where a.proforma_id = '$proforma_id'"); // while($item_row = mysqli_fetch_assoc($getitemsql)){ // $item_image = $item_row['item_image']; ?> <tr class="gradeX"> <td><?php echo $serNo+=1;?></td> <td ><?php echo $bproforma_id;?></td> <td><?php echo $ba_date;?></td> <td><?php echo ucwords(strtolower($bill_display_name));?> </td> <td><?php echo $item_count;?> <br> <input data-p-id="<?php echo $bproforma_id;?>" data-c-name="<?php echo ucwords(strtolower($bill_display_name));?>" type="button" class="btn btn-success comment_butn showItemDetailsBtn text-dark" value="Show Items"> </td> <td> <table class="chatTable"> <?php //chat row $getchatsql = mysqli_query($conn,"SELECT * FROM `chat_proforma` WHERE `chat_proforma`.`proformaId`='$bproforma_id' ORDER BY `id` DESC"); while($chat_row = mysqli_fetch_assoc($getchatsql)){ $c_userId = $chat_row['userId']; $c_comment = $chat_row['comment']; $c_date = $chat_row['date']; if($c_comment!=''){ ?> <tr> <td> <div class="chatInner"> <p class="chatUser"><em><?php echo $c_userId;?></em> / <?php echo $c_date;?> </p> <span class="charDetails"><?php echo $c_comment;?></span> </div> </td> </tr> <?php } } ?> </table> </td> <td><input data-p-id="<?php echo $bproforma_id;?>" type="button" class="btn btn-primary comment_butn postCommmentBtn" value="Post Comment"></td> </tr> <?php }}?> </tbody> </table> </div> </div> <!-- end: page --> </div> </div> </div> <!-- container --> </div> <div id="myModalPostComment" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalPostComment" data-backdrop="static" data-keyboard="false" aria-hidden="true"> <div class="modal-dialog modal-xl"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h5 class="modal-title" id="addressTitle" style="font-weight:300;"> </h5> </div> <div class="modal-body"> <div class="row"> <div class="col-md-12"> <form id="chatProformaAction" action="POST"> <div class="form-group"> <label for="comment">Comment:</label> <textarea class="form-control" rows="2" name="mo_txtcomment" id="mo_txtcomment" required></textarea> <input type="hidden" name="model_Pi" id="model_Pi"> <button type="submit" id="chatProformaActionBtn" name="chatProformaActionBtn" class="form-control btn btn-primary" style="margin-top:10px">Comment</button> </div> </form> </div> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary waves-effect" data-dismiss="modal">Close</button> </div> </div> </div> </div> <div id="myModalShowItem" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalShowItem" data-backdrop="static" data-keyboard="false" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h5 class="modal-title itemProIdz" style="font-weight:300;"> </h5> </div> <div class="modal-body"> <div class="row"> <div class="col-md-12"> <div class="card-box table-responsive"> <table id="view_proforma_tracking" class="table table-bordered table-striped"> <thead> <tr class="theme-bg"> <th>#</th> <th>Item Code</th> <th>Item Name</th> <th>Image</th> <th>Qty</th> <th>Unit</th> </tr> </thead> <tbody id="tableShowItem"> </tbody> </table> </div> </div> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary waves-effect" data-dismiss="modal">Close</button> </div> </div> </div> </div> <!-- content --> <?php include 'copyrignt.php' ?> </div> <!-- ============================================================== --> <!-- 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='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> <!--<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/select2/4.0.5/js/select2.min.js'></script>--> <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> <script src="plugins/sweet-alert2/sweetalert2.min.js"></script> <script src="plugins/jquery-toastr/jquery.toast.min.js" type="text/javascript"></script> <!--<script src="https://www.digitalvcards.org/assets/js/additional-methods.min.js"></script>--> <!--<script src="https://www.digitalvcards.org/assets/js/jquery.validate.min.js"></script>--> <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.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> $('#view_proforma_tracking').DataTable({ // dom: 'Bfrtip', 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', title: 'proforma_tracking', className: 'btn-sm' }, { extend: 'csv', title: 'proforma_tracking', className: 'btn-sm' }, { extend: 'excel', title: 'proforma_tracking', className: 'btn-sm' }, { extend: 'pdf', title: 'proforma_tracking', className: 'btn-sm' }, { extend: 'print', title: 'proforma_tracking', className: 'btn-sm' } ] }); // $('.seeRespectiveData').click(function() { // var data_resptive = $(this).attr("data-resptive"); // // alert(data_resptive); // if (data_resptive != '') { // $.ajax({ // url: "fetch-track-data.php", // method: "POST", // data: { // data_resptive: data_resptive // }, // success: function(data) { // // alert(data); // // console.log(data); // $('#addressTitle').html(data_resptive); // $('.dataInvoiceDisplay').html(data); // $('#myModalViewSummary').modal('show'); // } // }); // } else { // alert("There is no data."); // } // }); $(document).ready(function() { $('.js-example-basic-single').select2({ placeholder: 'Please select proforma.' }); $(".trackPI").change(function() { var profaramId = $(this).val(); //alert(profaramId); if (profaramId != "") { $.ajax({ url: 'ajax/check-profaramId-details.php', type: "post", data: { profaramId: profaramId }, success: function(response) { //alert(response); //console.log(response); $('#showRecords').html(response); $(".showDetails").css("display", "block"); } }); } }); //submit comment $("#showRecords").on("click","#AccountBtn",function(){ var txtcomment = $('#txtcomment').val(); var pr_Id = $('#pr_Id').val(); //alert("test" + txtcomment +pr_Id); if (txtcomment != "") { $.ajax({ url: 'ajax/check-profaramId-details.php', type: "post", data: { txtcomment: txtcomment, pr_Id:pr_Id }, success: function(data){ //alert("thanks for comment"); //$('#mydivComment').html("thanks for comment"); $('#showRecords').html(data); $(".showDetails").css("display", "block"); } }); } }); setTimeout(function() { $('#mydivComment').fadeOut('fast'); }, 1000); }); $("#view_proforma_tracking").on("click",".postCommmentBtn",function(){ //$(".postCommmentBtn").on('click',function(e){ var data_proformaId = $(this).attr("data-p-id"); if (data_proformaId != '') { //alert(data_proformaId); $('#addressTitle').html("Post Comments For Proforma Id <b>"+data_proformaId+"</b>"); $('#model_Pi').val(data_proformaId); $('#myModalPostComment').modal('show'); }else{ alert("ERROR"); } }); $("#view_proforma_tracking").on("click",".showItemDetailsBtn",function(){ // $(".showItemDetailsBtn").on('click',function(e){ var data_proformaId = $(this).attr("data-p-id"); var data_proforma_cName = $(this).attr("data-c-name"); $('#myModalShowItem .itemProIdz').html('<b>'+data_proformaId + ' ('+ data_proforma_cName +')</b>'); if (data_proformaId != '') { $.ajax({ url: 'ajax/show-profaramId-items.php', type: "post", data: { data_proformaId:data_proformaId }, success: function(response){ //alert(response); $('#tableShowItem').html(response); $('#myModalShowItem').modal('show'); } }); } }); // $("#showRecords #AccountBtn").on('click',function(e){ // // var txtcomment = $('#txtcomment').val(); // // var pr_Id = $('#pr_Id').val(); // alert("click me"); // }); $("#chatProformaAction").on('submit', function(e){ e.preventDefault(); var txtcomment = $('#mo_txtcomment').val(); var pr_Id = $('#model_Pi').val(); $.ajax({ url: 'ajax/add-profaramId-comments.php', type: "post", data: { txtcomment: txtcomment, pr_Id:pr_Id }, success: function(response){ //console.log(response); //alert(response); var data = JSON.parse(response); if (data.status == "true") { alert(data.msg); window.location.reload(); // window.location.href = base_url_sign_in; } else { alert(data.msg); window.location.reload(); } } }); }); </script> </body> </html>