EVOLUTION-NINJA
Edit File: osl_indent_add.php
<style> #dyed_code { display:none; } </style> <div class="page-content-wrapper"> <div class="page-content"> <?php if(isset($fetch_data)) { ?> <h3 class="page-title">Edit Indent </h3> <?php } else {?> <h3 class="page-title">Add Indent </h3> <?php } ?> <?php $this->load->view('templates/nav_menu'); ?> <form action="<?php echo base_url('vendor/insert_outsource_osl_data');?>" method="post" id="land_owner" class="form-inline"> <?php if(isset($fetch_data)) { ?> <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">Indent No.</label> <input type="text" class="col-sm-8 col-xs-7" id="indent_no" name="indent_no" value="<?php echo $fetch_data->indent_no; ?>" readonly> </div> <!-------------- hidden div -----------------> <div class="form-group col-sm-12 col-md-6"> <div class="col-sm-6 col-xs-7"> <input type="hidden" name="sl_no_id" id="sl_no_id" value="<?php echo $fetch_data->id; ?>"> <input type="hidden" name="sl_indent_no" id="sl_indent_no" value="<?php echo $fetch_data->sl_indent_no; ?>"> </div> </div> <div class="form-group col-sm-12 col-md-6 indent-space"> <label class="col-sm-4 col-xs-5" >Department</label> <select class="col-sm-8 col-xs-7" id="department" name="department" style="height:26px;" readonly> <option value="<?php echo $fetch_data->department; ?>"><?php echo $fetch_data->department; ?></option> <?php if(isset($department)) { foreach($department as $department) { ?> <option value="<?php echo $department->department; ?>"><?php echo $department->department; ?></option> <?php }} ?> </select> </div> </div> <!-- row 1---> <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" style="padding-right:0 !important;">Consumed At</label> <select class="col-sm-8 col-xs-7" id="consumed_at" name="consumed_at" style="height:26px;text-transform: uppercase !important" readonly> <option value="<?php echo $fetch_data->consumed_at; ?>"><?php echo $fetch_data->consumed_at; ?></option> <?php if(isset($consumed_at)) { foreach($consumed_at as $consumed_at) { ?> <option value="<?php echo $consumed_at->consumed_at; ?>" style="text-transform: uppercase !important" ><?php echo $consumed_at->consumed_at; ?></option> <?php }} ?> </select> </div> <div class="form-group col-sm-12 col-md-6 indent-space"> <label class="col-sm-4 col-xs-5">Purpose/DTL No.</label> <input type="text" class="col-sm-8 col-xs-7" name="purpose" style="text-transform: uppercase !important" id="purpose" value="<?php echo $fetch_data->purpose; ?>" required> </div> </div> <!-- row 2---> <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" style="padding-right:0 !important; ">Product Type</label> <select id="product_type" name="producttypee" class="col-sm-8 col-xs-7" style="height:25px;text-transform: uppercase !important;border-color: #af9a9a;" onchange="displayweftspecifctin_am(this.value,1)" > <?php if(isset($producttype)) { foreach($producttype as $productss) { ?> <option value="<?php echo $productss->purchaseType; ?>" <?php if($productss->purchaseType == $fetch_data->product_type) {echo "selected";}?> style="text-transform: uppercase !important"><?php echo $productss->purchaseType; ?></option> <?php }} ?> </select> </div> <div class="form-group col-sm-4 col-md-6 indent-space"> <label class="col-sm-4 col-xs-5">Quantity</label> <input type="text" class="col-sm-4 col-xs-3" name="quantity" id="quantity" value="<?php echo $fetch_data->quantity; ?>"> <input type="text" class="col-sm-3 col-xs-offset-1 col-xs-3" id="unitt" name="unitt" value="<?php echo $fetch_data->unit; ?>" readonly /> </div> <div class="form-group"> <label class="col-sm-5 col-xs-5"></label> <input type="hidden" class="col-sm-7 col-xs-7" id="product_id" name="product_id" style="height:26px;margin-left: -39px;" value="<?php echo $fetch_data->product_id; ?>" readonly /> </div> </div> <!-- row 1---> <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" >Add Products</label> <select class="col-sm-8 col-xs-7" id="add_product" name="add_product" style="height:26px;text-transform: uppercase !important" onchange="displayunit_edit(this.value,1)"> <?php if(isset($product)) { foreach($product as $product) { ?> <option value="<?php echo $product->product; ?>" <?php if($product->product== $fetch_data->add_product) {echo "selected";}?> style="text-transform: uppercase !important"><?php echo $product->product; ?></option> <?php }} ?> </select> </div> <div class="form-group col-sm-12 col-md-6 indent-space"> <label class="col-sm-4 col-xs-5 col-md-4" style="padding-right: 0 !important;">Required on or Before</label> <input type="text" class="col-sm-8 col-xs-7 col-md-8 input-group openDatePicker" name="required_on_date" id="required_on" data-provide="datepicker" value="<?php echo $fetch_data->required_on; ?>"> <input type="hidden" class="col-sm-8 col-xs-6 col-md-8 " name="update_submit" id="update_submit" value="<?php echo "update_submit"; ?>"> </div> </div> <!-- row 1---> <div class="row" id="shade_div" style="padding-bottom:15px;"> <div class="form-group col-sm-12 col-md-6" id="detail"> <label class="col-sm-4 col-xs-5" >Yarn Details</label> <input type="text" class="col-sm-8 col-xs-7 col-md-8 input-group " name="det" id="det" value="<?php echo $fetch_data->yarn_details; ?>" style="text-transform: uppercase !important;"> </div> <div class="form-group col-sm-12 col-md-6" id="shade"> <label class="col-sm-4 col-xs-5" >Shades</label> <input type="text" class="col-sm-8 col-xs-7 col-md-8 input-group " name="shades" id="shades" value="<?php echo $fetch_data->shades; ?>" style="text-transform: uppercase !important"> </div> <div class="form-group col-sm-12 col-md-6" id="dyed_shade"> <label class="col-sm-4 col-xs-5" style="padding-right:0 !important;">Supplier Shades</label> <input type="text" class="col-sm-8 col-xs-7 col-md-8 input-group " name="color_shade" class="color_shade" id="color_shade" value="<?php echo $fetch_data->shades; ?>" style="text-transform: uppercase !important"> <!-- <select class="col-sm-8 col-xs-7" id="shades" name="shades" style="height:26px;" > <option value="">Select Shade</option> <?php //if(isset($colors)) { foreach($colors as $colors) { ?> <option value="<?php //echo $colors->color; ?>"><?php //echo $colors->color; ?></option> <?php //}} ?> </select> --> </div> <br/> <div class="form-group col-sm-12 col-md-6" id="dyed_code"> <label class="col-sm-4 col-xs-5" style="padding-right:0 !important;">Color Code</label> <input type="text" class="col-sm-8 col-xs-7 col-md-8 input-group " name="color_code" class="color_code" id="color_code" value="<?php echo $fetch_data->color_code; ?>" style="text-transform: uppercase !important"> </div> <div class="form-group col-sm-12 col-md-6" id="width1"> <label class="col-sm-4 col-xs-5" >Width</label> <input type="text" class="col-sm-4 col-xs-3" name="indentwidth" id="indentwidth" value="<?php echo $numbers; ?>"> <input type="text" class="col-sm-3 col-xs-offset-1 col-xs-3" value="CMS" id="length" name="length" readonly /> </div> <!--- <div class="form-group" > <label class="col-sm-5 col-xs-5"></label> </div>--> </div> <div class="row" style="padding-bottom:15px;"> <?php if($fetch_data->confirm == 'Yes') {?> <div class="form-group col-sm-12 col-md-6"> <label class="col-sm-4 col-xs-5">Approved By</label> <input type="text" class="col-sm-8 col-xs-7" name="quantity" id="quantity" value="<?php echo $fetch_data->approved_by; ?>" required> </div> <?php } ?> </div> <!-- row 1---> <!--<div class="row land_owner_a"> <div class="col-sm-4 col-md-4"></div> <div class="col-sm-6 col-md-6"> <button name="update" id="update" class="btn center-block submit">Update</button> </div> <div class="col-sm-4 col-md-4"></div> </div> ---> <div class="row land_owner_a"> <div class="col-sm-2 col-md-4"></div> <div class="col-sm-10 col-md-6"> <?php if($fetch_data->confirm == 'Yes') {?> <button name="update_approved" id="update_approved" class="btn center-block submit">Update Indent</button> <button name="submit" id="submit_new" class="btn center-block submit">Submit Indent </button> <button name="approve" id="approve" class="btn center-block submit" disabled>Approved</button> <!--<button name="add_new_item1" id="add_new_item1" class="btn center-block submit" >Create New Indent</button> --> <a href="<?php echo base_url(); ?>vendor/add_indent_details" class="btn default" style=" width:20%;">Cancel</a> <?php } else { ?> <button name="update" id="update" class="btn center-block submit">Update Indent</button> <button name="submit" id="submit_new" class="btn center-block submit">Submit Indent</button> <?php if($approved_by == 'Veeru' || $approved_by == 'Vijay' || $approved_by == 'rsmurthy' || $approved_by == 'sunitha' || $approved_by == 'nagraj' ) { ?> <?php } else { ?> <button name="approve" id="approve" class="btn center-block submit" >Approve</button> <?php } ?> <button name="add_new_item2" id="add_new_item2" class="btn center-block submit" >Create New Product</button> <a href="<?php echo base_url(); ?>vendor/add_indent_details" class="btn default" style=" width:20%;">Cancel</a> <?php } ?> </div> <div class="col-sm-2 col-md-4"></div> </div> <!-- row 3---> <?php } else { ?> <?php if(empty($indent_no1)) { ?> <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">Indent No.</label> <input type="text" class="col-sm-8 col-xs-7" id="indent_no" name="indent_no" value="<?php echo $indent_no." "." "."DT".".".date("d.m.y"); ?>" readonly> </div> <!-------------- hidden div -------------------> <div class="form-group col-sm-12 col-md-6"> <div class="col-sm-8 col-xs-7"> <input type="hidden" name="sl_indent_no" id="sl_indent_no" value="<?php echo $indent_no; ?>"> </div> </div> <div class="form-group col-sm-12 col-md-6"> <label class="col-sm-4 col-xs-5" >Department</label> <select class="col-sm-8 col-xs-7" id="department" name="department" style="height:26px;" required> <option value="">SELECT DEPARTMENT</option> <?php if(isset($department)) { foreach($department as $department) { ?> <option value="<?php echo $department->department; ?>" <?php if($department->department == 'PPC') { echo "Selected"; } ?>><?php echo $department->department; ?></option> <?php }} ?> </select> </div> </div> <!-- row 1---> <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" style="padding-right:0 !important;">Consumed At</label> <select class="col-sm-8 col-xs-7" id="consumed_at" name="consumed_at" style="height:26px;" required> <option value="">SELECT CONSUMED AT</option> <?php if(isset($consumed_at)) { foreach($consumed_at as $consumed_at) { ?> <option value="<?php echo $consumed_at->consumed_at; ?>" <?php if($consumed_at->consumed_at == 'PEENYA - DYEING') {echo "selected";}?> style="text-transform: uppercase !important"><?php echo $consumed_at->consumed_at; ?></option> <?php }} ?> </select> </div> <div class="form-group col-sm-12 col-md-6"> <label class="col-sm-4 col-xs-5">Purpose/DTL No.</label> <input type="text" class="col-sm-8 col-xs-7" name="purpose" id="purpose" style="text-transform: uppercase !important" value="<?php echo $osl_val->oslNo; ?>" readonly="readonly"> <input type="hidden" class="col-sm-8 col-xs-7" name="purpose_shadeid" id="purpose_shadeid" style="text-transform: uppercase !important" value="<?php echo $osl_val->shadeID; ?>" readonly="readonly"> </div> </div> <!-- row 2---> <?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">Indent No.</label> <input type="hidden" class="col-sm-8 col-xs-7" name="sl_indent_no" id="sl_indent_no" value="<?php echo $sl_indent_no1; ?>"> <input type="text" class="col-sm-8 col-xs-7" id="indent_no" name="indent_no" value="<?php echo $indent_no1; ?>" > </div> <div class="clearfix visible-xs"></div> <div class="form-group col-sm-12 col-md-6"> <label class="col-sm-4 col-xs-5" >Department</label> <select class="col-sm-8 col-xs-7" id="department" name="department" style="height:26px;" required> <?php if(isset($department)) { foreach($department as $department) { ?> <option value="<?php echo $department->department; ?>" <?php if($department_no1== $department->department) {echo "selected";}?>><?php echo $department->department; ?></option> <?php }} ?> </select> </div> </div> <!-- row 1---> <div class="row" > <div class="form-group col-sm-12 col-md-6"> <label class="col-sm-4 col-xs-5" style="padding-right:0 !important;">Consumed At</label> <select class="col-sm-8 col-xs-7" id="consumed_at" name="consumed_at" style="height:26px;text-transform: uppercase !important" required> <?php if(isset($consumed_at)) { foreach($consumed_at as $consumed_at) { ?> <option value="<?php echo $consumed_at->consumed_at; ?>" <?php if($consumed_at_no1== $consumed_at->consumed_at) {echo "selected";}?> style="text-transform: uppercase !important"><?php echo $consumed_at->consumed_at; ?></option> <?php }} ?> </select> </div> <div class="form-group col-sm-12 col-md-6"> <label class="col-sm-4 col-xs-5">Purpose/DTL No.</label> <input type="text" class="col-sm-8 col-xs-7" name="purpose" id="purpose" value="<?php echo $purpose1;?>" style="text-transform: uppercase !important" required> </div> </div> <!-- row 2---> <?php }?> <div class="row" > <div class="form-group col-sm-12 col-md-6"> <label class="col-sm-4 col-xs-5" >Product Types</label> <select class="col-sm-8 col-xs-7" id="product_type" name="producttypee" style="text-transform: uppercase !important" required> <option value="<?php echo 'FABRICS'; ?>" style="text-transform: uppercase !important"><?php echo 'FABRICS'; ?></option> </select> </div> <div class="clearfix visible-xs"></div> <div class="form-group col-sm-12 col-md-6"> <label class="col-sm-4 col-xs-5">Quantity</label> <input type="text" class="col-sm-4 col-xs-3" name="quantity" id="quantity" value="<?php echo $osl_val->PlndMtr; ?>" readonly="readonly"> <input type="text" class="col-sm-3 col-xs-offset-1 col-xs-3" id="unit" name="unitt" value="<?php echo $product_ids->unit; ?>" readonly /> </div> <div class="form-group "> <input type="hidden" id="product_id" name="product_id" value="<?php echo $product_ids->id; ?>" readonly /> </div> </div> <!-- row 1---> <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" >Add Products</label> <select class="col-sm-8 col-xs-7" id="add_product" name="add_product" style="height:26px;" style="text-transform: uppercase !important" required> <option value="<?php echo $product_ids->product; ?>" style="text-transform: uppercase !important"><?php echo $product_ids->product; ?></option> </select> </div> <div class="form-group col-sm-12 col-md-6"> <label class="col-sm-4 col-xs-5 col-md-4" style="padding-right: 0 !important;">Required on or Before</label> <input type="text" class="col-sm-8 col-xs-7 col-md-8 input-group openDatePicker" name="required_on_date" id="required_on" value="<?php echo date("d-m-Y", strtotime($osl_val->weavingDate)); ?>" data-provide="datepicker" required> </div> </div> <!-- row 1---> <div class="row" id="shade_div" style="padding-bottom:15px;"> <div class="form-group col-sm-12 col-md-6" id="detail"> <label class="col-sm-4 col-xs-5" >Yarn Details</label> <input type="text" class="col-sm-8 col-xs-7 col-md-8 input-group " name="det" id="det" style="text-transform: uppercase !important;"> </div> <div class="form-group col-sm-12 col-md-6" > <label class="col-sm-4 col-xs-5" >Shades</label> <input type="text" class="col-sm-8 col-xs-7 col-md-8 input-group " name="shades" id="shades" value="<?php echo $osl_val->b_shade; ?>" style="text-transform: uppercase !important" readonly="readonly"> </div> <div class="form-group col-sm-12 col-md-6" id="dyed_shade"> <label class="col-sm-4 col-xs-5" style="padding-right:0 !important;">Supplier Shades</label> <input type="text" class="col-sm-8 col-xs-7 col-md-8 input-group " name="color_shade" class="color_shade" id="color_shade" > <!-- <select class="col-sm-8 col-xs-7" id="shades" name="shades" style="height:26px;" > <option value="">Select Shade</option> <?php //if(isset($colors)) { foreach($colors as $colors) { ?> <option value="<?php //echo $colors->color; ?>"><?php //echo $colors->color; ?></option> <?php //}} ?> </select> --> </div> <div class="form-group col-sm-12 col-md-6" id="dyed_code"> <label class="col-sm-4 col-xs-5" style="padding-right:0 !important;">Color Code</label> <input type="text" class="col-sm-8 col-xs-7 col-md-8 input-group " name="color_code" class="color_code" id="color_code" style="text-transform: uppercase !important"> </div> <div class="form-group col-sm-12 col-md-6" > <label class="col-sm-4 col-xs-5" >Width</label> <input type="text" class="col-sm-4 col-xs-3" name="indentwidth" value="<?php echo $osl_val->m_width; ?>" id="indentwidth" readonly="readonly"> <input type="text" class="col-sm-3 col-xs-offset-1 col-xs-3" value="CMS" id="length" name="length" readonly /> </div> <!-- <div class="form-group" id="width1"> <label class="col-sm-5 col-xs-5"></label> </div>--> </div> <!-- row 1---> <div class="row land_owner_a"> <div class="col-sm-4 col-md-4"></div> <div class="col-sm-6 col-md-6"> <button type="submit" class="btn center-block submit">Save New Product</button> </form> <button type="button" class="btn center-block new_indent">Create New Indent</button> <a href="<?php echo base_url(); ?>vendor/add_indent_details" class="btn default" style=" width:20%;">Cancel</a> </div> <div class="col-sm-4 col-md-4"></div> </div> <!-- row 3---> <?php } ?> <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> <!-- page-content --> </div> <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> .ui-jqgrid tr.jqgrow td{ text-transform: uppercase !important; } </style> <script> $(".new_indent").click(function(e) { e.preventDefault(); $.ajax({ url:"<?php echo base_url('vendor/get_indent_no')?>", dataType: "json", type:"POST", async:true, success:function(data) { var obj=JSON.parse(data); //var d = new Date(); var d = $.datepicker.formatDate('dd.mm.y', new Date()); //alert(d); document.getElementById('indent_no').value=obj+' '+"DT"+'.'+d; document.getElementById('sl_indent_no').value=obj; $("#department").val('SELECT DEPARTMENT'); $("#consumed_at").val('SELECT CONSUMED AR'); $("#product_type").val('SELECT PRODUCT TYPE'); $("#unit").val('SELECT'); $("#purpose").val(''); $("#required_on").val(''); jQuery("#list2").jqGrid("clearGridData"); swal({ title: "New Indent Number is Generated.", text: "", }); } }); }); $("#addnew").click(function(e){ $.ajax({ url:"<?php echo base_url('request/autofill'); ?>", type:"GET", data:"", async:false, success:function(data){ $('#client_code1').val(data); if(data==''){ alert('Unsuccessful!'); } else{ var obj = jQuery.parseJSON(data); obj.id++; $("#customer").val(obj.customer_name); $("#customer_id").val(obj.customer_id); $("#reference").val(obj.reference); $("#orderDate").val(obj.date); $("#currency").val(obj.currency); $("#terms").val(obj.terms); } } }); e.preventDefault(); }); </script> <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_id1').value=obj.customerID; } }); } </script> <script> function myFunction() { //alert(); var customer = document.getElementById('customer').value; $.ajax({ url:"<?php echo base_url('request/search_by_customer')?>", dataType: "json", data:{'customer':customer}, type:"POST", async:true, success:function(data) { // alert('hai'); if(data=="") { alert('This customer is not a Swansilk Customer'); window.location.reload(); } else { 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> <script> function adddetails() { var customer=$("#customer").val(); var date=$("#date").val(); var product_type=$("#product_type").val(); var description=$("#description").val(); var size=$("#size").val(); var min_quality=$("#min_quality").val(); var customer_id=$("#customer_id").val(); var currency= $("#currency").val(); var article=$("#article").val(); var design=$("#design").val(); var price=$("#price").val(); var image=$("#image").val(); var reference= $("#reference").val(); var terms=$("#terms").val(); var quality= $("#quality").val(); var color=$("#color").val(); var composition=$("#composition").val(); var note=$("#note").val(); $.ajax({ url:"<?php echo base_url('request/customer_insert')?>", type:"POST", data:{'customer':customer,'date':date,'product_type':product_type,'description':description,'size':size,'min_quality':min_quality,'customer_id':customer_id,'currency':currency,'article':article,'design':design,'price':price,'image':image,'reference':reference,'terms':terms,'quality':quality,'color':color,'composition':composition,'note':note}, async:false, success:function(data){ alert('Successfully Added.'); //$("#editmodlist2").remove(); window.location.reload(); } }); } </script> <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; } .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 !important; } .ui-jqdialog .ui-jqdialog-titlebar-close span { display: block; margin: -9px !important; } #sData { height: 27px; } #cData { height: 27px; } #dData { height: 27px; } #eData { height: 27px; } </style> <script> function getDesignAndQuality(articleNo) { $.ajax({ type: "post", url: "<?php echo base_url(); ?>marketing/getDesignAndQuality", data: "articleNo=" + articleNo, success: function (data) { // alert(); var objData = jQuery.parseJSON(data); // document.getElementById("design").value = objData.design; document.getElementById("quality").value = objData.arrArticleDet.quality; var comp=""; $.each(objData.composition, function(key,val){ comp +=val.yarnQuality +":" + ((val.sum)*100).toFixed(2) +"% " ; }); document.getElementById("composition").value = comp; } }); } </script> <!-----------------datepicker-------------> <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 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'); ?>" /> <style type="text/css"> #submit_new { cursor: pointer; display:none; } #ui-datepicker-div { z-index:5 !important; top: 70.3667px !important; left: 981px; z-index: 1; display: block; } .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; } #add_product { text-transform: uppercase !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; text-align: right; padding-right: 23px !important; padding-left: 23px !important; } .ui-jqgrid .ui-jqgrid-btable tbody tr.jqgrow td { overflow: hidden; white-space: pre; } #gbox_list2 { margin-left: 14px !important; } </style> <!-----------------datepicker-------------> <!-- The link to the CSS that the grid needs --> <script> $(document).ready(function (){ var l=$("#sl_indent_no").val(); //alert(l); jQuery("#list2").jqGrid({ url:"<?php echo base_url('vendor/add_grid_details');?>/s"+l+"/", mtype : "get", datatype: "json", colNames:['Id','Indent No','Department','Consumed At','Add Product','Quantity','Unit','Purpose/DTL No.','Required On','Action'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, {name:'indent_no',index:'product', width:120,editable:false}, {name:'department',index:'product_type', width:110,editable:true,editrules:{required: true}}, {name:'consumed_at',index:'product_description', editable:true,editrules:{required: true},width:110}, {name:'add_product',index:'product_type', width:110,editable:true,editrules:{required: true}}, {name:'quantity',index:'product_description', editable:true,editrules:{required: true},width:110}, {name:'unit',index:'unit', editable:true,editrules:{required: true},width:110}, {name:'purpose', index:'product_type', width:120,editable:true,editrules:{required: true}}, {name:'required_on',index:'required_on', editable:true,editrules:{required: true},width:120}, {name:'edit',index:'edit',editable:true,style:'cursor:pointer',editrules:{required: true},width:112,classes:'coledit1',formatter:'showlink',formatoptions:{baseLinkUrl:'<?php echo base_url('vendor/indent_ids')?>'}}, ], 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:"Indent 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:false,refreshstate:false}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); }); function fun(rowId) { // var rowid = 123; var id = rowId.closest('tr').attr('id'); //alert(id); var confirmMsg= confirm("Do You Want To Confirm!"); if (confirmMsg==true) { $.ajax({ url:"<?php echo base_url('vendor/add_yes_confirmation')?>", type:"POST", data:{'id':id}, success:function(data){ if(data==""){ $("#editmodlist2").remove(); $("#list2").trigger("reloadGrid"); $("#jaytab").trigger("reloadGrid"); $("#jqGrid").trigger("reloadGrid"); window.location.reload(); } else{ } } }); } else if (confirmMsg==false) { $.ajax({ url:"<?php echo base_url('vendor/add_no_confirmation')?>", type:"POST", data:{'id':id}, success:function(data){ if(data==""){ $("#editmodlist2").remove(); $("#list2").trigger("reloadGrid"); window.location.reload(); } else{ } } }); } } </script> <!-- page-content-wrapper --> <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"> $("#update_approved").click(function(e) { e.preventDefault(); swal({ title: "This Indent is already Approved", text: "", }); }); </script> <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> <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> $("#approve").click(function(e) { e.preventDefault(); var id =$('#sl_no_id').val(); //alert(id); swal({ title: 'Remarks', input: 'text', showCancelButton: true, confirmButtonText: 'Submit', showLoaderOnConfirm: true, }).then(function (email) { $.ajax({ //alert(email); url:"<?php echo base_url('vendor/add_yes_confirmation')?>", type:"POST", data:{'id':id,'remarks':email}, success:function(data){ if(data==""){ $("#editmodlist2").remove(); $("#list2").trigger("reloadGrid"); $("#jaytab").trigger("reloadGrid"); $("#jqGrid").trigger("reloadGrid"); window.location.href = '<?php echo base_url('vendor/add_indent_details');?>'; } else{ } } }); }) }); $("#add").click(function(e) { e.preventDefault(); var indent_no =$('#indent_no').val(); var department =$('#department').val(); var consumed_at =$('#consumed_at').val(); var sl_indent_no =$('#sl_indent_no').val(); var add_product =$('#add_product').val(); var quantity =$('#quantity').val(); var purpose =$('#purpose').val(); var required_on =$('#required_on').val(); if(indent_no != '' && department != '' && consumed_at != '' && add_product != '' && quantity != '' && purpose != '' && required_on != '') { $.ajax({ url:"<?php echo base_url('vendor/insert_outsource_data');?>", type:"POST", data:{'indent_no':indent_no,'sl_indent_no':sl_indent_no,'department':department,'consumed_at':consumed_at,'add_product':add_product,'quantity':quantity,'purpose':purpose,'required_on':required_on}, async:false, success:function(data) { swal({ title: "Successfully Added", text: "", }); $("#add_product").val(''); $("#quantity").val(''); $("#purpose").val(''); $("#required_on").val(''); $('#list2').refresh(); window.location.reload(); } }); } else{ swal({ title: "Please Fill All The Fields", text: "", }); } }); $("#update").click(function(e) { e.preventDefault(); var sl_indent_no =$('#sl_indent_no').val(); var id =$('#sl_no_id').val(); var indent_no =$('#indent_no').val(); var department =$('#department').val(); var consumed_at =$('#consumed_at').val(); var purpose =$('#purpose').val(); var product_type =$('#product_type').val(); var quantity =$('#quantity').val(); var add_product =$('#add_product').val(); var required_on =$('#required_on').val(); var width =$('#indentwidth').val(); var shades =$('#shades').val(); var unit =$('#unitt').val(); var color_shade =$('#color_shade').val(); var color_code =$('#color_code').val(); var product_id =$('#product_id').val(); //color_shade //alert(id); if(indent_no != '' && department != '' && consumed_at != '' && add_product != '' && quantity != '' && purpose != '' && required_on != '') { $.ajax({ url:"<?php echo base_url('vendor/update_data');?>", type:"POST", data:{'color_shade':color_shade,'color_code':color_code,'id':id,'indent_no':indent_no,'sl_indent_no':sl_indent_no,'department':department,'consumed_at':consumed_at,'add_product':add_product,'quantity':quantity,'purpose':purpose,'required_on':required_on,'product_type':product_type,'shades':shades,'width':width,'unit':unit,'product_id':product_id}, async:false, success:function(data) { window.location.href = '<?php echo base_url('vendor/add_indent_details');?>'; } }); } else { swal({ title: "Please Fill All The Fields", text: "", }); } }); $(function () { $("#required_on").datepicker({ dateFormat: "dd/mm/yy", changeMonth: true, changeYear: true }); }); $("#add_new_item1").click(function(e) { e.preventDefault(); var indent_no =$('#indent_no').val(); $.ajax({ url:"<?php echo base_url('vendor/insert_new_data');?>", type:"POST", data:{'indent_no':indent_no}, async:false, success:function(data) { var objData = jQuery.parseJSON(data); obj=objData; var n=obj; document.getElementById("indent_no").value =obj.indent_no; $("#add_product").val(''); $("#quantity").val(''); $("#unit").val(''); $("#purpose").val(''); $("#required_on").val(''); $("#update_approved").hide(); $("#submit_new").show(); } }); }); $("#add_new_item2").click(function(e) { e.preventDefault(); var indent_no =$('#indent_no').val(); $.ajax({ url:"<?php echo base_url('vendor/insert_new_data');?>", type:"POST", data:{'indent_no':indent_no}, async:false, success:function(data) { var objData = jQuery.parseJSON(data); obj=objData; var n=obj; document.getElementById("indent_no").value =obj.indent_no; $("#product_type").val('SELECT'); $("#add_product").val(''); $("#quantity").val(''); $("#purpose").val(''); $("#required_on").val(''); $("#indentwidth").val(''); $("#color_shade").val(''); $("#color_code").val(''); $("#shades").val(''); $("#det").val(''); $("#update").hide(); $("#approve").hide(); $("#add_new_item2").hide(); $("#submit_new").show(); } }); }); function displayunit(str,strr,postdata) { //alert(); var product=document.getElementById("add_product").value; var space=" "; //alert(product); $.ajax({ type:"post", url:"<?php echo base_url(); ?>vendor/getunit", data:"type="+product, success:function(data) { var objData = jQuery.parseJSON(data); //alert(objData); document.getElementById("unit").value = objData.unit; document.getElementById("product_id").value = objData.id; if (objData.product_type=='Yarn - Raw') { document.getElementById("det").value = objData.yarnquality + space + objData.yarnname + space + objData.yarndenier + space + objData.grade; } else if (objData.product_type=='Yarn - Twisted') { document.getElementById("det").value = objData.yarnquality + space + objData.yarnname + space + objData.yarndenier + space + objData.yarnspecification + space + objData.grade; } else if (objData.product_type=='Yarn - Dyed') { document.getElementById("det").value = objData.yarnquality + space + objData.yarnname + space + objData.yarndenier + space + objData.yarnspecification; } } }); } function displayunit_edit(str,strr,postdata) { //alert(); var product=document.getElementById("add_product").value; var space=" "; //alert(product); $.ajax({ type:"post", url:"<?php echo base_url(); ?>vendor/getunit", data:"type="+product, success:function(data) { var objData = jQuery.parseJSON(data); //alert(objData); document.getElementById("unitt").value = objData.unit; document.getElementById("product_id").value = objData.id; if (objData.product_type=='Yarn - Raw') { document.getElementById("det").value = objData.yarnquality + space + objData.yarnname + space + objData.yarndenier + space + objData.grade; } else if (objData.product_type=='Yarn - Twisted') { document.getElementById("det").value = objData.yarnquality + space + objData.yarnname + space + objData.yarndenier + space + objData.yarnspecification + space + objData.grade; } else if (objData.product_type=='Yarn - Dyed') { document.getElementById("det").value = objData.yarnquality + space + objData.yarnname + space + objData.yarndenier + space + objData.yarnspecification; } } }); } function displayweftspecifctin_am(str,strr,postdata) { //alert(); var product=document.getElementById("product_type").value; if(product=="Fabrics") { $("#shade").show(); $("#width").show(); $("#width1").show(); $("#detail").hide(); $("#dyed_shade").hide(); $("#dyed_code").hide(); } else if(product=="Yarn - Raw") { $("#shade").hide(); $("#width").hide(); $("#width1").hide(); $("#detail").show(); $("#dyed_shade").hide(); $("#dyed_code").hide(); } else if(product=="Yarn - Twisted") { $("#shade").show(); $("#width").hide(); $("#width1").hide(); $("#detail").show(); $("#dyed_shade").hide(); $("#dyed_code").hide(); } else if(product=="Yarn - Dyed") { $("#shade").hide(); $("#width").hide(); $("#width1").hide(); $("#detail").show(); $("#dyed_shade").show(); $("#dyed_code").show(); } else if(product=="Consumables") { $("#shade").hide(); $("#width").hide(); $("#width1").hide(); $("#detail").hide(); $("#dyed_shade").hide(); $("#dyed_code").hide(); } else if(product=="Spares") { $("#shade").hide(); $("#width").hide(); $("#width1").hide(); $("#detail").hide(); $("#dyed_shade").hide(); $("#dyed_code").hide(); } $.ajax({ type:"post", url:"<?php echo base_url(); ?>vendor/productlist", data:"type="+product, success:function(data) { document.getElementById("add_product").innerHTML="<option value=''>SELECT</option>"; var objData = jQuery.parseJSON(data); for(var i=0;i<objData.length;i++) { if(postdata==objData[i].product) { slcted="selected='selected'"; } else { slcted=''; } document.getElementById("add_product").innerHTML+="<option "+slcted+" value='"+objData[i].product+"'>"+objData[i].product+"</option>"; } } }); } $(document).ready(function() { $("#shade").hide(); $("#width").hide(); $("#width1").hide(); $("#detail").hide(); $("#dyed_shade").hide(); var product=document.getElementById("product_type").value; if(product=="Fabrics") { $("#shade").show(); $("#width").show(); $("#width1").show(); $("#unit").val('MTRS'); $("#detail").hide(); $("#dyed_shade").hide(); $("#dyed_code").hide(); } else if(product=="Yarn - Raw") { $("#shade").hide(); $("#width").hide(); $("#width1").hide(); $("#unit").val('KGS'); $("#detail").show(); $("#dyed_shade").hide(); $("#dyed_code").hide(); } else if(product=="Yarn - Twisted") { $("#shade").show(); $("#width").hide(); $("#width1").hide(); $("#unit").val('KGS'); $("#detail").show(); $("#dyed_shade").hide(); $("#dyed_code").hide(); } else if(product=="Yarn - Dyed") { $("#shade").hide(); $("#width").hide(); $("#width1").hide(); $("#unit").val('KGS'); $("#detail").show(); $("#dyed_shade").show(); $("#dyed_code").show(); } else if(product=="Consumables") { $("#shade").hide(); $("#width").hide(); $("#width1").hide(); $("#unit").val('PCS'); $("#detail").hide(); $("#dyed_shade").hide(); $("#dyed_code").hide(); } else if(product=="Spares") { $("#shade").hide(); $("#width").hide(); $("#width1").hide(); $("#unit").val('PCS'); $("#detail").hide(); $("#dyed_shade").hide(); $("#dyed_code").hide(); } }); </script> <script> $(document).ready(function() { //alert(); $( "#color_code" ).autocomplete({ source: '<?php echo base_url('vendor/auto_complete_shade'); ?>', }); }); $(document).ready(function(){ $('#quantity').on('change keyup', function() { var sanitized = $(this).val().replace(/[^0-9.]/g, ''); $(this).val(sanitized); }); }); $(document).ready(function(){ $('#indentwidth').on('change keyup', function() { var sanitized = $(this).val().replace(/[^0-9.]/g, ''); $(this).val(sanitized); }); }); </script> <style> .btn { float: left; //margin-left: 25%; } #ui-id-1 { height:200px !important; overflow-y: scroll; overflow-x:hidden !important; } .ui-autocomplete { height:200px !important; overflow-y: scroll; overflow-x:hidden !important; } #ui-datepicker-div { top: 123.3667px !important; } @media only screen and (min-width:320px) and (max-width:640px) { #ui-datepicker-div { top: 220.3667px !important; } .jaytab { overflow-x:scroll; } .indent-space { margin-top:30px; } } </style>