EVOLUTION-NINJA
Edit File: remnant_stock.php
<style> .ui-jqgrid { text-transform: capitalize !important; } .tablediv { text-transform: uppercase !important; } .ui-jqgrid tr.jqgrow td{ text-transform: uppercase !important; } </style> <div class="page-content-wrapper"> <div class="page-content"> <!-- BEGIN PAGE HEADER--> <h3 class="page-title"> Remnants Stock Transferred Details </h3> <div class="page-bar"> <ul class="page-breadcrumb"> <li><i class="fa fa-home"></i> <a href="https://swansilk.co/dashboard/dashboard_fun">Home</a> <i class="fa fa-angle-right"></i> <a href="#" > Remnants </a></li> </ul> </div> <?php if(empty($access_row)) { } else { if($access_row->insert_id == '1') { ?> <form action="<?php echo base_url(); ?>stock/remnants_transfer" method="post" class="form-horizontal"> <b>To insert data click here:</b> <input type="hidden" name="yarn_type_val" value="dyed"> <input type="submit" name="Insert" value="Transfer" /><br><br> </form> <?php } else { ?> <?php } }?> <input type="hidden" id="preview_id" class="preview_id" value="<?php if(empty($access_row)){ } else { echo $access_row->preview_id; } ?>" > <input type="hidden" id="edit_id" class="edit_id" value="<?php if(empty($access_row)){ } else { echo $access_row->edit_id; } ?>" > <input type="hidden" id="delete_id" class="delete_id" value="<?php if(empty($access_row)){ } else { echo $access_row->delete_id; } ?>" > <input type="hidden" id="approval_id" class="approval_id" value="<?php if(empty($access_row)){ } else { echo $access_row->approval_id; } ?>" > <input type="hidden" value="<?php echo $ref; ?>" id="ref_id" > <input type="hidden" value="<?php echo $url_val; ?>" id="url_ref" style="width: 230px;" > <div id="location_modal" class="modal fade"> <div class="modal-dialog"> <div class="modal-content" class="workorder_application"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title">Locations</h4> </div> <div class="modal-body"> <div class="row"> <div class="col-md-12"> <div class="form-group"> <label class="control-label col-md-3">Location :</label> <div class="col-md-7"> <select class="form-control loc_drop_down" id="consumed_att" name="consumed_at" style="height:26px;" > <option value="">Select</option> <?php if(isset($consumed_at)) { foreach($consumed_at as $consumed_at) { ?> <option value="<?php echo $consumed_at->id; ?>"><?php echo $consumed_at->consumed_at; ?></option> <?php }} ?> </select> <input type="hidden" class="form-control loc_feild" id="row_id" name="row_id" readonly="readonly"> </div> </div> </div> </div> <!-- row -2--> </div> <div class="modal-footer"> <button class="btn btn-default" data-dismiss="modal">Close</button> <button id="submit_modal" name="submit" onclick="goods_details()" class="btn btn-primary">Submit</button> </div> </div> <!-- /.modal-content --> </div> <!-- /.modal-dialog --> </div> <div class="radio-list" style="margin-left: 2%;"> <div id = "jaytab1" class="jaytab"> <table id="list7"></table> <div id="pager7"></div> <div id="dialogSelectRow" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> </div> </div> <!-- End BEGIN CONTAINER --> <!-- BEGIN FOOTER --> <!-- BEGIN FOOTER --> <link rel="stylesheet" href="<?php echo base_url('assets/css/code_jquery.min.css');?>"> <script src="<?php echo base_url('assets/js/jquery-ui.min.js'); ?>" type="text/javascript"></script> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('assets/css/jquery-ui.min.css'); ?>" /> <style> .ss{ padding-right: 0 !important; padding-left: 0 !important; } .form-control { width:65% !important; height:27px !important; padding: 3px 12px !important; border-radius: 0px !important; //margin-bottom:15px; } label { font-weight: normal; text-align: left; } .hr-line{ border-top: 1px solid #465A81; } .well-sm { padding: 3px !important; border-radius: 0px !important; } input[type="file"] { padding-bottom: 28px !important; height: 25px !important; color:transparent; } .portlet.box.blue-madison { border: 1px solid #fff !important; border-top: 0; background:#fff !important; } #table_approved_indent { display:none; } #refresh_list3 { display:none !important; } @media only screen and (min-width:320px) and (max-width:640px) { } </style> <script> function getDesignAndQuality(articleNo) { $.ajax({ type: "post", url: "<?php echo base_url(); ?>marketing/getDesignAndQuality", data: "articleNo=" + articleNo, success: function (data) { var objData = jQuery.parseJSON(data); document.getElementById("design").value = objData.design; document.getElementById("quality").value = objData.quality; } }); } </script> <!-----------------datepicker-------------> <!-- The link to the CSS that the grid needs --> <link href="<?php echo base_url('assets/css/sweetalert2.min.css');?>" rel="stylesheet"/> <script src="<?php echo base_url('assets/js/sweetalert2.min.js');?>"></script> <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.min.js'); ?>"></script> <!-- A link to a jQuery UI ThemeRoller theme, more than 22 built-in and many more custom --> <!-- 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.min.css'); ?>" /> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('jqgrid/css/ui.jqgrid-bootstrap.min.css'); ?>" /> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('jqgrid/css/ui.jqgrid-bootstrap-ui.min.css'); ?>" /> <link rel="stylesheet" href="<?php echo base_url('assets/css/code_jquery.min.css');?>"> <script src="<?php echo base_url('assets/js/jquery-ui.min.js'); ?>" type="text/javascript"></script> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('assets/css/jquery-ui.min.css'); ?>" /> <style type="text/css"> .ss{ padding-right: 0 !important; padding-left: 0 !important; } label { font-weight: normal; text-align: left; } .hr-line{ border-top: 1px solid #465A81; } .well-sm { padding: 3px !important; border-radius: 0px !important; } input[type="file"] { padding-bottom: 28px !important; height: 25px !important; color:transparent; } .portlet.box.blue-madison { border: 1px solid #fff !important; border-top: 0; background:#fff !important; } input[type=file] { display: none; } .ui-jqgrid .ui-jqgrid-caption { text-align: left; background: rgb(72,91,127); color: white; } .ui-jqdialog .ui-jqdialog-titlebar { padding: .1em .1em; min-height: 35px; background: rgb(72,91,127); color: white; } .ui-jqdialog .ui-jqdialog-titlebar-close span { display: block; margin: -9px; } #sData { height: 27px; } #cData { height: 27px; } #dData { height: 27px; } #eData { height: 27px; } .coledit { cursor:pointer; padding-right: 22px !important; padding-left: 23px !important; margin-top: 4px !important; color:bold !important; } </style> <!-----------------datepicker-------------> <!-- The link to the CSS that the grid needs --> <script> $(document).ready(function (){ var l=$("#ref_id").val(); jQuery("#list7").jqGrid({ url:"<?php echo base_url('stock/remnats_yarn_details')?>/s"+l+"/", datatype: "json", colNames:['Id','Transfer Id','Product Type','Product Location','Transfer Location','Transferred By','Transferred Date','Edit','Preview','PC'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, {name:'remnants_val',index:'remnants_val', width:120,editable:false}, {name:'product_type',index:'product_type', width:120,editable:false}, {name:'product_location',index:'product_location', width:120,editable:true,editrules:{required: true}}, {name:'transfer_location',index:'transfer_location', editable:true,editrules:{required: true},width:120}, {name:'transfer_by',index:'transfer_by', editable:true,editrules:{required: true},width:120}, {name:'transfer_date',index:'transfer_date', editable:true,editrules:{required: true},width:120}, {name:'',index:'',align: "center",editable:false,editrules:{required: true}, width:200,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_fabric_edit($(this)" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' class='fa fa-eye' value='EDIT' onclick='some_function' classes='preview' \>"; }}, {name:'preview',index:'preview',align: "center",editable:false,editrules:{required: true}, width:140,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_dyed_preview($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' class='fa fa-eye' value='PREVIEW' onclick='some_function' classes='preview' \>"; }}, {name:'',index:'',align: "center",editable:false,editrules:{required: true}, width:50,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="remnants_pc($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' class='fa fa-eye' value='PC' onclick='some_function' classes='preview' \>"; }} ], height: 'auto', rowNum:50, rowTotal: 200000000000000000000000000, rowList : [50,100,200,300,500,1000,5000], rownumbers: true, rownumWidth: 40, pager:"#pager7", sortname:'id', viewrecords: true, gridview: true, autowidth: true, sortorder:"desc", loadonce:true, caption:"Remnants Details", subGrid: true, subGridRowExpanded: function(subgrid_id, row_id) { var subgrid_table_id; //alert(row_id); swan_id=row_id; //alert(swan_id); subgrid_table_id = subgrid_id+"_t"; jQuery("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table>"); jQuery("#"+subgrid_table_id).jqGrid({ url:"<?php echo base_url('stock/transfer_remnants_subgrid');?>/s"+row_id+"/", //data:{'sub_id':123}, mtype : "get", datatype: "json", colNames:['Id','OSL','Yarn Name','Yarn Denier','Yarn Specification','Shade','Color Code','Lot','Bale','Bag','Net Weight','Transferred Net Weight','Balanced Net Weight','Confirm','Received By'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, {name:'osl',index:'osl', width:150,editable:true,editrules:{required: true}}, {name:'yarn_name',index:'yarn_name', width:100,editable:true,editrules:{required: true}}, {name:'yarn_den',index:'yarn_den', editable:true,editrules:{required: true},width:70}, {name:'yarn_spec',index:'yarn_spec', editable:true,editrules:{required: true},width:70}, {name:'shades', index:'shades', width:100,editable:true,editrules:{required: true}}, {name:'color_code', index:'color_code', width:100,editable:true,editrules:{required: true}}, {name:'yarn_lot', index:'yarn_lot', width:100,editable:true,editrules:{required: true}}, {name:'yarn_bale',index:'yarn_bale', editable:true,editrules:{required: true},width:100}, {name:'bag',index:'bag', width:150,editable:true,editrules:{required: true}}, {name:'rements',index:'rements', width:100,editable:true,editrules:{required: true}}, {name:'issued_rem_wt',index:'issued_rem_wt', editable:true,editrules:{required: true},width:70}, {name:'bal_rem_wt',index:'bal_rem_wt', editable:true,editrules:{required: true},width:70}, { name: 'confirm', index: 'confirm', width:80, align: 'center', formatter: 'checkbox', editoptions: { value: '1:0' }, formatoptions: { disabled: true } }, {name:'rec_by',index:'rec_by', editable:true,editrules:{required: true},width:70}, ], height: 'auto', rowNum:20000000, sortname: 'num', sortorder: "asc" }); } }); //$("#list2").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required jQuery("#list7").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false, defaultSearch: "cn" }); $("#list7").jqGrid('navGrid','#pager7', {edit:false,add:false,del:false,search:false,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); }); function remnants_pc(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; $.ajax({ type:'post', url:'<?php echo base_url("stock/remnants_pc"); ?>', data:{'as':as}, async:false, success:function() { var url_r=$('#url_ref').val(); window.location.href = '<?php echo base_url('stock/remnants_pc');?>/'+ '?id='+as; } }); } function fun_dyed_preview(rowId) { var v=$('#preview_id').val(); if(v == 1) { var id = rowId.closest('tr').attr('id'); var as=id; $.ajax({ type:'post', url:'<?php echo base_url("stock/rem_preview"); ?>', data:{'as':as}, async:false, success:function() { var url_r=$('#url_ref').val(); if(url_r == '1') { window.location.href = '<?php echo base_url('stock/rem_preview');?>/'+ '?id='+as; } else if(url_r == '2') { window.location.href = '<?php echo base_url('stock/rem_preview');?>/'+ '?id='+as; } else if(url_r == '3') { window.location.href = '<?php echo base_url('stock/rem_preview');?>/'+ '?id='+as; } else if(url_r == '4') { window.location.href = '<?php echo base_url('stock/rem_preview');?>/'+ '?id='+as; } } }); } else { swal({ title: "You Don't Have Access For This Preview", text: "", }); } } function fun_fabric_edit(rowId) { var v=$('#edit_id').val(); if(v == 1) { var id = rowId.closest('tr').attr('id'); var as=id; $.ajax({ type:'post', url:'<?php echo base_url("stock/location_rem_preview"); ?>', type:"POST", data:{'as':as}, success:function(data) { var obj = jQuery.parseJSON(data); var objData = obj.details; var status=obj.rec_status; if(status == 'not yet') { if(objData.product_location == 'PEENYA - DYEING') { var loc='1'; $("#consumed_att").children("option[value^=" + loc + "]").hide() } else if(objData.product_location == 'HO') { var loc='2'; $("#consumed_att").children("option[value^=" + loc + "]").hide() } else if(objData.product_location == 'PEENYA - TAILORING') { var loc='3'; $("#consumed_att").children("option[value^=" + loc + "]").hide() } else if(objData.product_location == 'NANDI') { var loc='4'; $("#consumed_att").children("option[value^=" + loc + "]").hide() } else if(objData.product_location == 'BYATRANPURA') { var loc='5'; $("#consumed_att").children("option[value^=" + loc + "]").hide() } else if(objData.product_location == 'VIJAYAPURA') { var loc='6'; $("#consumed_att").children("option[value^=" + loc + "]").hide() } else if(objData.product_location == 'DODDAJALA') { var loc='7'; $("#consumed_att").children("option[value^=" + loc + "]").hide() } else if(objData.product_location == 'KUMARA PARK') { var loc='8'; $("#consumed_att").children("option[value^=" + loc + "]").hide() } <!-------------transfer location ---------------------------> if(objData.transfer_location == 'PEENYA - DYEING') { var locc='1'; $('#consumed_att').val(locc).attr("selected", "selected"); } else if(objData.transfer_location == 'HO') { var locc='2'; $('#consumed_att').val(locc).attr("selected", "selected"); } else if(objData.transfer_location == 'PEENYA - TAILORING') { var locc='3'; $('#consumed_att').val(locc).attr("selected", "selected"); } else if(objData.transfer_location == 'NANDI') { var locc='4'; $('#consumed_att').val(locc).attr("selected", "selected"); } else if(objData.transfer_location == 'BYATRANPURA') { var locc='5'; $('#consumed_att').val(locc).attr("selected", "selected"); } else if(objData.transfer_location == 'VIJAYAPURA') { var locc='6'; $('#consumed_att').val(locc).attr("selected", "selected"); } else if(objData.transfer_location == 'DODDAJALA') { var locc='7'; $('#consumed_att').val(locc).attr("selected", "selected"); } else if(objData.transfer_location == 'KUMARA PARK') { var locc='8'; $('#consumed_att').val(locc).attr("selected", "selected"); } $('#location_modal').modal('show'); $('#row_id').val(as); } else if(status == 'complete') { swal({ title: "This Stock Is Already Received Completely", text: "", }); } else { swal({ title: "This Stock Is Partly Received", text: "", }); } } }); } else { swal({ title: "You Don't Have Access For This Edit", text: "", }); } } </script> <script src="<?php echo base_url(); ?>assets/js/sweetalert.min.js" type="text/javascript"></script> <link href="<?php echo base_url(); ?>assets/css/sweetalert.min.css" rel="stylesheet" type="text/css" > <script type="text/javascript"> function goods_details() { var consumed_att =$('#consumed_att').val(); var row_id =$('#row_id').val(); $.ajax({ url:"<?php echo base_url('stock/replace_rem_transfer_location');?>", type:"POST", data:{'consumed_att':consumed_att,'row_id':row_id}, async:false, success:function(data) { swal({ title: "Successfully Added", text: "",}); $('#location_modal').modal('toggle'); $("#list7").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } }); } </script> <style> .preview { padding-bottom:3px !important; padding-top:3px !important; } .preview { padding-bottom:3px !important; padding-top:3px !important; } .tablediv { width: auto !important; overflow: scroll !important; } .ui-jqgrid .ui-jqgrid-btable tbody tr.jqgrow td { overflow: hidden; white-space: pre; } </style> <link rel="stylesheet" href="<?php echo base_url('assets/css/code_jquery.min.css');?>"> <script src="<?php echo base_url('assets/js/jquery-ui.min.js'); ?>" type="text/javascript"></script> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('assets/css/jquery-ui.min.css'); ?>" /> <script> $(document).ready(function() { $( "#customer" ).autocomplete({ source: '<?php echo base_url('request/auto_sea'); ?>', }); }); function searchname() { var customer = document.getElementById('customer').value; $.ajax({ url:"<?php echo base_url('request/search_by_fetch')?>", dataType: "json", data:{'customer':customer}, type:"POST", async:true, success:function(data) { // alert('hai'); var obj=JSON.parse(data); document.getElementById('customer_id').value=obj[0].customerID; } }); } </script> <style> #jaytab{ width:100%; overflow:auto; } } #search_list2 { display:none !important; } #list2_122_t { height:0px !important; } list2_136_t { height:12px !important; } .scroll { height:12px !important; } .ui-jqgrid-btable { } .ui-common-table { height:12px !important; } #refresh_list2 { display:none !important; } #client_edit { padding-right:12px !important; } #list2 { width: 1050px; height: 0px !important; } #gbox_list2 { height: auto !important; } #gview_list2 { height: auto !important; } @media only screen and (min-width:320px) and (max-width:641px){ .ui-jqgrid { margin-left: 1px !important; } .radio-list { margin-left:7% !important; } #table_pending_indent{ overflow-x: scroll; } #jaytab{ margin-top: 0 !important; margin-left: 0 !important; overflow-x: scroll; width: 600px !important; padding-left: 0 !important; } #jaytab1 { margin-top: 0 !important; margin-left: 0 !important; overflow-x: scroll; width: 300px !important; padding-left: 0 !important; } #editmodlist2 { width:90% !important; } #sData span, #cData span { margin-left: 0 !important; } } @media only screen and (min-width:641px) and (max-width:991px){ .ui-jqgrid { margin-left: 1px !important; } #jaytab{ margin-top: 0 !important; margin-left: 0 !important; overflow-x: scroll; width: 100% !important; padding-left:0 !important; padding-right:9px !important; } } #sData span, #cData span { margin-left: 3px; } #sData { height: 29px; } #cData { height: 29px; } .jqgfirstrow { height: 0px !important; } </style>