示例#1
0
     $_REQUEST['date_created'] = date("Y-m-d H:i:s", time());
     $_REQUEST['room_id'] = $community_report_rooms_object->getMaxId();
     if ($community_report_rooms_object->add()) {
         for ($j = 0; $j < count($array_data[$i]->roomItems); $j++) {
             $roomItems = $array_data[$i]->roomItems;
             $_REQUEST['room_template_item_id'] = $roomItems[$j]->roomTemplateItemId;
             $_REQUEST['name'] = $roomItems[$j]->name;
             $_REQUEST['status_id'] = $roomItems[$j]->statusId;
             $_REQUEST['work_category_id'] = $roomItems[$j]->work_category_id;
             $_REQUEST['date'] = $_REQUEST['date_created'] = date("Y-m-d H:i:s", time());
             $_REQUEST['comment'] = $roomItems[$j]->comment;
             $community_report_room_items_id = $community_report_room_items_object->getMaxId();
             if ($community_report_room_items_object->add()) {
                 if (trim($_REQUEST['comment']) != '') {
                     $_REQUEST['room_item_id'] = $community_report_room_items_id;
                     if ($community_report_room_item_comments->add()) {
                     } 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.';
             }
         }
     } else {
         $result['success'] = false;
         $result['message'] = 'Sorry, there has been a problem processing your request.';
     }
 }
 $_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) {
                 $query2 = "INSERT INTO community_report_room_items (`id`,`report_id`,`room_id`,`room_template_item_id`,`name`,`status_id`,`date_created`) VALUES";
             }
             for ($i = 0; $i < count($complex_report_rooms_array); $i++) {
                 $query .= "({$community_report_rooms_max_id}," . $_REQUEST['report_id'] . "," . $complex_report_rooms_array[$i]["room_template_id"] . ",'" . addslashes(stripslashes($complex_report_rooms_array[$i]["name"])) . "',NOW()," . $_SESSION['user_id'] . "),";
示例#3
0
    $image_filename = $report_id . "_" . $imageId . "." . $array_file[count($array_file) - 1];
} else {
    if (trim($_GET['propertyId']) != '') {
        $_REQUEST['report_id'] = '';
        $image_filename = $property_id . "_" . $imageId . "." . $array_file[count($array_file) - 1];
    }
}
$result = $uploader->save(dirname(dirname(__FILE__)) . '/images/report_uploads/' . $image_filename);
if ($result) {
    $_REQUEST['image_name'] = $image_filename;
    $_REQUEST['date'] = date("Y-m-d H:i:s", time());
    $_REQUEST['user_id'] = $_SESSION['user_id'];
    $array_images_exist = array();
    $array_images_exist = $report_images->getAll("WHERE property_id = " . $property_id);
    if (count($array_images_exist) > 0) {
        $_REQUEST['property_image'] = 0;
    } else {
        $_REQUEST['property_image'] = 1;
    }
    $report_images->add();
    ?>
{error:"true",filename:"<?php 
    print $_REQUEST['image_name'];
    ?>
"}
<?php 
} else {
    ?>
{error:"false"}
<?php 
}
示例#4
0
     $_REQUEST['date_created'] = date("Y-m-d H:i:s", time());
     $_REQUEST['room_id'] = $complex_report_rooms_object->getMaxId();
     if ($complex_report_rooms_object->add()) {
         for ($j = 0; $j < count($array_data[$i]->roomItems); $j++) {
             $roomItems = $array_data[$i]->roomItems;
             $_REQUEST['room_template_item_id'] = $roomItems[$j]->roomTemplateItemId;
             $_REQUEST['name'] = $roomItems[$j]->name;
             $_REQUEST['status_id'] = $roomItems[$j]->statusId;
             $_REQUEST['work_category_id'] = $roomItems[$j]->work_category_id;
             $_REQUEST['date'] = $_REQUEST['date_created'] = date("Y-m-d H:i:s", time());
             $_REQUEST['comment'] = $roomItems[$j]->comment;
             $complex_report_room_items_id = $complex_report_room_items_object->getMaxId();
             if ($complex_report_room_items_object->add()) {
                 if (trim($_REQUEST['comment']) != '') {
                     $_REQUEST['room_item_id'] = $complex_report_room_items_id;
                     if ($complex_report_room_item_comments->add()) {
                     } 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.';
             }
         }
     } else {
         $result['success'] = false;
         $result['message'] = 'Sorry, there has been a problem processing your request.';
     }
 }
 $complex_properties_array = $complex_properties_obj->getOne();
 $_REQUEST['date_created'] = $complex_properties_array["date_created"];
 $_REQUEST['status'] = $complex_properties_array['status'];
 $_REQUEST['created_by'] = $complex_properties_array['created_by'];
 $_REQUEST['reported_by'] = $_REQUEST["updated_by"] = $_SESSION['user_id'];
 $properties_obj = new Dynamo("properties");
 $_REQUEST['property_id'] = $community_property_id = $properties_obj->getMaxId();
 if ($properties_obj->add()) {
     $reports_obj = new Dynamo("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_closed'] = $_REQUEST['subcontractor'] = 0;
     $_REQUEST['is_saved'] = 1;
     $_REQUEST['report_id'] = $community_report_id = $reports_obj->getMaxId();
     if ($reports_obj->add()) {
         $report_rooms_obj = new Dynamo("report_rooms");
         $report_rooms_max_id = $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 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");
             $report_room_items_obj = new Dynamo("report_room_items");
             $report_room_items_max_id = $report_room_items_obj->getMaxId();
             if (count($complex_report_room_items_array) > 0) {
                 $query2 = "INSERT INTO report_room_items (`id`,`report_id`,`room_id`,`room_template_item_id`,`name`,`status_id`,`date_created`) VALUES";
             }
             for ($i = 0; $i < count($complex_report_rooms_array); $i++) {
                 $query .= "({$report_rooms_max_id}," . $_REQUEST['report_id'] . "," . $complex_report_rooms_array[$i]["room_template_id"] . ",'" . addslashes(stripslashes($complex_report_rooms_array[$i]["name"])) . "',NOW()," . $_SESSION['user_id'] . "),";
示例#6
0
<?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']) != '') {
    $workCategoryObj = new Dynamo("work_categories");
    if ($workCategoryObj->add()) {
        $result['success'] = true;
        $result['message'] = 'Work Category successfully added!';
    } 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);
示例#7
0
<?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']) != '') {
    $unitsObj = new Dynamo("units");
    if ($unitsObj->add()) {
        $result['success'] = true;
        $result['message'] = 'Units successfully added!';
    } 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);
<?php

if (!isset($_SESSION)) {
    session_start();
}
define('__ROOT__', dirname(dirname(__FILE__)));
define('__BASENAME__', basename(__ROOT__));
require_once __ROOT__ . '/modules/Dynamo.class.php';
$result['success'] = false;
$result['message'] = '';
if (trim($_REQUEST['property_id']) != '' && trim($_REQUEST['data']) != '') {
    $subcontractors_assign = new Dynamo("subcontractors_assign");
    $subcontractors_assign->deleteCustom("WHERE property_id = " . $_REQUEST['property_id']);
    $array_sub = json_decode($_REQUEST['data']);
    for ($i = 0; $i < count($array_sub); $i++) {
        $_REQUEST['sub_contractor_id'] = $array_sub[$i]->sub_contractor_id;
        $_REQUEST['work_category_id'] = $array_sub[$i]->work_category_id;
        $subcontractors_assign->add();
    }
    $result['success'] = true;
    $result['message'] = 'Subcontractors successfully edited!';
} else {
    $result['success'] = false;
    $result['message'] = '';
}
header('Content-type: application/json');
echo json_encode($result);
示例#9
0
if (!isset($_SESSION)) {
    session_start();
}
define('__ROOT__', dirname(dirname(__FILE__)));
define('__BASENAME__', basename(__ROOT__));
require_once __ROOT__ . '/modules/Dynamo.class.php';
$result['success'] = false;
$result['message'] = '';
if (trim($_REQUEST['property_id']) != '' && trim($_REQUEST['data']) != '') {
    $community_subcontractors_assign = new Dynamo("community_subcontractors_assign");
    $community_subcontractors_assign->deleteCustom("WHERE property_id = " . $_REQUEST['property_id']);
    $array_sub = json_decode($_REQUEST['data']);
    for ($i = 0; $i < count($array_sub); $i++) {
        $_REQUEST['sub_contractor_id'] = $array_sub[$i]->sub_contractor_id;
        $_REQUEST['work_category_id'] = $array_sub[$i]->work_category_id;
        $community_subcontractors_assign->add();
    }
    $result['success'] = true;
    $result['message'] = 'Subcontractors successfully edited!';
} else {
    $result['success'] = false;
    $result['message'] = '';
}
header('Content-type: application/json');
echo json_encode($result);
/*if(!isset($_SESSION)){
	session_start();
}

define('__ROOT__', dirname(dirname(__FILE__)));
define('__BASENAME__', basename(__ROOT__));
示例#10
0
        <?php 
        exit;
    }
    $_REQUEST['id'] = $_REQUEST["propertyId"];
    $propertiesObject = new Dynamo("properties");
    $propertyArray = $propertiesObject->getOne();
} else {
    print "You'll need property ID in order to proceed";
    exit;
}
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);
    $_REQUEST['daily_logs_id'] = $maxId = $dailyLogsObject->getMaxId();
    $_REQUEST['user_id'] = $_SESSION['user_id'];
    if ($dailyLogsObject->add()) {
        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 {
                    $_REQUEST["missed_inspection"] = 0;
                }
示例#11
0
<?php

define('__ROOT__', dirname(dirname(__FILE__)));
define('__BASENAME__', basename(__ROOT__));
require_once __ROOT__ . '/modules/Dynamo.class.php';
$_REQUEST['date_created'] = date("Y-m-d H:i:s");
if (trim($_REQUEST['email']) != '' && trim($_REQUEST['first_name']) != '' && trim($_REQUEST['last_name']) != '' && trim($_REQUEST['phone_number']) != '') {
    $subContractorObj = new Dynamo("sub_contractors");
    $sub_contractor_id = $subContractorObj->getMaxId();
    if ($subContractorObj->add()) {
        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 ($subContractorObj->customExecuteQuery($query)) {
                $result['success'] = true;
                $result['message'] = 'Sub contractor successfully added!';
            }
        } else {
            $result['success'] = true;
            $result['message'] = 'Sub contractor successfully added!';
        }
示例#12
0
         if ($_REQUEST["site_issues_" . $i]) {
             $_REQUEST["site_issues"] = 1;
         } else {
             $_REQUEST["site_issues"] = 0;
         }
         if ($_REQUEST["vendor_mistake_" . $i]) {
             $_REQUEST["vendor_mistake"] = 1;
         } else {
             $_REQUEST["vendor_mistake"] = 0;
         }
         if ($_REQUEST["other_" . $i]) {
             $_REQUEST["other"] = 1;
         } else {
             $_REQUEST["other"] = 0;
         }
         $daily_logs_today_progress_object->add();
     } else {
         break;
     }
 }
 if (count($_REQUEST) > 0) {
     foreach ($_REQUEST as $key => $value) {
         if (stristr($key, "image_")) {
             if (trim($value) != '') {
                 $query = "UPDATE daily_logs_images SET image_notes = '" . addslashes($value) . "' WHERE id = " . str_replace("image_", "", $key);
                 $daily_logs_images_object->customExecuteQuery($query);
             }
         }
     }
 }
 //image upload