EVOLUTION-NINJA
Edit File: gss_receipt.php
<!DOCTYPE HTML> <html lang="en-US"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> <title>GSS Receipt</title> <link rel="stylesheet" type="text/css" href="<?php echo base_url('public/assets/css/main.css');?>"/> <link rel="stylesheet" type="text/css" href="<?php echo base_url('public/assets/css/bootstrap.min.css');?>" /> <link rel="stylesheet" type="text/css" href="<?php echo base_url('public/assets/css/font-awesome.min.css');?>" /> <script type="text/javascript" src="<?php echo base_url('public/assets/js/jquery-2.2.4.min.js');?>"></script> <script type="text/javascript" src="<?php echo base_url('public/assets/js/bootstrap.min.js');?>"></script> </head> <body class="gss_body" id="gss_body" style="width:900px;display:block;margin:auto !important;"> <p class="booking_ids" style="display:none;"> <?= service('uri')->getSegment(2); ?> </p> <div class="row print_div" id="print_div"> <div class="row row_one"> <h2 class="gss_redline">GSS Project Consultants Pvt. Ltd.</h2> <img src="<?php echo base_url('assets/images/header_line.png');?>" class="img-responsive center-block"> <h2 style="font-size: 28px;line-height: 1.3; ">Project Name: <?php echo $project->project_name;?><br>Address: <?php echo $project->land_owner_address;?></h2> </div> <div class="row row_two"> <img src="<?php echo base_url('assets/images/line.png');?>" class="img-responsive center-block"> <div class="table_one"> <table class="table"> <tr> <!-- <td style="width: 25%;"><p>Date: <?php $date = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $todays_date = $date->format('d-m-Y'); echo $todays_date;?></p></td>--> <td style="width: 50%;"><h3 style="text-align:center;">RECEIPT</h3></td> <!-- <td style="text-align:right;"><p></p></td> --> </tr> </table> </div> <img src="<?php echo base_url('assets/images/line.png');?>" class="img-responsive center-block"> </div> <div class="row row_three"> <div class="table_one"> <table class="table"> <tr> <td><p style="padding-left: 50px;">Client Name: <?php echo $site_result[0]['customer_name'];?></p></td> <td><p style="padding-right: 50px;text-align:right;">Site No: <?php echo $site_result[0]['site_number'];?></p></td> </tr> </table> </div> </div> <div class="row row_four"> <table class="table table-bordered"> <tbody> <tr> <td style="width:15%;">Payment Date</td> <!-- <td style="width:18%;">Receipt No</td> --> <td style="width:18%;">Amount</td> <td style="width:18%;">Payment Type</td> <td style="width:25%;">Particulars</td> </tr> <tr> <td class="booking_date1"><?php $date= date("d-m-Y", strtotime($site_result[0]['booking_date1'])); if($date == '0000-00-00' || $date =='30-11--0001' || $date == '01-01-1970'){echo "";}else {echo $date;}?></td> <!-- <td class="booking_ack_no1" style="width: 20%;"><?php echo "Receipt No: 01"?></td> --> <td class="booking_amount1"><?php $num=$site_result[0]['booking_amount1'];$explrestunits = "" ; if(strlen($num)>3) { $lastthree = substr($num, strlen($num)-3, strlen($num)); $restunits = substr($num, 0, strlen($num)-3); // extracts the last three digits $restunits = (strlen($restunits)%2 == 1)?"0".$restunits:$restunits; // explodes the remaining digits in 2's formats, adds a zero in the beginning to maintain the 2's grouping. $expunit = str_split($restunits, 2); for($i=0; $i<sizeof($expunit); $i++) { // creates each of the 2's group and adds a comma to the end if($i==0) { $explrestunits .= (int)$expunit[$i].","; // if is first value , convert into integer } else { $explrestunits .= $expunit[$i].","; } } $thecash = $explrestunits.$lastthree; } else { $thecash = $num; } echo 'Rs. '.$thecash.'/-'; ?></td> <td class="booking_count1"><?php echo 'Booking Amount 1';?></td> <?php $cheque_date = date('d-m-Y',strtotime($site_result[0]['check_date']));?> <?php $online_date = date('d-m-Y',strtotime($site_result[0]['online_date'])); ?> <?php $dd_date1 = date('d-m-Y',strtotime($site_result[0]['dd_date'])); ?> <?php $paytm_date1 = date('d-m-Y',strtotime($site_result[0]['paytm_online_date'])); ?> <?php $upi_date1 = date('d-m-Y',strtotime($site_result[0]['upi_online_date'])); ?> <td class="booking_payment_particulars1"><?php $bpt = $site_result[0]['booking_payment_type']; if($bpt == 'Online Payment'){ echo 'NEFT/RTGS'.'<br>'; }else if($bpt == 'Paytm Payment'){ echo 'UPI/Direct Payment'.'<br>'; }else if($bpt == 'UPI Payment'){ echo 'Credit/Debit Payment'.'<br>'; }else{ echo $bpt.'<br>';} if($bpt == 'Cheque'){ if(!empty($site_result[0]['check_no'])) { echo ' No. : '.$site_result[0]['check_no'].'<br>'; } else { echo 'No.:'.'<br>'; } if($site_result[0]['check_date'] == '0000-00-00' || $site_result[0]['check_date'] =='30-11--0001' || $site_result[0]['check_date'] == '1970-01-01') { echo ' '.'<br>'; } else { echo ' Date : '.$cheque_date.'<br>'; } if(!empty($site_result[0]['bank_name'])) { echo ' Bank Name : '.$site_result[0]['bank_name'].'<br>'; } else { } } else if($bpt == 'Online Payment') { if(!empty($site_result[0]['vtr_no'])) { echo ' No. : '.$site_result[0]['vtr_no'].'<br>'; } else { echo ' No. : '.'<br>'; } if($site_result[0]['online_date'] != '0000-00-00') { echo ' Date : '.$online_date.'<br>'; } else if($site_result[0]['online_date'] == '0000-00-00' || $site_result[0]['online_date'] =='30-11--0001' || $site_result[0]['online_date'] == '1970-01-01') { echo ''; } else { } } else if($bpt == 'DD') { if(!empty($site_result[0]['dd_no'])) { echo ' No. : '.$site_result[0]['dd_no'].'<br>'; } else { echo 'No.'.'<br>'; } if($site_result[0]['dd_date'] != '0000-00-00') { echo ' Date : '.$dd_date1.'<br>'; } else if($site_result[0]['dd_date'] == '0000-00-00' || $site_result[0]['dd_date'] =='30-11--0001' || $site_result[0]['dd_date'] == '1970-01-01') { echo ''; } else { } if(!empty($site_result[0]['dd_bank'])) { echo ' Bank Name : '.$site_result[0]['dd_bank'].'<br>'; } else { } } else if($bpt == 'Paytm Payment') { if(!empty($site_result[0]['paytm_ref_no'])) { echo ' No. : '.$site_result[0]['paytm_ref_no'].'<br>'; } else { } if($site_result[0]['paytm_online_date'] != '0000-00-00' ) { echo ' Date : '.$paytm_date1.'<br>'; } else if($site_result[0]['paytm_online_date'] == '0000-00-00' || $site_result[0]['paytm_online_date'] =='30-11--0001' || $site_result[0]['paytm_online_date'] == '1970-01-01') { echo ''; } else { } } else if($bpt == 'UPI Payment') { if(!empty($site_result[0]['upi_ref_no'])) { echo ' No. : '.$site_result[0]['upi_ref_no'].'<br>'; } else { echo 'No.'.'<br>'; } if($site_result[0]['upi_online_date'] != '0000-00-00') { echo ' Date : '.$upi_date1.'<br>'; } else if($site_result[0]['upi_online_date'] == '0000-00-00' || $site_result[0]['upi_online_date'] =='30-11--0001' || $site_result[0]['upi_online_date'] == '1970-01-01') { echo ''; } else { } } ?></td> </tr> <?php if(!empty($site_result[0]['booking_amount2'])) { ?> <tr> <!-- <td class="booking_date2"><?php echo date("d-m-Y", strtotime($site_result[0]['booking_date2']));?></td> --> <td class="booking_date2"><?php $date= date("d-m-Y", strtotime($site_result[0]['booking_date2'])); if($date == '0000-00-00' || $date =='30-11--0001' || $date == '1970-01-01'){echo "";}else {echo $date;}?></td> <!-- <td class="booking_ack_no2" style="width: 20%;"><?php echo "Receipt No: 02"?></td> --> <td class="booking_amount2"><?php $num=$site_result[0]['booking_amount2'];$explrestunits = "" ; if(strlen($num)>3) { $lastthree = substr($num, strlen($num)-3, strlen($num)); $restunits = substr($num, 0, strlen($num)-3); // extracts the last three digits $restunits = (strlen($restunits)%2 == 1)?"0".$restunits:$restunits; // explodes the remaining digits in 2's formats, adds a zero in the beginning to maintain the 2's grouping. $expunit = str_split($restunits, 2); for($i=0; $i<sizeof($expunit); $i++) { // creates each of the 2's group and adds a comma to the end if($i==0) { $explrestunits .= (int)$expunit[$i].","; // if is first value , convert into integer } else { $explrestunits .= $expunit[$i].","; } } $thecash = $explrestunits.$lastthree; } else { $thecash = $num; } echo 'Rs. '.$thecash.'/-'; ?></td> <td class="booking_count2"><?php echo 'Booking Amount 2';?></td> <?php $cheque_date2 = date('d-m-Y',strtotime($site_result[0]['check_date2']));?> <?php $online_date2 = date('d-m-Y',strtotime($site_result[0]['online_date2'])); ?> <?php $dd_date2 = date('d-m-Y',strtotime($site_result[0]['dd_date2'])); ?> <?php $paytm_date2 = date('d-m-Y',strtotime($site_result[0]['paytm_online_date2'])); ?> <?php $upi_date2 = date('d-m-Y',strtotime($site_result[0]['upi_online_date2'])); ?> <td class="booking_payment_particulars2"><?php $bpt = $site_result[0]['booking_payment_type2']; if($bpt == 'Online Payment'){ echo 'NEFT/RTGS'.'<br>'; }else if($bpt == 'Paytm Payment'){ echo 'UPI/Direct Payment'.'<br>'; }else if($bpt == 'UPI Payment'){ echo 'Credit/Debit Payment'.'<br>'; }else{ echo $bpt.'<br>'; } if($bpt == 'Cheque') { if(!empty($site_result[0]['check_no2'])) { echo ' No. : '.$site_result[0]['check_no2'].'<br>'; } else { } if($site_result[0]['check_date2'] != '0000-00-00') { echo ' Date : '.$cheque_date2.'<br>'; } else if($site_result[0]['check_date2'] == '0000-00-00' || $site_result[0]['check_date2'] =='30-11--0001' || $site_result[0]['check_date2'] == '1970-01-01') { echo ''; } else { } if(!empty($site_result[0]['bank_name2'])) { echo ' Bank Name : '.$site_result[0]['bank_name2'].'<br>'; }else { } } else if($bpt == 'Online Payment') { if(!empty($site_result[0]['vtr_no2'])) { echo ' No. : '.$site_result[0]['vtr_no2'].'<br>'; } else { } if($site_result[0]['online_date2'] != '0000-00-00') { echo ' Date : '.$online_date2.'<br>'; } else if($site_result[0]['online_date2'] == '0000-00-00' || $site_result[0]['online_date2'] =='30-11--0001' || $site_result[0]['online_date2'] == '1970-01-01') { echo ''; } else { } } else if($bpt == 'DD'){ if(!empty($site_result[0]['dd_no2'])) { echo ' No. : '.$site_result[0]['dd_no2'].'<br>'; } else { } if($site_result[0]['dd_date2'] != '0000-00-00') { echo ' Date : '.$dd_date2.'<br>'; } else if($site_result[0]['dd_date2'] == '0000-00-00' || $site_result[0]['dd_date2'] =='30-11--0001' || $site_result[0]['dd_date2'] == '1970-01-01') { echo ''; } else { } if(!empty($site_result[0]['dd_bank2'])) { echo ' Bank Name : '.$site_result[0]['dd_bank2'].'<br>'; } else { } } else if($bpt == 'Paytm Payment') { if(!empty($site_result[0]['paytm_ref_no2'])) { echo ' No. : '.$site_result[0]['paytm_ref_no2'].'<br>'; } else { } if($site_result[0]['paytm_online_date2'] != '0000-00-00') { echo ' Date : '.$paytm_date2.'<br>'; } else if($site_result[0]['paytm_online_date2'] == '0000-00-00' || $site_result[0]['paytm_online_date2'] == '30-11--0001' || $site_result[0]['paytm_online_date2'] == '1970-01-01') { echo ''; } else { } } else if($bpt == 'UPI Payment') { if(!empty($site_result[0]['upi_ref_no2'])) { echo ' No. : '.$site_result[0]['upi_ref_no2'].'<br>'; } else { } if($site_result[0]['upi_online_date2'] != '0000-00-00') { echo ' Date : '.$upi_date2.'<br>'; } else if($site_result[0]['upi_online_date2'] == '0000-00-00' || $site_result[0]['upi_online_date2'] =='30-11--0001' || $site_result[0]['upi_online_date2'] == '1970-01-01') { echo ''; } else { } } ?> </td> </tr> <?php } ?> </tbody> </table> <p>(The validity of this receipt is subject to realization of all <br>cheques/demand draft/account transfter)</p> <p>This is a computer generated receipt. Signature is not required.</p> </div> <div class="row row_five"> <p>For GSS Project Consultants</p> <p style="padding-left:30px;padding-top:50px;">Authorized Signatory</p> </div> </div> <div class="row row_four print_mail" style="display:none;"> <p><button type="button" class="print">Print</button> <button type="button" class="mail">Mail</button> <button type="button" class="back">Back</button> <!--<button type="button" class="download">Download</button>--></p> </div> </body> </html> <script type="text/javascript"> $(document).ready(function() { $('.print_mail').show(); }); $('.print').click(function() { $('.print_mail').hide(); window.print(); window.close(); window.location.href = "<?php echo site_url('booked-sites');?>"; }); $('.back').click(function(){ window.location.href = "<?php echo site_url('booked-sites');?>"; }); $('.mail').click(function() { /* var ack_no1 = $('.booking_ack_no1').text(); var ack_no2= $('.booking_ack_no2').text();*/ var receipt_type = $('.gss_redline').text(); var booking_date1 = $('.booking_date1').text(); var booking_amount1 = $('.booking_amount1').text(); var booking_count = $('.booking_count1').text(); var booking_payment_particulars1 = $('.booking_payment_particulars1').text(); var booking_date2 = $('.booking_date2').text(); //alert(booking_date2); if(booking_date2 == undefined) { var booking_date2 = '00-00-0000'; } else { var booking_date2 = $('.booking_date2').text(); } var booking_amount2 = $('.booking_amount2').text(); if(booking_amount2 == undefined) { var booking_amount2 = '0'; } else { var booking_amount2 = $('.booking_amount2').text(); } var booking_count2 = $('.booking_count2').text(); if(booking_count2 == undefined) { var booking_count2 = '0'; } else { var booking_count2 = $('.booking_count2').text(); } var booking_payment_particulars2 = $('.booking_payment_particulars2').text(); if(booking_payment_particulars2 == undefined) { var booking_payment_particulars2 = '0'; } else { var booking_payment_particulars2 = $('.booking_payment_particulars2').text(); } var booking_ids = $('.booking_ids').text(); $.ajax({ type : 'post', url : "<?php echo site_url('send-mail-receipt');?>", data : {'booking_ids':booking_ids, 'receipt_type':receipt_type, 'booking_date1':booking_date1, 'booking_date2':booking_date2, 'booking_amount1':booking_amount1, 'booking_amount2':booking_amount2, 'booking_count':booking_count, 'booking_count2':booking_count2, 'booking_payment_particulars1':booking_payment_particulars1, 'booking_payment_particulars2':booking_payment_particulars2}, success:function(response){ response=jQuery.parseJSON(response); console.log(response); if(response.result == 1) { var inserted_id = response.message; window.location.href = "<?php echo site_url('view_mail_content');?>"+'/'+inserted_id; } } }) }); </script> <style> .gss_body { border-left:10px solid #E3000F; padding-left: 100px !important; padding-right: 100px !important; padding-top: 50px !important; padding-bottom: 50px !important; } .row_one { padding-bottom:15px; position:relative; } .row_one h2 { text-align:center; } .gss_redline { position:relative; padding-bottom:5px; } .row_two { padding-bottom:15px; padding-top:15px; position:relative; } .row_two h3 { margin-bottom:0px; margin-top:0px; text-align:center; color:#E40025; font-weight:bold; } .row_two p, .row_three p, .row_five p { margin-bottom:0px; margin-top:0px; font-size:18px; font-weight:bold; padding-top: 3px; } .row_three { padding-bottom:20px; } .table-bordered>tbody>tr>td { border: 2px solid #e40025 !important; text-align:center !important; vertical-align:middle !important; font-size:18px !important; font-weight:bold !important; } .row_four p { text-align:center; font-weight:bold; font-size:18px; line-height:1.8; } .row_five { padding-top:50px; } .table_one>table { margin-bottom:0px !important; } .table_one>.table>tbody>tr>td { border-top: transparent !important; } </style>