$value){ $$key = get_magic_quotes_gpc() ? $value : addslashes($value); } $result = mysql_query("SELECT * FROM listings WHERE id='$lid'",$dbconnect); $data = mysql_fetch_assoc($result); $result = mysql_query("SELECT * FROM agents WHERE id='{$data['agentid']}'",$dbconnect); $agent = mysql_fetch_assoc($result); $appresult = mysql_query("SELECT * FROM appointments WHERE lid='$lid' ORDER BY `date` DESC",$dbconnect); $message = " Your listing, MLS:{$data['mls']} {$data['address']} has a new appointment scheduled. Please login for details. ----------------------------------------------------------- Time | Agent | Brokerage | Phone | Fax | Email | Entered By ----------------------------------------------------------- "; while ($app = mysql_fetch_assoc($appresult)){ $message .= date("M jS, Y",$app['date'])." | ".date("g:ia",$app['date'])." | ".$app['agent']." | ".$app['brokerage']." | ".$app['phone']." | ".$app['fax']." | ".$app['email']." | ".$app['enteredby']." Comment:".$app['comment']." -----------------------------------------------------------"; } mail($agent['email'],'AAPRealty.com New Appointment Scheduled',$message,'From: noreply@aaprealty.com'); $_GET['action'] = 'details'; $_GET['id'] = $lid; } #add appt if ((isset($_POST['addappointment'])) && ($_POST['addappointment'] == 'true')){ foreach ($_POST as $key => $value){ $$key = get_magic_quotes_gpc() ? $value : addslashes($value); } if ($tod == 'pm') $hour = 12 + $hour; $date = mktime($hour,$min,0,$month,$day,$year); $result = mysql_query("INSERT INTO appointments (lid,`date`,comment,agent,brokerage,phone,fax,email,enteredby) VALUES ('$lid','$date','$comment','$agent','$brokerage','$phone','$fax','$email','$enteredby')",$dbconnect); $_GET['action'] = 'details'; $_GET['id'] = $lid; } #edit appointment if ((isset($_POST['editappointment'])) && ($_POST['editappointment'] == 'true')){ foreach ($_POST as $key => $value){ $$key = get_magic_quotes_gpc() ? $value : addslashes($value); } if ($hour != 12){ if ($tod == 'pm'){ $hour = 12 + $hour; } } $date = mktime($hour,$min,0,$month,$day,$year); $result = mysql_query("UPDATE appointments SET date='$date',agent='$agent',brokerage='$brokerage',phone='$phone',fax='$fax',email='$email',enteredby='$enteredby',comment='$comment' WHERE id='$id'",$dbconnect); $msg = 'Appointment edited successfully!'; } #delete appointment if ((isset($_GET['action'])) && ($_GET['action'] == 'deleteappointment')){ $result = mysql_query("DELETE FROM appointments WHERE id='{$_GET['id']}'",$dbconnect); $msg = 'Appointment deleted successfully!'; } #add listing if ((isset($_POST['addlisting'])) && ($_POST['addlisting'] == 'true')){ foreach ($_POST as $key => $value){ $$key = get_magic_quotes_gpc() ? $value : addslashes($value); } $result = mysql_query("INSERT INTO listings (mls,address,agentid,comment) VALUES ('$mls','$address','$agentid','$comment')",$dbconnect); $result = mysql_query("SELECT * FROM streets WHERE name='$address'",$dbconnect); if (mysql_num_rows($result) != 1){ $result = mysql_query("INSERT INTO streets (name) VALUES ('$address')",$dbconnect); } $msg = 'Listing added successfully!'; } #edit listing if ((isset($_POST['editlisting'])) && ($_POST['editlisting'] == 'true')){ foreach ($_POST as $key => $value){ $$key = get_magic_quotes_gpc() ? $value : addslashes($value); } $result = mysql_query("UPDATE listings SET mls='$mls',agentid='$agentid',comment='$comment' WHERE id='$id'",$dbconnect); $result = mysql_query("SELECT * FROM streets WHERE name='$address'",$dbconnect); if (mysql_num_rows($result) != 1){ $result = mysql_query("INSERT INTO streets (name) VALUES ('$address')",$dbconnect); } $msg = 'Listing edited successfully!'; } #delete listing if ((isset($_GET['action'])) && ($_GET['action'] == 'deletelisting')){ $result = mysql_query("DELETE FROM listings WHERE id='{$_GET['id']}'",$dbconnect); $msg = 'Listing deleted successfully!'; } #edit street if ((isset($_POST['editstreet'])) && ($_POST['editstreet'] == 'true')){ foreach ($_POST as $key => $value){ $$key = get_magic_quotes_gpc() ? $value : addslashes($value); } $result = mysql_query("UPDATE streets SET name='$name' WHERE id='$id'",$dbconnect); $result = mysql_query("UPDATE listings SET address='$name' WHERE address='$street'",$dbconnect); $msg = 'Street edited successfully!'; } #delete street if ((isset($_GET['action'])) && ($_GET['action'] == 'deletestreet')){ $result = mysql_query("DELETE FROM streets WHERE id='{$_GET['id']}'",$dbconnect); $msg = 'Street deleted successfully!'; } #get logged in agent info $result = mysql_query("SELECT * FROM passes WHERE id='{$_SESSION['agentid']}' LIMIT 1",$dbconnect); $agent = mysql_fetch_assoc($result); ?> Welcome To AAPRealty.com
SEARCH LISTINGS

Welcome, . [ Logout ]

MLS #
Address:
Agent
 
Back to Search

MLS #
Address:
Agent
Showing Instructions

Appointment Info
 
Date
Time
Agent
Brokerage
Phone
Email
Entered By
Jan 1st, 1970
12:00am
Comment:

Current Appointments (Add New)
Admin
Jan 1st, 1970 - ...
Edit Appointment
Date:
Time:
Showing Agent:
Showing Company:
Phone:
Email:
Entered By:
Comment:
Back to Search

Current Streets
Admin
Edit Street
Street Address:
Back to Search

Current Listings (Add New) (Streets)
Admin
-
Add Listing
MLS:
Street Address:
Agent:
Showing Instructions:
Edit Listing
MLS:
Street Address:
Agent:
Showing Instructions:
Schedule Appointment
Date:
Time:
Showing Agent:
Showing Company:
Phone:
Email:
Entered By:
Comment:
Search Listings (Listings Administration)
MLS #:
Street Address:
Agent: