Beispiel #1
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/modules/Report.class.php';
require_once dirname(dirname(dirname(__FILE__))) . '/modules/Room.class.php';
require_once dirname(dirname(dirname(__FILE__))) . '/modules/Dynamo.class.php';
$roomObj = new Room();
$listRoomTemplates = $roomObj->getRoomTemplates(false);
$reportObj = new Report();
if (trim($_REQUEST['id']) != '') {
    $complex_properties_object = new Dynamo("complex_properties");
    $array_properties = $complex_properties_object->getOne();
}
?>
<div id="community_left">
	<form method="POST" class="form-horizontal" id="addPropertyForm" onsubmit="return false;">
	<input type="hidden" id="baseName" name="baseName" value="<?php 
echo __BASENAME__;
?>
" />
	<input type="hidden" id="userId" name="userId" value="<?php 
echo $_SESSION['user_id'];
?>
" />
	<input type="hidden" id="property_id" name="property_id" value="<?php 
echo $_REQUEST['id'];
?>
" />
	
		<div class="pull-left"><h4>Edit Complex</h4></div>
		<div class="clearfix"></div>
Beispiel #2
0
define('__BASENAME__', basename(__ROOT__));
require_once __ROOT__ . '/modules/Dynamo.class.php';
$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();
require_once __ROOT__ . '/modules/Dynamo.class.php';
require_once __ROOT__ . '/config/main.config.php';
$_REQUEST = $_POST;
if (trim($_REQUEST['email']) != '' && trim($_REQUEST['first_name']) != '' && trim($_REQUEST['last_name']) != '' && trim($_REQUEST['phone_number']) != '' && trim($_REQUEST['id']) != '') {
    if (!preg_match(EMAIL_PATTERN, $_REQUEST['email'])) {
        $result['success'] = false;
        $result['message'] = 'Please enter a valid email address.';
    } else {
        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 {
if (!isset($_SESSION)) {
    session_start();
}
define('__ROOT__', dirname(dirname(__FILE__)));
define('__BASENAME__', basename(__ROOT__));
require_once __ROOT__ . '/modules/Dynamo.class.php';
if (trim($_REQUEST['community']) != '' && trim($_REQUEST['jobType']) != '' && trim($_REQUEST['propertyType']) != '' && trim($_REQUEST['city']) != '' && trim($_REQUEST['zip']) != '' && trim($_REQUEST['emailList']) != '' && trim($_REQUEST['id']) != '') {
    $_REQUEST['job_type'] = $_REQUEST['jobType'];
    $_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();
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/modules/Dynamo.class.php';
if (trim($_REQUEST['id']) != '') {
    $work_categories = new Dynamo("work_categories");
    $work_category = $work_categories->getOne();
    $parent_work_categories = $work_categories->getAll("WHERE parent_id = 0");
    if (count($work_category) > 0) {
        ?>
		<form method="POST" class="form-horizontal" id="workCategoryForm">
		<input type="hidden" id="baseName" name="baseName" value="<?php 
        echo __BASENAME__;
        ?>
" />
		<input type="hidden" id="id" name="id" value="<?php 
        print $work_category['id'];
        ?>
" />
		<input type="hidden" id="date_created" name="date_created" value="<?php 
        print $work_category['date_created'];
        ?>
" />
		<div class="pull-left"><h4>Edit Work Category</h4></div>
		<div class="pull-right"><button class="btn btn-warning" type="submit">Submit Changes</button> &nbsp; <a href="work_categories.html" class="btn btn-default">Cancel</a></div>
		<div class="clearfix"></div>
		
		<div id="status-message"></div>
		<?php 
        if (count($parent_work_categories) > 0) {
            ?>
        <div class="control-group">
$daily_logs_images_object = new Dynamo("daily_logs_images");
if (trim($_REQUEST['estimate']) == "true") {
    $estimate = "&estimate=true";
} else {
    $estimate = "";
}
if (trim($_REQUEST["id"]) != '') {
    $_REQUEST["daily_logs_id"] = $_REQUEST["id"];
    $daily_logs_array = $dailyLogsObject->getOne();
} else {
    header("Location: add_daily_log.html?propertyId=" . $_REQUEST["propertyId"] . $estimate);
    exit;
}
if (trim($_REQUEST["propertyId"]) != '') {
    $_REQUEST['id'] = $_REQUEST["propertyId"];
    $propertyArray = $propertiesObject->getOne();
} else {
    print "You'll need property ID in order to proceed";
    exit;
}
?>
	<form method="POST" class="form-horizontal" id="addDailyLog">
	<input type="hidden" id="baseName" name="baseName" value="<?php 
echo __BASENAME__;
?>
" />
	<input type="hidden" id="userId" name="userId" value="<?php 
echo $_SESSION['user_id'];
?>
" />
    
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/modules/Dynamo.class.php';
$sub_contractors = new Dynamo("sub_contractors");
$work_categories = new Dynamo("work_categories");
if ($_SESSION['user_type'] == 5) {
    $readonly = true;
} else {
    $readonly = false;
}
$work_categories_array = $work_categories->getAll("WHERE parent_id = 0");
$sub_contractor_work_category = new Dynamo("sub_contractor_work_category");
if (trim($_REQUEST['id']) != '') {
    $array_sub_contractor = $sub_contractors->getOne();
    if (count($array_sub_contractor) > 0) {
        $array_sub_work = $sub_contractor_work_category->getAllWithId_default("WHERE sub_contractor_id = " . $_REQUEST['id'], "work_category_id");
        ?>
	
		<form method="POST" class="form-horizontal" id="addSubContractorForm" onSubmit="return false;">
		<input type="hidden" id="baseName" name="baseName" value="<?php 
        echo __BASENAME__;
        ?>
" />
		<input type="hidden" id="id" name="id" value="<?php 
        print $_REQUEST['id'];
        ?>
" />
		<div class="pull-left"><h4>View SubContractor</h4></div>
		<div class="pull-right"><button class="btn btn-warning" type="submit">Submit Changes</button> &nbsp;<?php 
        if ($_SESSION['user_type'] != 5) {
            ?>
Beispiel #8
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/modules/Dynamo.class.php';
if (trim($_REQUEST['id']) != '') {
    $unitsObj = new Dynamo("units");
    $unit_array = $unitsObj->getOne();
    if (count($unit_array) > 0) {
        ?>
		<form method="POST" class="form-horizontal" id="unitForm">
		<input type="hidden" id="baseName" name="baseName" value="<?php 
        echo __BASENAME__;
        ?>
" />
		<input type="hidden" id="id" name="id" value="<?php 
        print $unit_array['id'];
        ?>
" />
		<div class="pull-left"><h4>Edit Unit</h4></div>
		<div class="pull-right"><button class="btn btn-warning" type="submit">Submit Changes</button> &nbsp; <a href="units.html" class="btn btn-default">Cancel</a></div>
		<div class="clearfix"></div>
		
		<div id="status-message"></div>
		
		<div class="control-group">
			<label for="email" class="control-label">Estimate Unit</label>
			<div class="controls">
				<input type="text" name="estimate_unit" id="estimate_unit" class="form-control" placeholder="Estimate Unit" value="<?php 
        print $unit_array['estimate_unit'];
        ?>
" data-validation="required" data-validation-error-msg="Please enter a unit name."  />
			</div>
if (!isset($_SESSION)) {
    session_start();
}
define('__ROOT__', dirname(dirname(__FILE__)));
define('__BASENAME__', basename(__ROOT__));
require_once __ROOT__ . '/modules/Room.class.php';
require_once __ROOT__ . '/modules/Dynamo.class.php';
$id = !isset($_POST['id']) ? "" : $_POST['id'];
$roomObj = new Room();
$property_obj = new Dynamo("properties");
$estimates_obj = new Dynamo("estimates");
$room_templates_obj = new Dynamo("room_templates");
$estimate_rooms_obj = new Dynamo("estimate_rooms");
$estimate_room_items_obj = new Dynamo("estimate_room_items");
$data = $roomObj->getRoomTemplateItems($id, false);
$array_room_templates = $room_templates_obj->getOne();
$maxIdEstimateRooms = $estimate_rooms_obj->getMaxId();
ob_start();
if (trim($_REQUEST['estimatesId']) == '' && trim($_REQUEST['propertyId']) != '') {
    $_REQUEST['estimatesId'] = $estimates_obj->getMaxId();
    $query = "INSERT INTO estimates (`id`,`property_id`,`date_created`,`reported_by`,`is_submitted`,`is_saved`,`is_closed`) \n\tVALUES(" . $_REQUEST['estimatesId'] . "," . $_REQUEST['propertyId'] . ",NOW()," . $_SESSION['user_id'] . ",0,1,0)";
    $estimates_obj->customExecuteQuery($query);
    $query = "UPDATE properties SET in_estimates = 1 WHERE id = " . $_REQUEST['propertyId'];
    $property_obj->customExecuteQuery($query);
}
if (count($data) > 0) {
    $query = "INSERT INTO estimate_rooms VALUES({$maxIdEstimateRooms}," . $_REQUEST['estimatesId'] . ",{$id},'" . htmlentities(html_entity_decode($_REQUEST['roomName']), ENT_QUOTES) . "',NOW()," . $_SESSION['user_id'] . ")";
    $room_templates_obj->customExecuteQuery($query);
    $result['roomId'] = $maxIdEstimateRooms;
    $query = "INSERT INTO estimate_room_items (`id`,`estimate_id`,`room_id`,`room_template_item_id`,`name`,`date_created`) VALUES";
    $reportRoomMaxId = $estimate_room_items_obj->getMaxId();
Beispiel #10
0
            } else {
                ?>
				window.location.href = "edit_property.html?propertyId=<?php 
                print $_REQUEST["propertyId"];
                ?>
";
			<?php 
            }
        }
        ?>
		</script>
		<?php 
    }
}
$_REQUEST["id"] = $_REQUEST["daily_logs_id"];
$daily_logs_array = $dailyLogsObject->getOne();
?>
	<form method="POST" class="form-horizontal" id="addDailyLog" name="addDailyLog" action="edit_daily_log.html?propertyId=<?php 
print $_REQUEST["propertyId"];
?>
&id=<?php 
print $_REQUEST["daily_logs_id"];
?>
" enctype="multipart/form-data">
    <?php 
if (trim($estimate) != '') {
    ?>
    <input type="hidden" name="estimate" value="true" />
    <?php 
}
?>