$promisedate = $rowestimate['promise_date']; $plateno = $rowestimate['plate_no']; $makedesc = $rowestimate['make_desc']; $yeardesc = $rowestimate['year_desc']; $modeldesc = $rowestimate['model_desc']; $colordesc = $rowestimate['color_desc']; $variant = $rowestimate['variant']; $engineno = $rowestimate['engine_no']; $chassisno = $rowestimate['chassis_no']; $serialno = $rowestimate['serial_no']; } $qrycost_accessory = new v_service_detail_accessory(); $rescost_accessory = $dbo->query($qrycost_accessory->Query("WHERE estimate_refno = '{$estimaterefno}'")); $qrycost_job = new v_service_detail_job(); $rescost_job = $dbo->query($qrycost_job->Query("WHERE estimate_refno = '{$estimaterefno}'")); $qrycost_material = new v_service_detail_material(); $rescost_material = $dbo->query($qrycost_material->Query("WHERE estimate_refno = '{$estimaterefno}'")); $qrycost_parts = new v_service_detail_parts(); $rescost_parts = $dbo->query($qrycost_parts->Query("WHERE estimate_refno = '{$estimaterefno}'")); $subtotal = 0; if (isset($_POST['savewo']) && !empty($_POST['savewo']) && $_POST['savewo'] == 1) { $empid = $_POST['empid']; $promisetime = $_POST['promisetime']; $promisedate = dateFormat($_POST['promisedate'], "Y-m-d"); $paymentmode = $_POST['paymentmode']; $qry = null; $qry .= "UPDATE tbl_service_master SET payment_id = '{$paymentmode}', technician = '{$empid}',promise_date = '{$promisedate}',promise_time = '{$promisetime}' WHERE estimate_refno = '{$estimaterefno}'; "; $qry .= "INSERT INTO tbl_jobclock_master(wo_refno) VALUE('{$worefno}'); "; $res = $dbo->query($qry); if (!$res) { echo '<script>alert("There has been an error in updating your data! Please re-process hour transaction."); window.location="workorder_approval.php?estimaterefno=' . $estimaterefno . '";</script>';
session_start(); $ses_id = session_id(); require_once "conf/db_connection.php"; require_once "functions.php"; $estimaterefno = $_GET['estimaterefno']; $qryestimate = new v_service_master(); $resestimate = $dbo->query($qryestimate->Query("WHERE tbl_service_master.estimate_refno = '{$estimaterefno}'")); $qrytempjob = new v_service_detail_job(); $restempjob = $dbo->query($qrytempjob->Query("WHERE estimate_refno = '{$estimaterefno}'")); $qrytempparts = new v_service_detail_parts(); $restempparts = $dbo->query($qrytempparts->Query("WHERE estimate_refno = '{$estimaterefno}'")); $numparts = count($restempparts); $qrytempaccessory = new v_service_detail_accessory(); $restempaccessory = $dbo->query($qrytempaccessory->Query("WHERE estimate_refno = '{$estimaterefno}'")); $numlubricant = count($restempaccessory); $qrytempmaterial = new v_service_detail_material(); $restempmaterial = $dbo->query($qrytempmaterial->Query("WHERE estimate_refno = '{$estimaterefno}'")); $nummaterial = count($restempmaterial); foreach ($resestimate as $rowestimate) { $custid = $rowestimate['customer_id']; $custname = $rowestimate['customername']; $address = $rowestimate['cust_address']; $vehicleid = $rowestimate['vehicle_id']; $odometer = $rowestimate['odometer']; $remarks = $rowestimate['remarks']; $paymentmode = $rowestimate['payment_mode']; $discount = $rowestimate['discount']; $worefno = $rowestimate['wo_refno']; $transstatus = $rowestimate['trans_status']; $subtotal = $rowestimate['subtotal_amount']; $total = $rowestimate['total_amount'];