JezK
Edit File: update_quotation_status.php
<?php include("app/checkSession.php"); // include("app/adminObj.php"); if(!isset($_SESSION['customer_user_id'])){ $customerObj->redirect('login.php'); } include("header.php"); //~ echo "<pre>"; // print_r($_REQUEST); $quotationInfo =$customerObj->getQuotationsInfo($_REQUEST['id']); // print_r($quotationInfo); $warehouseInfo = $customerObj->getWareHouseMainDetails($quotationInfo['warehouse_id']); $customerInfo = $customerObj->getCustomerDetailsById($quotationInfo['user_id']); // print_r($warehouseInfo); //~ print_r($quotationInfo); // exit; // print_r($quotationInfo); // print_r($quotationInfo['warehouse_id']); // function dateFormat($originalDate){ // $date=date_create($originalDate); // $modifiedDate=date_format($date,"d-m-Y"); // return $modifiedDate; // } $quotationStatus = "Open"; $setQuotationStatus =1; $setClosedStatus =1; switch ($quotationInfo['quotation_status']) { case "0": $quotationStatus = "Pending"; break; case "1": $quotationStatus = "Wating Acceptance"; break; case "3": $quotationStatus = "Accepted"; break; case "2": $quotationStatus = "Rejected"; break; //~ case "4": //~ $quotationStatus = "Finally Closed"; //~ break; default: $quotationStatus = "Pending"; } $closedStatus = "Pending"; switch ($quotationInfo['closed_status']) { case "0": $closedStatus = "Pending"; break; case "1": $closedStatus = "Pending"; break; case "2": $closedStatus = "Lost"; break; case "3": $closedStatus = "Won"; break; case "4": $closedStatus = "Finally Closed"; break; default: $closedStatus = "Pending"; } $finallyClosedHTML = ""; if($quotationStatus == 2 || $quotationStatus == 3 ){ $setQuotationStatus= $quotationInfo['quotation_status']; $finallyClosedHTML = '<div class="dt-buttons col-md-9 mt-3"> <button name="closed" class="dt-button"><span>Finally Closed</span></button> </div>;'; } else if($quotationInfo['quotation_status'] == 1){ $finallyClosedHTML = '<div class="dt-buttons col-md-9 mt-3"> <button name="accept" class="dt-button"><span>Accept</span></button> <button name="reject" class="dt-button"><span>Reject</span></button> </div>;'; } $storageType=''; if($quotationInfo['storage_type']==2){ $storageType="pallet"; } else{ $storageType="space"; } ?> <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['WAREHOUSE_RESPONSE_DETAILS'] ?></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'] ?>" /> <input type="hidden" name="adminDescription" id="adminDescription" value="<?php echo $quotationInfo['whadmin_description'] ?>" /> <input type="hidden" name="adminExpectedRate" id="adminExpectedRate" value="<?php echo $quotationInfo['admin_expected_rate'] ?>" /> <input type="hidden" name="warehouseId" id="warehouseId" value="<?php echo $warehouseInfo['warehouse_id'] ?>" /> <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_ID'];?></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['TOTAL_VALUE_OF_ITEMS'] ?></label><br> <?php echo $quotationInfo['expected_rate']; ?> <span class="currencyType"><?php if(isset($quotationInfo['expected_rate'])){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="closedstatus"><?php echo $lang['TOTAL_WEIGHT_FOR_GOODS'] ?></label><br> <?php echo $quotationInfo['total_wgt_goods'] ?> </div> <!-- <div class="col-md-6 col-lg-3 col-sm-12 mt-3"> <label for="exvalue"><?php echo $lang['WAREHOUSE_TOTAL_QUOTATION_PRICE'] ?></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> </div> </div> </div> </div> <div class="mt-3"> <div class="card mt-5"> <div class="card-body" id="headingTwoZ" data-toggle="collapse" data-target="#collapseThree" > <h5 class="mb-0"><b><?php echo $lang['WAREHOUSE_RESPONSE_DETAILS'] ?></b> <i class="ml-1 caret fa fa-caret-up float-right" data-toggle="collapse" data-target="#collapseThree" aria-expanded="false" aria-controls="collapseTwo"> </i> </h5> </div> <div id="collapseThree" class="collapse show" aria-labelledby="headingTwo" data-parent="#accordionExample" > <div class="card-body" > <div class="row editQuot"> <div class="col-md-12"> <label for="description" id="qprice"><?php echo $lang['WAREHOUSE_RESPONSE_DETAILS'] ?></label><br> <textarea type="text" class="col-sm-12" id="description1" placeholder="Description" readonly> <?php echo isset($quotationInfo['whadmin_description']) ? $quotationInfo['whadmin_description']: "" ;?> </textarea> </div> <div class="col-md-12 "> <label for="exvalue" id="qprice"><?php echo $lang['WAREHOUSE_TOTAL_QUOTATION_PRICE'] ?></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> </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; } .row.editQuot label { font-size: 14px; 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; } #qprice { font-size: 16px !important; } </style>