EVOLUTION-NINJA
Edit File: add_link_product.php
<div class="page-content-wrapper"> <div class="page-content"> <?php if(isset($fetch_product_data->product)) {?> <h3 class="page-title">Edit Product </h3> <?php } else {?> <h3 class="page-title">Add Product </h3> <?php } ?> <div class="page-bar"> <ul class="page-breadcrumb"> <li><i class="fa fa-home"></i> <a href="<?php echo base_url();?>dashboard/dashboard_fun">Home</a> <i class="fa fa-angle-right"></i> <a href="<?php echo base_url('vendor/add_link_product_details'); ?>" > Product Master </a></li> </ul> </div> <script> $(document).ready(function (){ //alert(); var ids=$("#product_id").val(); //alert(ids); jQuery("#list3").jqGrid({ url:"<?php echo base_url('vendor/fetch_productyarn_details')?>/s"+ids+"/", datatype: "json", colNames:['Id','Yarn Type','Yarn Quality','Yarn Name','Yarn Denier','Yarn Specification','Hank Length.','Hank Weight'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, {name:'yarntype',index:'yarntype', width:148,editable:false}, {name:'yarnquality',index:'yarnquality', width:148,editable:true,editrules:{required: true}}, {name:'yarnname',index:'yarnname', editable:true,editrules:{required: true},width:148}, {name:'yarndenier',index:'yarndenier', width:148,editable:false}, {name:'yarnspecification',index:'yarnspecification', width:148,editable:true,editrules:{required: true}}, {name:'hanklength',index:'hanklength', editable:true,editrules:{required: true},width:148}, {name:'hankweight',index:'hankweight', editable:true,editrules:{required: true},width:148}, ], rowNum:50, rowTotal: 200000000000000000000000000, rowList : [50,100,200,300,500,1000,5000], rownumbers: true, pager: '#pager3', sortname:'id', viewrecords: true, loadonce:true, gridview: true, sortorder:"desc", caption:"Yarn Details", // multiselect: true, // onPaging : function(but) { // alert("Button: "+but + " is clicked"); // } }); $("#list3").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required $("#list3").jqGrid('navGrid','#pager3', {edit:false,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true, multipleGroup:true, caption:"search" } ); $("#list3").navButtonAdd('#pager3', { caption:"Delete", buttonicon:"ui-icon-trash", onClickButton: deleteRow, position: "last", title:"", cursor: "pointer", id:"client_delete" } ); }); }); </script> <form id="land_owner" class="form-inline"> <?php if(isset($fetch_product_data->product)) {?> <div class="row" style="padding-bottom:15px;"> <div class="form-group col-sm-12 col-md-6"> <label class="col-sm-4 col-xs-5" id="fabpro">Product(Article)</label> <label class="col-sm-4 col-xs-5" id="otherpro">Product</label> <input type="hidden" class="col-sm-8 col-xs-7" id="product_id" name="product_id" value="<?php echo $fetch_product_data->id; ?>" style="text-transform: uppercase !important"> <input type="text" class="col-sm-8 col-xs-7" id="product_name" name="product_name" value="<?php echo $fetch_product_data->product; ?>" style="text-transform: uppercase !important" readonly> </div> <div class="clr hidden-sm hidden-md hidden-lg"></div> <div class="form-group col-sm-12 col-md-6"> <label class="col-sm-4 col-xs-5" >Product Type</label> <select id="product_type" name="product_type" class="col-sm-8 col-xs-7" onchange="displayweftspecifctin_am(this.value,1)" style="text-transform: uppercase !important" readonly> <!--<?php if(isset($product)) { foreach($product as $product) { ?> <option value="<?php echo $product->purchaseType; ?>" <?php if($fetch_product_data->product_type == $product->purchaseType) {echo "selected";}?>><?php echo $product->purchaseType; ?></option> <?php }} ?>--> <option value="<?php echo $fetch_product_data->product_type; ?>"><?php echo $fetch_product_data->product_type; ?></option> </select> <!--<input type="text" class="col-sm-8 col-xs-7" id="product_type" name="product_type">---> </div> </div> <!-- row 1---> <div class="row" style="padding-bottom:15px;"> <div class="form-group col-sm-12 col-md-6"> <?php if($fetch_product_data->product_type=='Consumables' || $fetch_product_data->product_type=='Spares') {?> <label class="col-sm-4 col-xs-5 " id="consumabless" style="padding-right:0 !important;">Product Description </label> <?php } else {?> <label class="col-sm-4 col-xs-5 " id="others" style="padding-right:0 !important;">Product Quality </label> <?php }?> <input type="text" class="col-sm-8 col-xs-7" id="product_desc" name="product_desc" value="<?php echo $fetch_product_data->product_description; ?>" style="text-transform: uppercase" > </div> <div class="clr hidden-sm hidden-md hidden-lg"></div> <div class="form-group col-sm-12 col-md-6"> <label class="col-sm-4 col-xs-5">Units</label> <?php if($fetch_product_data->product_type=='Consumables' || $fetch_product_data->product_type=='Spares' || $fetch_product_data->product_type=='Services') {?> <select class="col-sm-8 col-xs-7" id="unit" name="unit" style="height:26px;" > <option value="KGS" <?php if($fetch_product_data->unit=="KGS"){ echo "selected";}?>>KGS</option> <option value="LTRS" <?php if($fetch_product_data->unit=="LTRs"){ echo "selected";}?>>LTRS</option> <option value="MTRS" <?php if($fetch_product_data->unit=="MTRS"){ echo "selected";}?>>MTRS</option> <option value="PCS" <?php if($fetch_product_data->unit=="PCS"){ echo "selected";}?>>PCS</option> <option value="BOX" <?php if($fetch_product_data->unit=="BOX"){ echo "selected";}?>>BOX</option> <option value="TON" <?php if($fetch_product_data->unit=="TON"){ echo "selected";}?>>TON</option> <option value="SQFT" <?php if($fetch_product_data->unit=="SQFT"){ echo "selected";}?>>SQFT</option> <option value="SQMT" <?php if($fetch_product_data->unit=="SQMT"){ echo "selected";}?>>SQMT</option> <option value="CBM" <?php if($fetch_product_data->unit=="CBM"){ echo "selected";}?>>CBM</option> <option value="BAG" <?php if($fetch_product_data->unit=="BAG"){ echo "selected";}?>>BAG</option> <option value="NO." <?php if($fetch_product_data->unit=="NO."){ echo "selected";}?>>NO.</option> </select> <?php } else {?> <select class="col-sm-8 col-xs-7" id="unit" name="unit" style="height:26px;" > <option value="KGS" <?php if($fetch_product_data->unit=="KGS"){ echo "selected";}?>>KGS</option> <option value="LTRS" <?php if($fetch_product_data->unit=="LTRs"){ echo "selected";}?>>LTRS</option> <option value="MTRS" <?php if($fetch_product_data->unit=="MTRS"){ echo "selected";}?>>MTRS</option> <option value="PCS" <?php if($fetch_product_data->unit=="PCS"){ echo "selected";}?>>PCS</option> </select> <?php }?> </div> </div> <!-- row 2---> <div class="row" style="padding-bottom:15px;"> <div class="form-group col-sm-12 col-md-6" id="cgst_div"> <label class="col-sm-4 col-xs-5" >CGST</label> <input type="text" class="col-sm-8 col-xs-7" id="cgst" name="cgst" value="<?php echo $fetch_product_data->cgst; ?>"> </div> <div class="clr hidden-sm hidden-md hidden-lg"></div> <div class="form-group col-sm-12 col-md-6" id="sgst_div"> <label class="col-sm-4 col-xs-5" >SGST</label> <input type="text" class="col-sm-8 col-xs-7" id="sgst" name="sgst" value="<?php echo $fetch_product_data->sgst; ?>"> </div> </div> <!-- row 3---> <div class="row" style="padding-bottom:15px;"> <div class="form-group col-sm-12 col-md-6" id="igst_div"> <label class="col-sm-4 col-xs-5" >IGST</label> <input type="text" class="col-sm-8 col-xs-7" id="igst" name="igst" value="<?php echo $fetch_product_data->igst; ?>" required> </div> <!--<div class="clr hidden-sm hidden-md hidden-lg"></div> <div class="form-group col-sm-12 col-md-6" id="sgst_div"> <label class="col-sm-4 col-xs-5" >SGST</label> <input type="text" class="col-sm-8 col-xs-7" id="sgst" name="sgst" value="<?php echo $fetch_product_data->sgst; ?>"> </div>--> </div> <!-- row 3---> <?php if($fetch_product_data->product_type=='Fabrics') {?> <div class="row" style="padding-bottom:15px;"> <div class="form-group col-sm-12 col-md-6" id="width_divs"> <label class="col-sm-4 col-xs-5" >Width</label> <input type="text" class="col-sm-8 col-xs-7" id="width" name="width" value="<?php echo $fetch_product_data->width; ?>"> </div> <div class="clr hidden-sm hidden-md hidden-lg"></div> <div class="form-group col-sm-12 col-md-6" id="weight_divs"> <label class="col-sm-4 col-xs-5" >Weight in GSM</label> <input type="text" class="col-sm-8 col-xs-7" id="weight" name="weight" value="<?php echo $fetch_product_data->weight; ?>"> </div> </div> <!-- row 3---> <!-- row 2---> <div class="row" style="padding-bottom:15px;"> <div class="form-group col-sm-12 col-md-6" id="details_divs"> <label class="col-sm-4 col-xs-5" style="padding-right:0 !important;">Composition</label> <input type="text" class="col-sm-8 col-xs-7" id="construction_details" name="construction_details" value="<?php echo $fetch_product_data->construction_details; ?>" style="text-transform: uppercase" > </div> <div class="clr hidden-sm hidden-md hidden-lg"></div> <div class="form-group col-sm-12 col-md-6" id="compo_div"> <label class="col-sm-4 col-xs-5" style="padding-right:0 !important;">Supplier References</label> <input type="text" class="col-sm-8 col-xs-7" id="references" name="references" value="<?php echo $fetch_product_data->references; ?>" style="text-transform: uppercase" > </div> </div> <!-- row 3---> <?php }?> <!-- row 1---> <?php if($fetch_product_data->product_type=='Yarn - Raw' || $fetch_product_data->product_type=='Yarn - Twisted' || $fetch_product_data->product_type=='Yarn - Dyed' ) {?> <div class="row" style="padding-bottom:15px;" id="mill_grades"> <div class="form-group col-sm-12 col-md-6"> <label class="col-sm-4 col-xs-6 " style="padding-right:0 !important;">Mill #</label> <input type="text" class="col-sm-8 col-xs-6" id="mill" name="mill"> </div> <div class="clr hidden-sm hidden-md hidden-lg"></div> <div class="form-group col-sm-12 col-md-6"> <label class="col-sm-4 col-xs-5" >Grade</label> <input type="text" class="col-sm-8 col-xs-7" id="grade" name="grade" style="text-transform: uppercase" > </div> </div> <!-- row 2---> <div class="row" style="padding-bottom:15px;"> <a id="addButton" class="btn blue addButton" data-toggle="modal" data-target="#myModal" style="margin-left: 30px;"> <i class="fa fa-plus"></i></a> </div> <!-- row 3---> <?php }?> <?php if($fetch_product_data->product_type=='Fabrics') {?> <div class="row" style="padding-bottom:15px;" id="compo_div"> <div class="form-group col-sm-12 col-md-6" > <label class="col-sm-4 col-xs-5" style="padding-right:0 !important;">Construction details</label> <input type="text" class="col-sm-8 col-xs-7" id="details" name="details" value="<?php echo $fetch_product_data->details; ?>" style="text-transform: uppercase" > </div> <div class="form-group col-sm-12 col-md-6"> <label class="col-sm-4 col-xs-5" >Price / MTR</label> <input type="text" class="col-sm-8 col-xs-7" id="update_price_mtr" name="update_price_mtr" style="text-transform: uppercase" value="<?php echo $fetch_product_data->price_mtr; ?>" > </div> </div> <!-- row 4---> <?php }?> <a id="addButton" class="btn blue addButton" data-toggle="modal" data-target="#myModal" style="margin-left: 30px;"> <i class="fa fa-plus"></i></a> <div class="clr hidden-sm hidden-md hidden-lg"></div> <div class="row land_owner_a"> <div class="col-sm-4 col-md-4"></div> <div class="col-sm-4 col-md-4"> <button name="add" id="update" value="Submit" class="btn center-block submit" >Update</button> <a href="<?php echo base_url(); ?>vendor/add_link_product_details" class="btn default" style=" width:26%;color:rgb(51,51,81);">Cancel</a> </div> <div class="col-sm-4 col-md-4"></div> </div> <!-- row 3---> <div id = "jaytab1" class="jaytab1"> <table id="list3"></table> <div id="pager3"></div> <div id="dialogSelectRow" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> <?php } else {?> <div class="row" style="padding-bottom:15px;"> <div class="form-group col-sm-12 col-md-6"> <label class="col-sm-4 col-xs-5" id="fabpro">Product(Article)</label> <label class="col-sm-4 col-xs-5" id="otherpro">Product</label> <input type="text" class="col-sm-8 col-xs-7" id="product_name" name="product_name" style="text-transform: uppercase"> </div> <div class="clr hidden-sm hidden-md hidden-lg"></div> <div class="form-group col-sm-12 col-md-6"> <label class="col-sm-4 col-xs-5" >Product Type</label> <?php if($approved_by == 'Murali' ) { ?> <select id="product_type" name="product_type" class="col-sm-8 col-xs-7" onchange="displayweftspecifctin_am(this.value,1)" style="text-transform: uppercase !important"> <option value="Select">Select</option> <option value="Consumables">Consumables</option> <option value="Spares">Spares</option> </select> <?php } else { ?> <select id="product_type" name="product_type" class="col-sm-8 col-xs-7" onchange="displayweftspecifctin_am(this.value,1)"> <option value="">Select Product Type</option> <?php if(isset($product)) { foreach($product as $product) { if($product->purchaseType != 'Swan - Yarn - Dyed') { ?> <option value="<?php echo $product->purchaseType; ?>"><?php echo $product->purchaseType; ?></option> <?php }}} } ?> </select> <!--<input type="text" class="col-sm-8 col-xs-7" id="product_type" name="product_type">---> </div> </div> <!-- row 1---> <div class="row" style="padding-bottom:15px;"> <div class="form-group col-sm-12 col-md-6" id="prod"> <label class="col-sm-4 col-xs-5" id="consumables" style="padding-right:0 !important;">Product Description</label> <label class="col-sm-4 col-xs-5 " id="other" style="padding-right:0 !important;">Product Quality </label> <input type="text" class="col-sm-8 col-xs-7" id="product_desc" name="product_desc" style="text-transform: uppercase" > </div> <div class="form-group col-sm-12 col-md-6" id="yarn_sup_div"> <label class="col-sm-4 col-xs-5" style="padding-right:0 !important;">Supplier References</label> <input type="text" class="col-sm-8 col-xs-7" id="references" name="references" style="text-transform: uppercase" > </div> <div class="clr hidden-sm hidden-md hidden-lg"></div> <div class="form-group col-sm-12 col-md-6"> <label class="col-sm-4 col-xs-5">Units</label> <select class="col-sm-8 col-xs-7" id="unit" name="unit" style="height:26px;" > <option value="">Select</option> <option value="KGS">KGS</option> <option value="LTRS">LTRS</option> <option value="MTRS">MTRS</option> <option value="PCS">PCS</option> </select> </div> </div> <!-- row 2---> <div class="row" style="padding-bottom:15px;"> <div class="form-group col-sm-12 col-md-6" id="cgst_div"> <label class="col-sm-4 col-xs-5" >CGST</label> <input type="text" class="col-sm-8 col-xs-7" id="cgst" name="cgst" placeholder="CGST in %" required> </div> <div class="clr hidden-sm hidden-md hidden-lg"></div> <div class="form-group col-sm-12 col-md-6" id="sgst_div"> <label class="col-sm-4 col-xs-5" >SGST</label> <input type="text" class="col-sm-8 col-xs-7" id="sgst" name="sgst" placeholder="SGST in %" required> </div> </div> <!-- row 3---> <div class="row" style="padding-bottom:15px;"> <div class="form-group col-sm-12 col-md-6" id="igst_div"> <label class="col-sm-4 col-xs-5" >IGST</label> <input type="text" class="col-sm-8 col-xs-7" id="igst" name="igst" placeholder="IGST in %" required> </div> <!--<div class="clr hidden-sm hidden-md hidden-lg"></div> <div class="form-group col-sm-12 col-md-6" id="sgst_div"> <label class="col-sm-4 col-xs-5" >SGST</label> <input type="text" class="col-sm-8 col-xs-7" id="sgst" name="sgst" placeholder="SGST in %" required> </div> --> </div> <!-- row 3---> <!-- row 1---> <div class="row" style="padding-bottom:15px;" id="mill_grade"> <div class="form-group col-sm-12 col-md-6"> <label class="col-sm-4 col-xs-5" style="padding-right:0 !important;">Mill #</label> <input type="text" class="col-sm-8 col-xs-7" id="mill" name="mill"> </div> <div class="clr hidden-sm hidden-md hidden-lg"></div> <div class="form-group col-sm-12 col-md-6"> <label class="col-sm-4 col-xs-5" >Grade</label> <input type="text" class="col-sm-8 col-xs-7" id="grade" name="grade" style="text-transform: uppercase" > </div> </div> <!-- row 2---> <div class="row" style="padding-bottom:15px;"> <div class="form-group col-sm-12 col-md-6" id="width_div"> <label class="col-sm-4 col-xs-5" >Width</label> <input type="text" class="col-sm-8 col-xs-7" id="width" name="width"> </div> <a id="addButton" class="btn blue addButton" data-toggle="modal" data-target="#myModal" style="margin-left: 30px;"> <i class="fa fa-plus"></i></a> <div class="clr hidden-sm hidden-md hidden-lg"></div> <div class="form-group col-sm-12 col-md-6" id="weight_div"> <label class="col-sm-4 col-xs-5" >Weight in GSM</label> <input type="text" class="col-sm-8 col-xs-7" id="weight" name="weight"> </div> </div> <!-- row 3---> <div class="row" style="padding-bottom:15px;"> <div class="form-group col-sm-12 col-md-6" id="details_div"> <label class="col-sm-4 col-xs-5" style="padding-right:0 !important;">Composition</label> <input type="text" class="col-sm-8 col-xs-7" id="construction_details" name="construction_details" style="text-transform: uppercase" > </div> <div class="clr hidden-sm hidden-md hidden-lg"></div> <div class="form-group col-sm-12 col-md-6" id="sup_div"> <label class="col-sm-4 col-xs-5" style="padding-right:0 !important;">Supplier References</label> <input type="text" class="col-sm-8 col-xs-7" id="freferences" name="references" style="text-transform: uppercase" > </div> </div> <!-- row 4---> <!-- row 2---> <div class="row" style="padding-bottom:15px;" id="compo"> <div class="form-group col-sm-12 col-md-6" > <label class="col-sm-4 col-xs-5" style="padding-right:0 !important;">Construction details</label> <input type="text" class="col-sm-8 col-xs-7" id="details" name="details" style="text-transform: uppercase" > </div> <div class="form-group col-sm-12 col-md-6" > <label class="col-sm-4 col-xs-5" style="padding-right:0 !important;">Price / MTR</label> <input type="text" class="col-sm-8 col-xs-7" id="price_mtr" name="price_mtr" style="text-transform: uppercase" > </div> </div> <!-- row 3---> <!-- Hidden values --> <input type="hidden" class="col-sm-8 col-xs-6" id="yarntype" name="yarntype"> <input type="hidden" class="col-sm-8 col-xs-6" id="yarnquality" name="yarnquality"> <input type="hidden" class="col-sm-8 col-xs-6" id="yarnname" name="yarnname"> <input type="hidden" class="col-sm-8 col-xs-6" id="yarndenier" name="yarndenier"> <input type="hidden" class="col-sm-8 col-xs-6" id="yarnspecification" name="yarnspecification"> <input type="hidden" class="col-sm-8 col-xs-6" id="hanklength" name="hanklength"> <input type="hidden" class="col-sm-8 col-xs-6" id="hankweight" name="hankweight"> <div class="row land_owner_a"> <div class="col-sm-4 col-md-4"></div> <div class="col-sm-4 col-md-4"> <button name="add" id="add" value="Submit" class="btn center-block submit" >Submit</button> <a href="<?php echo base_url(); ?>vendor/add_link_product_details" class="btn default" style=" width:26%;color:rgb(51,51,81);">Cancel</a> </div> <div class="col-sm-4 col-md-4"></div> </div> <!-- row 3---> <?php } ?> </form> <!-- form 1 END ----------------------------------------------------------> <br/><br/> <div id = "jaytab" class="jaytab"> <table id="list2"></table> <div id="pager2"></div> <div id="dialogSelectRow" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> <div id="myModal" class="modal fade" role="dialog" style="color:#000;"> <div class="modal-dialog" > <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title">Yarn Details</h4> </div> <div class="modal-body"> <form class="form-horizontal article_master_Data"> <fieldset> <div class="row" style="padding-bottom:45px;"> <div class="col-sm-4"></div> <div class="col-sm-4"> <label class="radio-inline"><input type="radio" name="optradio" checked value="Warp">Warp</label> <label class="radio-inline"><input type="radio" name="optradio" value="Weft">Weft</label> </div> <div class="col-sm-4"></div> </div> <!-- radio button ---> <!-- <input type="text" id="myInput" onkeyup="myFunction_filetr()" placeholder="Search for names.." title="Type in a name"> <input type="text" id="search" placeholder=" live search"></input>--> <!-- Form Name --> <div class="portlet-body" id="portlet-body"> <label class="col-sm-1 col-xs-1" style="padding-right:0 !important;"><b>Search :</b> </label> <input type="text" id="search_warp" placeholder="Type to search"> <br/><br/> <table class="table table-striped table-bordered table-hover" style="width:900px;" id="sample"> <thead> <tr> <th> Select yarn </th> <th> Yarn Type </th> <th> Yarn Quality </th> <th> Yarn Name </th> <th> Yarn Denier </th> <th> Yarn Specification </th> <th> Hank Length </th> <th> Hank Wt. </th> </tr> </thead> <tbody> <?php $count=1; foreach($getalldata as $getresult) { ?> <tr> <td><input type="checkbox" name="yarn" onclick="display()" value="<?php echo $getresult->id; ?>"><input type="hidden" value="<?php echo $getresult->id; ?>"></td> <td><?php echo $getresult->yarnType; ?></td> <td><?php echo $getresult->yarnQuality; ?></td> <td><?php echo $getresult->yarnName; ?></td> <td><?php echo $getresult->yarnDenier; ?></td> <td><?php echo $getresult->yarnSpecification; ?></td> <td><?php echo $getresult->hankLength; ?></td> <td><?php echo $getresult->hankWt; ?></td> </tr> <?php }?> </tbody> </table> </div> <div class="portlet-body1" id="portlet-body1" style="display:none;"> <label class="col-sm-1 col-xs-1" style="padding-right:0 !important;"><b>Search :</b> </label> <input type="text" id="search_weft" placeholder="Type to search"> <br/><br/> <table class="table table-striped table-bordered table-hover" id="sample"> <thead> <tr> <th> Select yarn </th> <th> Yarn Type </th> <th> Yarn Quality </th> <th> Yarn Name </th> <th> Yarn Denier </th> <th> Yarn Specification </th> <th> Hank Length </th> <th> Hank Wt. </th> </tr> </thead> <tbody> <?php $count=1; foreach($getalldata_weft as $getresult) { ?> <tr> <td><input type="checkbox" name="yarn" onclick="display()" value="<?php echo $getresult->id; ?>"><input type="hidden" value="<?php echo $getresult->id; ?>"></td> <td><?php echo $getresult->yarnType; ?></td> <td><?php echo $getresult->yarnQuality; ?></td> <td><?php echo $getresult->yarnName; ?></td> <td><?php echo $getresult->yarnDenier; ?></td> <td><?php echo $getresult->yarnSpecification; ?></td> <td><?php echo $getresult->hankLength; ?></td> <td><?php echo $getresult->hankWt; ?></td> </tr> <?php }?> </tbody> </table> </div> </fieldset> </form> </div> <div class="modal-footer"> <button type="button" class="btn btn-primary" id="generate" data-dismiss="modal" >Submit</button> <form action="#" method="post" class="form"> <input type="hidden" id="ids" name="ids" class="ids"> </form> </div> </div> </div> </div> </div> <!-- page-content --> </div> <!-- page-content-wrapper --> <script type="text/javascript"> $(document).ready(function () { $('input[type="radio"]').click(function () { if ($(this).attr("value") == "Warp") { $("#portlet-body1").hide(); $("#portlet-body").show(); } if ($(this).attr("value") == "Weft") { $("#portlet-body").hide(); $("#portlet-body1").show(); } }); }); </script> <style> .modal-content { height:auto; max-height:600px !important; overflow-y:scroll !important; width:952px; !important; } #search_list2 { display:none !important; } #refresh_list2 { display:none !important; } .btn{ padding: 4px 29px !important; font-size: 15px !important; font-weight: bold; } .select_product label{ background: #485b7f; color: white; height: 23px; padding-top: 2px; margin-bottom:0; } .select_product input{ background: #e8ecf2; border: transparent; height: 25px; border-bottom: 2px solid white; } @media only screen and (min-width:320px) and (max-width:640px) { .add{ margin-left: 40%; margin-top: 10px; } } .form-group { margin-bottom:0 !important; } </style> <style> @media only screen and (min-width:320px) and (min-height:640px){ #gbox_list2{ width:1052px !important; } #gview_list2{ width:100% !important; } .ui-jqgrid-hdiv{ width:100% !important; } .ui-jqgrid-htable{ width:100% !important; } #list2{ width:100% !important; } } </style> <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"> $("#add").click(function(e) { e.preventDefault(); if($('#freferences').val() !="") { var reference =$('#freferences').val(); } else { var reference =$('#references').val(); } var product_name =$('#product_name').val(); var product_type =$('#product_type').val(); var product_desc =$('#product_desc').val(); var width =$('#details').val(); var composition =$('#construction_details').val(); var width =$('#width').val(); var weight =$('#weight').val(); var unit =$('#unit').val(); var details =$('#details').val(); var mill =$('#mill').val(); var grade =$('#grade').val(); var yarntype =$('#yarntype').val(); var yarnquality =$('#yarnquality').val(); var yarnname =$('#yarnname').val(); var yarndenier =$('#yarndenier').val(); var yarnspecification =$('#yarnspecification').val(); var hanklength =$('#hanklength').val(); var hankweight =$('#hankweight').val(); var cgst =$('#cgst').val(); var sgst =$('#sgst').val(); var igst =$('#igst').val(); var price_mtr =$('#price_mtr').val(); if( product_type=='Yarn - Raw' || product_type=='Yarn - Twisted' || product_type=='Yarn - Dyed') { if(cgst != '' && sgst != '' && igst != '') { if(yarntype != '' && yarnname != '' ) { $.ajax({ url:"<?php echo base_url('vendor/insert_product_data');?>", type:"POST", data:{'product_name':product_name,'product_type':product_type,'product_desc':product_desc,'composition':composition,'width':width,'weight':weight,'unit':unit,'details':details, 'details':details,'mill':mill,'grade':grade,'reference':reference,'yarntype':yarntype,'yarnquality':yarnquality,'yarnname':yarnname,'yarndenier':yarndenier,'yarnspecification':yarnspecification,'hanklength':hanklength,'hankweight':hankweight,'cgst':cgst,'sgst':sgst,'igst':igst}, async:false, success:function(data) { window.location.reload(); } }); } else{ swal({ title: "Please Select Yarn Details", text: "", }); } } else { swal({ title: "Please Fill All The Feilds", text: "", }); } } else if(product_name != '' && product_type != '' && cgst != '' && sgst != '' && igst != '') { $.ajax({ url:"<?php echo base_url('vendor/insert_product_data');?>", type:"POST", data:{'price_mtr':price_mtr,'product_name':product_name,'product_type':product_type,'product_desc':product_desc,'composition':composition,'width':width,'weight':weight,'unit':unit,'details':details, 'details':details,'mill':mill,'grade':grade,'reference':reference,'yarntype':yarntype,'yarnquality':yarnquality,'yarnname':yarnname,'yarndenier':yarndenier,'yarnspecification':yarnspecification,'hanklength':hanklength,'hankweight':hankweight,'cgst':cgst,'sgst':sgst,'igst':igst}, async:false, success:function(data) { window.location.reload(); } }); } else{ swal({ title: "Please Fill All The Fields", text: "", }); } }); $("#add_link").click(function(e) { e.preventDefault(); var p_name =$('#pp_name').val(); var p_type =$('#pp_type').val(); var p_desc =$('#pp_desc').val(); var v_name =$('#v_name').val(); var v_phone =$('#v_phone').val(); var v_address =$('#v_address').val(); var v_email =$('#v_email').val(); if(p_name != '' && p_type != '' && p_desc != ''&& v_name != '' && v_phone != '' && v_address != '' && v_email != '' ) { $.ajax({ url:"<?php echo base_url('vendor/insert_product_link_data');?>", type:"POST", data:{'p_name':p_name,'p_type':p_type,'p_desc':p_desc,'v_name':v_name,'v_phone':v_phone,'v_address':v_address,'v_email':v_email}, async:false, success:function(data) { $("#product_name").val(''); $("#product_type").val(''); $("#product_desc").val(''); window.location.reload(); } }); } else{ swal({ title: "Please Fill All The Fields", text: "", }); } }); </script> <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() { $( "#pro_name" ).autocomplete({ source: '<?php echo base_url('vendor/auto_sea'); ?>', }); }); function searchname() { var customer = document.getElementById('pro_name').value; $.ajax({ url:"<?php echo base_url('vendor/search_by_fetch')?>", dataType: "json", data:{'customer':customer}, type:"POST", async:true, success:function(data) { // alert('hai'); var obj=JSON.parse(data); document.getElementById('pp_name').value=obj[0].product; document.getElementById('pp_type').value=obj[0].product_type; document.getElementById('pp_desc').value=obj[0].product_description; } }); } function myFunction() { var customer = document.getElementById('pro_name').value; $.ajax({ url:"<?php echo base_url('vendor/search_by_fetch')?>", dataType: "json", data:{'customer':customer}, type:"POST", async:true, success:function(data) { // alert('hai'); var obj=JSON.parse(data); document.getElementById('pp_name').value=obj[0].product; document.getElementById('pp_type').value=obj[0].product_type; document.getElementById('pp_desc').value=obj[0].product_description; } }); } $(document).ready(function() { $( "#vendor_name" ).autocomplete({ source: '<?php echo base_url('vendor/auto'); ?>', }); }); function vendor_searchname() { var customer = document.getElementById('vendor_name').value; $.ajax({ url:"<?php echo base_url('vendor/vendor_search_by_fetch')?>", dataType: "json", data:{'customer':customer}, type:"POST", async:true, success:function(data) { // alert('hai'); var obj=JSON.parse(data); document.getElementById('v_name').value=obj[0].name; document.getElementById('v_phone').value=obj[0].phone; document.getElementById('v_address').value=obj[0].address; document.getElementById('v_email').value=obj[0].email; } }); } function vendor_myFunction() { var customer = document.getElementById('vendor_name').value; $.ajax({ url:"<?php echo base_url('vendor/vendor_search_by_fetch')?>", dataType: "json", data:{'customer':customer}, type:"POST", async:true, success:function(data) { // alert('hai'); var obj=JSON.parse(data); document.getElementById('v_name').value=obj[0].name; document.getElementById('v_phone').value=obj[0].phone; document.getElementById('v_address').value=obj[0].address; document.getElementById('v_email').value=obj[0].email; } }); } </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" type="text/css" href="<?php echo base_url();?>assets/css/bootstrap-datepicker.min.css"/> <script src="<?php echo base_url();?>assets/js/bootstrap-datepicker.min.js"></script> <script> $('.datepicker').datepicker({ format: 'yyyy/mm/dd', }); </script> <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; } .form-horizontal .radio-inline { padding-top: 2px !important; margin-top: 0; margin-bottom: 0; } .form-horizontal .radio > span { margin-top: -3px !important; } </style> <script> $(document).ready(function (){ $("#weight_div").hide(); $("#width_div").hide(); $("#details_div").hide(); $("#consumables").hide(); $("#other").show(); $("#addButton").hide(); $("#fabpro").hide(); $("#otherpro").show(); $("#sup_div").hide(); $("#mill_grade").hide(); $("#compo").hide(); $("#yarn_sup_div").hide(); $("#prod").show(); }); $("#update").click(function(e) { e.preventDefault(); // alert(); var product_id =$('#product_id').val(); var product_name =$('#product_name').val(); var product_type =$('#product_type').val(); var product_desc =$('#product_desc').val(); var composition =$('#construction_details').val(); var width =$('#width').val(); var weight =$('#weight').val(); var unit =$('#unit').val(); var details =$('#details').val(); var mill =$('#mill').val(); var grade =$('#grade').val(); var reference =$('#references').val(); var yarntype =$('#yarntype').val(); var yarnquality =$('#yarnquality').val(); var yarnname =$('#yarnname').val(); var yarndenier =$('#yarndenier').val(); var yarnspecification =$('#yarnspecification').val(); var hanklength =$('#hanklength').val(); var hankweight =$('#hankweight').val(); var cgst =$('#cgst').val(); var sgst =$('#sgst').val(); var igst =$('#igst').val(); var update_price_mtr =$('#update_price_mtr').val(); if(product_name != '' && product_type != '' && product_desc != '') { $.ajax({ url:"<?php echo base_url('vendor/update_product_link_data');?>", type:"POST", data:{'update_price_mtr':update_price_mtr,'product_id':product_id,'product_name':product_name,'product_type':product_type,'product_desc':product_desc,'composition':composition,'width':width,'weight':weight,'unit':unit,'details':details, 'details':details,'mill':mill,'grade':grade,'reference':reference,'yarntype':yarntype,'yarnquality':yarnquality,'yarnname':yarnname,'yarndenier':yarndenier,'yarnspecification':yarnspecification,'hanklength':hanklength,'hankweight':hankweight,'sgst':sgst,'cgst':cgst,'igst':igst}, async:false, success:function(data) { window.location.href = '<?php echo base_url('vendor/add_link_product_details');?>'; } }); } else{ swal({ title: "Please Fill All The Fields", text: "", }); } }); function displayweftspecifctin_am(str,strr,postdata) { //alert(); var product=document.getElementById("product_type").value; //alert(product); if(product=="Fabrics") { $("#weight_div").show(); $("#width_div").show(); $("#details_div").show(); $("#consumables").hide(); $("#addButton").hide(); $("#other").show(); $("#otherpro").hide(); $("#fabpro").show(); $("#sup_div").show(); $("#mill_grade").hide(); $("#compo").show(); $("#jaytab").hide(); $("#yarn_sup_div").hide(); $("#prod").show(); document.getElementById("unit").innerHTML="<option value='MTRS'>MTRS</option>"; $('#cgst').val(''); $('#igst').val(''); $('#sgst').val(''); } else if(product=="Consumables") { $("#weight_div").hide(); $("#width_div").hide(); $("#details_div").hide(); $("#consumables").show(); $("#other").hide(); $("#addButton").hide(); $("#fabpro").hide(); $("#otherpro").show(); $("#sup_div").hide(); $("#mill_grade").hide(); $("#compo").hide(); $("#jaytab").hide(); $("#yarn_sup_div").hide(); $("#prod").show(); document.getElementById("unit").innerHTML="<option value='PCS'>PCS</option>"; document.getElementById("unit").innerHTML+="<option value='KGS'>KGS</option>"; document.getElementById("unit").innerHTML+="<option value='LTRS'>LTRS</option>"; document.getElementById("unit").innerHTML+="<option value='MTRS'>MTRS</option>"; document.getElementById("unit").innerHTML+="<option value='BOX'>BOX</option>"; document.getElementById("unit").innerHTML+="<option value='TON'>TON</option>"; document.getElementById("unit").innerHTML+="<option value='SQFT'>SQFT</option>"; document.getElementById("unit").innerHTML+="<option value='SQMT'>SQMT</option>"; document.getElementById("unit").innerHTML+="<option value='CBM'>CBM</option>"; document.getElementById("unit").innerHTML+="<option value='BAG'>BAG</option>"; document.getElementById("unit").innerHTML+="<option value='NO.'>NO.</option>"; $('#cgst').val(''); $('#igst').val(''); $('#sgst').val(''); } else if(product=="Spares") { $("#weight_div").hide(); $("#width_div").hide(); $("#details_div").hide(); $("#consumables").show(); $("#other").hide(); $("#addButton").hide(); $("#fabpro").hide(); $("#otherpro").show(); $("#sup_div").hide(); $("#mill_grade").hide(); $("#compo").hide(); $("#jaytab").hide(); $("#yarn_sup_div").hide(); $("#prod").show(); //document.getElementById("unit").innerHTML="<option value='PCS'>PCS</option>"; //document.getElementById("unit").innerHTML+="<option value='LTRS'>LTRS</option>"; document.getElementById("unit").innerHTML="<option value='PCS'>PCS</option>"; document.getElementById("unit").innerHTML+="<option value='KGS'>KGS</option>"; document.getElementById("unit").innerHTML+="<option value='LTRS'>LTRS</option>"; document.getElementById("unit").innerHTML+="<option value='MTRS'>MTRS</option>"; document.getElementById("unit").innerHTML+="<option value='BOX'>BOX</option>"; document.getElementById("unit").innerHTML+="<option value='TON'>TON</option>"; document.getElementById("unit").innerHTML+="<option value='SQFT'>SQFT</option>"; document.getElementById("unit").innerHTML+="<option value='SQMT'>SQMT</option>"; document.getElementById("unit").innerHTML+="<option value='CBM'>CBM</option>"; document.getElementById("unit").innerHTML+="<option value='BAG'>BAG</option>"; document.getElementById("unit").innerHTML+="<option value='NO.'>NO.</option>"; $('#cgst').val(''); $('#igst').val(''); $('#sgst').val(''); } else if(product=="Services") { $("#weight_div").hide(); $("#width_div").hide(); $("#details_div").hide(); $("#consumables").show(); $("#other").hide(); $("#addButton").hide(); $("#fabpro").hide(); $("#otherpro").show(); $("#sup_div").hide(); $("#mill_grade").hide(); $("#compo").hide(); $("#jaytab").hide(); $("#yarn_sup_div").hide(); $("#prod").show(); //document.getElementById("unit").innerHTML="<option value='PCS'>PCS</option>"; //document.getElementById("unit").innerHTML+="<option value='LTRS'>LTRS</option>"; document.getElementById("unit").innerHTML="<option value='PCS'>PCS</option>"; document.getElementById("unit").innerHTML+="<option value='KGS'>KGS</option>"; document.getElementById("unit").innerHTML+="<option value='LTRS'>LTRS</option>"; document.getElementById("unit").innerHTML+="<option value='MTRS'>MTRS</option>"; document.getElementById("unit").innerHTML+="<option value='BOX'>BOX</option>"; document.getElementById("unit").innerHTML+="<option value='TON'>TON</option>"; document.getElementById("unit").innerHTML+="<option value='SQFT'>SQFT</option>"; document.getElementById("unit").innerHTML+="<option value='SQMT'>SQMT</option>"; document.getElementById("unit").innerHTML+="<option value='CBM'>CBM</option>"; document.getElementById("unit").innerHTML+="<option value='BAG'>BAG</option>"; document.getElementById("unit").innerHTML+="<option value='NO.'>NO.</option>"; $('#cgst').val('0'); $('#igst').val('0'); $('#sgst').val('0'); } else { $("#weight_div").hide(); $("#width_div").hide(); $("#details_div").hide(); $("#consumables").hide(); $("#other").hide(); $("#prod").hide(); $("#addButton").show(); $("#fabpro").hide(); $("#otherpro").show(); $("#sup_div").hide(); $("#mill_grade").show(); $("#compo").hide(); $("#jaytab").show(); $("#yarn_sup_div").show(); document.getElementById("unit").innerHTML="<option value='KGS'>KGS</option>"; $('#cgst').val(''); $('#igst').val(''); $('#sgst').val(''); } } function display() { //alert(); $("input[name='yarn']").change(function () { // alert(); var maxAllowed =1; var cnt = $("input[name='yarn']:checked").length; var yarn= $("input[name='yarn']:checked").val(); $(".ids").val(yarn); //alert(cnt); if (cnt = maxAllowed) { $(this).prop("checked", true); $("input[name='yarn']").attr("disabled", true); // alert('You can select maximum ' + maxAllowed + ' Yarn!!'); $.ajax({ url:"<?php echo base_url('vendor/fetch_yarn_details')?>/s"+yarn+"/", type:"POST", async:false, success:function(data) { var obj=JSON.parse(data); document.getElementById("product_name").value =obj[0].yarnName+" "; document.getElementById("product_name").value +=obj[0].yarnDenier+" "; document.getElementById("product_name").value +=obj[0].yarnSpecification; $( "#product_name" ).prop( "disabled", true ); } }); swal({ title: 'You can select only ' + maxAllowed + ' Yarn!!', text: "", }); } }); } $("#generate").on('click', function () { var ids= $(".ids").val(); $.ajax({ url:"<?php echo base_url('vendor/fetch_yarn_details')?>/s"+ids+"/", type:"POST", async:false, success:function(data) { var obj=JSON.parse(data); var yarntype =$('#yarntype').val(obj[0].yarnType); var yarnquality =$('#yarnquality').val(obj[0].yarnQuality); var yarnname =$('#yarnname').val(obj[0].yarnName); var yarndenier =$('#yarndenier').val(obj[0].yarnDenier); var yarnspecification =$('#yarnspecification').val(obj[0].yarnSpecification); var hanklength =$('#hanklength').val(obj[0].hankLength); var hankweight =$('#hankweight').val(obj[0].hankWt); } }); jQuery("#list2").jqGrid({ url:"<?php echo base_url('vendor/fetch_yarn_details')?>/s"+ids+"/", datatype: "json", colNames:['Id','Yarn Type','Yarn Quality','Yarn Name','Yarn Denier','Yarn Specification','Hank Length.','Hank Weight'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, {name:'yarnType',index:'yarnType', width:148,editable:false}, {name:'yarnQuality',index:'yarnQuality', width:148,editable:true,editrules:{required: true}}, {name:'yarnName',index:'yarnName', editable:true,editrules:{required: true},width:148}, {name:'yarnDenier',index:'yarnDenier', width:148,editable:false}, {name:'yarnSpecification',index:'yarnSpecification', width:148,editable:true,editrules:{required: true}}, {name:'hankLength',index:'hankLength', editable:true,editrules:{required: true},width:148}, {name:'hankWt',index:'hankWt', editable:true,editrules:{required: true},width:148}, ], rowNum:50, rowTotal: 200000000000000000000000000, rowList : [50,100,200,300,500,1000,5000], rownumbers: true, pager: '#pager2', sortname:'id', viewrecords: true, loadonce:true, gridview: true, sortorder:"desc", caption:"Yarn Details", // multiselect: true, // onPaging : function(but) { // alert("Button: "+but + " is clicked"); // } }); //$("#list2").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required jQuery("#list2").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false, defaultSearch: "cn" }); $("#list2").jqGrid('navGrid','#pager2', {edit:false,add:false,del:false,search:true,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true, multipleGroup:true, caption:"search" } ); $("#list2").navButtonAdd('#pager2', { caption:"Delete", buttonicon:"ui-icon-trash", onClickButton: deleteRow, position: "last", title:"", cursor: "pointer", id:"client_delete" } ); }); </script> <script> var $rows = $('#sample tr'); $('#search_warp').keyup(function() { var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase(); $rows.show().filter(function() { var text = $(this).text().replace(/\s+/g, ' ').toLowerCase(); return !~text.indexOf(val); }).hide(); }); </script> <script> var $rows = $('#sample tr'); $('#search_weft').keyup(function() { var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase(); $rows.show().filter(function() { var text = $(this).text().replace(/\s+/g, ' ').toLowerCase(); return !~text.indexOf(val); }).hide(); }); </script> <style> .btn { float: left; //margin-left: 25%; } .modal-dialog { width:70%; } @media only screen and (min-width:320px) and (max-width:640px) { .modal-dialog { width:970px; } #myModal { overflow-x: auto !important; } .jaytab { overflow-x: auto !important; } } </style> <script> $(document).ready(function(){ $('#cgst').on('change keyup', function() { var sanitized = $(this).val().replace(/[^0-9.]/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('#sgst').on('change keyup', function() { var sanitized = $(this).val().replace(/[^0-9.]/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('#igst').on('change keyup', function() { var sanitized = $(this).val().replace(/[^0-9.]/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('#update_price_mtr').on('change keyup', function() { var sanitized = $(this).val().replace(/[^0-9.]/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('#price_mtr').on('change keyup', function() { var sanitized = $(this).val().replace(/[^0-9.]/g, ''); $(this).val(sanitized); }); }); </script>