$_REQUEST['property_type'] = $_REQUEST['propertyType']; $_REQUEST['estimates_multiplier'] = $_REQUEST['estimatesMultiplier']; $_REQUEST['emails'] = $_REQUEST['emailList']; $_REQUEST['estimates_emails'] = $_REQUEST['estimatesEmailList']; $_REQUEST['date_created'] = date("Y-m-d H:i:s"); $complex_properties_obj = new Dynamo("complex_properties"); $complex_properties_array = $complex_properties_obj->getOne(); $_REQUEST['status'] = $complex_properties_array['status']; $_REQUEST['created_by'] = $complex_properties_array['created_by']; $_REQUEST["reported_by"] = $_SESSION['user_id']; $community_properties_obj = new Dynamo("community_properties"); $_REQUEST['property_id'] = $community_property_id = $community_properties_obj->getMaxId(); if ($community_properties_obj->add()) { $community_reports_obj = new Dynamo("community_reports"); $complex_reports_obj = new Dynamo("complex_reports"); $complex_reports_array = $complex_reports_obj->getOneWhere("property_id = " . $complex_properties_array["id"]); $_REQUEST['date_reported'] = date("Y-m-d H:i:s"); $_REQUEST['status_id'] = $_REQUEST['is_submitted'] = $_REQUEST['is_saved'] = $_REQUEST['is_closed'] = 0; $_REQUEST['report_id'] = $community_report_id = $community_reports_obj->getMaxId(); if ($community_reports_obj->add()) { $community_report_rooms_obj = new Dynamo("community_report_rooms"); $community_report_rooms_max_id = $community_report_rooms_obj->getMaxId(); $complex_report_rooms_obj = new Dynamo("complex_report_rooms"); $complex_report_rooms_array = $complex_report_rooms_obj->getAll("WHERE report_id = " . $complex_reports_array["id"] . " ORDER BY id"); if (count($complex_report_rooms_array) > 0) { $query = "INSERT INTO community_report_rooms (`id`,`report_id`,`room_template_id`,`name`,`date_created`,`created_by`) VALUES"; $complex_report_room_items_obj = new Dynamo("complex_report_room_items"); $complex_report_room_items_array = $complex_report_room_items_obj->getAll("WHERE report_id = " . $complex_report_rooms_array[0]["report_id"] . " ORDER BY id"); $community_report_room_items_obj = new Dynamo("community_report_room_items"); $community_report_room_items_max_id = $community_report_room_items_obj->getMaxId(); if (count($complex_report_room_items_array) > 0) {