EVOLUTION-NINJA
Edit File: sam_sdk_order_input_preview.php
<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>Deco-Textil</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 class="close-right" ><a href="<?php echo base_url('planning/sam_stk_program?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 class="close-right" ><a href="<?php echo base_url('planning/sam_stk_program?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 class="close-right" ><a href="<?php echo base_url('planning/sam_stk_program?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 class="close-right" ><a href="<?php echo base_url('planning/sam_stk_program?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%;">ORDER INPUT DETAILS</h3> <table> <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> Sample 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 Reference:  <?php echo $fetch_preview1->orderNo; ?> </p> </div> </div> <div class="col-sm-6"> <div class="col-sm-6" style="padding-top: 30px;"> <p> 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;margin-right: 12px;"> </div> </div> </div> </table> <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>Width(CMS)</th> <th>Article</th> <th>Quality & Description </th> <th> Design</th> <th>Sl.NO</th> <th>Our shade</th> <th>Buyer Shade</th> <th>Order Type</th> <th>Description</th> <th>Quantity</th> </tr> <?php $a=1;$total=0;$tab=0; foreach($fetch_preview2 as $preview){ ?> <tr> <td> <?php foreach ($fetch_pre as $pre) { if($preview->subCode != $tab) { echo $preview->subCode; } break; } $tab=$preview->subCode; ?> </td> <td> <?php echo $preview->width; ?> </td> <td> <?php echo $preview->articleNo; ?> </td> <td> <?php //echo $preview->quality; ?> <?php //echo '&'; ?> <?php echo $preview->description; ?> </td> <td> <?php echo $preview->design; ?> </td> <td> <?php echo $a++; ?> </td> <td> <?php echo $preview->ourShade; ?> </td> <td> <?php echo $preview->buyerShade; ?> </td> <td> <?php echo $preview->subOrderType; ?> </td> <td> <?php echo $preview->description; ?> </td> <td> <?php echo $preview->quantity." ".$preview->unit; ?> </td> </tr> <?php $total=$total + $preview->quantity; } ?> </tbody> </table> <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 foreach ($fetch_pre as $pre){ echo "For Subcode".$pre->subCode .": ".$pre->subtotal." ".$preview->unit."<br>"; } ?></p> <p>Grand Total: <?php if(isset($total)){ echo $total ." "; 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%;">ORDER INPUT DETAILS</h3> <table> <!--<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/images/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/images/1.jpg');?>" class="img-responsive" style="background-color:#485B7F;float:right;width: 100px;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"><?php echo $address->customerName; ?></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;"><?php echo $address->customerAddress; if($address->pincode !="") {?><br/> <?php echo $address->city."-".$address->pincode; } ?> <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> <table border="1" class="table table-bordered table-striped table-hover table-condensed table-responsive" style="margin-top:10px;border-spacing:0 !important;"> <tbody> <tr > <th>SUB NO</th> <th>Width(CMS)</th> <th>Article</th> <th>Quality & Description </th> <th> Design</th> <th>Sl.NO</th> <th>Our shade</th> <th>Buyer Shade</th> <th>Order Type</th> <th>Description</th> <th>Quantity</th> </tr> <?php $a=1;$total=0;$tab=0; foreach($fetch_preview2 as $preview){ ?> <tr > <td > <?php foreach ($fetch_pre as $pre) { if($preview->subCode != $tab) { echo $preview->subCode; } break; } $tab=$preview->subCode; ?> </td> <td > <?php echo $preview->width; ?> </td> <td> <?php echo $preview->articleNo; ?> </td> <td> <?php echo $preview->quality; ?> </td> <td> <?php echo $preview->design; ?> </td> <td> <?php echo $a++; ?> </td> <td> <?php echo $preview->ourShade; ?> </td> <td> <?php echo $preview->buyerShade; ?> </td> <td> <?php echo $preview->subOrderType; ?> </td> <td> <?php echo $preview->description; ?> </td> <td> <?php echo $preview->quantity." ".$preview->unit;; ?> </td> </tr> <?php $total=$total + $preview->quantity; } ?> </tbody> </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 $pre){ echo "For Subcode".$pre->subCode .": ".$pre->subtotal." ".$preview->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>