Esempio n. 1
0
	Initialises the content div for everything. 
	-->
	<div class='content'>
		
		<!--
		-->
		
		<?php 
$pid = $_GET['pid'];
if (isset($_COOKIE['id'])) {
    $id = $_COOKIE['id'];
    $result = $pdo->query("\n\t\t\tSELECT user_type\n\t\t\tFROM users\n\t\t\tWHERE id = '{$id}'");
    foreach ($result as $row) {
        $user_type = $row["user_type"];
        if ($user_type = 'admin') {
            PRINTF("\n\t\t\t\t\t\t<h2>Delete Success</h2> ");
            $result = $pdo->query("\n\t\t\t\t\t\t\t\tDELETE\n\t\t\t\t\t\t\t\tFROM properties\n\t\t\t\t\t\t\t\tWHERE pid = '{$pid}'");
        } elseif ($user_type = 'user') {
            printf("Error");
        }
    }
} else {
    printf("<p>Oops</p>");
}
?>
	</div>
	<?php 
include "../includes/footer.inc";
?>
	</div>
	</div>
Esempio n. 2
0
    $eid = $row['eid'];
    $rid = $row['rid'];
    $value = $row['value'];
    $oid = $row['oid'];
    $contract_start = $row['contract_start'];
    $contract_end = $row['contract_end'];
}
/*
 */
if (isset($_COOKIE['id'])) {
    $id = $_COOKIE['id'];
    $result = $pdo->query("\n\t\t\tSELECT user_type\n\t\t\tFROM users\n\t\t\tWHERE id = '{$id}'");
    foreach ($result as $row) {
        $user_type = $row["user_type"];
        if ($user_type == 'Admin' or $user_type == 'Staff' or $id == $oid) {
            PRINTF("\n\t\t\t\t\t\t<h2>Edit Property details below</h2> \n        \n   \t\t\t\t\t\t<form name='edit' action='editsuccess.php' method='POST'>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\tAddress: <input name='address' type='text' size='30' value='{$address}'/><P/>\n\t\t\t\t\t\tSuburb: <input name='suburb' type='text' size='40' value='{$suburb}'/><P/>\n\t\t\t\t\t\tState: <input name='state' type='text' size='40' value='{$state}'/><P/>\n\t\t\t\t\t\tPostcode: <input name='postcode' type='text' size='4' value='{$postcode}'/><P/>\n\t\t\t\t\t\tMarket Value: <input name='price' type='text' size='7' value='{$price}'/><P/>\n\t\t\t\t\t\tPrice: <input name='value' type='text' size='7' value='{$value}'/><P/>\n\t\t\t\t\t\tInspection Times: <input name='inspection' type='text' size='60' value='{$inspection}'/><P/>\n\t\t\t\t\t\tType: <input name='type' type='text' size='10' value='{$type}'/><P/>\n\t\t\t\t\t\tVacant: <input type='radio' name='vacant' value='Yes' /> Yes \n\t\t\t\t\t\t\t\t<input type='radio' name='vacant' value='No' /> No <p>\n\t\t\t\t\t\tRenter ID: <input name='rid' type='text' size='6' value='{$rid}'/><P/>\n\t\t\t\t\t\tEmployee ID: <input name='eid' type='text' size='6' value='{$eid}'/><P/>\n\t\t\t\t\t\tStart of Contract: <input name='contract_start' type='date' value ='{$contract_start}' /><P/>\n\t\t\t\t\t\tEnd of Contract: <input name='contract_end' type='date' value ='{$contract_end}' /><P/>\n\t\t\t\t\t\tOwner ID: <input name='oid' type='text' size='6' value='{$oid}'/><P/>\n\t\t\t\t\t\tImage: <input name='image' type='text' size='100' value='{$image}'/><P/>\n\t\t\t\t\t\t\t\t\t\t\t\tFurnished: <input type='radio' name='furnished' value='Yes' /> Yes \n\t\t\t\t\t\t\t\t<input type='radio' name='furnished' value='No' /> No <p>\n\t\t\t\t\t\tPrimary School: <input type='radio' name='primaryschool' value='Yes' /> Yes \n\t\t\t\t\t\t\t\t<input type='radio' name='primaryschool' value='No' /> No <p>\n\t\t\t\t\t\tHigh School: <input type='radio' name='highschool' value='Yes' /> Yes \n\t\t\t\t\t\t\t\t<input type='radio' name='highschool' value='No' /> No <p>\n\t\t\t\t\t\tAbout: <input name='about' type='text' value ='{$about}' size='60' /><P/>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<input name='pid'  type ='hidden' value='{$pid}'/>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<input name='submit' type='submit' value='submit'/>\n      \t\t\t\t\t<input name='reset' type='reset' value='reset'/>\n         \n   \t\t\t\t\t\t</form>\n\t\t\t\t\t");
        } elseif ($user_type == 'user') {
            printf("Error");
        }
    }
} else {
    printf("<p>Oops</p>");
}
?>
	</div>
	<?php 
include "../includes/footer.inc";
?>
	</div>
	</div>
</body>
Esempio n. 3
0
        if ($user_type == 'Admin') {
            PRINTF('
		
		<h2>Create User</h2>
		Enter your information for your user account
		<p>
		<!--
		Creates the form and various inputs to be posted to the registersuccess.php file to be added to the database. Minor HTML5 valdiation checking on some inputs.
		-->
		<form name="create" action="createusersuccess.php" method="POST">
			First Name: <input name="first_name" type="text" size="20"/>
			<p>
			Last Name: <input name="last_name" type="text" size="20"/>
			<p>
			User Type: <select name="user_type"><option value ="User">User</option><option value ="Owner">Owner</option><option value ="Staff">Staff</option></select>
			<p>
			Phone: <input name="phone" type="text" size="10"/>
			<p>
			Email: <input name="email" type="text" size="20"/>
			<p>
			Password: <input name="password" type="text"  size="10"/>
			<p>
			Confirm Password: <input name="password" type="text"  size="10"/>
			<p>
			Gender: <input name="gender" type="radio"  value="Male"/> Male <input name="gender" type="radio"  value="Female"/>Female
			<p>
			<input name="submit" type="submit" value="submit"/>
			<input name="reset" type="reset" value="reset"/>
		</form>
		');
        }
Esempio n. 4
0
include "/var/www/andrix/Includes/energyfunctions.php";
$starttime = EXPLODE(' ', MICROTIME());
$starttime = $starttime[1] + $starttime[0];
//fixar lite datum,tid osv
$datum = date("Y-m-d");
$tid = date("G:i");
$dag = date("d");
$manad = date("m");
$year = date("Y");
$timme = date("H");
$minut = date("i");
updateday();
updatemonth($manad);
if ($tid == '00:00') {
    updatemonth($manad);
    updateyear();
}
if ($tid == '06:00') {
    updatemonth($manad);
}
if ($tid == '12:00') {
    updatemonth($manad);
    updateyear();
}
if ($tid == '18:00') {
    updatemonth($manad);
}
$mtime = EXPLODE(' ', MICROTIME());
$totaltime = $mtime[0] + $mtime[1] - $starttime;
PRINTF('Page loaded in %.3f seconds.', $totaltime);
Esempio n. 5
0
    $primaryschool = $row['primaryschool'];
    $highschool = $row['highschool'];
    $about = $row['about'];
    $image = $row['image'];
    $eid = $row['eid'];
    $rid = $row['rid'];
}
/*
 */
if (isset($_COOKIE['id'])) {
    $id = $_COOKIE['id'];
    $result = $pdo->query("\n\t\t\tSELECT user_type\n\t\t\tFROM users\n\t\t\tWHERE id = '{$id}'");
    foreach ($result as $row) {
        $type = $row["user_type"];
        if ($user_type = 'staff') {
            PRINTF("\n\t\t\t\t\t\t<h2>Edit Property details below</h2> \n        \n   \t\t\t\t\t\t<form name='edit' action='editsuccess.php' method='POST'>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\tProperty ID: <input name='pid' type='text' size='6' value='{$pid}'/><P/>\n\t\t\t\t\t\tAddress: <input name='address' type='text' size='30' value='{$address}'/><P/>\n\t\t\t\t\t\tSuburb: <input name='suburb' type='text' size='40' value='{$suburb}'/><P/>\n\t\t\t\t\t\tPrice: <input name='price' type='text' size='7' value='{$price}'/><P/>\n\t\t\t\t\t\tInspection Times: <input name='inspection' type='text' size='60' value='{$inspection}'/><P/>\n\t\t\t\t\t\tType: <input name='type' type='text' size='10' value='{$type}'/><P/>\n\t\t\t\t\t\tVacant: <input type='radio' name='vacant' value='Y' /> Yes \n\t\t\t\t\t\t\t\t<input type='radio' name='vacant' value='N' /> No <p>\n\t\t\t\t\t\tRenter ID: <input name='rid' type='text' size='6' value='{$rid}'/><P/>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<input name='submit' type='submit' value='submit'/>\n      \t\t\t\t\t<input name='reset' type='reset' value='reset'/>\n         \n   \t\t\t\t\t\t</form>\n\t\t\t\t\t");
        } elseif ($user_type = 'user') {
            printf("Error");
        }
    }
} else {
    printf("<p>Log in to book an insepction time</p>");
}
?>
	</div>
	<?php 
include "../includes/footer.inc";
?>
	</div>
	</div>
</body>
Esempio n. 6
0
	Initialises the content div for everything. 
	-->
	<div class='content'>
		
		<!--
		-->
		
		<?php 
/*
 */
if (isset($_COOKIE['id'])) {
    $id = $_COOKIE['id'];
    $result = $pdo->query("\n\t\t\tSELECT user_type\n\t\t\tFROM users\n\t\t\tWHERE id = '{$id}'");
    foreach ($result as $row) {
        $user_type = $row["user_type"];
        if ($user_type == 'Admin' or $user_type == 'Owner') {
            PRINTF("\n\t\t\t\t\t\t<h2>Create Property details below</h2> \n        \n   \t\t\t\t\t\t<form name='create' action='createsuccess.php' method='POST'>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\tAddress: <input name='address' type='text' size='30'/><P/>\n\t\t\t\t\t\tSuburb: <input name='suburb' type='text' size='40' /><P/>\n\t\t\t\t\t\tState: <input name='state' type='text' size='40' /><P/>\n\t\t\t\t\t\tPostcode: <input name='postcode' type='text' size='4' /><P/>\n\t\t\t\t\t\tPrice: <input name='value' type='text' size='7'/><P/>\n\t\t\t\t\t\tMarket Price: <input name='price' type='text' size='7'/><P/>\n\t\t\t\t\t\tInspection Times: <input name='inspection' type='text' size='60' /><P/>\n\t\t\t\t\t\tType: <input name='type' type='text' size='10' /><P/>\n\t\t\t\t\t\tEmployee ID: <input name='eid' type='text' size='6'/><P/>\n\t\t\t\t\t\tOwner ID: <input name='oid' type='text' size='6'/><P/>\n\t\t\t\t\t\tImage: <input name='image' type='text' size='100'/><P/>\n\t\t\t\t\t\tFurnished: <input type='radio' name='furnished' value='Yes' /> Yes \n\t\t\t\t\t\t\t\t<input type='radio' name='furnished' value='No' /> No <p>\n\t\t\t\t\t\tPrimary School: <input type='radio' name='primaryschool' value='Yes' /> Yes \n\t\t\t\t\t\t\t\t<input type='radio' name='primaryschool' value='No' /> No <p>\n\t\t\t\t\t\tHigh School: <input type='radio' name='highschool' value='Yes' /> Yes \n\t\t\t\t\t\t\t\t<input type='radio' name='highschool' value='No' /> No <p>\n\t\t\t\t\t\tAbout: <input name='about' type='text' size='60' /><P/>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<input name='submit' type='submit' value='submit'/>\n      \t\t\t\t\t<input name='reset' type='reset' value='reset'/>\n         \n   \t\t\t\t\t\t</form>\n\t\t\t\t\t");
        }
    }
} else {
    printf("<p>Oops</p>");
}
?>
	</div>
	<?php 
include "../includes/footer.inc";
?>
	</div>
	</div>
</body>
</html>