This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ # Includes require_once "_lib/php/auth.php"; # Parse Contact Methods if (isset($_POST["contact_method_mText"])) { $contactMethods = hex2str($_POST["contact_method_mText"]); $contactMethods = json_decode($contactMethods); $contactMethodsInsertStr = array2sqlstring($contactMethods, "0,2"); } # Multi Form Columns $contactMethodsCols = "contact_method,contact_method_notes,id_contact_method_tp,id_cust_contact"; # Parse Form Action $action = $_POST['action']; $form = $_POST['form']; $formAction = $form . "," . $action; # Begin SQL Functions switch ($formAction) { case "frmContact,insert": /*****************************************************************************/ # Insert Address Record $gdbo->dbTable = "_addr"; $gdbo->insertRec(); $_POST["id_addr"] = $gdbo->insertedID;
$contactMethodsInsertStr = array2sqlstring($contactMethods, "0,2"); } if (isset($_POST["degree_mText"])) { $degree = hex2str($_POST["degree_mText"]); $degree = json_decode($degree); $degreeInsertStr = array2sqlstring($degree, "0,1,2,4,5,6"); } if (isset($_POST["certification_mText"])) { $certification = hex2str($_POST["certification_mText"]); $certification = json_decode($certification); $certificationInsertStr = array2sqlstring($certification, "3,4,5"); } if (isset($_POST["insurance_mText"])) { $insurance = hex2str($_POST["insurance_mText"]); $insurance = json_decode($insurance); $insuranceInsertStr = array2sqlstring($insurance, "0,2,3,4"); } # Multi Form Columns $contactMethodsCols = "contact_method,contact_method_notes,id_contact_method_tp,id_cust_contact"; $degreeCols = "hr_degree_hours,hr_degree,hr_degree_ds,hr_degree_da,id_hr_degree_status,id_hr_degree_level,id_cust_company,id_cust_branch,id_hr_emp"; $certificationCols = "hr_certification_hours,hr_certification_ds,hr_certification_da,id_hr_certification_status,id_hr_certification_provider,id_hr_certification_tp,id_hr_emp"; $insuranceCols = "hr_insurance_ds,hr_insurance_de,id_cust_company,id_hr_insurance_plan,id_hr_insurance_coverage,id_hr_emp"; # Parse Form Action $action = $_POST['action']; $form = $_POST['form']; $formAction = $form . "," . $action; # Begin SQL Functions switch ($formAction) { case "frmEmp,insert": /*****************************************************************************/ # Insert Address Record
$_POST["contract_dr"] = $dtTimeUTC; } elseif ($_POST["id_sys_status"] != 14 && isset($_POST["contract_dr"]) && $_POST["contract_dr"] != "") { $_POST["contract_dr"] = ''; } else { $_POST["contract_dr"] = isset($_POST["contract_dr"]) ? $_POST["contract_dr"] : null; } # Parse if (isset($_POST["payment_mText"])) { $payments = hex2str($_POST["payment_mText"]); $payments = json_decode($payments); $paymentsFormatted = array(); foreach ($payments as $payment => $entry) { $paymentProcessed = !empty($entry[2]) ? strtotime($entry[2]) : NULL; $paymentsFormatted[] = array($entry[0], strtotime($entry[1]), $paymentProcessed, $entry[3]); } $paymentsInsertStr = array2sqlstring($paymentsFormatted, "0,1"); } # Multi Form Columns $paymentCols = "contract_payment,contract_payment_dr,contract_payment_dp,id_contract"; switch ($formAction) { case "frmContract,insert": /*****************************************************************************/ $gdbo->dbTable = "_contract"; $gdbo->insertRec(); $_POST["id_contract"] = $gdbo->insertedID; # Insert Payments $gdbo->dbTable = "_contract_payment"; if (!empty($paymentsInsertStr)) { $gdbo->dbTable = "_contract_payment"; $paymentsInsertStr = str_replace("~id~", $_POST["id_contract"], $paymentsInsertStr); $gdbo->sql = "(" . $paymentCols . ") values " . $paymentsInsertStr;
GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ # Includes require_once "_lib/php/auth.php"; if (isset($_POST["lineItem_mText"])) { $lineItems = hex2str($_POST["lineItem_mText"]); $lineItems = json_decode($lineItems); $lineItemsInsertStr = array2sqlstring($lineItems, '0,2,3,4'); } if (isset($_POST["payment_mText"])) { $paymentItems = hex2str($_POST["payment_mText"]); $paymentItems = json_decode($paymentItems); $paymentItemsInsertStr = array2sqlstring($paymentItems, '0,4'); } # Multi Form Columns $lineItemsCols = "purchaseorder_item,purchaseorder_item_dservice,purchaseorder_item_qty,purchaseorder_item_rate,purchaseorder_item_amount,purchaseorder_item_percentTax,purchaseorder_item_totalAmount,id_contract,id_purchaseorder_qty_tp,id_purchaseorder"; $paymentItemsCols = "purchaseorder_payment,purchaseorder_payment_refNumber,purchaseorder_payment_dreceived,purchaseorder_payment_dcleared,id_purchaseorder_payment_tp,id_contract,id_purchaseorder"; # Parse Form Action $action = $_POST['action']; $form = $_POST['form']; $formAction = $form . "," . $action; # Begin SQL Functions switch ($formAction) { case "frmpurchaseorder,insert": /*****************************************************************************/ $_POST["purchaseorder_du"] = $dtTimeUTC; $_POST["id_sys_user"] = $id_sys_user; # Insert purchaseorder Record