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KO}ӽmSşذqsOy?\[,d@'73'j%kOe`1.g2"e =YIzS2|zŐƄa\U,dP;jhhhaxǶ?КZ՚.q SE+XrbOu%\GتX(H,N^~]JyEZQKceTQ]VGYqnah;y$cQahT&QPZ*iZ8UQQM.qo/T\7X"u?Mttl2Xq(IoW{R^ ux*SYJ! 4S.Jy~ BROS[V|žKNɛP(L6V^|cR7i7nZW1Fd@ Ara{詑|(T*dN]Ko?s=@ |_EvF]׍kR)eBJc" MUUbY6`~V޴dJKß&~'d3i WWWWWW
Current Directory: /home/u588966950/domains/vtsinfotech.online/public_html/steelrajdemo/admin
Viewing File: /home/u588966950/domains/vtsinfotech.online/public_html/steelrajdemo/admin/edit-agreement.php
<?php include 'includes/session.php'; ?> <?php include 'includes/header.php'; ?> <?php if(isset($_POST['editbtn'])){ $sqlStock = "UPDATE tbl_agreement SET lessor = '".$_POST['lessor']."', lessee = '".$_POST['lessee']."', billprefix = '".$_POST['billprefix']."', status = '".$_POST['status']."', agreementtype = '".$_POST['agreementtype']."', agreementdate = '".date('Y-m-d',strtotime($_POST['agreementdate']))."', fromtenure = '".date('Y-m-d',strtotime($_POST['fromtenure']))."', totenure = '".date('Y-m-d',strtotime($_POST['totenure']))."', grosstotal = '".$_POST['grosstotal']."', tenureofagreement = '".$conn->real_escape_string($_POST['tenureofagreement'])."', rcdate = '".$conn->real_escape_string($_POST['rcdate'])."', lockinperiod = '".$conn->real_escape_string($_POST['lockinperiod'])."', securitydeposit = '".$conn->real_escape_string($_POST['securitydeposit'])."', camcharges = '".$conn->real_escape_string($_POST['camcharges'])."', duedate = '".$conn->real_escape_string($_POST['duedate'])."', enhancement = '".$conn->real_escape_string($_POST['enhancement'])."', termination = '".$conn->real_escape_string($_POST['termination'])."', rdota = '".$conn->real_escape_string($_POST['rdota'])."', dateofreg = '".$conn->real_escape_string($_POST['dateofreg'])."', placeofreg = '".$conn->real_escape_string($_POST['placeofreg'])."', bookno = '".$conn->real_escape_string($_POST['bookno'])."', volumeno = '".$conn->real_escape_string($_POST['volumeno'])."', pagenos = '".$conn->real_escape_string($_POST['pagenos'])."', deedno = '".$conn->real_escape_string($_POST['deedno'])."' WHERE id='".$_POST['id']."'"; if($conn->query($sqlStock)){ $lastID = $_POST['id']; $conn->query("DELETE FROM `tbl_agreement_units` where agreementid='".$lastID."'"); $conn->query("DELETE FROM `tbl_agreement_rentincrement` where agreementid='".$lastID."'"); $conn->query("DELETE FROM `tbl_agreement_billfor` where agreementid='".$lastID."'"); for($i=0; $i<count($_POST['unitid']); $i++) { $sqlDetails = "INSERT INTO tbl_agreement_units SET agreementid = '".$lastID."', billforunits = '".$_POST['billforunits'][$i]."', soltidunits = '".$_POST['soltidunits'][$i]."', unitid = '".$_POST['unitid'][$i]."', unitarea = '".$_POST['unitarea'][$i]."', rate = '".$_POST['rate'][$i]."', amount = '".$_POST['amount'][$i]."', gstper = '".$_POST['gstper'][$i]."', gstamount = '".$_POST['gstamount'][$i]."', roundedoff = '".$_POST['roundedoff'][$i]."', netamount = '".$_POST['netamount'][$i]."'"; $conn->query($sqlDetails); } for($j=0; $j<count($_POST['incrementdate']); $j++) { $sqlIncDetails = "INSERT INTO tbl_agreement_rentincrement SET agreementid = '".$lastID."', billforincrement = '".$_POST['billforincrement'][$j]."', soltidincrement = '".$_POST['soltidincrement'][$j]."', incrementdate = '".date('Y-m-d',strtotime($_POST['incrementdate'][$j]))."', incmonth = '".date('m',strtotime($_POST['incrementdate'][$j]))."', incyear = '".date('Y',strtotime($_POST['incrementdate'][$j]))."', incrementper = '".$_POST['incrementper'][$j]."', incrementamt = '".$_POST['incrementamt'][$j]."', inctodate = '".date('Y-m-d',strtotime($_POST['inctodate'][$j]))."', previncamount = '".$_POST['previncamount'][$j]."', billincamount = '".$_POST['billincamount'][$j]."', inccgst = '".$_POST['inccgst'][$j]."', incsgst = '".$_POST['incsgst'][$j]."', incroundedoff = '".$_POST['incroundedoff'][$j]."', incnetamount = '".$_POST['incnetamount'][$j]."'"; $conn->query($sqlIncDetails); } for($k=0; $k<count($_POST['billingforid']); $k++) { $sqlBillDetails = "INSERT INTO tbl_agreement_billfor SET agreementid = '".$lastID."', billingforid = '".$_POST['billingforid'][$k]."', billforftenure = '".date('Y-m-d',strtotime($_POST['billforftenure'][$k]))."', billforttenure = '".date('Y-m-d',strtotime($_POST['billforttenure'][$k]))."', totalunitarea = '".$_POST['totalunitarea'][$k]."', totalamount = '".$_POST['totalamount'][$k]."', totalgstamount = '".$_POST['totalgstamount'][$k]."', totalnetamount = '".$_POST['totalnetamount'][$k]."'"; $conn->query($sqlBillDetails); } $_SESSION['success'] = 'Updated successfully'; } else{ $_SESSION['error'] = $conn->error; } echo "<script>location.href='print-agreement-details.php?agreementid=".$lastID."'</script>"; } $fetch = $conn->query("SELECT * FROM tbl_agreement where id='".$_GET['editid']."'")->fetch_assoc(); ?> <body class="hold-transition skin-blue sidebar-mini"> <div class="wrapper"> <?php include 'includes/navbar.php'; ?> <?php include 'includes/menubar.php'; ?> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header hidden-xs"> <h1> Edit Agreement </h1> <ol class="breadcrumb"> <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li> <li>Reports</li> <li class="active">Edit Agreement</li> </ol> </section> <!-- Main content --> <section class="content"> <div class="row"> <form method="POST" action="" name="stockFrm" enctype="multipart/form-data"> <input type="hidden" name="id" value="<?php echo $fetch['id']; ?>"> <div class="col-xs-12"> <div class="box"> <div class="box-body"> <div class="form-horizontal"> <div class="form-group col-sm-6"> <label for="time_in" class="col-sm-12 control-label" style="text-align:left;">Company</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <select class="form-control" id="lessor" name="lessor" onChange="chkunit();" required> <?php $queryLessor = $conn->query("SELECT * FROM tbl_company where id='".$fetch['lessor']."' order by companyname ASC"); while($rowLessor = $queryLessor->fetch_assoc()){ ?> <option value="<?php echo $rowLessor['id']; ?>" <?php if(isset($_GET['lessor']) && $_GET['lessor']==$rowLessor['id']){?> selected="selected" <?php }else if($fetch['lessor']==$rowLessor['id']){?> selected="selected" <?php } ?>><?php echo $rowLessor['companyname']; ?></option> <?php } ?> </select> </div> </div> </div> <div class="form-group col-sm-6"> <label for="time_in" class="col-sm-12 control-label" style="text-align:left;">Client</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <select class="form-control" id="lessee" name="lessee" required> <option value="">-Select-</option> <?php $queryLessee = $conn->query("SELECT * FROM tbl_lessee order by companyname ASC"); while($rowLessee = $queryLessee->fetch_assoc()){ ?> <option value="<?php echo $rowLessee['id']; ?>" <?php if(isset($_GET['lessee']) && $_GET['lessee']==$rowLessee['id']){?> selected="selected" <?php }else if($fetch['lessee']==$rowLessee['id']){?> selected="selected" <?php } ?>><?php echo $rowLessee['companyname']; ?></option> <?php } ?> </select> </div> </div> </div> <div class="form-group col-sm-6"> <label class="col-sm-12 control-label" style="text-align:left;">Agreement&nbsp;Head</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <input type="text" class="form-control" id="agreementtype" value="<?php if(isset($_GET['agreementtype'])){ echo $_GET['agreementtype']; }else if(isset($fetch['agreementtype'])){ echo $fetch['agreementtype']; }?>" name="agreementtype" required> </div> </div> </div> <div class="form-group col-sm-6"> <label class="col-sm-12 control-label" style="text-align:left;">Agreement&nbsp;Date</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <input type="date" value="<?php if(isset($_GET['agreementdate'])){ echo $_GET['agreementdate']; }else if(isset($fetch['agreementdate'])){ echo $fetch['agreementdate']; }?>" class="form-control" id="agreementdate" name="agreementdate" required> </div> </div> </div> <div class="form-group col-sm-6"> <label class="col-sm-12 control-label" style="text-align:left;">Agreement commencement date</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <input type="date" value="<?php if(isset($_GET['fromtenure'])){ echo $_GET['fromtenure']; }else if(isset($fetch['fromtenure'])){ echo $fetch['fromtenure']; }?>" class="form-control" id="fromtenure" name="fromtenure" required> </div> </div> </div> <div class="form-group col-sm-6"> <label class="col-sm-12 control-label" style="text-align:left;">Agreement expiry date</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <input type="date" value="<?php if(isset($_GET['totenure'])){ echo $_GET['totenure']; }else if(isset($fetch['totenure'])){ echo $fetch['totenure']; }?>" class="form-control" id="totenure" name="totenure" required> </div> </div> </div> <div class="form-group col-sm-6"> <label for="time_in" class="col-sm-12 control-label" style="text-align:left;">Bill Prefix</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <select class="form-control" id="billprefix" name="billprefix" required> <option value="">-Select-</option> <?php $querybillprefix = $conn->query("SELECT * FROM rk_source WHERE company='".$fetch['lessor']."'"); while($rowbillprefix = $querybillprefix->fetch_assoc()){ ?> <option <?php if($fetch['billprefix']==$rowbillprefix['name']){?> selected="selected" <?php } ?>><?php echo $rowbillprefix['name']; ?></option> <?php } ?> </select> </div> </div> </div> <div class="form-group col-sm-12"></div> <div class="form-group col-sm-6"> <label class="col-sm-12 control-label" style="text-align:left;">Billing For</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <select class="form-control" id="billingforid" name="billingforid" style="width: 84%; float:left;"> <option value="">-Select-</option> <?php $queryBillfor = $conn->query("SELECT rk_fabric.agreementtype FROM rk_fabric where company='".$fetch['lessor']."' GROUP BY agreementtype"); while($rowBillfor = $queryBillfor->fetch_assoc()){ $agreementtype = $conn->query("SELECT * FROM position WHERE id='".$rowBillfor['agreementtype']."'")->fetch_assoc(); ?> <option value="<?php echo $agreementtype['id']; ?>"><?php echo $agreementtype['description']; ?></option> <?php } ?> </select> <button type="button" id="billingforbtn" class="btn btn-primary btn-sm btn-flat" style="padding: 8px 10px;" onClick="getUnitstable();"><i class="fa fa-plus"></i> ADD</button> </div> </div> </div> </div> <div id="billforSectiondiv" class="form-horizontal col-sm-12" style="padding:0;"> <?php $grosstotal=0; $sqlBillfor = "SELECT * FROM tbl_agreement_units where agreementid='".$fetch['id']."' GROUP BY billforunits ORDER BY detailsid ASC"; $queryBillfor = $conn->query($sqlBillfor); while($rowBillfor = $queryBillfor->fetch_assoc()){ $randomString = $rowBillfor['soltidunits']; $agreementtype = $conn->query("SELECT * FROM position WHERE id='".$rowBillfor['billforunits']."'")->fetch_assoc(); $lessee = $conn->query("SELECT * FROM tbl_lessee WHERE id='".$fetch['lessee']."'")->fetch_assoc(); if($agreementtype['gst']=='YES'){ $gstper=18; }else{ $gstper=0; } if($lessee['gst']=='NO'){ $gstper=0; } $chkbillfortenure = $conn->query("SELECT * FROM tbl_agreement_billfor WHERE agreementid='".$fetch['id']."' AND billingforid='".$rowBillfor['billforunits']."'")->fetch_assoc(); ?> <div class="form-horizontal col-sm-12" style="padding:0; overflow-x:scroll;" id="removebillfor<?php echo $randomString; ?>"> <input type="hidden" name="soltid" id="soltid<?php echo $randomString; ?>" value="<?php echo $randomString; ?>"> <table id="table<?php echo $randomString; ?>" class="table table-bordered"> <tr> <th colspan="2"> <button style="padding: 2px 5px;border-radius: 3px;margin-right: 5px;" type="button" id="addmore_old<?php echo $randomString; ?>" onClick="getUnitstableRow<?php echo $randomString; ?>();" class="btn btn-primary btn-sm btn-flat"><i class="fa fa-plus"></i></button> <?php echo $agreementtype['description']; ?> <input type="hidden" name="billingforid[]" value="<?php echo $agreementtype['id']; ?>"> </th> <th style="text-align:right;">Rent commencement date</th> <th><input type="date" value="<?php echo $chkbillfortenure['billforftenure']; ?>" class="form-control" name="billforftenure[]" required></th> <th style="text-align:right;">Rent expiry date</th> <th><input type="date" value="<?php echo $chkbillfortenure['billforttenure']; ?>" class="form-control" name="billforttenure[]" required></th> <th colspan="2" style="text-align: center;"><span style='cursor:pointer; font-size:20px; color:#FF0000;' onClick='removebillfor<?php echo $randomString; ?>()'><i class="fa fa-trash-o" aria-hidden="true"></i></span></th> </tr> <tr> <th>&nbsp;</th> <th>Unit Name</th> <th>Unit Area(in Sqft)</th> <th>Rate per Sqft</th> <th>Amount</th> <th>GST Amount(<?php echo $gstper; ?>%)</th> <th>Rounded Off(+/-)</th> <th>Net Amount</th> </tr> <?php $sl=0; $totalunitarea=0; $totalamount=0; $totalgstamount=0; $totalnetamount=0; $sql = "SELECT * FROM tbl_agreement_units where agreementid='".$fetch['id']."' AND billforunits='".$rowBillfor['billforunits']."'"; $query = $conn->query($sql); while($row = $query->fetch_assoc()){ $sl++; $totalunitarea=$totalunitarea+$row['unitarea']; $totalamount=$totalamount+$row['amount']; $totalgstamount=$totalgstamount+$row['gstamount']; $totalnetamount=$totalnetamount+$row['netamount']; $grosstotal=$grosstotal + $row['netamount']; ?> <tr> <td><input type='hidden' value='<?php echo $sl; ?>' name='slno[]' id='slno<?php echo $randomString; ?><?php echo $sl; ?>'><span style='cursor:pointer; font-size:16px;' onClick='deltr<?php echo $randomString; ?>(<?php echo $sl; ?>)'><i class="fa fa-trash-o" aria-hidden="true"></i></span></td> <td> <select class='form-control apunitids<?php echo $randomString; ?>' id='unitid<?php echo $randomString; ?><?php echo $sl; ?>' name='unitid[]' onChange='chk_product<?php echo $randomString; ?>(<?php echo $sl; ?>)' style='width:200px;' required> <option value='0'>-Select-</option> <?php $queryUnits = $conn->query("SELECT * FROM rk_fabric where company='".$fetch['lessor']."' AND agreementtype='".$row['billforunits']."' ORDER BY name ASC"); while($rowUnits = $queryUnits->fetch_assoc()){ ?> <option value='<?php echo $rowUnits['id']; ?>' <?php if($row['unitid']==$rowUnits['id']){?> selected <?php } ?>><?php echo $rowUnits['name']; ?></option> <?php } ?> </select> <input type='hidden' value='<?php echo $row['billforunits']; ?>' name='billforunits[]'><input type='hidden' value='<?php echo $randomString; ?>' name='soltidunits[]'> </td> <td><input type='text' class='form-control ttlunitarea<?php echo $randomString; ?>' id='unitarea<?php echo $randomString; ?><?php echo $sl; ?>' name='unitarea[]' value='<?php echo $row['unitarea']; ?>' style='width:120px;' onKeyUp='chkcal<?php echo $randomString; ?>(<?php echo $sl; ?>);' readonly></td> <td><input type='text' class='form-control' id='rate<?php echo $randomString; ?><?php echo $sl; ?>' name='rate[]' onKeyUp='chkcal<?php echo $randomString; ?>(<?php echo $sl; ?>);' value='<?php echo $row['rate']; ?>' style='width:120px;'></td> <td><input type='text' class='form-control ttlamount<?php echo $randomString; ?>' id='amount<?php echo $randomString; ?><?php echo $sl; ?>' name='amount[]' onKeyUp='chkmanualcal<?php echo $randomString; ?>(<?php echo $sl; ?>);' value='<?php echo $row['amount']; ?>' style='width:120px;'></td> <td> <input type='hidden' id='gstper<?php echo $randomString; ?><?php echo $sl; ?>' name='gstper[]' value='<?php echo $gstper; ?>' readonly> <input type='text' class='form-control ttlgstamount<?php echo $randomString; ?>' id='gstamount<?php echo $randomString; ?><?php echo $sl; ?>' name='gstamount[]' value='<?php echo $row['gstamount']; ?>' style='width:120px;' readonly></td> <td><input type='text' class='form-control' id='roundedoff<?php echo $randomString; ?><?php echo $sl; ?>' name='roundedoff[]' value='<?php echo $row['roundedoff']; ?>' style='width:120px;' onKeyUp='chkgound<?php echo $randomString; ?>(<?php echo $sl; ?>);'></td> <td><input type='text' class='form-control ttlnetamount<?php echo $randomString; ?>' id='netamount<?php echo $randomString; ?><?php echo $sl; ?>' name='netamount[]' value='<?php echo $row['netamount']; ?>' style='width:120px;' readonly></td> </tr> <?php } ?> <tfoot style="background: #eee;"> <th>&nbsp;</th> <th valign="middle"><?php echo $agreementtype['description']; ?> TOTAL</th> <th><input type='text' class='form-control' id="totalunitarea<?php echo $randomString; ?>" name='totalunitarea[]' value='<?php echo $totalunitarea; ?>' style='width:120px;'></th> <th>&nbsp;</th> <th><input type='text' class='form-control' id="totalamount<?php echo $randomString; ?>" name='totalamount[]' value='<?php echo $totalamount; ?>' style='width:120px;'></th> <th><input type='text' class='form-control' id="totalgstamount<?php echo $randomString; ?>" name='totalgstamount[]' value='<?php echo $totalgstamount; ?>' style='width:120px;'></th> <th>&nbsp;</th> <th><input type='text' class='form-control grosstotal' id="totalnetamount<?php echo $randomString; ?>" name='totalnetamount[]' value='<?php echo $totalnetamount; ?>' style='width:120px;'></th> </tfoot> </table> <table id="rentincrementtbl<?php echo $randomString; ?>" class="table table-bordered"> <tr> <th colspan="11" style="text-transform:uppercase;"><button style="padding: 2px 5px;border-radius: 3px;margin-right: 5px;" type="button" onClick='addtrIcdt<?php echo $randomString; ?>()' class="btn btn-primary btn-sm btn-flat"><i class="fa fa-plus"></i></button> <?php echo $agreementtype['description']; ?> - Increment Date</th> </tr> <tr> <th>&nbsp;</th> <th>From Date</th> <th>To Date</th> <th>Prev Amt</th> <th>Inc(%)</th> <th>Inc(Amt)</th> <th>Bill Amt</th> <th>CGST(<?php echo $gstper/2; ?>%)</th> <th>SGST(<?php echo $gstper/2; ?>%)</th> <th>Rounded Off(+/-)</th> <th>Net Amt</th> </tr> <?php $ui=0; $sqlUInc = "SELECT * FROM tbl_agreement_rentincrement where agreementid='".$fetch['id']."' AND billforincrement='".$rowBillfor['billforunits']."'"; $queryUInc = $conn->query($sqlUInc); while($rowUInc = $queryUInc->fetch_assoc()){ $ui++; ?> <tr> <td><input type='hidden' value='<?php echo $rowBillfor['billforunits']; ?>' name='billforincrement[]'><input type='hidden' value='<?php echo $randomString; ?>' name='soltidincrement[]'><input type='hidden' value='<?php echo $ui; ?>' name='slnoIcdt[]' id='slnoIcdt<?php echo $randomString; ?><?php echo $ui; ?>'><span style='cursor:pointer; font-size:16px;' onClick='deltrIcdt<?php echo $randomString; ?>(<?php echo $ui; ?>)'><i class="fa fa-trash-o" aria-hidden="true"></i></span></td> <td><input type='date' class='form-control' id='incrementdate<?php echo $randomString; ?><?php echo $ui; ?>' name='incrementdate[]' value='<?php echo $rowUInc['incrementdate']; ?>' style='width:120px;' ></td> <td><input type='date' class='form-control' id='inctodate<?php echo $randomString; ?><?php echo $ui; ?>' name='inctodate[]' value='<?php echo $rowUInc['inctodate']; ?>' style='width:120px;' ></td> <td><input type='text' class='form-control previncamount<?php echo $randomString; ?>' id='previncamount<?php echo $randomString; ?><?php echo $ui; ?>' name='previncamount[]' value='<?php echo $rowUInc['previncamount']; ?>' style='width:120px;' ></td> <td><input type='text' class='form-control' id='incrementper<?php echo $randomString; ?><?php echo $ui; ?>' name='incrementper[]' value='<?php echo $rowUInc['incrementper']; ?>' onKeyUp='chkincpercal<?php echo $randomString; ?>(<?php echo $ui; ?>);' style='width:120px;' ></td> <td><input type='text' class='form-control' id='incrementamt<?php echo $randomString; ?><?php echo $ui; ?>' name='incrementamt[]' value='<?php echo $rowUInc['incrementamt']; ?>' onKeyUp='chkinccal<?php echo $randomString; ?>(<?php echo $ui; ?>);' style='width:120px;' ></td> <td><input type='text' class='form-control billincamount<?php echo $randomString; ?>' id='billincamount<?php echo $randomString; ?><?php echo $ui; ?>' name='billincamount[]' value='<?php echo $rowUInc['billincamount']; ?>' onKeyUp='chkincbillcal<?php echo $randomString; ?>(<?php echo $ui; ?>);' style='width:120px;' ></td> <td><input type='text' class='form-control' id='inccgst<?php echo $randomString; ?><?php echo $ui; ?>' name='inccgst[]' value='<?php echo $rowUInc['inccgst']; ?>' style='width:120px;' readonly></td> <td><input type='text' class='form-control' id='incsgst<?php echo $randomString; ?><?php echo $ui; ?>' name='incsgst[]' value='<?php echo $rowUInc['incsgst']; ?>' style='width:120px;' readonly></td> <td><input type='text' class='form-control' id='incroundedoff<?php echo $randomString; ?><?php echo $ui; ?>' name='incroundedoff[]' value='<?php echo $rowUInc['incroundedoff']; ?>' onKeyUp='chkincgound<?php echo $randomString; ?>(1);' style='width:120px;' ></td> <td><input type='text' class='form-control incnetamount<?php echo $randomString; ?>' id='incnetamount<?php echo $randomString; ?><?php echo $ui; ?>' name='incnetamount[]' value='<?php echo $rowUInc['incnetamount']; ?>' style='width:120px;' readonly></td> </tr> <?php } ?> </table> </div> <script> function removebillfor<?php echo $randomString; ?>() { $('#removebillfor<?php echo $randomString; ?>').remove(); } function deltr<?php echo $randomString; ?>(id) { $('#slno<?php echo $randomString; ?>'+id).parents("tr").remove(); chkcal<?php echo $randomString; ?>(id); } function deltrIcdt<?php echo $randomString; ?>(id) { $('#slnoIcdt<?php echo $randomString; ?>'+id).parents("tr").remove(); } var i=<?php echo $sl+1; ?>; var sum=1; var j=<?php echo $ui+1; ?>; function addtrIcdt<?php echo $randomString; ?>() { var billincamount = $(".billincamount<?php echo $randomString; ?>").last().val(); var data="<tr><td><input type='hidden' value='<?php echo $rowBillfor['billforunits']; ?>' name='billforincrement[]'><input type='hidden' value='<?php echo $randomString; ?>' name='soltidincrement[]'><input type='hidden' value='"+j+"' name='slnoIcdt[]' id='slnoIcdt<?php echo $randomString; ?>"+j+"'><span style='cursor:pointer; font-size:16px;' onClick='deltrIcdt<?php echo $randomString; ?>("+j+")'><i class='fa fa-trash-o' aria-hidden='true'></i></span></td>"; data +="<td><input type='date' class='form-control' id='incrementdate<?php echo $randomString; ?>"+j+"' name='incrementdate[]' value='' style='width:120px;'></td><td><input type='date' class='form-control' id='inctodate<?php echo $randomString; ?>"+j+"' name='inctodate[]' value='' style='width:120px;'></td><td><input type='text' class='form-control previncamount<?php echo $randomString; ?>' id='previncamount<?php echo $randomString; ?>"+j+"' name='previncamount[]' value='"+billincamount+"' style='width:120px;' ></td><td><input type='text' class='form-control' style='width:120px;' id='incrementper<?php echo $randomString; ?>"+j+"' name='incrementper[]' value='' onKeyUp='chkincpercal<?php echo $randomString; ?>("+j+");'></td><td><input type='text' class='form-control' id='incrementamt<?php echo $randomString; ?>"+j+"' name='incrementamt[]' value='' style='width:120px;' onKeyUp='chkinccal<?php echo $randomString; ?>("+j+");' ></td><td><input type='text' class='form-control billincamount<?php echo $randomString; ?>' id='billincamount<?php echo $randomString; ?>"+j+"' name='billincamount[]' onKeyUp='chkincbillcal<?php echo $randomString; ?>("+j+");' value='' style='width:120px;' ></td><td><input type='text' class='form-control' id='inccgst<?php echo $randomString; ?>"+j+"' name='inccgst[]' value='' style='width:120px;' ></td><td><input type='text' class='form-control' id='incsgst<?php echo $randomString; ?>"+j+"' name='incsgst[]' value='' style='width:120px;' ></td><td><input type='text' class='form-control' id='incroundedoff<?php echo $randomString; ?>"+j+"' name='incroundedoff[]' style='width:120px;' value='' onKeyUp='chkincgound<?php echo $randomString; ?>(1);' ></td><td><input type='text' class='form-control incnetamount<?php echo $randomString; ?>' id='incnetamount<?php echo $randomString; ?>"+j+"' name='incnetamount[]' value='' style='width:120px;' readonly></td></tr>"; $('#rentincrementtbl<?php echo $randomString; ?>').append(data); j++; } function chk_product<?php echo $randomString; ?>(id) { if($('#unitid<?php echo $randomString; ?>'+id).val() != "") { $.post("load_unit_details.php", { product_code : $('#unitid<?php echo $randomString; ?>'+id).val()}, function(data) { var brokenstring = data.split('@||@'); if(brokenstring[0] > 0) { var brost = brokenstring[1].split('||'); $('#unitarea<?php echo $randomString; ?>'+id).val(brost[3]); $('#billingfor<?php echo $randomString; ?>'+id).val(brost[4]); chkbillingforamount<?php echo $randomString; ?>(id); chkcal<?php echo $randomString; ?>(id); } else { alert("Sorry! No unit found . Please select correctly"); $('#unitarea<?php echo $randomString; ?>'+id).val(''); } }); } else{ alert("Sorry! No unit found . Please select correctly"); $('#unitarea<?php echo $randomString; ?>'+id).val(''); } } function chkincpercal<?php echo $randomString; ?>(id){ var previncamount = 0; var incrementper = 0; var incrementamt = 0; var billincamount = 0; var inccgst = 0; var incsgst = 0; var incroundedoff = 0; var incnetamount = 0; if (parseFloat($('#previncamount<?php echo $randomString; ?>'+id).val()) > 0) { previncamount = parseFloat($('#previncamount<?php echo $randomString; ?>'+id).val()); } if (parseFloat($('#incrementper<?php echo $randomString; ?>'+id).val()) > 0) { incrementper = parseFloat($('#incrementper<?php echo $randomString; ?>'+id).val()); } incrementamt = (parseFloat(previncamount) * parseFloat(incrementper/100)); billincamount = (parseFloat(previncamount) + parseFloat(incrementamt)); $('#incrementamt<?php echo $randomString; ?>'+id).val(parseFloat(incrementamt).toFixed(2)); $('#billincamount<?php echo $randomString; ?>'+id).val(parseFloat(billincamount).toFixed(2)); inccgst = (parseFloat(billincamount) * parseFloat(<?php echo $gstper/2; ?>/100)); incsgst = (parseFloat(billincamount) * parseFloat(<?php echo $gstper/2; ?>/100)); $('#inccgst<?php echo $randomString; ?>'+id).val(parseFloat(inccgst).toFixed(2)); $('#incsgst<?php echo $randomString; ?>'+id).val(parseFloat(incsgst).toFixed(2)); incnetamount = (parseFloat(billincamount) + parseFloat(inccgst) + parseFloat(incsgst)); var finalamount = Math.round(incnetamount); if(finalamount>=incnetamount){ incroundedoff = parseFloat(finalamount) - parseFloat(incnetamount); $('#incroundedoff<?php echo $randomString; ?>'+id).val('+'+parseFloat(incroundedoff).toFixed(2)); } else { incroundedoff = parseFloat(incnetamount) - parseFloat(finalamount); $('#incroundedoff<?php echo $randomString; ?>'+id).val('-'+parseFloat(incroundedoff).toFixed(2)); } $('#incnetamount<?php echo $randomString; ?>'+id).val(parseFloat(finalamount).toFixed(2)); } function chkinccal<?php echo $randomString; ?>(id){ var previncamount = 0; var incrementper = 0; var incrementamt = 0; var billincamount = 0; var inccgst = 0; var incsgst = 0; var incroundedoff = 0; var incnetamount = 0; if (parseFloat($('#previncamount<?php echo $randomString; ?>'+id).val()) > 0) { previncamount = parseFloat($('#previncamount<?php echo $randomString; ?>'+id).val()); } if (parseFloat($('#incrementamt<?php echo $randomString; ?>'+id).val()) > 0) { incrementamt = parseFloat($('#incrementamt<?php echo $randomString; ?>'+id).val()); } billincamount = (parseFloat(previncamount) + parseFloat(incrementamt)); incrementper = parseFloat(incrementamt/previncamount)*100; $('#incrementper<?php echo $randomString; ?>'+id).val(parseFloat(incrementper).toFixed(3)); $('#billincamount<?php echo $randomString; ?>'+id).val(parseFloat(billincamount).toFixed(2)); inccgst = (parseFloat(billincamount) * parseFloat(<?php echo $gstper/2; ?>/100)); incsgst = (parseFloat(billincamount) * parseFloat(<?php echo $gstper/2; ?>/100)); $('#inccgst<?php echo $randomString; ?>'+id).val(parseFloat(inccgst).toFixed(2)); $('#incsgst<?php echo $randomString; ?>'+id).val(parseFloat(incsgst).toFixed(2)); incnetamount = (parseFloat(billincamount) + parseFloat(inccgst) + parseFloat(incsgst)); var finalamount = Math.round(incnetamount); if(finalamount>=incnetamount){ incroundedoff = parseFloat(finalamount) - parseFloat(incnetamount); $('#incroundedoff<?php echo $randomString; ?>'+id).val('+'+parseFloat(incroundedoff).toFixed(2)); } else { incroundedoff = parseFloat(incnetamount) - parseFloat(finalamount); $('#incroundedoff<?php echo $randomString; ?>'+id).val('-'+parseFloat(incroundedoff).toFixed(2)); } $('#incnetamount<?php echo $randomString; ?>'+id).val(parseFloat(finalamount).toFixed(2)); } function chkincbillcal<?php echo $randomString; ?>(id){ var previncamount = 0; var incrementper = 0; var incrementamt = 0; var billincamount = 0; var inccgst = 0; var incsgst = 0; var incroundedoff = 0; var incnetamount = 0; if (parseFloat($('#previncamount<?php echo $randomString; ?>'+id).val()) > 0) { previncamount = parseFloat($('#previncamount<?php echo $randomString; ?>'+id).val()); } if (parseFloat($('#billincamount<?php echo $randomString; ?>'+id).val()) > 0) { billincamount = parseFloat($('#billincamount<?php echo $randomString; ?>'+id).val()); } incrementamt = (parseFloat(billincamount) - parseFloat(previncamount)); incrementper = parseFloat(incrementamt/previncamount)*100; $('#incrementamt<?php echo $randomString; ?>'+id).val(parseFloat(incrementamt).toFixed(2)); $('#incrementper<?php echo $randomString; ?>'+id).val(parseFloat(incrementper).toFixed(3)); inccgst = (parseFloat(billincamount) * parseFloat(<?php echo $gstper/2; ?>/100)); incsgst = (parseFloat(billincamount) * parseFloat(<?php echo $gstper/2; ?>/100)); $('#inccgst<?php echo $randomString; ?>'+id).val(parseFloat(inccgst).toFixed(2)); $('#incsgst<?php echo $randomString; ?>'+id).val(parseFloat(incsgst).toFixed(2)); incnetamount = (parseFloat(billincamount) + parseFloat(inccgst) + parseFloat(incsgst)); var finalamount = Math.round(incnetamount); if(finalamount>=incnetamount){ incroundedoff = parseFloat(finalamount) - parseFloat(incnetamount); $('#incroundedoff<?php echo $randomString; ?>'+id).val('+'+parseFloat(incroundedoff).toFixed(2)); } else { incroundedoff = parseFloat(incnetamount) - parseFloat(finalamount); $('#incroundedoff<?php echo $randomString; ?>'+id).val('-'+parseFloat(incroundedoff).toFixed(2)); } $('#incnetamount<?php echo $randomString; ?>'+id).val(parseFloat(finalamount).toFixed(2)); } function chkincgound<?php echo $randomString; ?>(id){ var previncamount = 0; var incrementper = 0; var incrementamt = 0; var billincamount = 0; var inccgst = 0; var incsgst = 0; var incroundedoff = 0; var incnetamount = 0; if (parseFloat($('#previncamount<?php echo $randomString; ?>'+id).val()) > 0) { previncamount = parseFloat($('#previncamount<?php echo $randomString; ?>'+id).val()); } if (parseFloat($('#incrementamt<?php echo $randomString; ?>'+id).val()) > 0) { incrementamt = parseFloat($('#incrementamt<?php echo $randomString; ?>'+id).val()); } if (parseFloat($('#incroundedoff<?php echo $randomString; ?>'+id).val())!='') { incroundedoff = parseFloat($('#incroundedoff<?php echo $randomString; ?>'+id).val()); } billincamount = (parseFloat(previncamount) + parseFloat(incrementamt)); incrementper = parseFloat(incrementamt/previncamount)*100; $('#incrementper<?php echo $randomString; ?>'+id).val(parseFloat(incrementper).toFixed(3)); $('#billincamount<?php echo $randomString; ?>'+id).val(parseFloat(billincamount).toFixed(2)); inccgst = (parseFloat(billincamount) * parseFloat(<?php echo $gstper/2; ?>/100)); incsgst = (parseFloat(billincamount) * parseFloat(<?php echo $gstper/2; ?>/100)); $('#inccgst<?php echo $randomString; ?>'+id).val(parseFloat(inccgst).toFixed(2)); $('#incsgst<?php echo $randomString; ?>'+id).val(parseFloat(incsgst).toFixed(2)); incnetamount = (parseFloat(billincamount) + parseFloat(inccgst) + parseFloat(incsgst)); var finalamount = parseFloat(incnetamount) + parseFloat(incroundedoff); $('#incnetamount<?php echo $randomString; ?>'+id).val(parseFloat(finalamount).toFixed(2)); } function chkcal<?php echo $randomString; ?>(id){ var unitarea = 0; var rate = 0; var amount = 0; var gstper = 0; var gstamount = 0; var roundedoff = 0; var netamount = 0; if (parseFloat($('#unitarea<?php echo $randomString; ?>'+id).val()) > 0) { unitarea = parseFloat($('#unitarea<?php echo $randomString; ?>'+id).val()); } if (parseFloat($('#rate<?php echo $randomString; ?>'+id).val()) > 0) { rate = parseFloat($('#rate<?php echo $randomString; ?>'+id).val()); } if (parseFloat($('#gstper<?php echo $randomString; ?>'+id).val()) > 0) { gstper = parseFloat($('#gstper<?php echo $randomString; ?>'+id).val()); } amount = (parseFloat(unitarea) * parseFloat(rate)); gstamount = (parseFloat(amount) * parseFloat(gstper/100)); netamount = (parseFloat(amount) + parseFloat(gstamount)); var finalamount = Math.round(netamount); if(finalamount>=netamount){ roundedoff = parseFloat(finalamount) - parseFloat(netamount); $('#roundedoff<?php echo $randomString; ?>'+id).val('+'+parseFloat(roundedoff).toFixed(2)); } else { roundedoff = parseFloat(netamount) - parseFloat(finalamount); $('#roundedoff<?php echo $randomString; ?>'+id).val('-'+parseFloat(roundedoff).toFixed(2)); } $('#amount<?php echo $randomString; ?>'+id).val(parseFloat(amount).toFixed(2)); $('#gstamount<?php echo $randomString; ?>'+id).val(parseFloat(gstamount).toFixed(2)); $('#netamount<?php echo $randomString; ?>'+id).val(parseFloat(finalamount).toFixed(2)); $('#totalunitarea<?php echo $randomString; ?>').val(0); var totalunitarea=0; $(".ttlunitarea<?php echo $randomString; ?>").each(function(){ if(parseInt($(this).val())>0) totalunitarea += parseInt($(this).val()); }); $('#totalunitarea<?php echo $randomString; ?>').val(parseInt(totalunitarea)); $('#totalamount<?php echo $randomString; ?>').val(0); var totalamount=0; $(".ttlamount<?php echo $randomString; ?>").each(function(){ if(parseFloat($(this).val())>0) totalamount += parseFloat($(this).val()); }); $('#totalamount<?php echo $randomString; ?>').val(parseFloat(totalamount).toFixed(2)); $('#totalgstamount<?php echo $randomString; ?>').val(0); var ttlgstamount=0; $(".ttlgstamount<?php echo $randomString; ?>").each(function(){ if(parseFloat($(this).val())>0) ttlgstamount += parseFloat($(this).val()); }); $('#totalgstamount<?php echo $randomString; ?>').val(parseFloat(ttlgstamount).toFixed(2)); $('#totalnetamount<?php echo $randomString; ?>').val(0); var totalnetamount=0; $(".ttlnetamount<?php echo $randomString; ?>").each(function(){ if(parseFloat($(this).val())>0) totalnetamount += parseFloat($(this).val()); }); $('#totalnetamount<?php echo $randomString; ?>').val(parseFloat(totalnetamount).toFixed(2)); $('#grosstotal').val(0); var grosstotal=0; $(".grosstotal").each(function(){ if(parseFloat($(this).val())>0) grosstotal += parseFloat($(this).val()); }); $('#grosstotal').val(parseFloat(grosstotal).toFixed(2)); $(".previncamount<?php echo $randomString; ?>").first().val(parseFloat(totalamount).toFixed(2)); chkbillingforamount<?php echo $randomString; ?>(id); } function chkmanualcal<?php echo $randomString; ?>(id){ var unitarea = 0; var rate = 0; var amount = 0; var gstper = 0; var gstamount = 0; var roundedoff = 0; var netamount = 0; if (parseFloat($('#unitarea<?php echo $randomString; ?>'+id).val()) > 0) { unitarea = parseFloat($('#unitarea<?php echo $randomString; ?>'+id).val()); } if (parseFloat($('#amount<?php echo $randomString; ?>'+id).val()) > 0) { amount = parseFloat($('#amount<?php echo $randomString; ?>'+id).val()); } if (parseFloat($('#gstper<?php echo $randomString; ?>'+id).val()) > 0) { gstper = parseFloat($('#gstper<?php echo $randomString; ?>'+id).val()); } rate = (parseFloat(amount) / parseFloat(unitarea)); gstamount = (parseFloat(amount) * parseFloat(gstper/100)); netamount = (parseFloat(amount) + parseFloat(gstamount)); var finalamount = Math.round(netamount); if(finalamount>=netamount){ roundedoff = parseFloat(finalamount) - parseFloat(netamount); $('#roundedoff<?php echo $randomString; ?>'+id).val('+'+parseFloat(roundedoff).toFixed(2)); } else { roundedoff = parseFloat(netamount) - parseFloat(finalamount); $('#roundedoff<?php echo $randomString; ?>'+id).val('-'+parseFloat(roundedoff).toFixed(2)); } $('#rate<?php echo $randomString; ?>'+id).val(parseFloat(rate).toFixed(3)); $('#gstamount<?php echo $randomString; ?>'+id).val(parseFloat(gstamount).toFixed(2)); $('#netamount<?php echo $randomString; ?>'+id).val(parseFloat(finalamount).toFixed(2)); $('#totalunitarea<?php echo $randomString; ?>').val(0); var totalunitarea=0; $(".ttlunitarea<?php echo $randomString; ?>").each(function(){ if(parseInt($(this).val())>0) totalunitarea += parseInt($(this).val()); }); $('#totalunitarea<?php echo $randomString; ?>').val(parseInt(totalunitarea)); $('#totalamount<?php echo $randomString; ?>').val(0); var totalamount=0; $(".ttlamount<?php echo $randomString; ?>").each(function(){ if(parseFloat($(this).val())>0) totalamount += parseFloat($(this).val()); }); $('#totalamount<?php echo $randomString; ?>').val(parseFloat(totalamount).toFixed(2)); $('#ttlgstamount<?php echo $randomString; ?>').val(0); var ttlgstamount=0; $(".ttlgstamount<?php echo $randomString; ?>").each(function(){ if(parseFloat($(this).val())>0) ttlgstamount += parseFloat($(this).val()); }); $('#ttlgstamount<?php echo $randomString; ?>').val(parseFloat(ttlgstamount).toFixed(2)); $('#totalnetamount<?php echo $randomString; ?>').val(0); var totalnetamount=0; $(".ttlnetamount<?php echo $randomString; ?>").each(function(){ if(parseFloat($(this).val())>0) totalnetamount += parseFloat($(this).val()); }); $('#totalnetamount<?php echo $randomString; ?>').val(parseFloat(totalnetamount).toFixed(2)); $('#grosstotal').val(0); var grosstotal=0; $(".grosstotal").each(function(){ if(parseFloat($(this).val())>0) grosstotal += parseFloat($(this).val()); }); $('#grosstotal').val(parseFloat(grosstotal).toFixed(2)); $(".previncamount<?php echo $randomString; ?>").first().val(parseFloat(totalamount).toFixed(2)); chkbillingforamount<?php echo $randomString; ?>(id); } function getUnitstableRow<?php echo $randomString; ?>() { var unitids = []; $('.apunitids<?php echo $randomString; ?>').each(function () { unitids.push($(this).val()); }); unitids = unitids.join(','); $.post("units-tablerows-ajaxfile.php", { trid : i,soltid : '<?php echo $randomString; ?>',lessor : <?php echo $fetch['lessor']; ?>,billingforid : <?php echo $rowBillfor['billforunits']; ?>,sunitsid : unitids}, function(data) { $('#table<?php echo $randomString; ?>').append(data); sum=sum+i; i++; }); } </script> </div> <?php } ?> </div> <div class="form-horizontal col-sm-12" id="grosstotalDiv" style="padding:0;"> <div class="form-group col-sm-6"> <label class="col-sm-12 control-label" style="text-align:left;">Gross&nbsp;Total</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <input type="text" value="<?php echo $grosstotal; ?>" class="form-control" id="grosstotal" name="grosstotal" required> </div> </div> </div> </div> <div class="form-horizontal col-sm-12" style="padding: 0;"> <div class="form-group col-sm-6"> <label class="col-sm-12 control-label" style="text-align:left;">Tenure of the Agreement</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <input type="text" value="<?php echo $fetch['tenureofagreement']; ?>" class="form-control" name="tenureofagreement" id="tenureofagreement"> </div> </div> </div> <div class="form-group col-sm-6"> <label class="col-sm-12 control-label" style="text-align:left;">Rent Commencement Date</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <input type="text" value="<?php echo $fetch['rcdate']; ?>" class="form-control" name="rcdate" id="rcdate"> </div> </div> </div> <div class="form-group col-sm-6"> <label class="col-sm-12 control-label" style="text-align:left;">Lock-in Period</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <input type="text" value="<?php echo $fetch['lockinperiod']; ?>" class="form-control" name="lockinperiod" id="lockinperiod"> </div> </div> </div> <div class="form-group col-sm-6"> <label class="col-sm-12 control-label" style="text-align:left;">Common Area Maintenance Charges</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <input type="text" value="<?php echo $fetch['camcharges']; ?>" class="form-control" name="camcharges" id="camcharges"> </div> </div> </div> <div class="form-group col-sm-6"> <label class="col-sm-12 control-label" style="text-align:left;">Due Date</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <input type="text" value="<?php echo $fetch['duedate']; ?>" class="form-control" name="duedate" id="duedate"> </div> </div> </div> <div class="form-group col-sm-6"> <label class="col-sm-12 control-label" style="text-align:left;">Enhancement</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <input type="text" value="<?php echo $fetch['enhancement']; ?>" class="form-control" name="enhancement" id="enhancement"> </div> </div> </div> <div class="form-group col-sm-12"> <label class="col-sm-12 control-label" style="text-align:left;">Security Deposit</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <textarea class="form-control" name="securitydeposit" id="securitydeposit"><?php echo $fetch['securitydeposit']; ?></textarea> </div> </div> </div> <div class="form-group col-sm-12"> <label class="col-sm-12 control-label" style="text-align:left;">Termination</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <textarea class="form-control" id="termination" name="termination"><?php echo $fetch['termination']; ?></textarea> </div> </div> </div> <div class="form-group col-sm-12"> <label class="col-sm-12 control-label" style="text-align:left;">Registration Details of the Agreement? &nbsp;&nbsp; <input type="radio" name="rdota" value="YES" onClick="chkAgreement('YES')" <?php if($fetch['rdota']=='YES'){?> checked="checked" <?php } ?>>&nbsp;YES &nbsp; <input type="radio" name="rdota" value="NO" onClick="chkAgreement('NO')" <?php if($fetch['rdota']=='NO'){?> checked="checked" <?php } ?>>&nbsp;NO </label> <script> function chkAgreement(data) { if(data=='YES') { $('#dateofRegDiv').show(); $('#placeofRegDiv').show(); $('#booknoDiv').show(); $('#volumenoDiv').show(); $('#pagenosDiv').show(); $('#deednoDiv').show(); } else { $('#dateofRegDiv').hide(); $('#placeofRegDiv').hide(); $('#booknoDiv').hide(); $('#volumenoDiv').hide(); $('#pagenosDiv').hide(); $('#deednoDiv').hide(); } } </script> </div> <div class="form-group col-sm-6" id="dateofRegDiv" <?php if($fetch['rdota']=='YES'){?> style="display:block;" <?php }else{ ?> style="display:none;" <?php } ?>> <label class="col-sm-12 control-label" style="text-align:left;">Date of Registration</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <input type="text" value="<?php echo $fetch['dateofreg']; ?>" class="form-control" name="dateofreg" id="dateofreg"> </div> </div> </div> <div class="form-group col-sm-6" id="placeofRegDiv" <?php if($fetch['rdota']=='YES'){?> style="display:block;" <?php }else{ ?> style="display:none;" <?php } ?>> <label class="col-sm-12 control-label" style="text-align:left;">Place of Registration</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <input type="text" value="<?php echo $fetch['placeofreg']; ?>" class="form-control" name="placeofreg" id="placeofreg"> </div> </div> </div> <div class="form-group col-sm-6" id="booknoDiv" <?php if($fetch['rdota']=='YES'){?> style="display:block;" <?php }else{ ?> style="display:none;" <?php } ?>> <label class="col-sm-12 control-label" style="text-align:left;">Book No</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <input type="text" value="<?php echo $fetch['bookno']; ?>" class="form-control" name="bookno" id="bookno"> </div> </div> </div> <div class="form-group col-sm-6" id="volumenoDiv" <?php if($fetch['rdota']=='YES'){?> style="display:block;" <?php }else{ ?> style="display:none;" <?php } ?>> <label class="col-sm-12 control-label" style="text-align:left;">Volume No</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <input type="text" value="<?php echo $fetch['volumeno']; ?>" class="form-control" name="volumeno" id="volumeno"> </div> </div> </div> <div class="form-group col-sm-6" id="pagenosDiv" <?php if($fetch['rdota']=='YES'){?> style="display:block;" <?php }else{ ?> style="display:none;" <?php } ?>> <label class="col-sm-12 control-label" style="text-align:left;">Page Nos</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <input type="text" value="<?php echo $fetch['pagenos']; ?>" class="form-control" name="pagenos" id="pagenos"> </div> </div> </div> <div class="form-group col-sm-6" id="deednoDiv" <?php if($fetch['rdota']=='YES'){?> style="display:block;" <?php }else{ ?> style="display:none;" <?php } ?>> <label class="col-sm-12 control-label" style="text-align:left;">Deed No</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <input type="text" value="<?php echo $fetch['deedno']; ?>" class="form-control" name="deedno" id="deedno"> </div> </div> </div> <div class="form-group col-sm-6"> <label for="time_in" class="col-sm-12 control-label" style="text-align:left;">Status</label> <div class="col-sm-12"> <div class="bootstrap-timepicker"> <select class="form-control" id="status" name="status" required> <option <?php if($fetch['status']=='Active'){?> selected="selected" <?php } ?>>Active</option> <option <?php if($fetch['status']=='Inactive'){?> selected="selected" <?php } ?>>Inactive</option> </select> </div> </div> </div> </div> <div style="width:100%;" class="form-horizontal col-sm-12"> <button type="submit" class="btn btn-primary btn-flat" name="editbtn"><i class="fa fa-save"></i> Update</button> </div> </div> </div> </div> </form> </div> </section> </div> <!------------------------------> <?php include 'includes/footer.php'; ?> <?php include 'includes/scripts.php'; ?> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script> <script src='src/jquery-customselect.js'></script> <link href='src/jquery-customselect.css' rel='stylesheet' /> <link href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/smoothness/jquery-ui.min.css" rel="stylesheet" type="text/css" /> <script> function deltr(id) { $('#slno'+id).parents("tr").remove(); } $("#delete").on('click', function() { $('.case:checkbox:checked').parents("tr").remove(); }); var i=<?php echo $sl+1; ?>; var sum=1; $("#addmore").on('click',function(){ var data="<tr><td><input type='hidden' value='"+i+"' name='slno[]' id='slno"+i+"'><span style='cursor:pointer; font-size:16px;' onClick='deltr("+i+")'><i class='fa fa-trash-o' aria-hidden='true'></i></span></td>"; data +="<td><select class='form-control' id='unitid"+i+"' name='unitid[]' onChange='chk_product("+i+")' style='width:200px;' required><option value=''>-Select-</option><?php $queryUnits = $conn->query("SELECT * FROM rk_fabric where company='".$_GET['lessor']."' ORDER BY name ASC"); while($rowUnits = $queryUnits->fetch_assoc()){ $agreementtype = $conn->query("SELECT * FROM position WHERE id='".$rowUnits['agreementtype']."'")->fetch_assoc(); ?><option value='<?php echo $rowUnits['id']; ?>'><?php echo $rowUnits['name']; ?> - <?php echo $agreementtype['description']; ?></option><?php } ?></select></td><td><input type='text' class='form-control' id='billingfor"+i+"' name='billingfor[]' value='' readonly></td><td><input type='text' class='form-control' id='unitarea"+i+"' name='unitarea[]' value='' onKeyUp='chkcal("+i+")' readonly></td><td><input type='text' class='form-control' id='rate"+i+"' name='rate[]' onKeyUp='chkcal("+i+")' value=''></td><td><input type='text' class='form-control' id='amount"+i+"' name='amount[]' onKeyUp='chkmanualcal("+i+")' value=''></td><td><input type='text' class='form-control' id='gstamount"+i+"' name='gstamount[]' value='' readonly></td><td><input type='text' class='form-control apsum' id='netamount"+i+"' name='netamount[]' value='' readonly></td></tr>"; $('#table').append(data); sum=sum+i; i++; }); function select_all() { $('input[class=case]:checkbox').each(function(){ if($('input[class=check_all]:checkbox:checked').length == 0){ $(this).prop("checked", false); } else { $(this).prop("checked", true); } }); } function chk_product(id) { if($('#unitid'+id).val() != "") { $.post("load_unit_details.php", { product_code : $('#unitid'+id).val()}, function(data) { var brokenstring = data.split('@||@'); if(brokenstring[0] > 0) { var brost = brokenstring[1].split('||'); $('#unitarea'+id).val(brost[3]); $('#billingfor'+id).val(brost[4]); chkbillingforamount(id); } else { alert("Sorry! No unit found . Please select correctly"); $('#unitarea'+id).val(''); } }); } else{ alert("Sorry! No unit found . Please select correctly"); $('#unitarea'+id).val(''); } } function chkcal(id){ var unitarea = 0; var rate = 0; var amount = 0; var gstamount = 0; var netamount = 0; if (parseFloat($('#unitarea'+id).val()) > 0) { unitarea = parseFloat($('#unitarea'+id).val()); } if (parseFloat($('#rate'+id).val()) > 0) { rate = parseFloat($('#rate'+id).val()); } amount = (parseFloat(unitarea) * parseFloat(rate)); gstamount = (parseFloat(amount) * parseFloat(18/100)); netamount = (parseFloat(amount) + parseFloat(gstamount)); $('#amount'+id).val(parseFloat(amount).toFixed(2)); $('#gstamount'+id).val(parseFloat(gstamount).toFixed(2)); $('#netamount'+id).val(parseFloat(netamount).toFixed(2)); $('#grosstotal').val(0); var grosstotal=0; $(".grosstotal").each(function(){ if(parseFloat($(this).val())>0) grosstotal += parseFloat($(this).val()); }); $('#grosstotal').val(parseFloat(grosstotal).toFixed(2)); chkbillingforamount(id); } function chkmanualcal(id){ var amount = 0; var gstamount = 0; var netamount = 0; if (parseFloat($('#amount'+id).val()) > 0) { amount = parseFloat($('#amount'+id).val()); } gstamount = (parseFloat(amount) * parseFloat(18/100)); netamount = (parseFloat(amount) + parseFloat(gstamount)); $('#gstamount'+id).val(parseFloat(gstamount).toFixed(2)); $('#netamount'+id).val(parseFloat(netamount).toFixed(2)); $('#grosstotal').val(0); var grosstotal=0; $(".grosstotal").each(function(){ if(parseFloat($(this).val())>0) grosstotal += parseFloat($(this).val()); }); $('#grosstotal').val(parseFloat(grosstotal).toFixed(2)); chkbillingforamount(id); } function chkbillingforamount(id) { $.post("chkbillingforamount.php", { soltid : $('#soltid').val(),slno : $('#slno'+id).val(),unitid : $('#unitid'+id).val(),billingfor : $('#billingfor'+id).val(),unitarea : $('#unitarea'+id).val(),rate : $('#rate'+id).val(),amount : $('#amount'+id).val(),gstamount : $('#gstamount'+id).val(),netamount : $('#netamount'+id).val()}, function(data) { $('#billforgroupHtml').html(data); }); } function getUnitstable() { if($('#lessor').val()=='') { alert("Please select Lessor"); } else { $.post("units-table-ajaxfile.php", { lessor : $('#lessor').val(),billingforid : $('#billingforid').val(),lessee : $('#lessee').val()}, function(data) { $('#billforSectiondiv').append(data); $('#grosstotalDiv').show(); }); } } </script> <script src="https://cdn.tiny.cloud/1/7pmfugg3c18u0q5hj2gyidkk93p5sju1huvuz4v8y6y62mus/tinymce/6/tinymce.min.js" referrerpolicy="origin"></script> <script> tinymce.init({ selector: '#termination' }); </script> <script> tinymce.init({ selector: '#securitydeposit' }); </script> </body> </html>