<?php require "_globals.php"; require SECURITY; include CLASS_MP_BUSINESS; $biz = new handleBusiness(); if (isset($_POST["submit"])) { $biz->createNewCompany(); foreach ($_POST["fields"] as $db_field => $db_value) { $biz->updateData($db_field, $db_value, $biz->rec["record_id"]); } $biz->updateData("latitude", $_POST["latitude"], $biz->rec["record_id"]); $biz->updateData("longitude", $_POST["longitude"], $biz->rec["record_id"]); $biz->updateData("search_terms", $_POST["search_terms"], $biz->rec["record_id"]); foreach ($_POST["day"] as $key => $value) { if ($value["closed"] == "on") { $build .= "CL|"; } elseif ($value["by_appointment"] == "on") { $build .= "BA|"; } else { $build .= $value["o_hour"] . ":" . $value["o_min"] . "-" . $value["c_hour"] . ":" . $value["c_min"] . "|"; } } $business_hours = rtrim($build, "|"); $biz->updateData("business_hours", $business_hours, $biz->rec["record_id"]); if (trim($_POST["new_sd_cat"]) != "") { $biz->addServiceDirectoryCat(); } $biz->__construct(); header("location: company_edit.php?id=" . $biz->id . "&m=2"); exit;