ria/app/Views/viewresinbatchpdf.php
2024-09-11 08:54:25 +05:30

1078 lines
28 KiB
PHP
Executable File

<style>
td{
text-align:center;
height:17px;
}
table{
font-size:10px;
}
</style>
<style>
th{
text-align:center !important;
}
</style>
<div class="content-wrapper">
<section class="content">
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<!--<center><h3 class="box-title">-->
<div class="box-tools">
<div class="box-tools">
<div class="row">
<table style="border-collapse:collapse;border-left-style:hidden;width:100%;font-size:9px;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="width: 51px;" colspan="4"><h2>RESIN BATCH CARD REPORT </h2></td>
</tr>
<tr>
<td style="width: 51px;" colspan="2"><b><?php echo $records['masterdata'][0]->client_name?></b></td>
<td style="width: 51px;" colspan="2"><b><?php echo $records['masterdata'][0]->product_name.'-'.$records['masterdata'][0]->product_description?></b></td>
</tr>
<tr>
<td style="width: 51px;" colspan="2"><b>Resin Name : </b><b><?php echo $records['masterdata'][0]->resinname;?></b></td>
<td style="width: 51px;" colspan="2"><b> Batch Date : </b><b><?php echo format_date($records['masterdata'][0]->batchdate,0,'d-m-Y');?></td>
</tr>
<tr>
<td style="width: 51px;" colspan="2"><b>Shift Name : </b><b><?php echo $records['masterdata'][0]->plantname?></b></td>
<td style="width: 51px;" colspan="2"><b>TRP Batch No(For TRP Sand) : </b><b><?php echo $records['masterdata'][0]->trpbatchcardno;?></b></td>
</tr>
<tr>
<td style="width: 51px;"><b>IGR No(For Resin)</b></td>
<td style="width: 51px;"><b><?php echo $records['masterdata'][0]->igrno_for_resin;?> </b></td>
<td style="width: 51px;"><b>IGR No(For Hexamine)</b></td>
<td style="width: 51px;"><b><?php echo $records['masterdata'][0]->igrno_for_haxamine;?></td>
</tr>
<tr>
<td style="width: 51px;"><b>IGR No(For CS)</b></td>
<td style="width: 51px;"><b><?php echo $records['masterdata'][0]->igrno_for_cs;?></b></td>
<td style="width: 51px;"><b>IGR No(For Catalyst)</b></td>
<td style="width: 51px;"><b><?php echo $records['masterdata'][0]->igrno_for_catalyst;?></b></td>
</tr>
<tr>
<td style="width: 51px;"><b>IGR No(For 50 Bags)</b></td>
<td style="width: 51px;"><b><?php echo $records['masterdata'][0]->igrno_for_bags;?></b></td>
<td style="width: 51px;"><b>IGR No(For 1 ton Bag)</b></td>
<td style="width: 51px;"><b><?php echo $records['masterdata'][0]->igrno_for_tonbags;?></b></td>
</tr>
<tr>
<td style="width: 51px;"><b>IGR No(For Fresh Sand)</b></td>
<td style="width: 51px;"><b><?php echo $records['masterdata'][0]->igrno_for_sand;?></b></td>
<td style="width: 51px;"><b>Machine Name</b></td>
<td style="width: 51px;"><b><?php echo $records['masterdata'][0]->machinecode .'-'.$records['masterdata'][0]->Machine_Name?></td>
</tr>
<tr>
<td style="width: 51px;" colspan="1"><b>Helpers </b></td>
<td style="width: 51px;" colspan="3"><b><?php
foreach($existoperatorslist as $ex)
{
echo "<option value=".$ex->EmpID.">".$ex->EmpID.'-'.$ex->FirstName.'-'.$ex->LastName.','."</opiton>";
}
?></b></td>
</tr>
</tbody>
</table>
</table>
</div>
</div>
</div><!--</h3></center>-->
</div><!-- /.box-header -->
<div class="box-body">
<br/>
<table style="border-collapse: collapse;border-bottom:1px solid black;" width="100%">
<!-- <thead style="background: #00c068;"> -->
<thead>
<tr style="border-right: 1px solid black ;border-top: 1px solid black ;border-bottom: 1px solid black;
border-left: 1px solid black;/*background-color: #d2d2d2*/">
<th style="text-align: center;border-right: 1px solid black ;"><strong>Particulars</strong></th>
<th style="text-align: center;border-right: 1px solid black ;"><strong>Time</strong></th>
<?php
if(!empty($recordsheader))
foreach($recordsheader as $headervalue)
{
{
//print_r($headervalue);
?>
<th style="text-align: center;border-right: 1px solid black;
border-left: 1px solid black;"><?php echo $headervalue->testtype;?></th>
<?php
}
}
?>
</tr>
<tr style="border-right: 1px solid black ;border-top: 1px solid black ;border-bottom: 1px solid black;
border-left: 1px solid black">
<th rowspan="2" style="text-align: center;border-right: 1px solid black ;"><strong>SNO</strong></th>
<th style="text-align: center;border-right: 1px solid black ;"><strong>Unit</strong></th>
<?php
if(!empty($recordsheader))
foreach($recordsheader as $headervalue)
{
{
//print_r($headervalue);
?>
<th style="text-align: center;border-right: 1px solid black;
border-left: 1px solid black;"><?php echo $headervalue->uom;?></th>
<?php
}
}
?>
</tr>
<tr style="border-right: 1px solid black ;border-top: 1px solid black ;border-bottom: 1px solid black;
border-left: 1px solid black">
<th style="text-align: center;border-right: 1px solid black ;"><strong>Spec</strong></th>
<?php
if(!empty($recordsheader))
foreach($recordsheader as $headervalue)
{
{
//print_r($headervalue);
?>
<th style="text-align: center;border-right: 1px solid black;
border-left: 1px solid black;"><?php echo $headervalue->min.'-'.$headervalue->max;?></th>
<?php
}
}
?>
</tr>
</thead>
<tbody>
<?php
if(!empty($records['childdata']))
{
foreach($records['childdata'] as $k => $value)
{
//print_r($value);
?>
<tr >
<td style="text-align: center;border-right: 1px solid black;
border-left: 1px solid black;border-bottom: 1px solid black;"><?php echo $k;?></td>
<?php
foreach($value as $key => $v)
{
if($key == 0){
//print_r($v);
?>
<td style="text-align: center;border-right: 1px solid black;border-bottom: 1px solid black;
border-left: 1px solid black;">
<?php echo $v ?></td>
<?php }
else{
?>
<td style="text-align: center;border-right: 1px solid black;border-bottom: 1px solid black;border-top: 1px solid black;
border-left: 1px solid black;"><?php
echo $v ?>
</td>
<?php
}
}?>
</tr>
<?php
}
}
?>
</tbody>
</table>
<br>
<!-- <div class="row">
<div class="col-md-offset-11 col-md-1" id="savebutton">
<input type="button" id="submit" value = "Add Row" class="btn btn-success" onclick="addNewRow();">
</div>
</div> -->
<p><b>Raw/Packing Material Consumption<b></p>
<!-- <table id="finaltable" class="table table-bordered" style="background-color:#fff;font-size:12px;text-align:center;"> -->
<table style="border-collapse:collapse;border-left-style:hidden;width:100%;font-size:9px;" border="1" cellspacing="0" cellpadding="0">
<!-- <thead style="background-color: #00d976;;"> -->
<thead>
<tr><th>Particulars</th><th>Sand</th><th>Resin</th><th>Hexamine</th><th>CS</th><th>Catalyst</th><th>50 Bags</th><th>1 ton Bag</th><th>Production Loss <br> Lump</th><th>Finished Prodcut <br> PCS</th></tr>
<tr><th>Unit</th><th>Kgs</th><th>Kgs</th><th>Kgs</th><th>Kgs</th><th>Kgs</th><th>Kgs</th><th>Nos</th><th>Kgs</th><th>Kgs</th></tr>
</thead>
<tbody id="">
<tr><td>Qty</td><td id="sandtotal"><?php echo $records['masterdata'][0]->sandtotal;?></td><td id="resintotal"><?php echo $records['masterdata'][0]->resintotal;?></td><td id="hextotal"><?php echo $records['masterdata'][0]->hextotal;?></td><td id="cstotal"><?php echo $records['masterdata'][0]->cstotal;?></td><td id="catalysttotal"><?php echo $records['masterdata'][0]->catalysttotal;?></td><td id="50bagtotal" contenteditable="true"><?php echo $records['masterdata'][0]->bags50total;?></td><td id="1tonbagtotal" contenteditable="true"><?php echo $records['masterdata'][0]->ton1bagstotal;?></td><td id="lumptotal" contenteditable="true"><?php echo $records['masterdata'][0]->producitonloss;?></td><td id="pcstotal" contenteditable="true"><?php echo $records['masterdata'][0]->finishedproduct;?></td></tr>
</tbody>
</table>
</div>
<div class="col-md-12">
<div class="row">&nbsp;</div>
<div class="col-md-12">
<h4>Remarks:</h4> <p><?php echo $records['masterdata'][0]->remarks; ?></p>
<hr>
<br>
<table >
<tr><td> Operator
:<?php echo $records['masterdata'][0]->operatedby.'-'.$records['masterdata'][0]->name?></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>Production In charge :<?php echo $records['masterdata'][0]->approvedby; ?></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<!-- <tr><td>Signature</td><td>&nbsp;</td></tr>-->
</table>
<!-- <div class="col-md-6">
<label>Remarks:</label>
<textarea id="remarks" class="form-control" rows="1"><?php echo $records['masterdata'][0]->remarks; ?></textarea>
</div>
-->
</div>
</div>
</div>
</section>
</div>
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
<script>
$(document).ready(function(){
$("#loibutton").click(function(){
$("#loiarea").toggle("slow");
});
$("#afsbutton").click(function(){
$("#afsarea").toggle("slow");
});
$("#chartbutton").click(function(){
$("#chartarea").toggle("slow");
});
var p = "<?php echo $records['masterdata'][0]->productid;?>";
var c = "<?php echo $records['masterdata'][0]->customerid;?>";
getAllSpec(p,c);
$('#approvedby').val('<?php echo $records['masterdata'][0]->approvedby?>');
//$('#operators').select2();
}); // End of document on ready funciton
function keyValidate(e)
{
if(((e.which || e.keyCode) == 8) || ((e.which || e.keyCode) == 9) || ((e.which || e.keyCode) == 46) || ((e.which || e.keyCode) == 37) || ((e.which || e.keyCode) == 39) || ((e.which || e.keyCode) == 45))
{
return true;
}
if(e.keyCode == 13)
{
return false;
}
if(((e.which || e.keyCode) < 48) || ((e.which || e.keyCode) > 57))
{
return false;
}
}
$('#product').change(function(){
getAllSpec();
});
$('#customer').change(function(){
getAllSpec();
});
var index = 0;
var allspecs = [];
var allspecvalues = [];
var flag = 0;
var totalcells = 0;
var overallrows = 0;
overallrows = $('#testreport').find('tr');
overallrows = ((overallrows.length)-4);
$('#igrnos').change(function(){
var html = '<option value = -1>Select IGRItemNo</option>';
var igrno = $('#igrnos').val();
//alert(igrno);
//$('.content').loader('show');
$.ajax({
data:{param1:igrno},
//dataType:"json",
type:"POST",
url:"<?php echo base_url() ?>resinbatchcard/getIGRLineNo",
success:function(data) {
//$('.content').loader('hide');
// alert(data);
data = JSON.parse(data);
if(data != ''){
$.each(data,function(index,value){
html+='<option value='+value.IGRItemNo+'>'+value.IGRItemNo+'</option>';
});
$('#igrlinenos').find('option').remove();
$('#igrlinenos').append(html);
}
else{
alert('No Line Item Available');
}
}
});
});
function getAllSpec(p,c)
{
var p = p;
var c = c;
var type = 'RESINBATCHCARD';
if(p == -1 || c == -1)
{
return false;
}
else
{
//$('.content').loader('show');
$.ajax({
data:{param1:p,param2:c,param3:type},
//dataType:"json",
type:"POST",
url:"<?php echo base_url() ?>quality/getAllSpecforReport",
success:function(data) {
data = JSON.parse(data);
if(data != '')
{
htmlspecname = '';
htmlspecid = '';
htmlspecuom = '';
htmlspec = '';
flag = 1;
//$('.content').loader('hide');
$.each(data,function(i,item){
var ide='';
//console.log(item);
//console.log('master1');
ide = item.testtype;
ide = ide.replace(/\s/g, "");
ide = ide.toLowerCase();
htmlspecname +='<td>'+item.testtype+'</td>';
htmlspecid += '<td>'+item.productspecmaster_id+'</td>';
htmlspecuom += '<td>'+item.uom+'</td>';
htmlspec += '<td>'+item.min+'-'+item.max+'</td>';
allspecs.push(ide);
allspecvalues.push(item.min+'-'+item.max);
});
// console.log(allspecs);
//console.log(allspecvalues);
$("#specname").append(htmlspecname);
$("#firstrowheader").append(htmlspecid);
$("#huom").append(htmlspecuom);
$("#spec").append(htmlspec);
document.getElementById('firstrowheader').style.display = 'none';
totalcells = $('#testreport').find('tr').eq(1).find('td');
totalcells = totalcells.length;
//alert('totalcellsbefore'+totalcells);
totalcells+=2;
}
else
{
alert('No Master Records Found..!');
//$('.content').loader('hide');
}
}
});
}
}
function addNewRow()
{
//alert(flag);
if(flag != 1)
{
alert('There is no report,Cannot Save');
return false;
}
index = overallrows + 1
if(index > 50)
{
alert('You have reached 50 Entries, No More...!');
return false;
}
var htmlrow = '';
for(i=1;i<=totalcells;i++)
{
if(i == 1)
{
htmlrow+='<tr id='+index+'><td>'+index+'</td>';
//alert('1');
}
else if( i == 2)
{
htmlrow+='<td class="edit" id="time'+index+'" contenteditable="true" onblur="timeCheck(this.id,this.textContent)"></td>';
//alert('not 1');
}
else
{
//var temp = index;
//console.log(allspecs[temp]);
var temp = index+''+allspecs[i-3];
htmlrow+='<td class="edit" id="'+temp+'" contenteditable="true" onkeypress="return keyValidate(event);" onblur="masterCalculationCheck(this.id,this.textContent)"></td>';
//temp++;
}
//alert('inside for loop'+i);
}
htmlrow+='</tr>'
$("#testreport tbody").append(htmlrow);
overallrows++;
var ide = '#time'+index;
window.setTimeout(function() {
$(ide).focus();
}, 0);
}
function timeCheck(id,val)
{
var id = id;
//alert('timecheck'+id);
if(val == '')
{
alert('Please Enter Time..!');
document.getElementById(id).textContent='';
var ide = '#'+id;
//alert(ide);
window.setTimeout(function() {
$(ide).focus();
}, 0);
return false;
}
if(val.length != 5)
{
alert('Please Enter Valid 24 Hrs Time..!');
var ide = '#'+id;
//alert(ide);
window.setTimeout(function() {
$(ide).focus();
}, 0);
document.getElementById(id).textContent='';
return false;
}
if(val.length == 5)
{
var cur = val.split(':');
if(isNaN(cur[0]) || isNaN(cur[1]) || cur[0] > 24 || cur[1] > 59)
{
var ide = '#'+id;
//alert(ide);
window.setTimeout(function() {
$(ide).focus();
}, 0);
document.getElementById(id).textContent='';
alert('Please Enter Valid 24Hrs Time Format..!');
return false;
}
}
}
function masterCalculationCheck(id,val)
{
//console.log(id+'-'+val);
var totalsandqty = 0;
var totalhexqty = 0;
var totalresinqty = 0;
var totalcsqty = 0;
var ide = id.substr(1);
var ide2 = id.substr(2);
console.log(ide+'-'+ide2);
//For Total Sand Calculation
if(ide == 'sand')
{
for(i=1;i<=overallrows;i++)
{
var tid = i+''+ide;
if(document.getElementById(tid))
{
var currentvalue = document.getElementById(tid).textContent;
if(isNaN(currentvalue) || currentvalue == '')
{
currentvalue = 0.00;
}
totalsandqty +=parseFloat(currentvalue);
}
}
if(document.getElementById('sandtotal'))
{
document.getElementById('sandtotal').textContent = parseFloat(totalsandqty);
}
}
else if(ide2 == 'sand')
{
for(i=1;i<=overallrows;i++)
{
var tid = i+''+ide2;
if(document.getElementById(tid))
{
var currentvalue = document.getElementById(tid).textContent;
if(isNaN(currentvalue) || currentvalue == '')
{
currentvalue = 0.00;
}
totalsandqty +=parseFloat(currentvalue);
}
}
if(document.getElementById('sandtotal'))
{
document.getElementById('sandtotal').textContent = parseFloat(totalsandqty);
}
}
//FOr total Hexamine Calculaiton
if(ide == 'hexamine')
{
for(i=1;i<=overallrows;i++)
{
var tid = i+''+ide;
if(document.getElementById(tid))
{
var currentvalue = document.getElementById(tid).textContent;
if(isNaN(currentvalue) || currentvalue == '')
{
currentvalue = 0.00;
}
totalhexqty +=parseFloat(currentvalue);
}
}
if(document.getElementById('hextotal'))
{
document.getElementById('hextotal').textContent = parseFloat(totalhexqty);
}
}
else if(ide2 == 'hexamine')
{
for(i=1;i<=overallrows;i++)
{
var tid = i+''+ide2;
if(document.getElementById(tid))
{
var currentvalue = document.getElementById(tid).textContent;
if(isNaN(currentvalue) || currentvalue == '')
{
currentvalue = 0.00;
}
totalhexqty +=parseFloat(currentvalue);
}
}
if(document.getElementById('hextotal'))
{
document.getElementById('hextotal').textContent = parseFloat(totalhexqty);
}
}
if(ide == 'catalyst')
{
for(i=1;i<=overallrows;i++)
{
var tid = i+''+ide;
if(document.getElementById(tid))
{
var currentvalue = document.getElementById(tid).textContent;
if(isNaN(currentvalue) || currentvalue == '')
{
currentvalue = 0.00;
}
totalsandqty +=parseFloat(currentvalue);
}
}
if(document.getElementById('catalysttotal'))
{
document.getElementById('catalysttotal').textContent = parseFloat(totalsandqty);
}
}
else if(ide2 == 'catalyst')
{
for(i=1;i<=overallrows;i++)
{
var tid = i+''+ide2;
if(document.getElementById(tid))
{
var currentvalue = document.getElementById(tid).textContent;
if(isNaN(currentvalue) || currentvalue == '')
{
currentvalue = 0.00;
}
totalsandqty +=parseFloat(currentvalue);
}
}
if(document.getElementById('catalysttotal'))
{
document.getElementById('catalysttotal').textContent = parseFloat(totalsandqty);
}
}
//FOr total Hexamine Calculaiton
if(ide == 'resin')
{
for(i=1;i<=overallrows;i++)
{
var tid = i+''+ide;
if(document.getElementById(tid))
{
var currentvalue = document.getElementById(tid).textContent;
if(isNaN(currentvalue) || currentvalue == '')
{
currentvalue = 0.00;
}
totalresinqty +=parseFloat(currentvalue);
}
}
if(document.getElementById('resintotal'))
{
document.getElementById('resintotal').textContent = parseFloat(totalresinqty);
}
}
else if(ide2 == 'resin')
{
for(i=1;i<=overallrows;i++)
{
var tid = i+''+ide2;
if(document.getElementById(tid))
{
var currentvalue = document.getElementById(tid).textContent;
if(isNaN(currentvalue) || currentvalue == '')
{
currentvalue = 0.00;
}
totalresinqty +=parseFloat(currentvalue);
}
}
if(document.getElementById('resintotal'))
{
document.getElementById('resintotal').textContent = parseFloat(totalresinqty);
}
}
//FOr total Hexamine Calculaiton
if(ide == 'cs')
{
for(i=1;i<=overallrows;i++)
{
var tid = i+''+ide;
if(document.getElementById(tid))
{
var currentvalue = document.getElementById(tid).textContent;
if(isNaN(currentvalue) || currentvalue == '')
{
currentvalue = 0.00;
}
totalcsqty +=parseFloat(currentvalue);
}
}
if(document.getElementById('cstotal'))
{
document.getElementById('cstotal').textContent = parseFloat(totalcsqty);
}
}
else if(ide2 == 'cs')
{
for(i=1;i<=overallrows;i++)
{
var tid = i+''+ide2;
if(document.getElementById(tid))
{
var currentvalue = document.getElementById(tid).textContent;
if(isNaN(currentvalue) || currentvalue == '')
{
currentvalue = 0.00;
}
totalcsqty +=parseFloat(currentvalue);
}
}
if(document.getElementById('cstotal'))
{
document.getElementById('cstotal').textContent = parseFloat(totalcsqty);
}
}
if(val == '')
{
//alert('Please Enter Time..!');
document.getElementById(id).textContent='0.00';
return false;
}
}
var listopsforstore = [];
var opstodelete = [];
var opstoinsert =[];
var oldops = [];
<?php
foreach($existoperatorslist as $ex)
{
echo "listopsforstore.push('".$ex->EmpID."');";
echo "oldops.push('".$ex->EmpID."');";
}
?>
console.log(listopsforstore+'-'+oldops);
function getAllData()
{
// if(flag != 1)
// {
// alert('Cannot Save');
// return false;
// }
var testreportdata = $("#testreport").tableToJSON();
var finaltable = $("#finaltable").tableToJSON();
testreportdata=JSON.stringify(testreportdata);
// alert(testreportdata);
finaltable=JSON.stringify(finaltable);
//alert(finaltable);
var productid = $('#product').val();
var customerid = $('#customer').val();
var batchdate = $('#batchdate').val();
var plantname = $('#plantname').val();
var macinecode = $('#machines').val();
var trpbatchcard = $('#trpbatchnos').val();
var igrnos = $('#igrnos').val();
var igrlinenos = $('#igrlinenos').val();
var remarks = $('#remarks').val();
var approvedby = $('#approvedby').val();
var olddoc = $('#olddoc').val();
var MASTERID = $('#MASTERID').val();
if(approvedby == -1 || listopsforstore.length == 0)
{
alert('Please Enter All Master Details..!');
return false;
}
var f = 0;
for(i=1;i<=overallrows;i++)
{
if(document.getElementById('time'+i).textContent == '')
{
f++;
}
}
// alert('F value'+f);
if(f != 0)
{
alert('Please Enter Time for All Entry..! ');
return false;
}
var formData = new FormData();
var reportfile = $("#reportfile").prop('files')[0];
formData.append('rfile',reportfile);
var param1 = productid;
var param2 = customerid;
var param3= batchdate;
var param4 = plantname;
var param5 = macinecode;
var param6 = trpbatchcard;
var param7 = igrnos;
var param8 = igrlinenos;
var param9 = remarks;
var param10 = approvedby;
var param11 = testreportdata;
var param12 = finaltable;
var param13 = olddoc;
var param14 = MASTERID;
var param15 = JSON.stringify(opstoinsert);
var param16 = JSON.stringify(opstodelete);
formData.append('param1',param1);
formData.append('param2',param2);
formData.append('param3',param3);
formData.append('param4',param4);
formData.append('param5',param5);
formData.append('param6',param6);
formData.append('param7',param7);
formData.append('param8',param8);
formData.append('param9',param9);
formData.append('param10',param10);
formData.append('param11',param11);
formData.append('param12',param12);
formData.append('param13',param13);
formData.append('param14',param14);
formData.append('param15',param15);
formData.append('param16',param16);
// $('.content').loader('show');
$.ajax({
data:formData,
type:"POST",
url:"<?php echo base_url() ?>resinbatchcard/updateTestReportData",
//async : false,
cache : false,
contentType : false,
processData : false,
success:function(data) {
if(data){
alert(data);
//$('.content').loader('hide');
window.location = "<?php echo base_url().'resinbatchcard/resinBatchCardLisitng';?>";
}
}
});
}
$('#operators').change(function(){
var val = $('#operators').val();
var text = $("#operators option:selected").text();
//alert(val);
//alert(text);
var totalelements = listopsforstore.length
if(totalelements != 0)
{
$.each(listopsforstore,function(key,value){
//alert(value);
if(value == val)
{
alert('Operator Already Added..!Choose Another One.!');
brea();
}
});
}
listopsforstore.push(val);
var locali = 0;
$.each(oldops,function(key,value){
//alert(value);
if(value == val)
{
//nothing
}
else
{
//opstoinsert.push(val);
locali++;
}
});
if(locali != 0)
{
opstoinsert.push(val);
}
opstodelete = opstodelete.filter(item => item != val);
console.log('INSERT-'+opstoinsert);
console.log('OLD-'+oldops);
console.log('DELETE-'+opstodelete);
console.log('CURRENT-'+listopsforstore);
console.log('*************************');
$("#listops").append('<option value='+val+'>'+text+'</option>');
});
$("#listops").dblclick(function(){
var text = $("#listops option:selected").text();
var val = $('#listops').val();
//alert(text+'-'+val);
$('option:selected', this).remove();
listopsforstore = listopsforstore.filter(item => item != val);
var localj = 0;
// if(totalelements != 0)
// {
$.each(oldops,function(key,value){
//alert(value);
if(value == val)
{
localj++;
}
});
if(localj != 0){ opstodelete.push(val);}
opstoinsert = opstoinsert.filter(item => item != val);
// }else{opstodelete.push(val);}
console.log('INSERT-'+opstoinsert);
console.log('OLD-'+oldops);
console.log('DELETE-'+opstodelete);
console.log('CURRENT-'+listopsforstore);
console.log('*************************');
});
/* function PrintFunction()
{
//alert('hi');
$('#printPDF').attr('action', '<?php echo base_url() ?>resinbatchcard/printResinBatchReport');
$('#printPDF').attr('method', 'post');
$('#printPDF').submit();
}
*/
</script>