if ($num_po_dtl > 0) { $nArrItems = rtrim($nArrItems, "|"); } if (isset($_POST['update'])) { $difference = $_POST['difference']; $paymentterm = $_POST['payment_terms']; $item = explode(":", $_POST['txtItemsArr']); $price = explode(":", $_POST['txtPricesArr']); $discount = str_replace(",", "", $_POST['discount']); $subtotal = str_replace(",", "", $_POST['subtotal']); $vat = str_replace(",", "", $_POST['vat']); $totalamount = str_replace(",", "", $_POST['total_amount']); switch ($_POST['status']) { case 1: //UPDATE $rrrefno = getNewNum('RECEIVING_REPORT'); $rr_mst = "INSERT INTO tbl_rr_mst(rr_reference_no,rr_date,po_reference_no,received_by,received_date,discount,sub_total,vat,total_amount)\n\t\t\t\t\t\t\t\t\tVALUES('{$rrrefno}','{$today}','{$id}','{$_SESSION['username']}','{$today}','{$discount}',\n\t\t\t\t\t\t\t\t\t\t\t'{$subtotal}',\n\t\t\t\t\t\t\t\t\t\t\t'{$vat}',\n\t\t\t\t\t\t\t\t\t\t\t'{$totalamount}')"; $res = mysql_query($rr_mst) or die("SAVING RR " . mysql_error()); $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'RECEIVING_REPORT' "; mysql_query($update_controlno); $cnt = 1; $ttlrrqty = 0; for ($i = 0; $i < count($item); $i++) { $itemcode = $item[$i]; $itemprice = $price[$i]; $qty = $_POST['txt' . $itemcode]; $ttlrrqty += $qty; // $sql_item = "SELECT * FROM tbl_items WHERE item_code = '$itemcode'"; $sql_item = "SELECT tbl_items.item_code,tbl_items.item_description,tbl_parts.part_onhand AS onhand,'parts' AS item_type\n\t\t\t\t\t\t\t\t\t\tFROM tbl_items\n\t\t\t\t\t\t\t\t\t\t\tJOIN tbl_parts ON tbl_parts.item_code = tbl_items.item_code\n\t\t\t\t\t\t\t\t\t\tWHERE tbl_items.item_code = '{$itemcode}'\n\n\t\t\t\t\t\t\t\t\t\tUNION\n\n\t\t\t\t\t\t\t\t\t\tSELECT tbl_items.item_code,tbl_items.item_description,tbl_material.material_onhand AS onhand,'material' AS item_type\n\t\t\t\t\t\t\t\t\t\tFROM tbl_items\n\t\t\t\t\t\t\t\t\t\t\tJOIN tbl_material ON tbl_material.item_code = tbl_items.item_code\n\t\t\t\t\t\t\t\t\t\tWHERE tbl_items.item_code = '{$itemcode}'\n\n\t\t\t\t\t\t\t\t\t\tUNION\n\n\t\t\t\t\t\t\t\t\t\tSELECT tbl_items.item_code,tbl_items.item_description,tbl_accessory.access_onhand AS onhand,'lubricants' AS item_type\n\t\t\t\t\t\t\t\t\t\tFROM tbl_items\n\t\t\t\t\t\t\t\t\t\t\tJOIN tbl_accessory ON tbl_accessory.item_code = tbl_items.item_code\n\t\t\t\t\t\t\t\t\t\tWHERE tbl_items.item_code = '{$itemcode}'"; $qry_item = mysql_query($sql_item); while ($row = mysql_fetch_array($qry_item)) {
break; case 1: $payment = "payment_id = 'PAY00000003'"; break; case 2: $payment = "payment_id = 'PAY00000004'"; break; default: break; } $qrybillingdtl = "SELECT * FROM v_for_billing_detail WHERE customer_id = '{$custid}' AND {$payment}"; $resbillingdtl = $dbo->query($qrybillingdtl); if (isset($_POST['billed']) && !empty($_POST['billed']) && $_POST['billed'] == 1) { $total_amnt = str_replace(",", "", $_POST['txtGrandTotal']); $sql = null; $newrefno = getNewNum('BILLING'); $sql3 = null; foreach ($_REQUEST['chkworefno'] as $val) { $sql1 = null; $sql2 = null; $val = explode("#", $val); $wo = $val[0]; $amnt = $val[1]; $sql1 = "INSERT INTO tbl_billing(wo_refno,billing_refno,billing_date,total_amount)\n\t\t\t\t\tVALUES('{$wo}','{$newrefno}','{$today}','{$amnt}'); "; $sql2 = "UPDATE tbl_service_master SET trans_status = '6' WHERE wo_refno = '{$wo}'; "; mysql_query($sql1); mysql_query($sql2); } $sql3 = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'BILLING'; "; $res = mysql_query($sql3); if (!$res) {
<?php require_once "conf/db_connection.php"; require_once "functions.php"; if (!isset($_SESSION)) { session_start(); } if (isset($_POST['save'])) { $package = $_POST['package']; $newnum = getNewNum('PACKAGE'); $employee_insert = "INSERT INTO tbl_package_master (package_id,package_name,created_by,created_date) VALUES\n\t\t('" . $newnum . "',\n\t\t'" . $package . "',\n\t\t'" . $_SESSION['username'] . "',\n\t\t'" . $today . "')"; $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'PACKAGE' "; $res = mysql_query($employee_insert) or die("INSERT EMPLOYEE " . mysql_error()); if (!$res) { echo '<script>alert("There has been an error on saving your package profile! Please double check all the data and save.");</script>'; } else { mysql_query($update_controlno); echo '<script>alert("Package profile successfully saved.");</script>'; } echo '<script>window.location="package_list.php";</script>'; } ?> <html> <head> <title></title> <link rel="stylesheet" type="text/css" href="style/cal.css" /> <link rel="stylesheet" type="text/css" href="style/forms.css" /> </script> </head> <body>
require_once "functions.php"; if (!isset($_SESSION)) { session_start(); } $qry_items = "SELECT * FROM v_items WHERE status = '1' ORDER BY item_description"; $result_items = $dbo->query($qry_items); if (isset($_POST['save'])) { $parts = strtoupper($_POST['parts']); $parts_discount = str_replace(",", "", $_POST['parts_discount']); $part_srp = str_replace(",", "", $_POST['part_srp']); $part_onhand = $_POST['part_onhand']; $parts_lowstock = $_POST['parts_lowstock']; $partstatus = $_POST['partstatus']; $new_price_date = date("Y-m-d h:i:s"); $item_code = $_POST['item_code']; $newnum = getNewNum('PARTS'); $parts_insert = "INSERT INTO tbl_parts (parts_id, parts, parts_discount, part_srp, part_onhand, parts_lowstock, partstatus, part_created, new_price_date,item_code) VALUES\n\t\t('" . $newnum . "',\n\t\t'" . $parts . "',\n\t\t'" . $parts_discount . "',\n\t\t'" . $part_srp . "',\n\t\t'" . $part_onhand . "',\n\t\t'" . $parts_lowstock . "',\n\t\t'" . $partstatus . "',\n\t\t'" . $today . "',\n\t\t'" . $new_price_date . "',\n\t\t'" . $item_code . "')"; $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'PARTS' "; $res = mysql_query($parts_insert) or die("INSERT PARTS " . mysql_error()); if (!$res) { echo '<script>alert("There has been an error on saving your parts! Please double check all the data and save.");</script>'; } else { mysql_query($update_controlno); echo '<script>alert("Parts successfully saved.");</script>'; } echo '<script>window.location="parts_list.php";</script>'; } ?> <html> <head> <title></title>
$ses_id = session_id(); require_once "conf/db_connection.php"; require_once "functions.php"; if (isset($_POST['save']) && !empty($_POST['save']) && $_POST['save'] == 1) { $customerid = $_POST['customer_id']; $vehicleid = $_POST['plateno']; $payment = $_POST['paymentmode']; $remarks = $_POST['txtremarks']; $subtotal = trim(str_replace(",", "", $_POST['subtotal'])); $discount = trim(str_replace(",", "", $_POST['discount'])); $discounted_price = trim(str_replace(",", "", $_POST['discounted_price'])); $vat = $_POST['vat']; $total_amount = trim(str_replace(",", "", $_POST['totalamount'])); $qrytempestimate = "SELECT * FROM v_temp_estimate WHERE ses_id = '{$ses_id}'"; $restempestimate = $dbo->query($qrytempestimate); $estimate_refno = getNewNum('ESTIMATEREFNO'); $sql = null; $sql .= "INSERT INTO tbl_service_master\n\t\t\t(estimate_refno,transaction_date,customer_id,vehicle_id,payment_id,subtotal_amount,discount,discounted_price,vat,total_amount,created_by,remarks)\n\t\t\tVALUES('{$estimate_refno}','{$today}','{$customerid}','{$vehicleid}','{$payment}','{$subtotal}','{$discount}','{$discounted_price}','{$vat}','{$total_amount}','{$ses_UserID}','{$remarks}'); "; foreach ($restempestimate as $rowtempestimate) { $sql .= "INSERT INTO tbl_service_detail\n\t\t\t\t(estimate_refno,type,id,amount)\n\t\t\t\tVALUES('{$estimate_refno}','{$rowtempestimate['type']}','{$rowtempestimate['id']}','{$rowtempestimate['rate']}'); "; } $sql .= "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'ESTIMATEREFNO'; "; $sql .= "DELETE FROM tbl_temp_estimate WHERE ses_id = '{$ses_id}'; "; $qry = $dbo->query($sql); if (!$qry) { echo '<script>alert("There has been an error on saving your service! Please double check all the data and save.");</script>'; } else { echo '<script>alert("Service successfully saved.");</script>'; } echo '<script>window.location="estimate.php";</script>'; }
$subtotal = $_POST['subtotal']; $discount = $_POST['discount']; $vat = $_POST['vat']; $discounted_price = $_POST['discounted_price']; $total_amount = $_POST['totalamount']; $remarks = $_POST['remarks']; $file = $_FILES['txtattachment']['name']; $qry = null; $getqryservice = "SELECT * FROM v_service_master WHERE estimate_refno = '{$estimaterefno}'"; $getresservice = $dbo->query($getqryservice); foreach ($getresservice as $rowresservice) { $worefno = $rowresservice['wo_refno']; } $getqrytemppodetail = "SELECT * FROM v_temp_po_detail WHERE ses_id = '{$ses_id}'"; $getrestemppodetail = $dbo->query($getqrytemppodetail); $new_refno = getNewNum('PURCHASEORDER'); if (!empty($file)) { $upload_path = 'attachments/'; $ext = substr($file, strpos($file, '.'), strlen($file) - 1); $attachment = $new_refno . $ext; move_uploaded_file($_FILES['txtattachment']['tmp_name'], $upload_path . $attachment); } $qry .= "INSERT INTO tbl_po_master(estimate_refno,wo_refno,po_refno,attachment,transaction_date,payment_id,subtotal_amount,discount,discounted_price,vat,total_amount,remarks,created_by)\n\t\t\t\tVALUES('{$estimaterefno}','{$worefno}','{$new_refno}','{$attachment}','{$today}','{$payment}','{$subtotal}','{$discount}','{$discounted_price}','12','{$total_amount}','{$remarks}','asdf'); "; foreach ($getrestemppodetail as $rowTEMPPODETAIL) { $qry .= "INSERT INTO tbl_po_detail(po_refno,type,description,amount)\n\t\t\t\t\tVALUES('{$new_refno}','{$rowTEMPPODETAIL['type']}','{$rowTEMPPODETAIL['description']}','{$rowTEMPPODETAIL['amount']}'); "; } $qry .= "UPDATE tbl_service_master SET po_refno = '{$new_refno}' WHERE estimate_refno = '{$estimaterefno}'; "; $qry .= "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'PURCHASEORDER'; "; $qry .= "DELETE FROM tbl_temp_po_detail WHERE ses_id = '{$ses_id}'; "; $res = $dbo->query($qry); $msg = "created";
} if (!empty($estimateno)) { $where .= " AND estimate_refno LIKE '{$estimateno}%'"; } $qryservices = new v_service_master(); $resservices = $dbo->query($qryservices->Query($where)); } if (isset($_POST['option']) && !empty($_POST['option']) && $_POST['option'] == 1) { $cntERNo = count($_POST['chkEstimateRefNo']); if ($cntERNo > 0) { switch ($_POST['opt']) { case 1: $cnt = 1; $qry = null; foreach ($_REQUEST['chkEstimateRefNo'] as $val) { $new_refno = getNewNum('WORKORDER', $cnt); $qry .= "UPDATE tbl_service_master SET wo_refno = '{$new_refno}', trans_status = '1' WHERE estimate_refno = '{$val}'; "; $cnt++; } $qry .= "UPDATE tbl_controlno SET lastseqno = (lastseqno + {$cnt}) WHERE control_type = 'WORKORDER'; "; $res = $dbo->query($qry); $msg = "approved"; break; case 2: $qry = null; foreach ($_REQUEST['chkEstimateRefNo'] as $val) { $qry .= "UPDATE tbl_service_master SET trans_status = '2' WHERE estimate_refno = '{$val}'; "; } $res = $dbo->query($qry); $msg = "disapproved"; break;
<?php require_once "conf/db_connection.php"; require_once "functions.php"; if (!isset($_SESSION)) { session_start(); } if (isset($_POST['save'])) { $desc = $_POST['description']; $newnum = getNewNum('PAYMENT_TERM'); $payment_term_insert = "INSERT INTO tbl_payment_term (payment_term_code,description,created_date) VALUES \n\t \t('" . $newnum . "',\n\t \t'" . $desc . "',\n\t \t'" . $today . "')"; $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'PAYMENT_TERM' "; $res = mysql_query($payment_term_insert) or die("INSERT PAYMENT TERM " . mysql_error()); if (!$res) { echo '<script>alert("There has been an error on saving your payment term! Please double check all the data and save.");</script>'; } else { mysql_query($update_controlno); echo '<script>alert("Payment term successfully saved.");</script>'; } echo '<script>window.location="payment_term_list.php";</script>'; } ?> <html> <head> <title></title> <link rel="stylesheet" type="text/css" href="style/cal.css" /> <link rel="stylesheet" type="text/css" href="style/forms.css" /> </head> <body> <form method="post" name="payment_term_form" class="form" onsubmit="return ValidateMe();"> <fieldset form="form_payment_term" name="form_payment_term">
$serial = $_POST['serial']; $remarks = $_POST['txtremarks']; $payment = $_POST['paymentmode']; $subtotal = trim(str_replace(",", "", $_POST['subtotal'])); $discount = trim(str_replace(",", "", $_POST['discount'])); $discounted_price = trim(str_replace(",", "", $_POST['discounted_price'])); $vat = $_POST['vat']; $total_amount = trim(str_replace(",", "", $_POST['totalamount'])); if ($_POST['txtrecommendation']) { $recommendation = $_POST['txtrecommendation']; } else { $recommendation = null; } $qrytempestimate = "SELECT * FROM v_temp_estimate WHERE ses_id = '{$ses_id}'"; $restempestimate = $dbo->query($qrytempestimate); $oe_no = getNewNum('ONLINE_ESTIMATE'); $sql = null; $sql .= "INSERT INTO tbl_online_estimate_master\n\t\t\t(oe_id,transaction_date,customer,address,contactno,emailaddress,plateno,year,make,model,color,variant,engineno,chassisno,serialno,remarks,recommendation,payment_id,subtotal_amount,discount,discounted_price,vat,total_amount)\n\t\t\tVALUES('{$oe_no}','{$today}','{$customer}','{$address}','{$contactno}','{$emailaddress}','{$plateno}','{$year}','{$make}','{$model}','{$color}','{$variant}','{$engine}','{$chassis}','{$serial}','{$remarks}','{$recommendation}','{$payment}','{$subtotal}','{$discount}','{$discounted_price}','{$vat}','{$total_amount}'); "; foreach ($restempestimate as $rowtempestimate) { $sql .= "INSERT INTO tbl_online_estimate_detail\n\t\t\t\t(oe_id,type,id,amount)\n\t\t\t\tVALUES('{$oe_no}','{$rowtempestimate['type']}','{$rowtempestimate['id']}','{$rowtempestimate['rate']}'); "; } $sql .= "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'ONLINE_ESTIMATE'; "; $sql .= "DELETE FROM tbl_temp_estimate WHERE ses_id = '{$ses_id}'; "; $qry = $dbo->query($sql); if (!$qry) { echo '<script>alert("There has been an error on saving your service! Please double check all the data and save.");</script>'; } else { echo '<script>alert("Service successfully saved. Please print a copy, this will serve as your reference.");</script>'; } echo '<script>window.open("online_estimate_print.php?oe_id=' . $oe_no . '");</script>'; // echo '<script>window.location="estimate_add1.php";</script>';
require_once "conf/db_connection.php"; require_once "functions.php"; if (!isset($_SESSION)) { session_start(); } $qry_items = "SELECT * FROM v_items WHERE status = '1' ORDER BY item_description"; $result_items = $dbo->query($qry_items); if (isset($_POST['save'])) { $accessory = strtoupper($_POST['accessory']); $access_disc = str_replace(",", "", $_POST['access_disc']); $access_srp = str_replace(",", "", $_POST['access_srp']); $access_onhand = $_POST['access_onhand']; $access_low = $_POST['access_low']; $access_status = $_POST['access_status']; $item_code = $_POST['item_code']; $newnum = getNewNum('ACCESSORY'); $accessory_insert = "INSERT INTO tbl_accessory (accessory_id, accessory, access_disc, access_srp, access_onhand, access_low, access_status, access_created, item_code) VALUES \n\t\t('" . $newnum . "',\n\t\t'" . $accessory . "',\n\t\t'" . $access_disc . "',\n\t\t'" . $access_srp . "',\n\t\t'" . $access_onhand . "',\n\t\t'" . $access_low . "',\n\t\t'" . $access_status . "',\n\t\t'" . $today . "',\n\t\t'" . $item_code . "')"; $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'ACCESSORY' "; $res = mysql_query($accessory_insert) or die("INSERT ACCESSORY " . mysql_error()); if (!$res) { echo '<script>alert("There has been an error on saving your accessory! Please double check all the data and save.");</script>'; } else { mysql_query($update_controlno); echo '<script>alert("Accessory successfully saved.");</script>'; } echo '<script>window.location="accessory_list.php";</script>'; } ?> <html> <head> <title></title>
<?php require_once "conf/db_connection.php"; require_once "functions.php"; if (!isset($_SESSION)) { session_start(); } if (isset($_POST['save'])) { $make = strtoupper($_POST['make']); $make_rate = str_replace(",", "", $_POST['make_rate']); $newnum = getNewNum('MAKE'); $make_insert = "INSERT INTO tbl_make (make_id, make, make_rate, make_created) VALUES\n\t\t('" . $newnum . "',\n\t\t'" . $make . "',\n\t\t'" . $make_rate . "',\n\t\t'" . $today . "')"; $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'MAKE' "; $res = mysql_query($make_insert) or die("INSERT MAKE " . mysql_error()); if (!$res) { echo '<script>alert("There has been an error on saving your make! Please double check all the data and save.");</script>'; } else { mysql_query($update_controlno); echo '<script>alert("Make successfully saved.");</script>'; } echo '<script>window.location="make_list.php";</script>'; } ?> <html> <head> <title></title> <link rel="stylesheet" type="text/css" href="style/cal.css" /> <link rel="stylesheet" type="text/css" href="style/forms.css" /> </script>
<?php require_once "conf/db_connection.php"; require_once "functions.php"; if (!isset($_SESSION)) { session_start(); } if (isset($_POST['save'])) { $idle_name = strtoupper($_POST['idle_name']); $newnum = getNewNum('IDLE'); $idle_insert = "INSERT INTO tbl_idle (idle_id, idle_name, idle_created) VALUES\n\t\t('" . $newnum . "',\n\t\t'" . $idle_name . "',\n\t\t'" . $today . "')"; $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'IDLE' "; $res = mysql_query($idle_insert) or die("INSERT IDLE " . mysql_error()); if (!$res) { echo '<script>alert("There has been an error on saving your idle! Please double check all the data and save.");</script>'; } else { mysql_query($update_controlno); echo '<script>alert("Idle successfully saved.");</script>'; } echo '<script>window.location="idle_list.php";</script>'; } ?> <html> <head> <title></title> <link rel="stylesheet" type="text/css" href="style/cal.css" /> <link rel="stylesheet" type="text/css" href="style/forms.css" /> </head> <body> <form method="post" name="color_form" class="form" onSubmit="return ValidateMe();">
<?php require_once "conf/db_connection.php"; require_once "functions.php"; if (!isset($_SESSION)) { session_start(); } if (isset($_POST['save'])) { $wocat = strtoupper($_POST['wocat']); $newnum = getNewNum('WOCATEGORY'); $wocat_insert = "INSERT INTO tbl_wocat (wocat_id, wocat, wocat_created) VALUES\n\t\t('" . $newnum . "',\n\t\t'" . $wocat . "',\n\t\t'" . $today . "')"; $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'WOCATEGORY' "; $res = mysql_query($wocat_insert) or die("INSERT WOCAT " . mysql_error()); if (!$res) { echo '<script>alert("There has been an error on saving your work order category! Please double check all the data and save.");</script>'; } else { mysql_query($update_controlno); echo '<script>alert("Work order category successfully saved.");</script>'; } echo '<script>window.location="wocategory_list.php";</script>'; } ?> <html> <head> <title></title> <link rel="stylesheet" type="text/css" href="style/cal.css" /> <link rel="stylesheet" type="text/css" href="style/forms.css" /> </head> <body> <form method="post" name="wocat_form" class="form" onSubmit="return ValidateMe();"> <fieldset form="form_wocat" name="form_wocat">
<?php require_once "conf/db_connection.php"; require_once "functions.php"; if (!isset($_SESSION)) { session_start(); } if (isset($_POST['save'])) { $color = strtoupper($_POST['color']); $newnum = getNewNum('COLOR'); $color_insert = "INSERT INTO tbl_color (color_id,color,color_created) VALUES\n\t\t('{$newnum}','{$color}','{$today}') "; $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'COLOR' "; $res = mysql_query($color_insert) or die("INSERT COLOR " . mysql_error()); if (!$res) { echo '<script>alert("There has been an error on saving your color! Please double check all the data and save.");</script>'; } else { mysql_query($update_controlno); echo '<script>alert("Color successfully saved.");</script>'; } echo '<script>window.location="color_list.php";</script>'; } ?> <html> <head> <title></title> <link rel="stylesheet" type="text/css" href="style/cal.css" /> <link rel="stylesheet" type="text/css" href="style/forms.css" /> </script> </head> <body> <form method="post" name="color_form" class="form" onSubmit="return ValidateMe();">
<?php require_once "conf/db_connection.php"; require_once "functions.php"; if (!isset($_SESSION)) { session_start(); } if (isset($_POST['save'])) { $desc = $_POST['description']; $newnum = getNewNum('ITEM_TYPE'); $item_type_insert = "INSERT INTO tbl_item_type (item_type_code,description,created_date) VALUES \n\t \t('" . $newnum . "',\n\t \t'" . $desc . "',\n\t \t'" . $today . "')"; $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'ITEM_TYPE' "; $res = mysql_query($item_type_insert) or die("INSERT ITEM TYPE " . mysql_error()); if (!$res) { echo '<script>alert("There has been an error on saving your Item Type! Please double check all the data and save.");</script>'; } else { mysql_query($update_controlno); echo '<script>alert("Item Type successfully saved.");</script>'; } echo '<script>window.location="item_type_list.php";</script>'; } ?> <html> <head> <title></title> <link rel="stylesheet" type="text/css" href="style/cal.css" /> <link rel="stylesheet" type="text/css" href="style/forms.css" /> </head> <body> <form method="post" name="item_type_form" class="form" onsubmit="return ValidateMe();"> <fieldset form="form_item_type" name="form_item_type">
$qry_payterms = "SELECT * FROM v_payment_term WHERE status = '1'"; $result_payterms = $dbo->query($qry_payterms); $qry_items = "SELECT * FROM v_items WHERE status = '1'"; $result_items = $dbo->query($qry_items); if (isset($_POST['save'])) { $supplier = $_POST['supplier']; $deliverto = $_POST['deliver_to']; $deliveryaddress = $_POST['delivery_address']; $special = $_POST['special']; $paymentterms = $_POST['payment_terms']; $discount = str_replace(",", "", $_POST['discount']); $subtotal = str_replace(",", "", $_POST['subtotal']); $vat = str_replace(",", "", $_POST['vat']); $totalamount = str_replace(",", "", $_POST['total_amount']); $item = explode("|", $_POST['arrItems']); $newnum = getNewNum('PURCHASE_ORDER'); $po_mst_insert = "INSERT INTO tbl_po_mst (po_reference_no,po_date,supplier_code,deliver_to,delivery_address,payment_code,discount,sub_total,vat,total_amount,special_instruction,created_date,created_by) VALUES\n\t\t('" . $newnum . "',\n\t\t'" . $today . "',\n\t\t'" . $supplier . "',\n\t\t'" . $deliverto . "',\n\t\t'" . $deliveryaddress . "',\n\t\t'" . $paymentterms . "',\n\t\t'" . $discount . "',\n\t\t'" . $subtotal . "',\n\t\t'" . $vat . "',\n\t\t'" . $totalamount . "',\n\t\t'" . $special . "',\n\t\t'" . $today . "',\n\t\t'" . $_SESSION['username'] . "')"; $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'PURCHASE_ORDER' "; $res = mysql_query($po_mst_insert) or die("INSERT PO " . mysql_error()); if (!$res) { echo '<script>alert("There has been an error on saving your RO! Please double check all the data and save.");</script>'; } else { $cnt = 1; for ($i = 0; $i < count($item); $i++) { $val = explode(":", $item[$i]); $qry_dtl = mysql_query("INSERT INTO tbl_po_dtl(po_reference_no,item_code,price,quantity,seqno) VALUES\n\t\t\t\t\t('" . $newnum . "',\n\t\t\t\t\t'" . $val[0] . "',\n\t\t\t\t\t'" . $val[4] . "',\n\t\t\t\t\t'" . $val[5] . "',\n\t\t\t\t\t'" . $cnt . "')"); $cnt++; } mysql_query($update_controlno); echo '<script>alert("PO successfully saved.");</script>'; }
<?php require_once "conf/db_connection.php"; require_once "functions.php"; if (!isset($_SESSION)) { session_start(); } if (isset($_POST['save'])) { $employee = strtoupper($_POST['employee']); $position = $_POST['position']; $image = $_FILES['emp_image']['name']; $newnum = getNewNum('EMPLOYEE'); if (!empty($image)) { $upload_path = 'images/employees/'; $ext = substr($image, strpos($image, '.'), strlen($image) - 1); if (file_exists($upload_path . $image)) { unlink($upload_path . $image); } $img = $newnum . $ext; move_uploaded_file($_FILES['emp_image']['tmp_name'], $upload_path . $img); } else { $img = 'no-image.png'; } $employee_insert = "INSERT INTO tbl_employee (emp_id,employee,position, emp_image, emp_created) VALUES\n\t\t('" . $newnum . "',\n\t\t'" . $employee . "',\n\t\t'" . $position . "',\n\t\t'" . $img . "',\n\t\t'" . $today . "')"; $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'EMPLOYEE' "; $res = mysql_query($employee_insert) or die("INSERT EMPLOYEE " . mysql_error()); if (!$res) { echo '<script>alert("There has been an error on saving your employee profile! Please double check all the data and save.");</script>'; } else { mysql_query($update_controlno); echo '<script>alert("Employee profile successfully saved.");</script>';
$nArrItems = null; foreach ($result_rr_dtl as $row) { $itemcode = $row['item_code']; $itemdesc = $row['item_description']; $itemuom = $row['UOM']; $itemuomdesc = $row['UOM_desc']; $itemprice = $row['price']; $itemqty = $row['quantity']; $itemrrttl = $row['rr_total']; $nArrItems .= $itemcode . ":" . $itemdesc . ":" . $itemuom . ":" . $itemuomdesc . ":" . $itemprice . ":" . $itemqty . ":" . $itemrrttl . "|"; } if ($num_rr_dtl > 0) { $nArrItems = rtrim($nArrItems, "|"); } if (isset($_POST['update'])) { $newnum = getNewNum('RR_POSTING'); $po_mst_upd = "UPDATE tbl_po_mst \n\t\t\tSET rr_post_reference_no = '{$newnum}'\n\t\t\t\t,rr_post_date = '{$today}'\n\t\t\t\t,posted_by = '{$_SESSION['username']}'\n\t\t\tWHERE po_reference_no = '{$id}' "; $rr_mst_upd = "UPDATE tbl_rr_mst \n\t\t\tSET rr_post_reference_no = '{$newnum}'\n\t\t\t\t,rr_post_date = '{$today}'\n\t\t\t\t,posted_by = '{$_SESSION['username']}'\n\t\t\t\t,status = '1'\n\t\t\tWHERE po_reference_no = '{$id}' "; $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'RR_POSTING' "; $res = mysql_query($po_mst_upd) or die("UPDATE Posting " . mysql_error()); mysql_query($rr_mst_upd); if (!$res) { echo '<script>alert("There has been an error on posting your RR! Please double check all the data and save.");</script>'; } else { mysql_query($update_controlno); echo '<script>alert("RR successfully posted.");</script>'; } echo '<script>window.location="rr_posting_edit.php?id=' . $id . '";</script>'; } ?> <html>
session_start(); require_once "conf/db_connection.php"; require_once "functions.php"; $worefno = $_GET['worefno']; $getempqry = new v_service_master(); $getempres = $dbo->query($getempqry->Query("WHERE wo_refno = '{$worefno}'")); foreach ($getempres as $rowEMP) { $empid = $rowEMP['emp_id']; $estimaterefno = $rowEMP['estimate_refno']; if ($rowEMP['po_refno'] != '0') { $po_refno = $rowEMP['po_refno']; } else { $po_refno = '0'; } } $billing_refno = getNewNum('BILLING'); $check_date = dateFormat($today, "Y-m-d H:i"); $qry = null; $qry .= "UPDATE tbl_jobclock_checkin_checkout SET check_out = '{$check_date}' WHERE wo_refno = '{$worefno}'; "; $qry .= "UPDATE tbl_jobclock_master SET job_end = '{$today}', job_status = '2' WHERE wo_refno = '{$worefno}'; "; $qry .= "UPDATE tbl_service_master SET trans_status = '5' WHERE wo_refno = '{$worefno}'; "; $qry .= "UPDATE tbl_po_master SET trans_status = '2' WHERE wo_refno = '{$worefno}'; "; $res = $dbo->query($qry); // GET DATA OF JOBCLOCK MASTER $qryidletimehistorymst = "SELECT * FROM v_jobclock_master WHERE wo_refno = '{$worefno}'"; $residletimehistorymst = mysql_query($qryidletimehistorymst); while ($row = mysql_fetch_array($residletimehistorymst)) { $jobstatus = $row['job_status']; $jobstart = $row['job_start']; $jobend = $row['job_end']; }
<?php require_once "conf/db_connection.php"; require_once "functions.php"; if (!isset($_SESSION)) { session_start(); } if (isset($_POST['save'])) { $model = strtoupper($_POST['model']); $variant = $_POST['model']; $variantdesc = $_POST['variantdesc']; $newnum = getNewNum('MODEL'); $model_insert = "INSERT INTO tbl_model (model_id, model, variant, variantdesc, model_created) VALUES\n\t\t('" . $newnum . "',\n\t\t'" . $model . "',\n\t\t'" . $variant . "',\n\t\t'" . $variantdesc . "',\n\t\t'" . $today . "')"; $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'MODEL' "; $res = mysql_query($model_insert) or die("INSERT MODEL " . mysql_error()); if (!$res) { echo '<script>alert("There has been an error on saving your model! Please double check all the data and save.");</script>'; } else { mysql_query($update_controlno); echo '<script>alert("Model successfully saved.");</script>'; } echo '<script>window.location="model_list.php";</script>'; } ?> <html> <head> <title></title> <link rel="stylesheet" type="text/css" href="style/cal.css" /> <link rel="stylesheet" type="text/css" href="style/forms.css" /> </script>
<?php require_once "conf/db_connection.php"; require_once "functions.php"; if (!isset($_SESSION)) { session_start(); } if (isset($_POST['save'])) { $job = strtoupper($_POST['job']); $wocatid = $_POST['wocatid']; $stdhr = $_POST['stdhr']; $flagrate = $_POST['flagrate']; $stdrate = str_replace(",", "", $_POST['stdrate']); $newnum = getNewNum('JOB'); $job_insert = "INSERT INTO tbl_job (job_id, job, wocat_id, stdhr, stdrate, flagrate) VALUES\n\t\t('" . $newnum . "',\n\t\t'" . $job . "',\n\t\t'" . $wocatid . "',\n\t\t'" . $stdhr . "',\n\t\t'" . $flagrate . "',\n\t\t'" . $stdrate . "')"; $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'JOB' "; $res = mysql_query($job_insert) or die("INSERT JOB " . mysql_error()); if (!$res) { echo '<script>alert("There has been an error on saving your job! Please double check all the data and save.");</script>'; } else { mysql_query($update_controlno); echo '<script>alert("Job successfully saved.");</script>'; } echo '<script>window.location="job_list.php";</script>'; } $query = " SELECT * FROM v_wocat order by wocat_id"; $result = $dbo->query($query); ?> <html> <head> <title</title>
if (!isset($_SESSION)) { session_start(); } $qry_uom = "SELECT * FROM v_uom ORDER BY description"; $result_uom = $dbo->query($qry_uom); $qry_item_type = "SELECT * FROM v_item_type ORDER BY description"; $result_item_type = $dbo->query($qry_item_type); if (isset($_POST['save'])) { $sapitemcode = strtoupper($_POST['sap_item_code']); $desc = strtoupper($_POST['description']); $unitprice = str_replace(",", "", $_POST['unit_price']); $uom = $_POST['uom']; $lowstockvalue = $_POST['low_stock_value']; $lastunitprice = str_replace(",", "", $_POST['last_unit_price']); $itemtype = $_POST['item_type']; $newnum = getNewNum('ITEMS'); $item_insert = "INSERT INTO tbl_items (item_code,SAP_item_code,item_description,unit_price,UOM,low_stock_value,last_unit_price,item_type,created_date) VALUES \n\t\t('" . $newnum . "',\n\t\t'" . $sapitemcode . "',\n\t\t'" . $desc . "',\n\t\t'" . $unitprice . "',\n\t\t'" . $uom . "',\n\t\t'" . $lowstockvalue . "',\n\t\t'" . $lastunitprice . "',\n\t\t'" . $itemtype . "',\n\t\t'" . $today . "')"; $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'ITEMS' "; $res = mysql_query($item_insert) or die("INSERT ITEM " . mysql_error()); if (!$res) { echo '<script>alert("There has been an error on saving your item! Please double check all the data and save.");</script>'; } else { mysql_query($update_controlno); echo '<script>alert("Item successfully saved.");</script>'; } echo '<script>window.location="items_list.php";</script>'; } ?> <html> <head> <title></title>
$rescost_accessory = $dbo->query($qrycost_accessory->Query("WHERE estimate_refno = '{$estimaterefno}'")); $numrow1 = count($rescost_accessory); $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}'")); $numrow2 = count($rescost_material); $qrycost_parts = new v_service_detail_parts(); $rescost_parts = $dbo->query($qrycost_parts->Query("WHERE estimate_refno = '{$estimaterefno}'")); $numrow = count($rescost_parts); $subtotal = 0; if (isset($_POST['option']) && !empty($_POST['option']) && $_POST['option'] == 1) { $qry = null; switch ($_POST['opt']) { case 1: $new_refno = getNewNum('WORKORDER'); $qry .= "UPDATE tbl_service_master SET wo_refno = '{$new_refno}',wo_trans_date = '{$today}', trans_status = '4' WHERE estimate_refno = '{$estimaterefno}'; "; $qry .= "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'WORKORDER'; "; // PARTS if ($numrow > 0) { // while($row = mysql_fetch_array($result)){ foreach ($rescost_parts as $row) { $qty = $row['qty']; $starting = $row['parts_onhand']; $ending = $row['parts_onhand'] - $qty; $qry .= "UPDATE tbl_parts SET part_onhand = (part_onhand - {$qty}), parts_used = (parts_used + {$qty}) WHERE parts_id = '{$row['id']}'; "; $qry .= "INSERT INTO tbl_po_inventory(item_code,beginning_balance,issued,issued_date,ending_balance,remarks,reference_no,item_type,created_date,created_by)\n\t\t\t\t\t\t\t\t\tVALUES('{$row['item_code']}','{$starting}','{$qty}','{$today}','{$ending}','{$new_refno}','{$new_refno}','parts','{$today}','{$_SESSION['username']}'); "; } } // ACCESSORY or LUBRICANTS if ($numrow1 > 0) {
<?php require_once "conf/db_connection.php"; require_once "functions.php"; if (!isset($_SESSION)) { session_start(); } if (isset($_POST['save'])) { $year = $_POST['year']; $newnum = getNewNum('YEAR'); $year_insert = "INSERT INTO tbl_year (year_id, year) VALUES\n\t\t('" . $newnum . "',\n\t\t'" . $year . "')"; $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'YEAR' "; $res = mysql_query($year_insert) or die("INSERT YEAR " . mysql_error()); if (!$res) { echo '<script>alert("There has been an error on saving your year! Please double check all the data and save.");</script>'; } else { mysql_query($update_controlno); echo '<script>alert("Year successfully saved.");</script>'; } echo '<script>window.location="year_list.php";</script>'; } ?> <html> <head> <title></title> <link rel="stylesheet" type="text/css" href="style/cal.css" /> <link rel="stylesheet" type="text/css" href="style/forms.css" /> </script> </head> <body> <form method="post" name="year_form" class="form" onSubmit="return ValidateMe();">
} if (isset($_POST['save'])) { $vehicle_id = $_POST['vehicle_id']; $customer_id = $_POST['customer_id']; $address = $_POST['customer_address']; $plate_no = strtoupper($_POST['plateno']); $year = $_POST['year']; $make = $_POST['make']; $model = $_POST['model']; $color = $_POST['color']; $variant = $_POST['variant']; $engine_no = $_POST['engineno']; $chassis_no = $_POST['chassisno']; $serial_no = $_POST['serialno']; $conductionsticker = $_POST['conductionsticker']; $newnum = getNewNum('VEHICLE'); $vehiclelist_insert = "INSERT INTO tbl_vehicleinfo (vehicle_id,customer_id, address, plate_no, year, make, model, color, variant, engine_no, chassis_no, serial_no, conduction_sticker) VALUES\n\t\t('" . $newnum . "',\n\t\t'" . $customer_id . "',\n\t\t'" . $address . "',\n\t\t'" . $plate_no . "',\n\t\t'" . $year . "',\n\t\t'" . $make . "',\n\t\t'" . $model . "',\n\t\t'" . $color . "',\n\t\t'" . $variant . "',\n\t\t'" . $engine_no . "',\n\t\t'" . $chassis_no . "',\n\t\t'" . $serial_no . "',\n\t\t'" . $conductionsticker . "')"; $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'VEHICLE' "; $res = mysql_query($vehiclelist_insert) or die("INSERT VEHICLE LIST " . mysql_error()); if (!$res) { echo '<script>alert("There has been an error on saving your customers vehicle profile!");</script>'; } else { mysql_query($update_controlno); echo '<script>alert("Customers vehicle profile successfully saved.");</script>'; } echo '<script>window.location="vehicle_list.php";</script>'; } $qry = " SELECT * FROM v_customer order by lastname"; $result = $dbo->query($qry); $qry1 = " SELECT * FROM v_customer order by lastname"; $result1 = $dbo->query($qry1);
require_once "conf/db_connection.php"; require_once "functions.php"; if (!isset($_SESSION)) { session_start(); } $qry_items = "SELECT * FROM v_items WHERE status = '1' ORDER BY item_description"; $result_items = $dbo->query($qry_items); if (isset($_POST['save'])) { $material = strtoupper($_POST['material']); $material_disc = str_replace(",", "", $_POST['material_disc']); $material_srp = str_replace(",", "", $_POST['material_srp']); $material_onhand = $_POST['material_onhand']; $material_lowstock = $_POST['material_lowstock']; $material_status = $_POST['material_status']; $item_code = $_POST['item_code']; $newnum = getNewNum('MATERIAL'); $material_insert = "INSERT INTO tbl_material (material_id, material, material_disc, material_srp, material_onhand, material_lowstock, material_status, material_created,item_code) VALUES\n\t\t('" . $newnum . "',\n\t\t'" . $material . "',\n\t\t'" . $material_disc . "',\n\t\t'" . $material_srp . "',\n\t\t'" . $material_onhand . "',\n\t\t'" . $material_lowstock . "',\n\t\t'" . $material_status . "',\n\t\t'" . $today . "',\n\t\t'" . $item_code . "')"; $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'MATERIAL' "; $res = mysql_query($material_insert) or die("INSERT MATERIAL " . mysql_error()); if (!$res) { echo '<script>alert("There has been an error on saving your material! Please double check all the data and save.");</script>'; } else { mysql_query($update_controlno); echo '<script>alert("Material successfully saved.");</script>'; } echo '<script>window.location="material_list.php";</script>'; } ?> <html> <head> <title></title>
<?php require_once "conf/db_connection.php"; require_once "functions.php"; if (!isset($_SESSION)) { session_start(); } if (isset($_POST['save'])) { $desc = $_POST['description']; $newnum = getNewNum('UOM'); $uom_insert = "INSERT INTO tbl_uom (uom_code,description,created_date) VALUES \n\t \t('" . $newnum . "',\n\t \t'" . $desc . "',\n\t \t'" . $today . "')"; $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'UOM' "; $res = mysql_query($uom_insert) or die("INSERT UOM " . mysql_error()); if (!$res) { echo '<script>alert("There has been an error on saving your UOM! Please double check all the data and save.");</script>'; } else { mysql_query($update_controlno); echo '<script>alert("UOM successfully saved.");</script>'; } echo '<script>window.location="uom_list.php";</script>'; } ?> <html> <head> <title></title> <link rel="stylesheet" type="text/css" href="style/cal.css" /> <link rel="stylesheet" type="text/css" href="style/forms.css" /> </head> <body> <form method="post" name="uom_form" class="form" onsubmit="return ValidateMe();"> <fieldset form="form_uom" name="form_uom">
<?php require_once "conf/db_connection.php"; require_once "functions.php"; if (!isset($_SESSION)) { session_start(); } if (isset($_POST['save'])) { $payment = mysql_real_escape_string(strtoupper($_POST['payment'])); $newnum = getNewNum('PAYMENT'); $payment_insert = "INSERT INTO tbl_payment (payment_id, payment, payment_created) VALUES\n\t\t('" . $newnum . "',\n\t\t'" . $payment . "',\n\t\t'" . $today . "')"; $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'PAYMENT' "; $res = mysql_query($payment_insert) or die("INSERT PAYMENT " . mysql_error()); if (!$res) { echo '<script>alert("There has been an error on saving your payment! Please double check all the data and save.");</script>'; } else { mysql_query($update_controlno); echo '<script>alert("Payment successfully saved.");</script>'; } echo '<script>window.location="payment_list.php";</script>'; } ?> <html> <head> <title></title> <link rel="stylesheet" type="text/css" href="style/cal.css" /> <link rel="stylesheet" type="text/css" href="style/forms.css" /> </head> <body> <form method="post" name="payment_form" class="form" onSubmit="return ValidateMe();">
require_once "conf/db_connection.php"; require_once "functions.php"; if (!isset($_SESSION)) { session_start(); } if (isset($_POST['save'])) { $sapsuppliercode = $_POST['sap_supplier_code']; $suppliername = $_POST['supplier_name']; $address = $_POST['address']; $contactperson = $_POST['contact_person']; $phone = $_POST['phone']; $fax = $_POST['fax']; $email = $_POST['email']; $tin = $_POST['TIN']; $isvat = $_POST['isVat']; $newnum = getNewNum('SUPPLIER'); $supplier_insert = "INSERT INTO tbl_suppliers (supplier_code,SAP_supplier_code,supplier_name,address,contact_person,phone,fax,email,TIN,isVat,created_date,status) VALUES \n\t \t('" . $newnum . "',\n\t \t'" . $sapsuppliercode . "',\n\t \t'" . $suppliername . "',\n\t \t'" . $address . "',\n\t \t'" . $contactperson . "',\n\t \t'" . $phone . "',\n\t \t'" . $fax . "',\n\t \t'" . $email . "',\n\t \t'" . $TIN . "',\n\t \t'" . $isvat . "',\n\t \t'" . $today . "','1')"; $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'SUPPLIER' "; $res = mysql_query($supplier_insert) or die("INSERT SUPPLIER " . mysql_error()); if (!$res) { echo '<script>alert("There has been an error on saving your supplier! Please double check all the data and save.");</script>'; } else { mysql_query($update_controlno); echo '<script>alert("Supplier successfully saved.");</script>'; } echo '<script>window.location="supplier_list.php";</script>'; } ?> <html> <head> <title></title>
$nArrItems = null; foreach ($result_rr_dtl as $row) { $itemcode = $row['item_code']; $itemdesc = $row['item_description']; $itemuom = $row['UOM']; $itemuomdesc = $row['UOM_desc']; $itemprice = $row['price']; $itemqty = $row['quantity']; $itemrr = $row['rr_quantity']; $nArrItems .= $itemcode . ":" . $itemdesc . ":" . $itemuom . ":" . $itemuomdesc . ":" . $itemprice . ":" . $itemqty . "|"; } if ($num_rr_dtl > 0) { $nArrItems = rtrim($nArrItems, "|"); } if (isset($_POST['update'])) { $newnum = getNewNum('CV_REFERENCE'); switch ($_POST['status']) { case 1: // BILLED $po_mst_upd = "UPDATE tbl_po_mst \n\t\t\t\t\t\tSET cv_reference_no = '{$newnum}'\n\t\t\t\t\t\t\t,payment_date = '{$today}'\n\t\t\t\t\t\t\t,billed_by = '{$_SESSION['username']}'\n\t\t\t\t\t\tWHERE po_reference_no = '{$id}'"; $rr_mst_upd = "UPDATE tbl_rr_mst \n\t\t\t\t\t\tSET cv_reference_no = '{$newnum}'\n\t\t\t\t\t\t\t,payment_date = '{$today}'\n\t\t\t\t\t\t\t,billed_by = '{$_SESSION['username']}'\n\t\t\t\t\t\t\t,status = '10'\n\t\t\t\t\t\tWHERE po_reference_no = '{$id}' "; $update_controlno = "UPDATE tbl_controlno SET lastseqno = (lastseqno + 1) WHERE control_type = 'CV_REFERENCE' "; $res = mysql_query($po_mst_upd) or die("UPDATE Billing " . mysql_error()); mysql_query($rr_mst_upd); if (!$res) { echo '<script>alert("There has been an error on billing your PO! Please double check all the data and save.");</script>'; } else { mysql_query($update_controlno); echo '<script>alert("PO successfully billed.");</script>'; } echo '<script>window.location="po_payment_edit.php?id=' . $id . '";</script>';