JezK
Edit File: myquotations_edit.php
<?php include("header.php"); // echo "<pre>"; // print_r($_SESSION); $type = isset($_REQUEST['type']) ? $_REQUEST['type'] : ""; $quotationInfo =$wareHouseAdminObj->getQuotationsInfo($_REQUEST['id']); $warehouseInfo = $wareHouseAdminObj->getWareHouseMainDetails($quotationInfo['warehouse_id']); $customerInfo = $wareHouseAdminObj->getCustomerDetailsById($quotationInfo['user_id']); // print_r($warehouseInfo); // print_r($quotationInfo); // print_r($customerInfo); // print_r($quotationInfo['warehouse_id']); $quotationStatus = "Pending"; $setQuotationStatus =1; $setClosedStatus =1; $readOnly =""; switch ($quotationInfo['quotation_status']) { case "0": $quotationStatus = $lang['PENDING']; break; case "1": $quotationStatus = $lang['WAITING_ACCEPTANCE']; break; case "3": $quotationStatus = $lang['ACCEPTED']; $setClosedStatus =3; break; case "2": $quotationStatus = $lang['REJECTED']; $setClosedStatus =2; break; //~ case "4": //~ $quotationStatus = "Finally Closed"; //~ break; default: $quotationStatus = $lang['PENDING']; } $closedStatus = $lang['PENDING']; //~ echo $quotationInfo['closed_status']; switch ($quotationInfo['closed_status']) { case "0": $closedStatus = $lang['PENDING']; break; case "1": $closedStatus = $lang['PENDING']; break; case "2": $closedStatus = $lang['LOST']; break; case "3": $closedStatus = $lang['WON']; break; case "4": $closedStatus = $lang['CLOSED']; break; default: $closedStatus = $lang['PENDING']; } $finallyClosedHTML = ""; //~ echo $quotationInfo['quotation_status']; if($quotationInfo['closed_status']== 2 || $quotationInfo['closed_status'] == 3 ){ $setQuotationStatus= $quotationInfo['quotation_status']; $setClosedStatus =4; $readOnly ="readonly"; if($type!=2) { $finallyClosedHTML = '<div class="dt-buttons col-md-9 mt-3"> <button name="closed" class="dt-button"><span>'.$lang['FINALLY_CLOSED'].'</span></button> </div>'; } } else if($quotationInfo['closed_status'] < 1){ $readOnly ="readonly"; if($type!=2) { $readOnly =""; $finallyClosedHTML = '<div class="dt-buttons col-md-9 mt-3"> <button name="submit" type="submit" class="dt-button" onclick="return validation();"><span>'.$lang['SEND_RESPONSE'].'</span></button> </div>'; } } else{ $readOnly ="readonly"; } $storageType=''; if($quotationInfo['storage_type']==2){ $storageType=$lang['PALLET']; } else{ $storageType=$lang['SPACE']; } ?> <style> .row.editQuot label { font-size: 16px; font-weight: 700; } .card { border: 0px solid #fff; border-radius: 22px; background: #ffffff; box-shadow: 0 0 10px #deeffe; padding: 2%; } textarea#description,textarea#description1,input#expectedValue { border: 0px; background: #ebf2f9; border-radius: 12px; } </style> <div class="container px-5"> <a href="javascript:history.go(-1)"><img src="images/back_main.png" class="pb-3"></a> <h4><?php echo $lang['MY_QUOTATION_LIST_EDIT'];?></h4> <form action="app/updateQuotationStatus.php" method="POST"> <div class="mt-3"> <div class="card mt-5"> <div class="card-body" id="headingTwoM" data-toggle="collapse" data-target="#collapseTwo" > <h5 class="mb-0"><b><?php echo $lang['QUOTATION_WE_DEAL_WITH'];?></b> <i class="ml-1 caret fa fa-caret-up float-right" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo"> </i> </h5> </div> <input type="hidden" name="quotation_id" id="quotation_id" value="<?php echo $quotationInfo['quotation_id'] ?>" /> <input type="hidden" name="whadmin_id" id="whadmin_id" value="<?php echo $quotationInfo['whadmin_id'] ?>" /> <input type="hidden" name="expected_rate" id="expected_rate" value="<?php echo $quotationInfo['expected_rate'] ?>" /> <input type="hidden" name="user_id" id="expected_rate" value="<?php echo $quotationInfo['user_id'] ?>" /> <input type="hidden" name="quotation_status" id="quotation_status" value="<?php echo $setQuotationStatus ?>" /> <input type="hidden" name="closed_status" id="closed_status" value="<?php echo $setClosedStatus ?>" /> <input type="hidden" name="customer_description" id="customer_description" value="<?php echo $quotationInfo['customer_description'] ?>" /> <div id="collapseTwo" class="collapse show" aria-labelledby="headingTwo" data-parent="#accordionExample" > <div class="card-body" > <div class="row editQuot"> <div class="col-md-6 col-lg-3 col-sm-12 mt-3"> <label for="WarehouseName"><?php echo $lang['WAREHOUSE_NAME'];?></label><br> <?php echo $warehouseInfo['warehouse_name']; ?> </div> <div class="col-md-6 col-lg-3 col-sm-12 mt-3 "> <label for="warehouseId"><?php echo $lang['WAREHOUSE_ID'];?></label><br> <?php echo $warehouseInfo['warehouse_id']; ?> </div> <div class="col-md-6 col-lg-3 col-sm-12 mt-3"> <label for="qtNum"><?php echo $lang['QUOTATION_NUMBER'];?></label><br> <?php echo $quotationInfo['quotation_id']; ?> </div> <div class="col-md-6 col-lg-3 col-sm-12 mt-3"> <label for="custName"><?php echo $lang['CUSTOMER_NAME'];?></label><br> <?php echo $customerInfo['first_name'].' '.$customerInfo['last_name'] ; ?> </div> <div class="col-md-6 col-lg-3 col-sm-12 mt-3"> <label for="custtype"><?php echo $lang['CUSTOMER_TYPE'];?></label><br> <?php echo $customerInfo['role_id'] == 3 ? 'Individual' : 'Business' ; ?> </div> <?php if($quotationInfo['closed_status']=='3' ||$quotationInfo['closed_status']=='4' ){} else{?> <div class="col-md-6 col-lg-3 col-sm-12 mt-3"> <label for="custexvalue"><?php echo $lang['CUSTOMER_EXPECTED_VALUE'];?></label><br> <?php echo $quotationInfo['expected_rate']; ?> <span class="currencyType"><?php echo $quotationInfo['currency'] ?></span> </div> <?php } ?> <div class="col-md-6 col-lg-3 col-sm-12 mt-3"> <label for="submitdate"><?php echo $lang['DATE_OF_SUBMISSION'];?></label><br> <?php echo date('d-m-Y', strtotime($quotationInfo['created_dt'])); ?> </div> <div class="col-md-6 col-lg-3 col-sm-12 mt-3"> <label for="resstatus"><?php echo $lang['RESPONSE_STATUS'];?></label><br> <?php echo $quotationStatus ?> </div> <div class="col-md-6 col-lg-3 col-sm-12 mt-3"> <label for="closedstatus"><?php echo $lang['CLOSED_STATUS'];?></label><br> <?php echo $closedStatus ?> </div> <div class="col-md-6 col-lg-3 col-sm-12 mt-3"> <label for="resdate"><?php echo $lang['RESPONSE_DATE'];?></label><br> <?php echo date('d-m-Y',strtotime($quotationInfo['modify_dt']));?> </div> <div class="col-md-6 col-lg-3 col-sm-12 mt-3"> <label for="closedstatus"><?php echo $lang['FROM_DATE'];?></label><br> <?php echo date('d-m-Y', strtotime($quotationInfo['from_date'])); ?> </div> <div class="col-md-6 col-lg-3 col-sm-12 mt-3"> <label for="closedstatus"><?php echo $lang['TO_DATE'];?></label><br> <?php echo date('d-m-Y', strtotime($quotationInfo['to_date'])); ?> </div> <div class="col-md-6 col-lg-3 col-sm-12 mt-3"> <label for="closedstatus"><?php echo $lang['SELECT_TYPE'];?></label><br> <?php echo $storageType ?> </div> <div class="col-md-6 col-lg-3 col-sm-12 mt-3"> <label for="closedstatus"><?php echo $lang['NUMBER_OF_DAYS'];?></label><br> <?php echo $quotationInfo['num_of_days'] ?> </div> <div class="col-md-6 col-lg-3 col-sm-12 mt-3"> <label for="exvalue"><?php echo $lang['TOTAL_VALUE_FOR_QUOTATION'];?></label><br> <?php echo isset($quotationInfo['admin_expected_rate'])?$quotationInfo['admin_expected_rate']:"";?> <span class="currencyType"><?php if(isset($quotationInfo['admin_expected_rate'])){echo $quotationInfo['currency'];}?></span> </div> <div class="col-md-6 col-lg-3 col-sm-12 mt-3"> <label for="exvalue"><?php echo $lang['TOTAL_WEIGHT_FOR_GOODS'];?></label><br> <?php echo $quotationInfo['total_wgt_goods'] ?> </div> <?php if($warehouseInfo['uflexit_percent'] != "") { // echo "hi"; if($quotationInfo['closed_status'] == "3" || $quotationInfo['closed_status'] == "4") { $uflexit_percent_value = $quotationInfo['admin_expected_rate']/$warehouseInfo['uflexit_percent']; $warehouse_percent = $quotationInfo['admin_expected_rate'] - $uflexit_percent_value; } else{ $uflexit_percent_value = $quotationInfo['expected_rate']/$warehouseInfo['uflexit_percent']; $warehouse_percent = $quotationInfo['expected_rate'] - $uflexit_percent_value; } } ?> <div class="col-md-6 col-lg-3 col-sm-12 mt-3"> <label for="exvalue"><?php echo $lang['UFLEXIT_VALUE_FOR_QUOTATION'];?></label><br> <?php echo $uflexit_percent_value; ?> </div> <div class="col-md-6 col-lg-3 col-sm-12 mt-3"> <label for="exvalue"><?php echo $lang['WAREHOUSE_VALUE_FOR_QUOTATION'];?></label><br> <?php echo $warehouse_percent; ?> </div> </div> </div> </div> </div> <!--<div class="d-flex justify-content-end"> <div>Total 150 Dinar </div> </div>--> </div> <div class="mt-3"> <div class="card mt-5"> <div class="card-body" id="headingTwoY" data-toggle="collapse" data-target="#collapseThree" > <h5 class="mb-0"><b><?php echo $lang['CUSTOMER_DESCRIPTION'];?></b> <i class="ml-1 caret fa fa-caret-up float-right" data-toggle="collapse" data-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree"> </i> </h5> </div> <div id="collapseThree" class="collapse show" aria-labelledby="headingTwo" data-parent="#accordionExample" > <div class="card-body p-3" > <div class="row editQuot"> <div class="col-md-12"> <textarea type="text" class="col-sm-12" id="description1" placeholder="" name="adminDescription1" <?php echo $readOnly; ?> readonly><?php echo $quotationInfo['customer_description']; ?></textarea> </div> </div> </div> </div> </div> </div> <div class="mt-3"> <div class="card mt-5"> <div class="card-body" id="headingTwoZ" data-toggle="collapse" data-target="#collapseFour" > <h5 class="mb-0"><b><?php echo $lang['RESPONSE'];?></b> <i class="ml-1 caret fa fa-caret-up float-right" data-toggle="collapse" data-target="#collapseFour" aria-expanded="false" aria-controls="collapseFour"> </i> </h5> </div> <div id="collapseFour" class="collapse show" aria-labelledby="headingTwo" data-parent="#accordionExample" > <div class="card-body p-3" > <div class="row editQuot"> <div class="col-md-12"> <label for="description"><?php echo $lang['WAREHOUSE_RESPONSE_DETAILS'];?></label><br> <textarea type="text" class="col-sm-12" id="description" placeholder="Description" name="adminDescription" <?php echo $readOnly; ?>><?php echo $quotationInfo['whadmin_description'] ?></textarea> </div> <div class="col-md-12 mt-2"> <label for="exvalue"><?php echo $lang['EXPECTED_TOTAL_VALUE_FOR_PRODUCT'];?></label><br> <input type="text" class="col-sm-3 expectedValue" id="expectedValue" placeholder="" name="adminExpectedRate" value="<?php echo $quotationInfo['admin_expected_rate'] ?>" <?php echo $readOnly; ?>><span class="currencyType"><?php echo $quotationInfo['currency'] ?></span> </div> </div> </div> </div> </div> </div> <?php echo $finallyClosedHTML; ?> </form> <?php include("footer.php"); ?> <style> .newRow_add tr td { padding: 0px !important; } .newRow_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[readonly] { width: 100%; border: none; padding: 0px 5px; } .invoices_page_div textarea { width: 100%; /* border: none; */ padding: 0px 5px; } .invoices_page_div input { width: 100%; /* border: none; */ padding: 0px 5px; } input.expectedValue { width: 23%; } </style> <script> function validation(){ var expectedValue=document.getElementById('expectedValue').value; if(expectedValue==''){ $('.expectedValue_error').html('Please Enter Expected Value'); $('#expectedValue').focus() return false; } } </script>