JezK
Edit File: invoicesView.php
<?php include_once("./app/checkSession.php"); if(!isset($_REQUEST['id'])) { header("Location: ./invoicedashboard.php"); } $id = $_REQUEST['id']; include("header.php"); // print_r($_SESSION['company_id']);exit; $companyLogo=$wareHouseAdminObj->getCompanyLogo($_SESSION['company_id']); $companyInfo=$wareHouseAdminObj->getCompanyInfo($_SESSION['company_id']); // print_r($companyInfo); // print_r($companyLogo); $invoiceInfo=$wareHouseAdminObj->getInvoiceInfo($id); // print_r($invoiceInfo); $currencyType=$invoiceInfo['currency']; $itemDetails=$wareHouseAdminObj->getInvoicesItemsInfo($id); $itemDetails1=$itemDetails ? $itemDetails :[]; $invoiceNumber = isset($invoiceInfo['invoice_number'])?$invoiceInfo['invoice_number']:""; $warehouseNumber = isset($invoiceInfo['warehouse_number'])?$invoiceInfo['warehouse_number']:""; $invoiceValue = isset($invoiceInfo['invoice_value'])?$invoiceInfo['invoice_value']:""; $createdDate = isset($invoiceInfo['created_date'])?$invoiceInfo['created_date']:""; $date=date_create($createdDate); $modifiedDate=date_format($date,"d-m-Y"); $warehouseName = isset($invoiceInfo['warehouse_name'])?$invoiceInfo['warehouse_name']:""; $customerName = $invoiceInfo['first_name'].' '.$invoiceInfo['last_name']; $descript=isset($invoiceInfo['description'])?$invoiceInfo['description']:""; $grandtotal=isset($invoiceInfo['grandtotal'])?$invoiceInfo['grandtotal']:""; $tableHTML =""; if($itemDetails1==0) { $tableHTML ="<tr class='text-center'> <td colspan='7' ><p class='p-2'>No data avilable</p></td> </tr>"; } foreach($itemDetails1 as $item) { $tableHTML .= '<tr> <td><input type="text" value="'.$item['item_number'].'" readonly></td> <td><input type="text" value="'.$item['description'].'" readonly></td> <td><input type="text" value="'.$item['quotation_id'].'" readonly></td> <td><input type="text" value="'.$item['numberof_pallets'].'" readonly></td> <td><input type="text" value="'.$item['quantity'].'" readonly></td> <td><input type="text" value="'.$item['price'].'" readonly></td> <td><input type="text" value="'.$item['total'].'" readonly></td> </tr>'; } ?> <div class="container px-3 px-md-5"> <a href="javascript:history.go(-1)" ><img src="images/back_main.png" class="pb-3"></a> <h4><?php echo $lang['INVOICES'];?></h4> <div class="row justify-content-center"> <div class="pb-4 mt-3 position-relative"> <!-- <img src="./images/profile.png" class="user_Img" height="100" width="100" id="imagePreview" alt=""> <span class="cursor-pointer"><label class="cursor-pointer" for="formUpload"><i class="fa fa-pencil userEdit" aria-hidden="true"></i></label> <input type="file" id="formUpload" name="formUpload" style="position: absolute;left: 0px;display: none;" accept="image/*" onchange="return validateUploadedImage(event);"></span> --> <?php if(isset($companyLogo['uploaded_attachement'])){ ?> <img src="../uploads/warehouse_docs/<?php echo $companyLogo['uploaded_attachement']?>" class="user_Img" height="100" width="100" alt="" /> <?php } else { ?> <img src="./images/profile.png" class="user_Img" height="100" width="100" alt=""> <?php }?> </div> </div> <div class="containercontent"> <div class="card-1 shadow-sm p-3 mb-5 p-md-0 bg-white rounded"> <div class="card-body invoices_page_div"> <div class="row align-items-center"> <div class="col-md-5 col-lg-2 col-sm-6"> <label for="invoices" class="custom-label"><?php echo $lang['INVOICES_NUMBER'];?></label> </div> <div class="col-md-5 col-lg-3 col-sm-6 d-flex align-itens-start custom-padding"> <span class="colon">:</span> <input type="text" class="" id="invoices" placeholder="" name="invoices" value="<?php echo $invoiceNumber; ?>" readonly> </div> <div class="col-md-5 col-lg-3 col-sm-6"> <label for="whnumber" class="custom-label"><?php echo $lang['WAREHOUSE_NUMBER'];?></label> </div> <div class="col-md-5 col-lg-2 col-sm-6 d-flex align-itens-start custom-padding"> <span class="colon">:</span> <input type="text" class="" id="whnumber" placeholder="" value="<?php echo $warehouseNumber; ?>" name="whnumber" readonly> </div> </div> <div class="row align-items-center"> <div class="col-md-5 col-lg-2 col-sm-6"> <label for="whname" class="custom-label"><?php echo $lang['WAREHOUSE_NAME'];?></label> </div> <div class="col-md-5 col-lg-3 col-sm-6 d-flex align-itens-start custom-padding"> <span class="colon">:</span> <input type="text" class="" id="whname" placeholder="" value="<?php echo $warehouseName; ?>" name="whname" readonly> </div> <div class="col-md-5 col-lg-3 col-sm-6"> <label for="invoices" class="custom-label"><?php echo $lang['QUOTATION_VALUE'];?></label> </div> <div class="col-md-5 col-lg-2 col-sm-6 d-flex align-itens-start custom-padding" > <span class="colon">:</span> <input type="text" class="" id="Invoicevalue" value="<?php echo $invoiceValue; ?>" placeholder="" name="Invoicevalue" readonly> <span id="currencyType"><?php echo $currencyType ?></span> </div> </div> <div class="row align-items-center" > <div class="col-md-5 col-lg-2 col-sm-6 col-6"> <label for="customer" class="custom-label"><?php echo $lang['CUSTOMER_NAME'];?></label> </div> <div class="col-md-5 col-lg-3 col-sm-6 d-flex align-itens-start custom-padding"> <span class="colon">:</span> <input type="text" class="" id="customer" placeholder="" value="<?php echo $customerName; ?>" name="customer" readonly> </div> <div class="col-md-5 col-lg-3 col-sm-6 col-6"> <!-- <div class="d-flex flex-row"> --> <label for="whnumber" class="custom-label"><?php echo $lang['DATE'];?></label></div> <div class="col-md-5 col-lg-2 col-sm-6 d-flex align-itens-start custom-padding"> <span class="colon">:</span> <input type="text" class=" " value="<?php echo $modifiedDate; ?>" id="whnumber" placeholder="" name="whnumber" readonly> </div> </div> </div> <div class="row mb-3"> <div class="col-md-5 col-lg-2 pl-4 mt-2"> <label for="customer" class="custom-label"><?php echo $lang['DESCRIPTION'];?></label> </div> <div class="col-md-6 col-lg-8 d-flex "> <span class="colon">:</span><textarea id="DescriptionMsg" name="DescriptionMsg" rows="2" class="form-control"readonly><?php echo $descript; ?></textarea> <div class="error customer_error"></div> </div> </div> <div class="table-responsive"> <table class="table table-bordered table_body invoice_add"> <thead class="theadcolor"> <tr> <th><?php echo $lang['INVOICE_NUMBER'];?></th> <!-- <th>Customer</th> --> <th><?php echo $lang['DESCRIPTION'];?></th> <th><?php echo $lang['QUOTATION_ID'];?></th> <!-- <th>Value</th> --> <th><?php echo $lang['NUMBER_OF_PALLETS'];?></th> <th><?php echo $lang['QUANTITY'];?></th> <th><?php echo $lang['PRICE'];?> (<?php echo $currencyType ?>)</th> <th><?php echo $lang['TOTAL'];?></th> </tr> </thead> <tbody> <?php echo $tableHTML; ?> </tbody> </table> </div> <div class="d-flex justify-content-between align-items-baseline borderdashed"> <div> <label><strong><?php echo $lang['Grand_Total_value'];?><strong></label> </div> <div class="inputwid"> <span class="inputWidth"> <input type="text" class="form-control" id="totalvalue" name="totalvalue" value="<?php echo $grandtotal ?>" readonly/> </span> </div> </div> <!--<div class="d-flex justify-content-end"> <div>Total 150 Dinar </div> </div>--> </div> </div> <?php include("footer.php"); ?> <style> .invoice_add tr td { padding: 0px !important; width: 100px; } .invoice_add tr td input{ width:100% !important;border:none;background:#eaeffa;padding: 10px;border-bottom: 1px solid #3663c88c; } button#addRow ,button#addRowSave{ background: #3663c8; border: none; padding: 5px 15px; color: #fff; } .invoices_page_div input { /* width: 100%;*/ border:none; padding: 0px 0px; } .user_Img{ border-radius: 50%; } .smallCurrency { position: absolute !important; margin-left: 71px !important; color: #2c60d0; font-weight: bold; } .largeCurrency { position: absolute !important; margin-left: 105px !important; color: #2c60d0; font-weight: bold; } .inputwid{ width: 149px; } span.inputWidth input.form-control { background: #eaeffa; border:none; outline:none; color:black; font-weight:bold; } .borderdashed { margin-bottom: 10px; border-top: 1px dashed; border-bottom: 1px dashed; padding: 3px; } table#myTable input,span.inputWidth input { text-align: center; } table.table.table-bordered.table_body.invoice_add input { text-align: center; } .custom-label{ font-size: 16px; font-family: 'Barlow'; font-weight: 600; } </style> <script> $(document).ready(function(){ var currencyLength='<?php echo $invoiceValue ?>'; // console.log() if(currencyLength.length<6){ $('#currencyType').addClass('smallCurrency'); } else if(currencyLength.length>6){ $('#currencyType').addClass('largeCurrency'); } }) </script>