EVOLUTION-NINJA
Edit File: supervisorpo_list.php
<!DOCTYPE HTML> <html lang="en-US"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> <title>Power Pik</title> <link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/css/main.css');?>" /> <link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/css/bootstrap.min.css');?>" /> <link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/css/font-awesome.min.css');?>" /> <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"> <script type="text/javascript" src="<?php echo base_url('assets/js/jquery-3.6.0.min.js');?>"></script> <script type="text/javascript" src="<?php echo base_url('assets/js/bootstrap.min.js');?>"></script> <link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/css/sweetalert.css');?>" /> <script type="text/javascript" src="<?php echo base_url('assets/js/sweetalert.min.js');?>"></script> </head> <body style="overflow-x:hidden;"> <header class="cf"> <div class="container"> <div class="logo"> <a href="" class="hidden-xs hidden-sm"><img src="<?php echo base_url('assets/img/F1.svg');?>" class="img-responsive center-block"></a> <a href="" class="hidden-md hidden-lg"><img src="<?php echo base_url('assets/img/F1.svg');?>" class="img-responsive center-block"></a> </div> <div class="navigation"> <nav> <a href="javascript:void(0)" class="smobitrigger ion-navicon-round"><span>Menu</span></a> <ul class="mobimenu"> <?php if($details->role == 2) { if($details->department == 4) {?> <li class="dropdown"> <a href="" class="dropdown-toggle" data-toggle="dropdown">Information <span class="glyphicon glyphicon-chevron-down"></span> </a> <ul class="dropdown-menu multi-column-dropdown"> <li><a href="<?php echo site_url('controller/inventory_import');?>">Stock Updates</a></li> <li><a href="<?php echo site_url('controller/po_import');?>">PO Acknowledgemets</a></li> </ul> </li> <!--<li><a href="<?php echo site_url('controller/news');?>" class="active">News</a></li> --> <?php }elseif($details->department == 5) {?> <li class="dropdown"> <a href="" class="dropdown-toggle" data-toggle="dropdown">Financials <span class="glyphicon glyphicon-chevron-down"></span> </a> <ul class="dropdown-menu multi-column-dropdown"> <li><a href="<?php echo site_url('controller/outstanding_statement');?>">Outstanding Statement</a></li> <li><a href="<?php echo site_url('controller/overdue_statement');?>">Overdue Statement</a></li> <li><a href="<?php echo site_url('controller/c_forms');?>">C forms</a></li> </ul> </li> <!--<li><a href="<?php echo site_url('controller/news');?>" class="active">News</a></li> --> <?php }elseif($details->department == 6) {?> <li class="dropdown"> <a href="" class="dropdown-toggle" data-toggle="dropdown">Technical Support <span class="glyphicon glyphicon-chevron-down"></span> </a> <ul class="dropdown-menu multi-column-dropdown"> <li><a href="<?php echo site_url('controller/drive_mannual_upload');?>">Drive Catalogues</a></li> <li><a href="<?php echo site_url('controller/case_stories_upload');?>">Case Stories</a></li> </ul> </li> <!--<li><a href="<?php echo site_url('controller/news');?>" class="active">News</a></li>--> <?php }elseif($details->department == 7) {?> <li class="dropdown"> <a href="" class="dropdown-toggle" data-toggle="dropdown">Financials <span class="glyphicon glyphicon-chevron-down"></span> </a> <ul class="dropdown-menu multi-column-dropdown"> <li><a href="<?php echo site_url('controller/outstanding_statement');?>">Outstanding Statement</a></li> <li><a href="<?php echo site_url('controller/overdue_statement');?>">Overdue Statement</a></li> <li><a href="<?php echo site_url('controller/c_forms');?>">C forms</a></li> </ul> </li> <!--<li><a href="<?php echo site_url('controller/news_upload');?>" class="active">News</a></li>--> <li><a href="<?php echo site_url('controller/po_list');?>">PO List </a></li> <?php } } elseif ($details->role == 3) {?> <li class="dropdown"> <a href="" class="dropdown-toggle" data-toggle="dropdown">Information <span class="glyphicon glyphicon-chevron-down"></span> </a> <ul class="dropdown-menu multi-column-dropdown"> <li><a href="<?php echo site_url('controller/stock_updates');?>">Stock Updates</a></li> <li><a href="<?php echo site_url('controller/po_acknowledgemets');?>">PO Acknowledgemets</a></li> </ul> </li> <li class="dropdown"> <a href="" class="dropdown-toggle" data-toggle="dropdown">Financials <span class="glyphicon glyphicon-chevron-down"></span> </a> <ul class="dropdown-menu multi-column-dropdown"> <li><a href="<?php echo site_url('controller/outstanding_statements_display');?>">Outstanding Statement</a></li> <li><a href="<?php echo site_url('controller/overdue_statements_display');?>">Overdue Statement</a></li> <li><a href="<?php echo site_url('controller/c_forms_display');?>">C forms</a></li> </ul> </li> <li class="dropdown"> <a href="" class="dropdown-toggle" data-toggle="dropdown">Technical Support <span class="glyphicon glyphicon-chevron-down"></span> </a> <ul class="dropdown-menu multi-column-dropdown"> <li><a href="<?php echo site_url('controller/drive_catalogues');?>">Drive Catalogues</a></li> <li><a href="<?php echo site_url('controller/case_stories');?>">Case Stories</a></li> </ul> </li> <!--<li><a href="<?php echo site_url('controller/news');?>" class="active">News</a></li>--> <li><a href="<?php echo site_url('controller/create_po');?>">PO Generate </a></li> <?php } ?> <li><a href="<?php echo site_url('controller/profile');?>">Profile</a></li> <li><a href="<?php echo site_url('controller/logout');?>">Logout</a></li> </ul> </nav> </div> </div> </header> <div class="row"> <div class="col-sm-2 menu-left" style="background-color:white;height:700px;"> <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens --> <div class="collapse navbar-collapse navbar-ex1-collapse text_color"> <ul class="nav navbar-nav side-nav my-nav" > <?php if ($details->role == 3) {?> <!--<li class="active" > <a href="<?php echo site_url('controller/add_new_po');?>"> Add New PO</a> </li>--> </br> <li> <a href="<?php echo site_url('controller/create_po');?>"> Create PO</a> </li> </br> <li> <a href="<?php echo site_url('controller/po_list');?>"> View All PO</a> </li> </br> <li> <a href="<?php echo site_url('controller/upload_signed_po');?>"> Upload Signed PO</a> </li> </br> <li> <a href="<?php echo site_url('controller/signed_po_list');?>"> Signed PO List</a> </li> <?php } else {?> <?php }?> </ul> </div> <!-- /.navbar-collapse --> </div><!---left side---> <div class="col-sm-10"> <div class="page-content-wrapper"> <div class="page-content"> <!-- BEGIN PAGE HEADER--> <h3 class="page-title"> Purchase Order List </h3> <?php if($details->role == 8): ?> <button type="button" id="cancel" style="float: right; margin-top: -29px; margin-right: 35px;">Back</button> <?php elseif($details->role == 1): ?> <button type="button" id="cancel1" style="float: right; margin-top: -29px; margin-right: 35px;">Back</button> <?php else: ?> <button type="button" id="cancel2" style="float: right; margin-top: -29px; margin-right: 35px;">Back</button> <?php endif; ?> <br> <input type="hidden" id="approval_id" class="approval_id" value="<?php if(empty($details)){ } else { echo $details->role; } ?>" > <input type="hidden" id="user_id" class="user_id" value="<?php if(empty($details)){ } else { echo $details->id; } ?>" > <div class="row 10"> <?php if($details->role == 8 || $details->role == 2){?> <label class="radio-inline"> <input type="radio" value="po" onclick="approval_status('normal_unapproved/normal_disapproved');" name="availability" /> NORMAL PO </label> <label class="radio-inline"> <input type="radio" value="approved_po" onclick="approval_status('normal_approved');" name="availability" /> NORMAL APPROVED PO </label> <label class="radio-inline"> <input type="radio" value="po" onclick="approval_status('special_unapproved/special_disapproved');" name="availability" /> SPECIAL PO </label> <label class="radio-inline"> <input type="radio" value="approved_po" onclick="approval_status('special_approved');" name="availability" /> SPECIAL APPROVED PO </label> <label class="radio-inline"> <input type="radio" value="pending_po" onclick="approval_status('pending_po');" name="availability" /> PENDING PO </label> <label class="radio-inline"> <input type="radio" value="transferred_po" onclick="approval_status('transferred_po');" name="availability" /> TRANSFERRED PO </label> <label class="radio-inline"> <input type="radio" value="transferred_po" onclick="approval_status('signed_po');" name="availability" /> SIGNED PO </label> <?php } else { ?> <label class="col-sm-2"></label> <label class="radio-inline"> <input type="radio" value="po" onclick="approval_status('normal_unapproveds/normal_disapproveds');" name="availability" /> NORMAL PO </label> <label class="radio-inline"> <input type="radio" value="po" onclick="approval_status('special_unapproveds/special_disapproveds');" name="availability" /> SPECIAL PO </label> <?php } ?> </div> <div id="menu1" class="tab-pane col-sm-12 col-md-12 "> <div id="jaytab1" style="margin-top:3%;margin-left: -28px;" class="col-sm-12 grid1"> <div class="grid_div1"></div><table id="list1"></table> <div id="pager1"></div> <div id="dialogSelectRow3" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <div id="menu2" class="tab-pane col-sm-12 col-md-12 "> <div id="jaytab2" style="margin-top:3%;margin-left: -28px;" class="col-sm-12 grid2"> <div class="grid_div2"></div><table id="list2"></table> <div id="pager2"></div> <div id="dialogSelectRow4" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <div id="menu3" class="tab-pane col-sm-12 col-md-12 "> <div id="jaytab3" style="margin-top:3%;margin-left: -28px;" class="col-sm-12 grid3"> <div class="grid_div3"></div><table id="list3"></table> <div id="pager3"></div> <div id="dialogSelectRow3" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <div id="menu4" class="tab-pane col-sm-12 col-md-12 "> <div id="jaytab4" style="margin-top:3%;margin-left: -28px;" class="col-sm-12 grid4"> <div class="grid_div4"></div><table id="list4"></table> <div id="pager4"></div> <div id="dialogSelectRow4" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <div id="menu5" class="tab-pane col-sm-12 col-md-12 "> <div id="jaytab5" style="margin-top:3%;margin-left: -28px;" class="col-sm-12 grid5"> <div class="grid_div5"></div><table id="list5"></table> <div id="pager5"></div> <div id="dialogSelectRow5" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <div id="menu6" class="tab-pane col-sm-12 col-md-12 "> <div id="jaytab6" style="margin-top:3%;margin-left: -28px;" class="col-sm-12 grid6"> <div class="grid_div6"></div><table id="list6"></table> <div id="pager6"></div> <div id="dialogSelectRow6" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <div id="menu7" class="tab-pane col-sm-12 col-md-12 "> <div id="jaytab7" style="margin-top:3%;margin-left: -28px;" class="col-sm-12 grid7"> <div class="grid_div7"></div><table id="list7"></table> <div id="pager7"></div> <div id="dialogSelectRow7" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <div id="menu8" class="tab-pane col-sm-12 col-md-12 "> <div id="jaytab8" style="margin-top:3%;margin-left: -28px;" class="col-sm-12 grid8"> <div class="grid_div8"></div><table id="list8"></table> <div id="pager8"></div> <div id="dialogSelectRow8" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <div id="menu9" class="tab-pane col-sm-12 col-md-12 "> <div id="jaytab9" style="margin-top:3%;margin-left: -28px;" class="col-sm-12 grid9"> <div class="grid_div9"></div><table id="list9"></table> <div id="pager9"></div> <div id="dialogSelectRow9" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <!-- This is the Javascript file of jqGrid --> <script type="text/ecmascript" src="<?php echo base_url('jqgrid/js/jquery.jqGrid.min.js'); ?>"></script> <!-- This is the localization file of the grid controlling messages, labels, etc. <!-- We support more than 40 localizations --> <script type="text/ecmascript" src="<?php echo base_url('jqgrid/js/i18n/grid.locale-en.js'); ?>"></script> <!-- A link to a jQuery UI ThemeRoller theme, more than 22 built-in and many more custom --> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('assets/css/jquery-ui.css'); ?>" /> <!-- The link to the CSS that the grid needs --> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('jqgrid/css/ui.jqgrid.css'); ?>" /> <script src="<?php echo base_url('assets/js/jquery-ui.js'); ?>" type="text/javascript"></script> </div> </div> </div> </div> <!-- /.container-fluid --> <!-- /#page-wrapper --> <!----------------------- Banner End------------------------------------------------------------> <style> .new_events i { color:#4eabf9; font-weight:700; } .new_events a { color:black; } .new_events p { color:black; padding-left:35px; padding-bottom:10px; } .n-tabs { padding:15px 15px; } </style> <!-- ---------------- News Paper END --> <div class="height-50"></div> <footer class=" navbar-fixed-bottom"> <div class="top-bg"> <div class="container"> <ul class="top_marqu"> <li><a href="tel:+91-9731676611"><i class="fa fa-mobile" aria-hidden="true"></i> : +91 9731676611</a></li> <li><a href="mailto:services@powerpik.in"><i class="fa fa-envelope-o" aria-hidden="true"></i> : services@powerpik.in</a></li> <li><a href=""> | </a></li> <li><a href="tel:+91-9711351351">North <i class="fa fa-mobile" aria-hidden="true"></i> : +91 9711351351</a></li> <li><a href="tel:+91-9620512399">South <i class="fa fa-mobile" aria-hidden="true"></i> : +91 9620512399</a></li> </ul> </div> </div> </footer> </body> </html> <div class="modal fade" id="newModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="myModalLabel">Upload File</h4> </div> <form id="upload" class="form-inline upload_pdf" enctype="multipart/form-data"> <div class="modal-body"> <input type="hidden" name="po_no" class="po_no"/> <div class="file-uploader"> <div class="file-uploader__message-area"> <p>Upload PDF file.</p> </div> <div class="file-chooser"> <input type="file" id="file" class="pdf_upload" name="pdf_file[]" multiple required> </div> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="submit" class="btn btn-primary submit_pdf">Upload</button> </div> </form> </div> </div> </div> <!---------- Navigation -----------------------> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" type="text/css" href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css"> <link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/css/simpleMobileMenu.css');?>" /> <script src="<?php echo base_url('assets/js/simpleMobileMenu.js');?>"></script> <script type="text/javascript"> jQuery(document).ready(function($) { $('.smobitrigger').smplmnu(); }); </script> <!---------------- Menu Drodown ---------------------> <script type="text/javascript"> jQuery(document).ready(function($) { $('.mobimenu li.dropdown').hover(function() { $(this).find('.dropdown-menu').stop(true, true).delay(200).fadeIn(500); }, function() { $(this).find('.dropdown-menu').stop(true, true).delay(200).fadeOut(500); }); }); </script> <script type="text/javascript"> function confirm(rowId) { var id = rowId.closest('tr').attr('id'); var po_no=id; $.ajax({ url:"<?php echo site_url('controller/approve_po')?>", type:"POST", data:{po_no:po_no}, success:function(response) { toastr["success"]("APPROVED"); location.reload(); } }); } function confirm1(rowId) { //alert(); var v=$('#approval_id').val(); var u=$('#user_id').val(); if(u == 8){ if(v == 2){ var po_no = rowId.closest('tr').attr('id'); var app = $("#list1").jqGrid('getRowData',po_no); app=app.approve_status; if(app=="UNAPPROVED") { swal({ title: "Are you sure?", text: "Do you want to approve this Purchase Order?", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes,proceed!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ //alert(po_no); if (isConfirm) { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); // test.attr('disabled', 'disabled'); // test.text("Updating..."); $.ajax({ type : 'post', url : '<?php echo site_url("controller/approve_po")?>', data : {po_no:po_no}, success:function(response) { toastr["success"]("APPROVED"); location.reload(); } }); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } else if(app=="DISAPPROVED") { swal({ title: "Are you sure?", text: "Do you want to approve this Purchase Order?", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes,proceed!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm) { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); // test.attr('disabled', 'disabled'); // test.text("Updating..."); $.ajax({ type : 'post', url : '<?php echo site_url("controller/approve_po")?>', data : {po_no:po_no}, success:function(response) { toastr["success"]("APPROVED"); location.reload(); } }); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } else { swal({ title: "Are you sure?", text: "Do you want to disapprove this Purchase Order?", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes,proceed!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm) { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); // test.attr('disabled', 'disabled'); // test.text("Updating..."); $.ajax({ type : 'post', url : '<?php echo site_url("controller/disapprove_po")?>', data : {po_no:po_no}, success:function(response) { toastr["success"]("DISAPPROVED"); location.reload(); } }); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } } else { swal({ title: "You Don't Have Access For This Approval", text: "", }); $( ".check" ).prop( "checked", false ); $("#list1").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } else{ swal("You Don't Have Access To Approve This PO."); } } function confirm5(rowId) { //alert(); var v=$('#approval_id').val(); var u=$('#user_id').val(); if(u == 8){ if(v == 2){ var po_no = rowId.closest('tr').attr('id'); //alert(po_no); var app = $("#list9").jqGrid('getRowData',po_no); var app=app.approve_status; //alert(app); if(app=="UNAPPROVED") { swal({ title: "Are you sure?", text: "Do you want to approve this Purchase Order?", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes,proceed!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ //alert(po_no); if (isConfirm) { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); // test.attr('disabled', 'disabled'); // test.text("Updating..."); $.ajax({ type : 'post', url : '<?php echo site_url("controller/approve_signedpo")?>', data : {po_no:po_no}, success:function(response) { toastr["success"]("APPROVED"); location.reload(); } }); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } else if(app=="DISAPPROVED") { swal({ title: "Are you sure?", text: "Do you want to approve this Purchase Order?", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes,proceed!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm) { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); // test.attr('disabled', 'disabled'); // test.text("Updating..."); $.ajax({ type : 'post', url : '<?php echo site_url("controller/approve_signedpo")?>', data : {po_no:po_no}, success:function(response) { toastr["success"]("APPROVED"); location.reload(); } }); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } else if(app=="SIGNED") { swal({ title: "Are you sure?", text: "Do you want to approve this Purchase Order?", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes,proceed!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm) { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); // test.attr('disabled', 'disabled'); // test.text("Updating..."); $.ajax({ type : 'post', url : '<?php echo site_url("controller/approve_signedpo")?>', data : {po_no:po_no}, success:function(response) { toastr["success"]("APPROVED"); location.reload(); } }); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } else if(app=="APPROVED") { //alert(po_no); swal({ title: "Are you sure?", text: "Do you want to disapprove this Purchase Order?", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes,proceed!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm) { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); // test.attr('disabled', 'disabled'); // test.text("Updating..."); $.ajax({ type : 'post', url : '<?php echo site_url("controller/disapprove_signedpo")?>', data : {po_no:po_no}, success:function(response) { // alert(response); toastr["success"]("DISAPPROVED"); location.reload(); } }); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } } else { swal({ title: "You Don't Have Access For This Approval", text: "", }); $( ".check" ).prop( "checked", false ); $("#list1").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } else{ swal("You Don't Have Access To Approve This PO."); } } function confirm2(rowId) { //alert(); var v=$('#approval_id').val(); var u=$('#user_id').val(); if(u == 8){ if(v == 2){ var po_no = rowId.closest('tr').attr('id'); var app = $("#list2").jqGrid('getRowData',po_no); app=app.approve_status; //alert(app); if(app=="UNAPPROVED") { swal({ title: "Are you sure?", text: "Do you want to approve this Purchase Order?", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes,proceed!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm) { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); // test.attr('disabled', 'disabled'); // test.text("Updating..."); $.ajax({ type : 'post', url : '<?php echo site_url("controller/approve_po")?>', data : {po_no:po_no}, success:function(response) { toastr["success"]("APPROVED"); location.reload(); } }); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } else if(app=="DISAPPROVED") { swal({ title: "Are you sure?", text: "Do you want to approve this Purchase Order?", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes,proceed!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm) { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); // test.attr('disabled', 'disabled'); // test.text("Updating..."); $.ajax({ type : 'post', url : '<?php echo site_url("controller/approve_po")?>', data : {po_no:po_no}, success:function(response) { toastr["success"]("APPROVED"); location.reload(); } }); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } else { swal({ title: "Are you sure?", text: "Do you want to disapprove this Purchase Order?", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes,proceed!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm) { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); // test.attr('disabled', 'disabled'); // test.text("Updating..."); $.ajax({ type : 'post', url : '<?php echo site_url("controller/disapprove_po")?>', data : {po_no:po_no}, success:function(response) { toastr["success"]("DISAPPROVED"); location.reload(); } }); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } } else { swal({ title: "You Don't Have Access For This Approval", text: "", }); $( ".check" ).prop( "checked", false ); $("#list1").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } else{ swal("You Don't Have Access To Approve This PO."); } } function confirm3(rowId) { //alert(); var v=$('#approval_id').val(); var u=$('#user_id').val(); if(u == 8){ if(v == 2){ var po_no = rowId.closest('tr').attr('id'); var app = $("#list3").jqGrid('getRowData',po_no); app=app.approve_status; //alert(app); if(app=="UNAPPROVED") { swal({ title: "Are you sure?", text: "Do you want to approve this Purchase Order?", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes,proceed!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ //alert(po_no); if (isConfirm) { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); // test.attr('disabled', 'disabled'); // test.text("Updating..."); $.ajax({ type : 'post', url : '<?php echo site_url("controller/approve_specialpo")?>', data : {po_no:po_no}, success:function(response) { toastr["success"]("APPROVED"); location.reload(); } }); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } else if(app=="DISAPPROVED") { swal({ title: "Are you sure?", text: "Do you want to approve this Purchase Order?", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes,proceed!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm) { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); // test.attr('disabled', 'disabled'); // test.text("Updating..."); $.ajax({ type : 'post', url : '<?php echo site_url("controller/approve_specialpo")?>', data : {po_no:po_no}, success:function(response) { toastr["success"]("APPROVED"); location.reload(); } }); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } else { swal({ title: "Are you sure?", text: "Do you want to disapprove this Purchase Order?", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes,proceed!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm) { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); // test.attr('disabled', 'disabled'); // test.text("Updating..."); $.ajax({ type : 'post', url : '<?php echo site_url("controller/disapprove_specialpo")?>', data : {po_no:po_no}, success:function(response) { toastr["success"]("DISAPPROVED"); location.reload(); } }); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } } else { swal({ title: "You Don't Have Access For This Approval", text: "", }); $( ".check" ).prop( "checked", false ); $("#list1").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } else{ swal("You Don't Have Access To Approve This PO."); } } function confirm4(rowId) { //alert(); var v=$('#approval_id').val(); var u=$('#user_id').val(); if(u == 8){ if(v == 2){ var po_no = rowId.closest('tr').attr('id'); var app = $("#list4").jqGrid('getRowData',po_no); app=app.approve_status; //alert(app); if(app=="UNAPPROVED") { swal({ title: "Are you sure?", text: "Do you want to approve this Purchase Order?", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes,proceed!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm) { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); // test.attr('disabled', 'disabled'); // test.text("Updating..."); $.ajax({ type : 'post', url : '<?php echo site_url("controller/approve_specialpo")?>', data : {po_no:po_no}, success:function(response) { toastr["success"]("APPROVED"); location.reload(); } }); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } else if(app=="DISAPPROVED") { swal({ title: "Are you sure?", text: "Do you want to approve this Purchase Order?", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes,proceed!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm) { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); // test.attr('disabled', 'disabled'); // test.text("Updating..."); $.ajax({ type : 'post', url : '<?php echo site_url("controller/approve_specialpo")?>', data : {po_no:po_no}, success:function(response) { toastr["success"]("APPROVED"); location.reload(); } }); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } else { swal({ title: "Are you sure?", text: "Do you want to disapprove this Purchase Order?", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes,proceed!", cancelButtonText: "No, cancel plz!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm) { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); // test.attr('disabled', 'disabled'); // test.text("Updating..."); $.ajax({ type : 'post', url : '<?php echo site_url("controller/disapprove_specialpo")?>', data : {po_no:po_no}, success:function(response) { toastr["success"]("DISAPPROVED"); location.reload(); } }); } else { $(".sweet-alert").hide(); $(".sweet-overlay").hide(); } }); } } else { swal({ title: "You Don't Have Access For This Approval", text: "", }); $( ".check" ).prop( "checked", false ); $("#list1").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } else{ swal("You Don't Have Access To Approve This PO."); } } function view_po(rowId) { var id = rowId.closest('tr').attr('id'); var po_no=id; //alert(po_no); $.ajax({ url:"<?php echo site_url('controller/view_po')?>", type:"POST", data:{po_no:po_no}, success:function(response) { response=jQuery.parseJSON(response); console.log(response); if(response.result == 1) { $.each(response.res,function(key,va){ //window.location.href = "<?php echo base_url()?>/"+va.po_path; window.open("<?php echo base_url()?>/"+va.po_path , "_blank"); }); } else { } } }); } function view_specialpo(rowId) { var id = rowId.closest('tr').attr('id'); var po_no=id; //alert(po_no); $.ajax({ url:"<?php echo site_url('controller/view_specialpo')?>", type:"POST", data:{po_no:po_no}, success:function(response) { response=jQuery.parseJSON(response); console.log(response); if(response.result == 1) { $.each(response.res,function(key,va){ //window.location.href = "<?php echo base_url()?>/"+va.po_path; window.open("<?php echo base_url()?>/"+va.po_path , "_blank"); }); } else { } } }); } function approval_status(str) { if(str=="normal_unapproved/normal_disapproved") { $('#jaytab1').show(); $('#jaytab2').hide(); $('#jaytab3').hide(); $('#jaytab4').hide(); $('#jaytab5').hide(); $('#jaytab6').hide(); $('#jaytab7').hide(); $('#jaytab8').hide(); $('#jaytab9').hide(); jQuery("#list1").jqGrid({ url:"<?php echo site_url('controller/normal_po_details')?>", mtype : "post", datatype: "json", colNames:['SI','PO NO','PO PATH','PO TYPE','','Approve','VIEW PO'], colModel:[ {name:'id',index:'id', width:100, hidden:true,editable:false,key:true}, {name:'po_no',index:'po_no', width:100, editable:false}, {name:'po_path',index:'po_path', width:375, editable:false}, {name:'po_type',index:'po_type',classes:'po_type',align: "center",width:125, editable:false}, {name:'approve_status',index:'approve_status', hidden:true, width:375, editable:false}, {name:'confirm',index:'confirm',classes:'agr_appr',align: "center",editable:false,editrules:{required: true}, width:150,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="confirm1($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='checkbox' id='check' class='check' value='SELECT' \>"; }}, {name:'po_path',index:'po_path', align: "center", editable:false,editrules:{}, width:220,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="view_po($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='VIEW PO' onclick='some_function' data-toggle='modal' data-target='#edit_modal' target='_blank'\>"; }}, ], rowNum:20, rowTotal: 2000, rowList : [10,20,30,50,100,500,1000], rownumbers: true, rownumWidth: 40, pager:"#pager1", sortname:'owner_id', viewrecords: true, gridview: true, autowidth: true, sortorder:"desc", shrinkToFit: false, emptyrecords: 'No records to display', // multiselect: true, // multiboxonly: true, loadonce:true, caption:"Normal Purchase Order Details", }); $("#list1").jqGrid("setLabel", "rn", "SL"); $("#list1").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list1").jqGrid('navGrid','#pager1', {edit:true,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); } else if(str=="normal_approved") { $('#jaytab1').hide(); $('#jaytab2').show(); $('#jaytab3').hide(); $('#jaytab4').hide(); $('#jaytab5').hide(); $('#jaytab6').hide(); $('#jaytab7').hide(); $('#jaytab8').hide(); $('#jaytab9').hide(); jQuery("#list2").jqGrid({ url:"<?php echo site_url('controller/get_normal_approved_po_details')?>", mtype : "post", datatype: "json", colNames:['SI','PO NO','PO PATH','PO TYPE','','APPROVE','VIEW PO'], colModel:[ {name:'id',index:'id', width:100, hidden:true,editable:false,key:true}, {name:'po_no',index:'po_no', width:100, editable:false}, {name:'po_path',index:'po_path', width:375, editable:false}, {name:'po_type',index:'po_type',classes:'po_type',align: "center",width:125, editable:false}, {name:'approve_status',index:'approve_status', hidden:true, width:375, editable:false}, {name:'approve_status',index:'approve_status',classes:'agr_appr',align: "center",editable:false,editrules:{required: true}, width:250,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="confirm2($(this))" '; }}, {name:'po_path',index:'po_path', align: "center", editable:false,editrules:{}, width:220,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="view_po($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='VIEW PO' onclick='some_function' data-toggle='modal' data-target='#edit_modal' target='_blank'\>"; }}, ], rowNum:20, rowTotal: 2000, rowList : [10,20,30,50,100,500,1000], rownumbers: true, rownumWidth: 40, pager:"#pager2", sortname:'owner_id', viewrecords: true, gridview: true, autowidth: true, sortorder:"desc", shrinkToFit: false, emptyrecords: 'No records to display', // multiselect: true, // multiboxonly: true, loadonce:true, caption:"Approved Normal Purchase Order Details", }); $("#list2").jqGrid("setLabel", "rn", "SL"); $("#list2").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list2").jqGrid('navGrid','#pager2', {edit:true,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); } else if(str=="special_unapproved/special_disapproved") { $('#jaytab1').hide(); $('#jaytab2').hide(); $('#jaytab3').show(); $('#jaytab4').hide(); $('#jaytab5').hide(); $('#jaytab6').hide(); $('#jaytab7').hide(); $('#jaytab8').hide(); $('#jaytab9').hide(); jQuery("#list3").jqGrid({ url:"<?php echo site_url('controller/special_po_details')?>", mtype : "post", datatype: "json", colNames:['SI','PO NO','PO PATH','PO TYPE','','Approve','VIEW PO'], colModel:[ {name:'id',index:'id', width:100, hidden:true,editable:false,key:true}, {name:'po_no',index:'po_no', width:100, editable:false}, {name:'po_path',index:'po_path', width:375, editable:false}, {name:'po_type',index:'po_type',classes:'po_type',align: "center",width:125, editable:false}, {name:'approve_status',index:'approve_status', hidden:true, width:375, editable:false}, {name:'confirm',index:'confirm',classes:'agr_appr',align: "center",editable:false,editrules:{required: true}, width:150,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="confirm3($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='checkbox' id='check' class='check' value='SELECT' \>"; }}, {name:'po_path',index:'po_path', align: "center", editable:false,editrules:{}, width:220,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="view_specialpo($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='VIEW PO' onclick='some_function' data-toggle='modal' data-target='#edit_modal' target='_blank'\>"; }}, ], rowNum:20, rowTotal: 2000, rowList : [10,20,30,50,100,500,1000], rownumbers: true, rownumWidth: 40, pager:"#pager3", sortname:'owner_id', viewrecords: true, gridview: true, autowidth: true, sortorder:"desc", shrinkToFit: false, emptyrecords: 'No records to display', // multiselect: true, // multiboxonly: true, loadonce:true, caption:"Special Purchase Order Details", }); $("#list3").jqGrid("setLabel", "rn", "SL"); $("#list3").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list3").jqGrid('navGrid','#pager3', {edit:true,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); } else if(str=="special_approved") { $('#jaytab1').hide(); $('#jaytab2').hide(); $('#jaytab3').hide(); $('#jaytab4').show(); $('#jaytab5').hide(); $('#jaytab6').hide(); $('#jaytab7').hide(); $('#jaytab8').hide(); $('#jaytab9').hide(); jQuery("#list4").jqGrid({ url:"<?php echo site_url('controller/get_special_approved_po_details')?>", mtype : "post", datatype: "json", colNames:['SI','PO NO','PO PATH','PO TYPE','','APPROVE','VIEW PO'], colModel:[ {name:'id',index:'id', width:100, hidden:true,editable:false,key:true}, {name:'po_no',index:'po_no', width:100, editable:false}, {name:'po_path',index:'po_path', width:375, editable:false}, {name:'po_type',index:'po_type',classes:'po_type',align: "center",width:125, editable:false}, {name:'approve_status',index:'approve_status', hidden:true, width:375, editable:false}, {name:'approve_status',index:'approve_status',classes:'agr_appr',align: "center",editable:false,editrules:{required: true}, width:250,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="confirm4($(this))" '; }}, {name:'po_path',index:'po_path', align: "center", editable:false,editrules:{}, width:220,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="view_specialpo($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='VIEW PO' onclick='some_function' data-toggle='modal' data-target='#edit_modal' \>"; }}, ], rowNum:20, rowTotal: 2000, rowList : [10,20,30,50,100,500,1000], rownumbers: true, rownumWidth: 40, pager:"#pager4", sortname:'owner_id', viewrecords: true, gridview: true, autowidth: true, sortorder:"desc", shrinkToFit: false, emptyrecords: 'No records to display', // multiselect: true, // multiboxonly: true, loadonce:true, caption:"Approved Special Purchase Order Details", }); $("#list4").jqGrid("setLabel", "rn", "SL"); $("#list4").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list4").jqGrid('navGrid','#pager4', {edit:true,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); } else if(str=="normal_unapproveds/normal_disapproveds") { $('#jaytab1').hide(); $('#jaytab2').hide(); $('#jaytab3').hide(); $('#jaytab4').hide(); $('#jaytab5').show(); $('#jaytab6').hide(); $('#jaytab7').hide(); $('#jaytab8').hide(); $('#jaytab9').hide(); jQuery("#list5").jqGrid({ url:"<?php echo site_url('controller/normal_po_details')?>", mtype : "post", datatype: "json", colNames:['SI','PO NO','PO PATH','PO TYPE','','VIEW PO'], colModel:[ {name:'id',index:'id', width:100, hidden:true,editable:false,key:true}, {name:'po_no',index:'po_no', width:100, editable:false}, {name:'po_path',index:'po_path', width:450, editable:false}, {name:'po_type',index:'po_type',classes:'po_type',align: "center",width:150, editable:false}, {name:'approve_status',index:'approve_status', hidden:true, width:375, editable:false}, {name:'po_path',index:'po_path', align: "center", editable:false,editrules:{}, width:300,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="view_po($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='VIEW PO' onclick='some_function' data-toggle='modal' data-target='#edit_modal' target='_blank'\>"; }}, ], rowNum:20, rowTotal: 2000, rowList : [10,20,30,50,100,500,1000], rownumbers: true, rownumWidth: 40, pager:"#pager5", sortname:'owner_id', viewrecords: true, gridview: true, autowidth: true, sortorder:"desc", shrinkToFit: false, emptyrecords: 'No records to display', // multiselect: true, // multiboxonly: true, loadonce:true, caption:"Approved Normal Purchase Order Details", }); $("#list5").jqGrid("setLabel", "rn", "SL"); $("#list5").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list5").jqGrid('navGrid','#pager5', {edit:true,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); } else if(str=="special_unapproveds/special_disapproveds") { $('#jaytab1').hide(); $('#jaytab2').hide(); $('#jaytab3').hide(); $('#jaytab4').hide(); $('#jaytab5').hide(); $('#jaytab6').show(); $('#jaytab7').hide(); $('#jaytab8').hide(); $('#jaytab9').hide(); jQuery("#list6").jqGrid({ url:"<?php echo site_url('controller/special_po_details')?>", mtype : "post", datatype: "json", colNames:['SI','PO NO','PO PATH','PO TYPE','','VIEW PO'], colModel:[ {name:'id',index:'id', width:100, hidden:true,editable:false,key:true}, {name:'po_no',index:'po_no', width:100, editable:false}, {name:'po_path',index:'po_path', width:450, editable:false}, {name:'po_type',index:'po_type',classes:'po_type',align: "center",width:150, editable:false}, {name:'approve_status',index:'approve_status', hidden:true, width:375, editable:false}, {name:'po_path',index:'po_path', align: "center", editable:false,editrules:{}, width:300,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="view_specialpo($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='VIEW PO' onclick='some_function' data-toggle='modal' data-target='#edit_modal' target='_blank'\>"; }}, ], rowNum:20, rowTotal: 2000, rowList : [10,20,30,50,100,500,1000], rownumbers: true, rownumWidth: 40, pager:"#pager6", sortname:'owner_id', viewrecords: true, gridview: true, autowidth: true, sortorder:"desc", shrinkToFit: false, emptyrecords: 'No records to display', // multiselect: true, // multiboxonly: true, loadonce:true, caption:"Special Purchase Order Details", }); $("#list6").jqGrid("setLabel", "rn", "SL"); $("#list6").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list6").jqGrid('navGrid','#pager6', {edit:true,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); } else if(str=="pending_po") { $('#jaytab1').hide(); $('#jaytab2').hide(); $('#jaytab3').hide(); $('#jaytab4').hide(); $('#jaytab5').hide(); $('#jaytab6').hide(); $('#jaytab7').show(); $('#jaytab8').hide(); $('#jaytab9').hide(); jQuery("#list7").jqGrid({ url:"<?php echo site_url('controller/get_pending_po')?>", mtype : "post", datatype: "json", colNames:['SI','PO NO','PO PATH','PO TYPE','','VIEW PO','SEND'], colModel:[ {name:'po_no',index:'po_no', width:100, hidden:true,editable:false,key:true}, {name:'po_no',index:'po_no', width:100, editable:false}, {name:'po_path',index:'po_path', width:250, editable:false}, {name:'po_type',index:'po_type',classes:'po_type',align: "center",width:150, editable:false}, {name:'transfer_status',index:'transfer_status', classes:'transfer_status',align: "center", width:150, editable:false}, {name:'po_path',index:'po_path', align: "center", editable:false,editrules:{}, width:150,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="view_pendingpo($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='VIEW PO' onclick='some_function' data-toggle='modal' data-target='#edit_modal' target='_blank'\>"; }}, {name:'po_path',index:'po_path', align: "center", editable:false,editrules:{}, width:150,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="transfer($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='SEND'\>"; }}, ], rowNum:20, rowTotal: 2000, rowList : [10,20,30,50,100,500,1000], rownumbers: true, rownumWidth: 40, pager:"#pager7", sortname:'owner_id', viewrecords: true, gridview: true, autowidth: true, sortorder:"desc", shrinkToFit: false, emptyrecords: 'No records to display', // multiselect: true, // multiboxonly: true, loadonce:true, caption:"Pending Purchase Order Details", }); $("#list7").jqGrid("setLabel", "rn", "SL"); $("#list7").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list7").jqGrid('navGrid','#pager7', {edit:true,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); } else if(str=="transferred_po") { $('#jaytab1').hide(); $('#jaytab2').hide(); $('#jaytab3').hide(); $('#jaytab4').hide(); $('#jaytab5').hide(); $('#jaytab6').hide(); $('#jaytab7').hide(); $('#jaytab8').show(); $('#jaytab9').hide(); jQuery("#list8").jqGrid({ url:"<?php echo site_url('controller/get_transferred_po')?>", mtype : "post", datatype: "json", colNames:['SI','PO NO','PO PATH','PO TYPE','STATUS'], colModel:[ {name:'id',index:'id', width:150, hidden:true,editable:false,key:true}, {name:'po_no',index:'po_no', width:150, editable:false}, {name:'po_path',index:'po_path', width:350, editable:false}, {name:'po_type',index:'po_type',classes:'po_type',align: "center",width:250, editable:false}, {name:'transfer_status',index:'transfer_status', classes:'transfer_status',align: "center", width:250, editable:false}, /* {name:'po_path',index:'po_path', align: "center", editable:false,editrules:{}, width:150,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="view_pendingpo($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='VIEW PO' onclick='some_function' data-toggle='modal' data-target='#edit_modal' target='_blank'\>"; }}, {name:'po_path',index:'po_path', align: "center", editable:false,editrules:{}, width:150,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="transfer($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='SEND'\>"; }},*/ ], rowNum:20, rowTotal: 2000, rowList : [10,20,30,50,100,500,1000], rownumbers: true, rownumWidth: 40, pager:"#pager8", sortname:'owner_id', viewrecords: true, gridview: true, autowidth: true, sortorder:"desc", shrinkToFit: false, emptyrecords: 'No records to display', // multiselect: true, // multiboxonly: true, loadonce:true, caption:"Transferred Purchase Order Details", }); $("#list8").jqGrid("setLabel", "rn", "SL"); $("#list8").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list8").jqGrid('navGrid','#pager8', {edit:true,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); } else if(str=="signed_po") { $('#jaytab1').hide(); $('#jaytab2').hide(); $('#jaytab3').hide(); $('#jaytab4').hide(); $('#jaytab5').hide(); $('#jaytab6').hide(); $('#jaytab7').hide(); $('#jaytab8').hide(); $('#jaytab9').show(); jQuery("#list9").jqGrid({ url:"<?php echo site_url('controller/get_signed_po')?>", mtype : "post", datatype: "json", colNames:['SI','PO NO','PO PATH','PO TYPE','APPROVE','STATUS','VIEW'], colModel:[ {name:'id',index:'id', width:150, hidden:true,editable:false,key:true}, {name:'po_no',index:'po_no', width:150, editable:false}, {name:'po_path',index:'po_path', width:350, editable:false}, {name:'po_type',index:'po_type',classes:'po_type',align: "center",width:250, editable:false}, /* {name:'confirm',index:'confirm',classes:'agr_appr',align: "center",editable:false,editrules:{required: true}, width:150,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="confirm5($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='checkbox' id='check' class='check' value='SELECT' \>"; }},*/ {name:'approve_status',index:'approve_status', align:'center', width:100, editable:false,formatter: function (cellvalue, options, rowObject) { if(rowObject.approve_status=='APPROVED'){ var retVal = ''; var retVal1 = ''; retVal ='<input type="button" value="Disapprove" onclick="confirm5($(this))"; />'; return retVal; } else if(rowObject.approve_status=='DISAPPROVED'){ retVal1 ='<input type="button" value="Approve" onclick="confirm5($(this))"; />'; return retVal1; } else if(rowObject.approve_status=='SIGNED'){ retVal1 ='<input type="button" value="Approve" onclick="confirm5($(this))"; />'; return retVal1; } }}, {name:'approve_status',index:'approve_status',hidden:true, width:375, editable:false}, {name:'po_path',index:'po_path', align: "center", editable:false,editrules:{}, width:150,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="view_signed_po($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='VIEW PO' onclick='some_function' data-toggle='modal' data-target='#edit_modal' target='_blank'\>"; }}, ], rowNum:20, rowTotal: 2000, rowList : [10,20,30,50,100,500,1000], rownumbers: true, rownumWidth: 40, pager:"#pager9", sortname:'owner_id', viewrecords: true, gridview: true, autowidth: true, sortorder:"desc", shrinkToFit: false, emptyrecords: 'No records to display', // multiselect: true, // multiboxonly: true, loadonce:true, caption:"Signed Purchase Order Details", }); $("#list9").jqGrid("setLabel", "rn", "SL"); $("#list9").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list9").jqGrid('navGrid','#pager8', {edit:true,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); } } function view_pendingpo(rowId) { var id = rowId.closest('tr').attr('id'); var ids=id; $.ajax({ url:"<?php echo site_url('controller/view_pendingpo')?>", type:"POST", data:{ids:ids}, success:function(response) { response=jQuery.parseJSON(response); console.log(response); if(response.result == 1) { window.open("<?php echo base_url()?>/"+response.res.po_path , "_blank"); } else { } } }); } function transfer(rowId) { var id = rowId.closest('tr').attr('id'); var po_no = $('.po_no').val(id); $('#newModal').modal('show'); $('.upload_pdf').submit(function(e) { e.preventDefault(); formdata = new FormData($(this)[0]); $.ajax({ type : 'post', url : '<?php echo site_url("controller/upload_pending_po_pdf")?>', data : formdata, contentType: false, processData: false, //async : false, success:function(data){ $('#newModal').modal('hide'); toastr["success"]("Succesfully Uploaded"); window.location.href = "<?php echo base_url('controller/po_list');?>" } }); }); } function view_signed_po(rowId) { var id = rowId.closest('tr').attr('id'); var ids=id; $.ajax({ url:"<?php echo site_url('controller/view_signed_po_details')?>", type:"POST", data:{ids:ids}, success:function(response) { response=jQuery.parseJSON(response); console.log(response); if(response.result == 1) { window.open("<?php echo base_url()?>/"+response.res.po_path , "_blank"); } else { } } }); } //test $("#cancel").click(function(e) { e.preventDefault(); window.location.href = '<?php echo base_url('controller/reg_product_list');?>'; }); $("#cancel1").click(function(e) { e.preventDefault(); window.location.href = '<?php echo base_url('controller/product');?>'; }); $("#cancel2").click(function(e) { e.preventDefault(); window.location.href = '<?php echo base_url('controller/outstanding_statement');?>'; }); </script> <style type="text/css"> .form-control:focus, input[type="Submit"]:focus, input[type="button"]:focus { border-color: #FF0000; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(255, 0, 0, 0.6); } #editmodlist2 { //height: 232px !important; width: 326px !important; } #FrmGrid_list2 { width: 100% !important; } .ui-jqdialog .ui-jqdialog-titlebar { height: 29px !important; background-color:#2A4474 !important; color: white; padding-left: 10px; } .fm-button { height: 21px !important; padding: 1px; margin-right: 10px !important; height: 21px !important; width: 43%; margin-top: -7px !important; } .ui-jqdialog-content td.navButton { padding-top: 12px !important; } .ui-jqgrid .ui-jqgrid-titlebar { height: 27px !important; background-color: #2A4474!important; color:white !important; } .ui-jqgrid-bdiv { height: 232px !important; } .ui-widget-overlay { z-index:0 !important; } </style> <style> .login-head { background:#3c5a98; padding-bottom:10px; padding-top:10px; } .login-footer { background:#3c5a98; padding-bottom:10px; padding-top:15px; color:white; text-align:center; } .login-head label { color:white !important; } .login-head a { font-size:12px; color:white; } .lgn-btn { margin-top:5px; } </style> <style> .login-head { background:#3c5a98; padding-bottom:10px; padding-top:10px; } .login-footer { background:#3c5a98; padding-bottom:10px; padding-top:15px; color:white; text-align:center; } .login-head label { color:white !important; } .login-head a { font-size:12px; color:white; } .lgn-btn { margin-top:5px; } </style> <!---- http://bootsnipp.com/snippets/featured/bootstrap-carousel-with-text slider reference---------------------> <style> .carousel-indicators .active { background-color: #2980b9; } .carousel-inner img { width: 100%; max-height: 500px } .carousel-control { width: 0; } .carousel-control.left, .carousel-control.right { opacity: 1; filter: alpha(opacity=100); background-image: none; background-repeat: no-repeat; text-shadow: none; } .carousel-control.left span { padding: 15px; } .carousel-control.right span { padding: 15px; } .carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right, .carousel-control .icon-prev, .carousel-control .icon-next { position: absolute; top: 45%; z-index: 5; display: inline-block; } .carousel-control .glyphicon-chevron-left, .carousel-control .icon-prev { left: 0; } .carousel-control .glyphicon-chevron-right, .carousel-control .icon-next { right: 0; } .carousel-control.left span, .carousel-control.right span { //background-color: #000; } .carousel-control.right span { margin-right: 16px; } .carousel-control.left span:hover, .carousel-control.right span:hover { opacity: .7; filter: alpha(opacity=70); } /* Carousel Header Styles */ .header-text { position: absolute; top: 20%; left: 1.8%; right: auto; width: 96.66666666666666%; color: #fff; } .header-text h2 { font-size: 40px; } .header-text h2 span { background-color: #2980b9; padding: 10px; } .header-text h3 span { background-color: #000; padding: 15px; } .btn-min-block { min-width: 170px; line-height: 26px; } .btn-theme { color: #fff; background-color: transparent; border: 2px solid #fff; margin-right: 15px; } .btn-theme:hover { color: #000; background-color: #fff; border-color: #fff; } </style> <!---------- news style---> <!-- <style>--> <!-- .news-1--> <!-- {--> <!-- background: #F0F0F0 !important;--> <!-- min-height:300px;--> <!-- }--> <!-- .news_cont--> <!-- {--> <!-- padding-bottom:25px;--> <!-- }--> <!-- .news-1 img--> <!-- {--> <!-- min-height:300px;--> <!-- }--> <!-- .news-1--> <!-- {--> <!-- padding-left: 0 !important;--> <!-- }--> <!-- #news-top-pad--> <!-- {--> <!-- //padding-top:25px;--> <!-- padding-bottom:30px;--> <!-- }--> <!-- #news-top-pad h3{--> <!-- color: #0065b3;--> <!-- font-weight: 600;--> <!-- border-bottom: 1px solid silver;--> <!-- padding-bottom: 10px;--> <!-- }--> <!-- .news-right-content h3--> <!-- {--> <!-- font-weight:700;--> <!-- }--> <!-- .sub-title--> <!-- {--> <!-- color:#283D74;--> <!-- font-size:18px;--> <!-- }--> <!-- .date--> <!-- {--> <!-- color: #928787;--> <!-- font-size: 17px;--> <!-- }--> <!-- .read_more--> <!-- {--> <!-- padding-top:15px;--> <!-- fonnt-weight:800;--> <!-- padding-bottom:10px;--> <!-- font-size: 17px;--> <!-- }--> <!-- @media only screen and (min-width:320px) and (max-width:640px) { --> <!-- .news-1--> <!-- {--> <!-- padding-left: 15px !important;--> <!-- }--> <!-- }--> <!-- .container--> <!-- {--> <!-- padding-right:0px !important;--> <!-- }--> <!-- .agr_appr--> <!--{--> <!-- font-weight:bold !important;--> <!-- color:#AF0100;--> <!-- cursor: pointer; --> <!-- text-transform: uppercase !important;--> <!--}--> <!--.po_type--> <!--{--> <!-- font-weight:bold !important;--> <!-- color:BLUE;--> <!-- cursor: pointer; --> <!-- text-transform: uppercase !important;--> <!--}--> <!-- </style>-->