if ($_REQUEST['password'] != $_REQUEST['passwordConfirm']) { $result['success'] = false; $result['message'] = 'Your passwords do not match.'; } else { $subContractorObj = new Dynamo("sub_contractors"); $sub_contractor_work_category = new Dynamo("sub_contractor_work_category"); $sub_contractor_id = $_REQUEST['id']; $array_sub_categories = $subContractorObj->getOne(); if (trim($_REQUEST['password']) != '') { $password = $_REQUEST['password']; $encryptedPass = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5(ENCRYPTION_KEY), $password, MCRYPT_MODE_CBC, md5(md5(ENCRYPTION_KEY)))); $_REQUEST['password'] = $encryptedPass; } else { $_REQUEST['password'] = $array_sub_categories['password']; } if ($subContractorObj->edit()) { $sub_contractor_work_category->deleteCustom("WHERE sub_contractor_id = " . $sub_contractor_id); if (trim($_REQUEST['work_category_id_string']) != '') { $array_work_category = array(); $work_category_id_string = substr($_REQUEST['work_category_id_string'], 0, -1); if (stristr($work_category_id_string, ",")) { $array_work_category = explode(",", $work_category_id_string); } else { $array_work_category[] = $work_category_id_string; } $query = "INSERT INTO sub_contractor_work_category VALUES"; for ($i = 0; $i < count($array_work_category); $i++) { $query .= "({$sub_contractor_id}," . $array_work_category[$i] . ",NOW()),"; } $query = substr($query, 0, -1); if ($sub_contractor_work_category->customExecuteQuery($query)) {
$community_properties_object = new Dynamo("community_properties"); $community_reports_object = new Dynamo("community_reports"); $community_report_rooms_object = new Dynamo("community_report_rooms"); $community_report_room_items_object = new Dynamo("community_report_room_items"); $community_report_room_item_comments = new Dynamo("community_report_room_item_comments"); $result['success'] = false; $result['message'] = ''; if (trim($_REQUEST['community']) != '' && trim($_REQUEST['jobType']) != '' && trim($_REQUEST['propertyType']) != '' && trim($_REQUEST['city']) != '' && trim($_REQUEST['zip']) != '' && trim($_REQUEST['emails']) != '' && trim($_REQUEST['id']) != '') { $_REQUEST['state'] = null; $_REQUEST['property_type'] = $_REQUEST['propertyType']; $_REQUEST['job_type'] = $_REQUEST['jobType']; $_REQUEST['created_by'] = $_REQUEST['userId']; $_REQUEST['emails'] = $_REQUEST['emails']; $community_properties_array = $community_properties_object->getOne(); $_REQUEST['date_created'] = $community_properties_array["date_created"]; if ($community_properties_object->edit()) { $result['success'] = true; $result['message'] = 'Community successfully edited!'; if (trim($_REQUEST['data']) != '') { $_REQUEST['property_id'] = $_REQUEST['id']; $_REQUEST['date_reported'] = date("Y-m-d H:i:s", time()); $_REQUEST['status_id'] = 0; $_REQUEST['user_id'] = $_REQUEST['created_by'] = $_REQUEST['reported_by'] = $_REQUEST['userId']; $_REQUEST['is_submitted'] = 0; $_REQUEST['is_saved'] = 0; $_REQUEST['is_closed'] = 0; $community_reports_array = $community_reports_object->getAll("WHERE property_id = " . $_REQUEST['property_id']); if (count($community_reports_array) <= 0 || !is_array($community_reports_array)) { $report_id = $_REQUEST['report_id'] = $community_reports_object->getMaxId(); if (!$community_reports_object->add()) { $result['success'] = false;
<?php if (!isset($_SESSION)) { session_start(); } define('__ROOT__', dirname(dirname(__FILE__))); define('__BASENAME__', basename(__ROOT__)); $result['success'] = false; $result['message'] = ''; require_once __ROOT__ . '/modules/Dynamo.class.php'; if (trim($_REQUEST['estimate_unit']) != '' && trim($_REQUEST['id']) != '') { $unitsObj = new Dynamo("units"); if ($unitsObj->edit()) { $result['success'] = true; $result['message'] = 'Estimate Unit successfully edited!'; } else { $result['success'] = false; $result['message'] = 'Sorry, there has been a problem processing your request.'; } } else { $result['success'] = false; $result['message'] = 'Sorry, there has been a problem processing your request.'; } header('Content-type: application/json'); echo json_encode($result);
$complex_properties_object = new Dynamo("complex_properties"); $complex_reports_object = new Dynamo("complex_reports"); $complex_report_rooms_object = new Dynamo("complex_report_rooms"); $complex_report_room_items_object = new Dynamo("complex_report_room_items"); $complex_report_room_item_comments = new Dynamo("complex_report_room_item_comments"); $result['success'] = false; $result['message'] = ''; if (trim($_REQUEST['community']) != '') { $_REQUEST['state'] = null; $_REQUEST['property_type'] = $_REQUEST['propertyType']; $_REQUEST['job_type'] = $_REQUEST['jobType']; $_REQUEST['created_by'] = $_REQUEST['userId']; $_REQUEST['emails'] = $_REQUEST['emails']; $complex_properties_array = $complex_properties_object->getOne(); $_REQUEST['date_created'] = $complex_properties_array["date_created"]; if ($complex_properties_object->edit()) { $result['success'] = true; $result['message'] = 'Complex successfully edited!'; if (trim($_REQUEST['data']) != '') { $_REQUEST['property_id'] = $_REQUEST['id']; $_REQUEST['date_reported'] = date("Y-m-d H:i:s", time()); $_REQUEST['status_id'] = 0; $_REQUEST['user_id'] = $_REQUEST['created_by'] = $_REQUEST['reported_by'] = $_REQUEST['userId']; $_REQUEST['is_submitted'] = 0; $_REQUEST['is_saved'] = 0; $_REQUEST['is_closed'] = 0; $complex_reports_array = $complex_reports_object->getAll("WHERE property_id = " . $_REQUEST['property_id']); if (count($complex_reports_array) <= 0 || !is_array($complex_reports_array)) { $report_id = $_REQUEST['report_id'] = $complex_reports_object->getMaxId(); if (!$complex_reports_object->add()) { $result['success'] = false;
<?php if (!isset($_SESSION)) { session_start(); } define('__ROOT__', dirname(dirname(__FILE__))); define('__BASENAME__', basename(__ROOT__)); $result['success'] = false; $result['message'] = ''; require_once __ROOT__ . '/modules/Dynamo.class.php'; if (trim($_REQUEST['name']) != '' && trim($_REQUEST['id']) != '') { $workCategoryObj = new Dynamo("work_categories"); if ($workCategoryObj->edit()) { $result['success'] = true; $result['message'] = 'Work Category successfully edited!'; } else { $result['success'] = false; $result['message'] = 'Sorry, there has been a problem processing your request.'; } } else { $result['success'] = false; $result['message'] = 'Sorry, there has been a problem processing your request.'; } header('Content-type: application/json'); echo json_encode($result);
$propertyArray = $propertiesObject->getOne(); } else { print "You'll need property ID in order to proceed"; exit; } if (trim($_GET['action']) != '' && trim($_GET['imageId']) != '') { $query = "DELETE FROM daily_logs_images WHERE id = " . $_GET['imageId']; $daily_logs_images_object->customExecuteQuery($query); } if (trim($_POST["company"]) != '' && trim($_POST["report_no"]) != '' && trim($_POST["log_date"]) != '' && trim($_POST["project_community"]) != '' && trim($_POST["total_field_workers"]) != '' && trim($_POST["superintendent"]) != '' && trim($_POST["weather"]) != '') { $log_date = strtotime($_REQUEST['log_date']); $_REQUEST['log_date'] = date("Y-m-d", $log_date); $dailyLogsObject = new Dynamo("daily_logs"); $_REQUEST['id'] = $_REQUEST['daily_logs_id']; $_REQUEST['user_id'] = $_SESSION['user_id']; if ($dailyLogsObject->edit()) { $query = "DELETE FROM daily_logs_today_progress WHERE daily_logs_id = " . $_REQUEST['daily_logs_id']; $daily_logs_today_progress_object->customExecuteQuery($query); for ($i = 1; $i < 30000; $i++) { if (trim($_REQUEST['notes_' . $i]) != '' || trim($_REQUEST['lot_' . $i]) != '') { $_REQUEST["lot"] = $_REQUEST["lot_" . $i]; $_REQUEST["job_status"] = $_REQUEST["job_status_" . $i]; $_REQUEST["notes"] = $_REQUEST["notes_" . $i]; if ($_REQUEST["weather_delay_" . $i]) { $_REQUEST["weather_delay"] = 1; } else { $_REQUEST["weather_delay"] = 0; } if ($_REQUEST["missed_inspection_" . $i]) { $_REQUEST["missed_inspection"] = 1; } else {