EVOLUTION-NINJA
Edit File: order_details.php
<?php //echo '<pre>'; //print_r($fetch_preview2); //echo '</pre>'; // echo '<pre>'; // print_r($material4); // echo '</pre>'; // die(); ?> <html lang="en-Us"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Full Order Details</title> <link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/css/style.min.css');?>"> <link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/css/bootstrap.min.css');?>"> <link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/css/font-awesome.min.css');?>"> <script type="text/javascript" src="<?php echo base_url('assets/js/jquery-3.2.1.min.js');?>"></script> <script src="<?php echo base_url('assets/js/bootstrap.min.js');?>"></script> </head> <body> <button type="button" id="booking_print" style=" margin-top: 13px; right:100px; padding-top: 2px; padding-bottom: 1px; padding-left: 15px; padding-right: 15px; background: rgb(72,91,127); color: white; font-size: 22px;position:absolute;">Print</button> <?php if($indent_p == 'indent_preview') { ?> <span id="back_button" class="close-right" ><a href="<?php echo base_url('marketing/transactions_order_details?prop_id=1');?>" style="font-size: 22px;border: 1px solid;padding-bottom: 8px; margin-top: 10%; text-decoration: none; padding-top: 1px; padding-right: 12px; padding-left: 12px;background: rgb(72,91,127);color: white;margin-top:10%;text-decoration:none;position:absolute;right:0;margin-right: 24px;margin-top: 13px;">Back</a></span> <?php } else if($indent_p == 'today_preview') { ?> <span id="back_button" class="close-right" ><a href="<?php echo base_url('marketing/transactions_order_details?prop_id=2');?>" style="font-size: 22px;border: 1px solid;padding-bottom: 8px; margin-top: 10%; text-decoration: none; padding-top: 1px; padding-right: 12px; padding-left: 12px;background: rgb(72,91,127);color: white;margin-top:10%;text-decoration:none;position:absolute;right:0;margin-right: 24px;margin-top: 13px;">Back</a></span> <?php } else if($indent_p == 'monthly_preview') { ?> <span id="back_button" class="close-right" ><a href="<?php echo base_url('marketing/transactions_order_details?prop_id=3');?>" style="font-size: 22px;border: 1px solid;padding-bottom: 8px; margin-top: 10%; text-decoration: none; padding-top: 1px; padding-right: 12px; padding-left: 12px;background: rgb(72,91,127);color: white;margin-top:10%;text-decoration:none;position:absolute;right:0;margin-right: 24px;margin-top: 13px;">Back</a></span> <?php } else if($indent_p == 'year_preview') { ?> <span id="back_button" class="close-right" ><a href="<?php echo base_url('marketing/transactions_order_details?prop_id=4');?>" style="font-size: 22px;border: 1px solid;padding-bottom: 8px; margin-top: 10%; text-decoration: none; padding-top: 1px; padding-right: 12px; padding-left: 12px;background: rgb(72,91,127);color: white;margin-top:10%;text-decoration:none;position:absolute;right:0;margin-right: 24px;margin-top: 13px;">Back</a></span> <?php } ?> <div class="mid-wrk"> <div class="mid-work" > <h3 style="text-align:center;margin-top:1%;margin-bottom:2%;">FULL ORDER DETAILS</h3> <table> <style> .mid-work, table { font-family:times !important; font-size:13px; } </style> <div class="row"> <div class="col-sm-6" style="padding-top: 30px;"> <div class="col-sm-6"> <p> <?php if(empty($address)) { ?> <?php } else {?> <?php echo $address->customerID; ?><br> <?php echo $address->customerName; ?><br/><?php echo $address->customerAddress; if($address->pincode !="") {?><br/> <?php echo $address->city."-".$address->pincode; } ?><br/> <?php echo strtoupper($address->country); ?> <?php } ?> </p> </div> <div class="col-sm-6"> <p> Order Date:  <?php $newDate = date("d-m-Y", strtotime($fetch_preview1->orderDate)); echo $newDate; ?><br> Order Delivery Date:  <?php $newDate1 = date("d-m-Y", strtotime($fetch_preview1->deliveryDate)); echo $newDate1; ?><br> Customer Order No:  <?php echo $fetch_preview1->orderNo; ?> </p> </div> </div> <div class="col-sm-6"> <div class="col-sm-6" style="padding-top: 30px;"> <p> Contract Type:   <?php if($fetch_main2->contractType != ""){ echo $fetch_main2->contractType; } ?><br> Currency:   <?php echo $fetch_preview1->currency; ?><br> OSL No:   <?php echo $fetch_preview1->oslNo; ?> </p> </div> <div class="col-sm-6"> <img src="<?php echo base_url('assets/img/preview_logo.png');?>" class="img-responsive" style="float:right;width:157px !important;margin-right: 12px;"> </div> </div> </div> </table> <?php $a=1;$total=0;$tab=0;$i = 0; foreach($fetch_preview2 as $preview){ $h=$preview->product_id; ?> <table border="1" class="table table-bordered table-striped table-hover table-condensed table-responsive" style="margin-top:10px;border:1;border-spacing:0 !important;"> <tbody> <tr> <th >SUB NO</th> <th style="width:10%;">Order Type</th> <th style="width:10%;"> <?php echo $preview->subOrderType; ?> </th> <th style="width:10%;">SlNo</th> <?php $j = 0; foreach($shades_preview2 as $shades){ if($shades->subCode == $preview->subCode){ $j++; ?> <td style="width:10%;"> <?php echo $j; ?> </td> <?php } } ?> </tr> <tr > <td rowspan="3" style="width:10%;"> <?php foreach ($fetch_pre as $pre) { if($preview->subCode != $tab) { echo $preview->subCode; } break; } $tab=$preview->subCode; ?> </td> <th style="width:10%;">Width<br>(CMS)</th> <td> <?php echo $preview->width; ?> </td> <th style="width:10%;">Our shade</th> <?php foreach($shades_preview2 as $shades){ if($shades->subCode == $preview->subCode){ ?> <td style="width:10%;"> <?php echo $shades->ourShade; ?> </td> <?php } } ?> </tr> <tr> <th>Currency</th> <td style="width:10%;"> <?php echo $currency; ?> </td> <th>Buyer Shade</th> <?php foreach($shades_preview2 as $shades){ if($shades->subCode == $preview->subCode){ ?> <td style="width:10%;"> <?php echo $shades->buyerShade; ?> </td> <?php } } ?> <td style="width:10%;"></td> <td style="width:10%;"></td> </tr> <tr> <th>RATE</th> <td style="width:10%;"> <?php echo $preview->unitPrice; ?> </td> <th>Quantity</th> <?php foreach($shades_preview2 as $shades){ if($shades->subCode == $preview->subCode){ ?> <td style="width:10%;"> <?php echo $shades->quantity." ".$preview->unit; ?> </td> <?php } } ?> </tr> <tr> <table border="1" class="table table-bordered table-striped table-hover table-condensed table-responsive" style="margin-top:10px;border:1;border-spacing:0 !important;"> <tr> <th style="width:10%;"></th> <th style="width:10%;">Width</th> <th style="width:10%;">Product</th> <th style="width:10%;">Consumption</th> <?php foreach($shades_preview2 as $shades){ if($shades->subCode == $preview->subCode){ ?> <th style="width:10%;"> <?php echo $shades->ourShade; ?></th> <?php } } ?> <th style="width:10%;">Total</th> <th style="width:10%;">Unit</th> </tr> <?php // foreach($shades_preview2 as $shades){ // $g=$shades->product_id; foreach($material4 as $e){ foreach($e as $w){ if($h==$w->product_id){ ?> <tr> <td style="width:10%; border-bottom:1px solid transparent !important;border-top:1px solid transparent !important;border-left:1px solid transparent !important;border-right:1px solid transparent !important;"> </td> <td style="width:10%;"> <?php echo $w->width; ?> </td> <td style="width:10%;"> <?php echo $w->product; ?> </td> <td style="width:10%;"> <?php echo $w->consumption; ?> </td> <?php $total = 0; foreach($shades_preview2 as $shades){ if($shades->subCode == $preview->subCode){ $total_quantity = $w->consumption*$shades->quantity; ?> <td style="width:10%;"> <?php echo $total_quantity; $total += $total_quantity; } } ?> </td> <td style="width:10%;" id = "total"> <?php echo $total; ?> </td> <td style="width:10%;"><?php echo $w->unit;?></td> </tr> <?php }} }?> </table> </tr> </table> <?php } ?> <div class="row"> <div class="col-sm-6"> <p>Customer Instruction:   <?php echo $fetch_preview1->customerComments; ?></p> </div> <div class="col-sm-6"> <p>Sub Total:  <br> <?php $gtotal = 0; foreach ($fetch_pre as $key => $value){ $gtotal += $value->subtotal; echo "For Subcode".$value->subCode .": ".$value->subtotal." ".$fetch_preview_unit[$key]->unit."<br>"; } ?></p> <p>Grand Total: <?php if(isset($gtotal)){ echo $gtotal ." "; if(isset($preview)){ echo $preview->unit; }} ?></p> </div> </div> </div> </div> <div class="mid-work hidden" id="print_report"> <h3 style="text-align:center;margin-top:1%;margin-bottom:2%;">FULL ORDER DETAILS</h3> <table> <style> .mid-work, table { font-family:times !important; font-size:13px; } </style> <!--<tr> <?php echo $address->customerID; ?> </tr>--> <tr > <?php if(empty($address->customerID)) { ?> <td style="width:150px;height:5px;padding:0 !important"></td> <td style="width:150px;height:5px;padding:0 !important">Order Date:  <?php $newDate = date("d-m-Y", strtotime($fetch_preview1->orderDate)); echo $newDate; ?></td> <td style="width:400px;height:5px;padding:0 !important">Contract Type:   <?php if($fetch_main2->contractType != ""){ echo $fetch_main2->contractType; } ?></td> <td style="width:250px;" rowspan="4"><img src="<?php echo base_url('assets/img/1.jpg');?>" class="img-responsive" style="background-color:#485B7F;float:right;width: 100px;margin-right: 12px;"></td> <?php } else {?> <td style="width:400px;height:5px;padding:0 !important"><?php echo $address->customerID; ?> </td> <td style="width:150px;height:5px;padding:0 !important">Order Date:  <?php $newDate = date("d-m-Y", strtotime($fetch_preview1->orderDate)); echo $newDate; ?></td> <td style="width:400px;height:5px;padding:0 !important">Contract Type:   <?php if($fetch_main2->contractType != ""){ echo $fetch_main2->contractType; } ?></td> <td style="width:250px;" rowspan="4"><img src="<?php echo base_url('assets/img/preview_logo.png');?>" class="img-responsive" style="background-color:#485B7F;float:right;width: 120px;margin-right: 12px;"></td> <?php } ?> </tr> <tr style=""> <?php if(empty($address->customerName)) { ?> <td style="width:150px;height:5px;padding:0 !important"></td> <td style="width:550px;height:5px;padding:0 !important">Order Delivery Date:  <?php $newDate1 = date("d-m-Y", strtotime($fetch_preview1->deliveryDate)); echo $newDate1; ?></td> <!--<td>Customer Order No:  <?php echo $fetch_preview1->orderNo; ?></td> <td>OSL No:   <?php echo $fetch_preview1->oslNo; ?></td> --> <td style="width:400px;height:5px;padding:0 !important">Currency:   <?php echo $fetch_preview1->currency; ?></td> <?php } else {?> <td style="width:450px;height:5px;padding:0 !important"></td> <td style="width:650px;height:5px;padding:0 !important">Order Delivery Date:  <?php $newDate1 = date("d-m-Y", strtotime($fetch_preview1->deliveryDate)); echo $newDate1; ?></td> <!--<td>Customer Order No:  <?php echo $fetch_preview1->orderNo; ?></td> <td>OSL No:   <?php echo $fetch_preview1->oslNo; ?></td> --> <td style="width:400px;height:5px;padding:0 !important">Currency:   <?php echo $fetch_preview1->currency; ?></td> <?php } ?> </tr> <tr style="height:10px;"> <?php if(empty($address->customerAddress)) { ?> <td style="width:150px;height:5px;"></td> <td style="width:550px;height:5px;">Customer Order No:  <?php echo $fetch_preview1->orderNo; ?></td> <td style="width:400px;height:5px;">OSL No:   <?php echo $fetch_preview1->oslNo; ?></td> <?php } else {?> <td style="width:400px;height:5px;"> <td style="width:550px;height:5px;">Customer Order No:  <?php echo $fetch_preview1->orderNo; ?></td> <td style="width:400px;height:5px;">OSL No:   <?php echo $fetch_preview1->oslNo; ?></td> <?php } ?> </tr> <tr style="height:10px;"> <?php if(empty($address->country)) { ?> <td style="width:150px;height:5px;"></td> <td style="width:550px;height:5px;"></td> <td style="width:400px;height:5px;"></td> <?php } else {?> <td style="width:400px;height:5px;"> <?php echo strtoupper($address->country); ?></td> <td style="width:550px;height:5px;"></td> <td style="width:400px;height:5px;"></td> <?php } ?> </tr> </table> <?php $a=1;$total=0;$tab=0;$i = 0; foreach($fetch_preview2 as $preview){ $h=$preview->product_id; ?> <table border="1" class="table table-bordered table-striped table-hover table-condensed table-responsive" style="margin-top:10px;border-spacing:0 !important;"> <tr> <th >SUB NO</th> <th style="width:10%;">Order Type</th> <th style="width:10%;"> <?php echo $preview->subOrderType; ?> </th> <th style="width:10%;">SlNo</th> <?php $j = 0; foreach($shades_preview2 as $shades){ if($shades->subCode == $preview->subCode){ $j++; ?> <td style="width:10%;"> <?php echo $j; ?> </td> <?php } } ?> </tr> <tr > <td rowspan="3" style="width:10%;"> <?php foreach ($fetch_pre as $pre) { if($preview->subCode != $tab) { echo $preview->subCode; } break; } $tab=$preview->subCode; ?> </td> <th style="width:10%;">Width<br>(CMS)</th> <td> <?php echo $preview->width; ?> </td> <th style="width:10%;">Our shade</th> <?php foreach($shades_preview2 as $shades){ if($shades->subCode == $preview->subCode){ ?> <td style="width:10%;"> <?php echo $shades->ourShade; ?> </td> <?php } } ?> </tr> <tr> <th>Currency</th> <td style="width:10%;"> <?php echo $currency; ?> </td> <th>Buyer Shade</th> <?php foreach($shades_preview2 as $shades){ if($shades->subCode == $preview->subCode){ ?> <td style="width:10%;"> <?php echo $shades->buyerShade; ?> </td> <?php } } ?> <td style="width:10%;"></td> <td style="width:10%;"></td> </tr> <tr> <th>RATE</th> <td style="width:10%;"> <?php echo $preview->unitPrice; ?> </td> <th>Quantity</th> <?php foreach($shades_preview2 as $shades){ if($shades->subCode == $preview->subCode){ ?> <td style="width:10%;"> <?php echo $shades->quantity." ".$preview->unit; ?> </td> <?php } } ?> </tr> <tr> <table border="1" class="table table-bordered table-striped table-hover table-condensed table-responsive" style="margin-top:10px;border:1;border-spacing:0 !important;"> <tr> <th style="width:10%;"></th> <th style="width:10%;">Width</th> <th style="width:10%;">Product</th> <th style="width:10%;">Consumption</th> <?php foreach($shades_preview2 as $shades){ if($shades->subCode == $preview->subCode){ ?> <th style="width:10%;"> <?php echo $shades->ourShade; ?></th> <?php } } ?> <th style="width:10%;">Total</th> <th style="width:10%;">Unit</th> </tr> <?php // foreach($shades_preview2 as $shades){ // $g=$shades->product_id; foreach($material4 as $e){ foreach($e as $w){ if($h==$w->product_id){ ?> <tr> <td style="width:10%; border-bottom:1px solid transparent !important;border-top:1px solid transparent !important;border-left:1px solid transparent !important;border-right:1px solid transparent !important;"> </td> <td style="width:10%;"> <?php echo $w->width; ?> </td> <td style="width:10%;"> <?php echo $w->product; ?> </td> <td style="width:10%;"> <?php echo $w->consumption; ?> </td> <?php $total = 0; foreach($shades_preview2 as $shades){ if($shades->subCode == $preview->subCode){ $total_quantity = $w->consumption*$shades->quantity; ?> <td style="width:10%;"> <?php echo $total_quantity; $total += $total_quantity; } } ?> </td> <td style="width:10%;" id = "total"> <?php echo $total; ?> </td> <td style="width:10%;"><?php echo $w->unit;?></td> </tr> <?php }} }?> </table> </tr> <?php }?> </table> <table border="0" class="table table-bordered " style="margin-top:10px;"> <tbody> <tr > <td style="width:550px"> Customer Instruction:   <?php echo $fetch_preview1->customerComments; ?> </td> <td> Sub Total:   </td> </tr> <tr> <td style="width:550px"></td> <td> <?php if(empty($preview->unit)){ foreach ($fetch_pre as $pre){ echo "For Subcode".$pre->subCode .": ".$pre->subtotal."<br>"; } } else {?> <?php foreach ($fetch_pre as $key => $value){ echo "For Subcode".$value->subCode .": ".$value->subtotal." ".$fetch_preview_unit[$key]->unit."<br>"; } } ?> </td> </tr> <tr> <td style="width:550px"></td> <td> <?php if(empty($preview->unit)){ ?> Grand Total:   <?php echo $total; ?> <?php } else {?> Grand Total:   <?php echo $total." ".$preview->unit; ?> <?php } ?> </td> </tr> </tbody> </table> </div> <?php function convert_number_to_words($no) { //$no = round($number); //alert(); $hundred = null; $digits_1 = strlen($no); $i = 0; $str = array(); $words = array('0' => '', '1' => 'One', '2' => 'Two', '3' => 'Three', '4' => 'Four', '5' => 'Five', '6' => 'Six', '7' => 'Seven', '8' => 'Eight', '9' => 'Nine', '10' => 'Ten', '11' => 'Eleven', '12' => 'Twelve', '13' => 'Thirteen', '14' => 'Fourteen', '15' => 'Fifteen', '16' => 'Sixteen', '17' => 'Seventeen', '18' => 'Eighteen', '19' =>'Nineteen', '20' => 'Twenty', '30' => 'Thirty', '40' => 'Forty', '50' => 'Fifty', '60' => 'Sixty', '70' => 'Seventy', '80' => 'Eighty', '90' => 'Ninety'); $digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore'); while ($i < $digits_1) { $divider = ($i == 2) ? 10 : 100; $number = floor($no % $divider); $no = floor($no / $divider); $i += ($divider == 10) ? 1 : 2; if ($number) { $plural = (($counter = count($str)) && $number > 9) ? 's' : null; $hundred = ($counter == 1 && $str[0]) ? ' And ' : null; $str [] = ($number < 21) ? $words[$number] . " " . $digits[$counter] . $plural . " " . $hundred : $words[floor($number / 10) * 10] . " " . $words[$number % 10] . " " . $digits[$counter] . $plural . " " . $hundred; } else $str[] = null; } $str = array_reverse($str); $result = implode('', $str); return $result ; } ?> </body> </html> <style> .close-right { text-align:right; } </style> <script> $(document).ready(function() { $("#booking_print").click(function(){ var divToPrint=document.getElementById("print_report"); newWin= window.open(""); newWin.document.write(divToPrint.outerHTML); newWin.print(); newWin.close(); }); }); </script> <style> @media only screen and (min-width:320px) and (max-width:640px) { .mid-work{ width:900px; } .mid-wrk{ overflow-x:auto; padding-top:30px; } } </style>