echo '<div id="inset">If this address is incorrect please <a href="javascript:cancelResponse();">try again</a></div>'; echo $form->renderForm(); exit; } elseif ($lookup_type == "manual") { // make the form $formData = array($scope . '_pcid' => array('type' => 'hidden', 'value' => '-1'), $scope . '_addr1' => array('type' => 'text', 'label' => 'House Number', 'required' => 2, 'attributes' => array('class' => 'addr'), 'function' => 'format_street'), $scope . '_addr2' => array('type' => 'text', 'label' => 'Building Name', 'required' => 1, 'attributes' => array('class' => 'addr'), 'function' => 'format_street'), $scope . '_addr3' => array('type' => 'text', 'label' => 'Street', 'required' => 2, 'attributes' => array('class' => 'addr'), 'function' => 'format_street'), $scope . '_addr5' => array('type' => 'text', 'label' => 'City or County', 'required' => 2, 'attributes' => array('class' => 'addr'), 'function' => 'format_street'), $scope . '_postcode' => array('type' => 'text', 'label' => 'Postcode', 'required' => 2, 'attributes' => array('class' => 'pc', 'maxlength' => 9), 'function' => 'format_postcode'), $scope . '_country' => array('type' => 'select', 'label' => 'Country', 'value' => $default_country, 'required' => 2, 'options' => db_lookup("pro_country", "country", "array"), 'attributes' => array('class' => 'addr'))); $form = new Form(); $form->addData($formData, $_GET); $formName = "form2"; $form->addHtml($form->addDiv($form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit')))); echo '<div id="inset">If this address is incorrect please <a href="javascript:cancelResponse();">try again</a></div>'; echo $form->renderForm(); exit; } else { $Data = $postcode->lookup($lookup_type, $search_string, "data"); if (count($Data) == 1) { foreach ($Data as $keyd => $data) { $udprn = $data["id"]; } header("Location:?lookup_type=udprn&search_string=" . $udprn . "&scope=" . $scope); exit; } else { $form = new Form(); $form->addHtml($form->addLabel("select", "Select Property", $postcode->output_list($Data))); $buttons = $form->makeField("button", "button", "", "Use Selected", array('class' => 'submit', 'onClick' => 'ajax_select_address(this.id);')); $buttons .= $form->makeField("button", "tryagain", "", "Try Again", array('class' => 'button', 'onClick' => 'cancelResponse();')); $form->addHtml($form->addDiv($buttons)); echo $form->renderForm(); exit; } }
// app_id is used when arranging a viewing, adding more clients to the viewing (optional) $form->addField("hidden", "app_id", "", $_GET["app_id"]); $form->addField("hidden", "searchLink", "", $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING']); // carry is for carrying return link through (e.g. when adding vendor to deal, we still want to retain the searchLink) $form->addField("hidden", "carry", "", $_GET["carry"]); $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Select Client</div>'); $form->addHtml($form->addLabel('cli_id', 'Existing Clients', $form->makeField("select", "cli_id", "", "", array('size' => '6', 'style' => 'width:400px;', 'onDblClick' => 'document.forms[0].submit();'), $options))); $form->addHtml($form->addDiv($form->makeField("submit", "", "", "Use Selected Client", array('class' => 'submit')))); #$form->addHtml($form->addDiv($form->makeField("button","","","Create New Client",array('class'=>'submit','onClick'=>'location.href=\''.$goto_notfound.'?'.http_build_query($terms).'&dest='.$_GET["dest"].'\';')))); $form->addHtml("</fieldset>\n"); $form->addHtml("</div>\n"); } $form2 = new Form(); $form2->addForm("form", "post", $PHP_SELF); $form2->addHtml("<div id=\"standard_form\">\n"); $form2->addField("hidden", "stage", "", "2"); $form2->addField("hidden", "action", "", "new_client"); $form2->addField("hidden", "dest", "", $_GET["dest"]); $form2->addField("hidden", "dea_id", "", $_GET["dea_id"]); $form2->addField("hidden", "app_id", "", $_GET["app_id"]); $form2->addField("hidden", "carry", "", $_GET["carry"]); $form2->addHtml("<fieldset>\n"); $form2->addLegend('New Client'); $form2->addData($formData1, $_GET); $form2->addRow('radio', 'p2c_type', 'Address Type', 'Home', '', db_enum("pro2cli", "p2c_type", "array")); if (!$_GET["pro_pro_id"]) { $form2->ajaxPostcode("by_freetext", "pro"); } else { $form2->addData($formData2, $_GET); $form2->addHtml($form2->addDiv($form->makeField("submit", "", "", "Save Changes", array('class' => 'submit'))));
$status_attributes = array('style' => 'width:300px', 'onChange' => 'controlUnderOffer(this,\'dea_status\',\'' . $dea_status . '\');'); } else { $status_attributes = array('style' => 'width:300px'); } // reset status attributes for LETTINGS if ($_SESSION["auth"]["default_scope"] == 'Lettings') { $status_attributes = array('style' => 'width:300px'); } $formData4 = array('dea_status' => array('type' => 'select', 'label' => 'Status', 'value' => $dea_status, 'options' => $statuses, 'attributes' => $status_attributes), 'dea_notes_sot' => array('type' => 'textarea', 'label' => 'Add Status Note', 'attributes' => array('class' => 'noteInput', 'viewform' => 3))); } // viewing arrangements $formData5 = array('dea_key' => array('type' => 'text', 'label' => 'Key Number', 'value' => $dea_key, 'attributes' => array('class' => 'wide')), 'dea_notes_arr' => array('type' => 'textarea', 'label' => 'Add Viewing Info', 'attributes' => array('class' => 'noteInput'))); if (!$_GET["action"]) { $form = new Form(); $form->addForm("", "GET", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "stage", "", "1"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "dea_id", "", $dea_id); $form->addField("hidden", "pro_id", "", $pro_id); $form->addField("hidden", "searchLink", "", urlencode($searchLink)); $form->addHtml('<h1>' . $pro_addr . ' (' . $dea_type . ')</h1>'); $formName = 'form1'; $form->addHtml("<fieldset>\n"); $form->addLegend('Summary', array('style' => 'cursor:pointer', 'onClick' => 'javascript:showHide(\'' . $formName . '\');')); $form->addHtml('<div id="' . $formName . '" style="display:none">'); $form->addHtml($form->addHtml($summary_table)); //$form->addHtml($form->addDiv($form->makeField("textarea",$formName,"General Notes","",array('class'=>'noteInput')))); $form->addHtml($form->addRow('textarea', 'dea_notes', 'Add General Note', '', array('class' => 'noteInput'), '', '')); $form->addHtml(renderNotes('deal_general', $dea_id, array('viewform' => '1', 'label' => 'General Notes'))); $buttons = $form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit'));
foreach ($data as $output) { $results .= $output; } $results .= '</table> '; } else { // no results $results = ' <table cellpadding="5"> <tr> <td>Your search returned no matches, please <strong><a href="' . urldecode($returnLink) . '">try again</a></strong></td> </tr> </table>'; } $form = new Form(); $form->addHtml("<div id=\"standard_form\">\n"); $form->addForm("", "get", $_SERVER['PHP_SELF']); $form->addField("hidden", "searchLink", "", $searchLink); $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Users</div>'); $form->addHtml('<div id="results_table">'); $form->addHtml($header); $form->addHtml($results); $form->addHtml($footer); $form->addHtml('</div>'); $form->addHtml("</fieldset>\n"); $form->addHtml('</div>'); $navbar_array = array('back' => array('title' => 'Back', 'label' => 'Back', 'link' => $returnLink), 'print' => array('title' => 'Print', 'label' => 'Print', 'link' => 'javascript:windowPrint();')); $navbar = navbar2($navbar_array); $page->setTitle('Users'); $page->addStyleSheet(getDefaultCss());
exit; } } /* if ($app["type"] == "Lunch" || $app["type"] == "Note" || $app["type"] == "Meeting") { $db_data["app_status"] = 'Cancelled'; db_query($db_data,"UPDATE","appointment","app_id",$app["id"]); header("Location:calendar.php?branch=".$app["branch"]."&y=$y&m=$m&d=$d"); exit; } */ $formData1 = array('notes' => array('type' => 'textarea', 'label' => 'Reason for Cancelling', 'value' => '', 'attributes' => array('class' => 'noteInput'))); $form = new Form(); $form->addForm("app_form", "POST", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "app_id", "", $app_id); $form->addField("hidden", "searchLink", "", urlencode($return)); $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Cancel ' . $app["type"] . '</div>'); $form->addHtml('<p class="appInfo">Please remember to inform all vendors/landlords and/or viewers that this appointment has been cancelled</p>'); $form->addData($formData1, $_POST); $form->addHtml(renderNotes('appointment_cancel', $app_id, array('label' => 'Cancellation Notes'))); $buttons = $form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit')); $form->addHtml($form->addDiv($buttons)); $form->addHtml("</fieldset>\n"); $form->addHtml('</div>'); if (!$_POST["action"]) { /* if ($_GET["searchLink"]) {
$duration = $default_valuation_duration; } // get the dea_branch and maybe others? $sql = "SELECT dea_branch FROM deal WHERE dea_id = {$dea_id}"; $q = $db->query($sql); if (DB::isError($q)) { die("db error: " . $q->getMessage()); } $numRows = $q->numRows(); while ($row = $q->fetchRow()) { $dea_branch = $row["dea_branch"]; } $formData1 = array('calendarID' => array('type' => 'select_branch', 'label' => 'Branch', 'value' => $dea_branch, 'attributes' => array('class' => 'medium')), 'app_user' => array('type' => 'select_user', 'label' => 'Negotiator', 'value' => $_SESSION["auth"]["use_id"], 'attributes' => array('class' => 'medium'), 'options' => array('' => '(unassigned)')), 'app_date' => array('type' => 'datetime', 'label' => 'Date', 'value' => $app_date, 'attributes' => array('class' => 'medium', 'readonly' => 'readonly'), 'tooltip' => 'Today\'s date is selected by default'), 'app_time' => array('type' => 'time', 'label' => 'Start Time', 'value' => $app_time), 'app_duration' => array('type' => 'select_duration', 'label' => 'Estimated Duration', 'value' => $duration, 'attributes' => array('class' => 'medium'), 'tooltip' => 'Duration is estimated at ' . $default_valuation_duration . ' minutes per property'), 'notes' => array('type' => 'textarea', 'label' => 'Notes', 'value' => $app["notes"], 'attributes' => array('class' => 'noteInput'))); if (!$_GET["action"]) { $form = new Form(); $form->addHtml("<div id=\"standard_form\">\n"); $form->addForm("", "get"); $form->addField("hidden", "stage", "", "appointment"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "cli_id", "", $cli_id); $form->addField("hidden", "app_id", "", $_GET["app_id"]); $form->addField("hidden", "dea_id", "", $dea_id); $form->addField("hidden", "searchLink", "", $searchLink); $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Valuation Appointment</div>'); $form->addData($formData1, $_GET); $buttons = $form->makeField("submit", "submit", "", "Save Changes", array('class' => 'submit')); //$buttons .= ' or '; $buttons .= $form->makeField("button", "button", "", "No appointment", array('class' => 'button', 'onClick' => 'document.location.href = \'deal_summary.php?dea_id=' . $dea_id . '\'')); $form->addHtml($form->addDiv($buttons)); $form->addHtml("</fieldset>\n");
} break; ########################################################### # stage 3 - areas ########################################################### ########################################################### # stage 3 - areas ########################################################### case 3: # build data arrays $formData1 = array(); $areas = area($_GET["cli_area"]); if (!$_GET["action"]) { $form = new Form(); $form->addForm("", "get", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "stage", "", "3"); $form->addField("hidden", "cli_id", "", $cli_id); ///////////////////////////////////////////////////////////////////////////////// $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Areas</div>'); //$form->addHtml($form->addLabel('East Dulwich','<table><tr>'.$render[1].'</tr></table>')); $form->addHtml(' <a href="javascript:checkToggle(document.forms[0], \'branch1\');"><strong>Camberwell Branch</strong></a>'); $form->addHtml('<table width="100%" cellspacing="0" cellpadding="0"><tr>' . $areas[1] . '</tr></table>'); $form->addHtml(' <a href="javascript:checkToggle(document.forms[0], \'branch2\');"><strong>Sydenham Branch</strong></a>'); $form->addHtml('<table width="100%" cellspacing="0" cellpadding="0"><tr>' . $areas[2] . '</tr></table>'); $form->addHtml($form->addDiv($form->makeField("submit", "", "", "Save Changes", array('class' => 'submit')))); $form->addHtml("</fieldset>\n"); $page->setTitle("Client > Add"); $page->addStyleSheet(getDefaultCss());
$results = ' <table> <tr> ' . columnHeader(array(array('title' => 'Name', 'column' => 'cli_name', 'colspan' => '2'), array('title' => 'Email', 'column' => 'cli_email'), array('title' => 'Address', 'column' => 'cli_addr'), array('title' => 'Telephone', 'column' => 'tel_number'), array('title' => 'First Reg\'d', 'column' => 'cli_created'), array('title' => 'Last Updated', 'column' => 'cli_timestamp'), array('title' => ' ')), $_SERVER["QUERY_STRING"]) . ' </tr>'; foreach ($data as $output) { $results .= $output; } $results .= '</table> '; } else { $results = ' No pending clients found'; } $page = new HTML_Page2($page_defaults); $form = new Form(); $form->addHtml("<div id=\"standard_form\">\n"); $form->addForm("", "get", "client_contact.php"); $form->addHtml("<fieldset><div class='block-header'>Pending Sales</div>\n"); $form->addHtml('<div id="results_table">'); $form->addHtml($header); $form->addHtml($results); $form->addHtml($footer); $form->addHtml('</div>'); $form->addHtml("</fieldset>\n"); $navbar_array = array('back' => array('title' => 'Back', 'label' => 'Back', 'link' => $returnLink), 'search' => array('title' => 'Client Search', 'label' => 'Client Search', 'link' => 'client_search.php')); $navbar = navbar2($navbar_array); $page->setTitle("Client > New Pending Clients"); $page->addStyleSheet(getDefaultCss()); $page->addScript('js/global.js'); $page->addBodyContent($header_and_menu); $page->addBodyContent('<div id="content_wide">');
while ($row = $q->fetchRow()) { $dea_user = $row["dea_neg"]; } if (!$dea_user) { $dea_user = $_SESSION["auth"]["use_id"]; } // change sydenham, lettins branch to camberwell, as only one calendar in use if ($_SESSION["auth"]["use_branch"] == 4) { $branch = 3; } else { $branch = $_SESSION["auth"]["use_branch"]; } $formData1 = array('calendarID' => array('type' => 'select_branch_2', 'label' => 'Branch', 'value' => $branch, 'attributes' => array('class' => 'medium')), 'app_user' => array('type' => 'select_user', 'label' => 'Negotiator', 'value' => $_SESSION["auth"]["use_id"], 'attributes' => array('class' => 'medium'), 'options' => $negotiators), 'app_date' => array('type' => 'datetime', 'label' => 'Date', 'value' => $app_date, 'attributes' => array('class' => 'medium', 'readonly' => 'readonly'), 'tooltip' => 'Today\'s date is selected by default'), 'app_time' => array('type' => 'time', 'label' => 'Start Time', 'value' => $app_time), 'app_duration' => array('type' => 'select_duration', 'label' => 'Estimated Duration', 'value' => $duration, 'attributes' => array('class' => 'medium'), 'tooltip' => 'Duration is estimated at ' . $default_production_duration . ' minutes')); if (!$_GET["action"]) { $form = new Form(); $form->addHtml("<div id=\"standard_form\">\n"); $form->addForm("", "get"); $form->addField("hidden", "stage", "", "appointment"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "cli_id", "", $cli_id); $form->addField("hidden", "dea_id", "", $dea_id); $form->addField("hidden", "searchLink", "", $searchLink); $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Appointment</div>'); $form->addData($formData1, $_GET); $form->addHtml($form->addDiv($form->makeField("submit", "submit", "", "Save Changes", array('class' => 'submit')))); $form->addHtml("</fieldset>\n"); $form->addHtml("</div>\n"); $navbar_array = array('back' => array('title' => 'Back', 'label' => 'Back', 'link' => $returnLink), 'search' => array('title' => 'Property Search', 'label' => 'Property Search', 'link' => 'property_search.php')); $navbar = navbar2($navbar_array); $page->setTitle("Arrange Production");
$form->addField("hidden", "pro_id", "", $_GET["pro_id"]); // adding hidden fields for deal, pro2cli, pro2con, pro2com $form->addField("hidden", "dea_id", "", $dea_id); $form->addField("hidden", "cli_id", "", $cli_id); $form->addField("hidden", "pro2con", "", $pro2con); $form->addField("hidden", "pro2com", "", $pro2com); $form->addHtml("<div id=\"standard_form\">\n"); $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Postcode Lookup</div>'); $form->ajaxPostcode("by_freetext", "pro"); $form->addHtml("</fieldset>\n"); $form->addHtml("</div>\n"); $form2 = new Form(); $form2->addForm("form2", "get", $PHP_SELF); $form2->addField("hidden", "pro_id", "", $_GET["pro_id"]); $form2->addHtml("<div id=\"standard_form\">\n"); $form2->addHtml("<fieldset>\n"); $form2->addLegend('Postcode Lookup'); $form2->ajaxPostcode("by_postcode", "pro"); $form2->addHtml("</fieldset>\n"); $form2->addHtml("</div>\n"); if (!$_GET["stage"]) { /* $render = ' <form method="get"> <select name="lookup_type"> <tr><td><a href="?stage=2&search_string="></a></td></tr> <tr><td><a href="?stage=2&search_string=browse">browse</a></td></tr> <tr><td><a href="?stage=2&search_string=by_freetext">by_freetext</a></td></tr> <tr><td><a href="?stage=2&search_string=by_postcode">by_postcode</a></td></tr> <tr><td><a href="?stage=2&search_string=by_area">by_area</a></td></tr>
} if ($_GET["action"] == "reorder") { $image = $_GET["med_id"]; $direction = $_GET["direction"]; header("Location:image.php?dir_id=" . $_GET["dir_id"]); } $formData1 = array('med_file' => array('type' => 'file', 'label' => 'Image', 'required' => 3, 'attributes' => array('style' => 'width:320px')), 'med_title' => array('type' => 'text', 'label' => 'Title', 'required' => 1, 'attributes' => array('style' => 'width:320px')), 'med_blurb' => array('type' => 'textarea', 'label' => 'Description', 'required' => 1, 'attributes' => array('style' => 'width:320px;height:50px'))); if (!$_POST["action"]) { if (!$_GET["dir_id"]) { echo "no directory entry identifier supplied"; exit; } // start new form object $form = new Form(); $form->addForm("form", "post", $PHP_SELF, "multipart/form-data"); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "dir_id", "", $_GET["dir_id"]); ///////////////////////////////////////////////////////////////////////////////// $form->addHtml("<fieldset>\n"); $form->addLegend('Add Image'); $form->addData($formData1, $_GET); $form->addHtml($form->addDiv($form->makeField("submit", "", "", "Save Changes", array('class' => 'submit')))); $form->addHtml("</fieldset>\n"); ///////////////////////////////////////////////////////////////////////////////// // get existing images $sql = "SELECT * FROM media WHERE\nmed_table = 'directory' AND\nmed_row = " . $_GET["dir_id"] . "\nORDER BY med_order ASC, med_created ASC"; $q = $db->query($sql); if (DB::isError($q)) { die("db error: " . $q->getMessage()); }
// sales specific forms $price_brackets = array('0-250000' => '£0 to £250k', '250000-350000' => '£250k to £350k', '350000-500000' => '£350k to £500k', '500000-750000' => '£500k to £750k', '750000-1000000' => '£750k to £1 million', '1000000-2000000' => '£1 million to £2 million'); $deposits = array('0-15' => '0-15%', '16-25' => '16-25%', '26-50' => '26-50%', '51-75' => '51-75%', '100' => '100%'); $form3 = array('cli_selling' => array('type' => 'radio', 'label' => 'Are you selling?', 'required' => 2, 'options' => array('Yes' => 'Yes', 'No' => 'No'), 'value' => $cli_selling), 'cli_renting' => array('type' => 'radio', 'label' => 'Are you renting?', 'required' => 2, 'options' => array('Yes' => 'Yes', 'No' => 'No'), 'value' => $cli_renting), 'cli_valuation' => array('type' => 'radio', 'label' => 'Requires Valuation?', 'required' => 2, 'options' => array('Yes' => 'Yes', 'No' => 'No'), 'value' => $cli_valuation), 'cli_wparents' => array('type' => 'radio', 'label' => 'Living with parents?', 'required' => 2, 'options' => array('Yes' => 'Yes', 'No' => 'No'), 'value' => $cli_wparents)); $form5 = array('cli_area' => array('type' => 'checkbox', 'label' => 'Area(s)', 'required' => 2, 'options' => $areas), 'cli_propertytype' => array('type' => 'checkbox', 'label' => 'Property Type(s)', 'required' => 2, 'options' => $propertytypes), 'cli_price_bracket' => array('type' => 'select', 'label' => 'Price Bracket', 'required' => 2, 'options' => $price_brackets, 'attributes' => array('style' => 'width:250px')), 'cli_deposit' => array('type' => 'select', 'label' => 'Deposit', 'required' => 2, 'options' => $deposits, 'attributes' => array('style' => 'width:100px'), 'value' => $cli_deposit), 'cli_salebed' => array('type' => 'select_number', 'value' => $cli_salebed, 'label' => 'Minimum Beds', 'required' => 2), 'cli_saleemail' => array('type' => 'radio', 'value' => $cli_saleemail, 'label' => 'Email Updates', 'required' => 2, 'options' => db_enum("client", "cli_saleemail", "array"))); $sql = "SELECT * FROM branch WHERE bra_title LIKE '%Sales%'"; $q = $db->query($sql); while ($row = $q->fetchRow()) { $branches[$row["bra_id"]] = $row["bra_title"]; } $form6 = array('cli_branch' => array('type' => 'select', 'label' => 'Branch', 'required' => 2, 'options' => $branches, 'attributes' => array('style' => 'width:250px'), 'value' => $_SESSION["auth"]["use_branch"]), 'cli_neg' => array('type' => 'select_neg', 'label' => 'Negotiator', 'required' => 2, 'attributes' => array('style' => 'width:250px'), 'value' => $_SESSION["auth"]["use_id"]), 'cli_notes' => array('type' => 'textarea', 'label' => 'General Notes', 'required' => 2, 'attributes' => array('style' => 'width:450px;height:150px;'))); if (!$_POST) { // start new form object $form = new Form(); $form->addForm("testForm", "post", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "cli_id", "", $cli_id); $form->addField("hidden", "searchLink", "", $searchLink); //$form->addHtml('<input type="hidden" name="action" value="update">'); $form->addHtml('<h1>New Client Questionaire</h1>'); $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Personal Details</div>'); $form->addHtml('<div>'); $form->addData($form1, $_POST); $form->addHtml("</div>\n"); $form->addHtml("</fieldset>\n"); $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Address</div>'); $form->addHtml('<div>'); $form->addData($form2, $_POST);
<tr> <td class="label" valign="top">Viewer(s)</td> <td>' . preg_replace("/\\([a-z0-9\\ ]+\\)/", "", $cli_name) . '</td> </tr>'; } $render .= ' <tr> <td class="label" valign="top">Date</td> <td>' . $app_date . '</td> </tr> </table>'; $formData1 = array('d2a_feedback' => array('type' => 'radio', 'label' => 'Outcome', 'value' => $d2a_feedback, 'options' => array_slice(db_enum("link_deal_to_appointment", "d2a_feedback", "array"), 1), 'required' => 2), 'notes' => array('type' => 'textarea', 'label' => 'Add Note', 'attributes' => array('class' => 'noteInput'), 'tooltip' => 'These notes will be visible to vendors')); if (!$_GET["action"]) { $form = new Form(); $form->addForm("app_form", "GET", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "app_id", "", $app_id); $form->addField("hidden", "d2a_id", "", $d2a_id); $form->addField("hidden", "dea_id", "", $dea_id); $form->addField("hidden", "cli_id", "", $cli_id); $form->addField("hidden", "searchLink", "", urlencode($searchLink)); $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Feedback</div>'); $form->addHtml($render); $form->addData($formData1, $_GET); $form->addHtml(renderNotes('feedback', $d2a_id)); if ($app_type == 'Viewing') { $form->addHtml($form->addRow('radio', 'makeoffer', 'Submit Offer?', 'No', '', array('Yes' => 'Yes', 'No' => 'No'))); } $form->addHtml($form->addDiv($form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit'))));
} $image_path_property = IMAGE_PATH_PROPERTY . $dea_id . "/"; $image_url_property = IMAGE_URL_PROPERTY . $dea_id . "/"; if ($med_type == "Photograph") { // which tab to show on return to production page $viewForm = 3; $formData = array('med_title' => array('type' => 'select', 'label' => 'Title', 'value' => $med_title, 'required' => 2, 'attributes' => array('style' => 'width:320px'), 'options' => $photograph_titles), 'med_blurb' => array('type' => 'textarea', 'label' => 'Description', 'value' => $med_blurb, 'attributes' => array('style' => 'width:320px'))); } elseif ($med_type == "Floorplan") { // which tab to show on return to production page $viewForm = 4; $formData = array('med_title' => array('type' => 'select', 'label' => 'Title', 'value' => $med_title, 'required' => 2, 'attributes' => array('style' => 'width:320px'), 'options' => $floorplan_titles), 'med_dims' => array('type' => 'text', 'label' => 'Area', 'value' => $med_dims, 'required' => 1, 'attributes' => array('style' => 'width:120px'), 'group' => 'Area'), 'med_measurement' => array('type' => 'radio', 'label' => 'Area', 'default' => 'mtr²', 'required' => 1, 'options' => array('mtr²' => 'metres', 'ft²' => 'feet'), 'group' => 'Area', 'last_in_group' => 1)); } if (!$_POST["action"]) { $form = new Form(); $form->addForm("", "POST", $PHP_SELF, "multipart/form-data"); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "stage", "", "1"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "dea_id", "", $dea_id); $form->addField("hidden", "med_id", "", $med_id); $form->addField("hidden", "searchLink", "", urlencode($searchLink)); $form->addHtml("<fieldset>\n"); //$form->addLegend('Edit '.$med_title); $form->addHtml('<div class="block-header">Edit ' . $med_title . '</div>'); $form->addData($formData, $_POST); $form->addHtml($form->addDiv($form->makeField("submit", "", "", "Save Changes", array('class' => 'submit')))); if ($med_type == "Photograph") { foreach ($thumbnail_sizes as $dims => $ext) { $dim = explode('x', $dims); $width = $dim[0]; $height = $dim[1];
Offer made by: ' . preg_replace("/\\([a-z0-9\\ ]+\\)/", "", $cli_name) . ' Date of offer: ' . $date . ' Amount: ' . format_price($off_price) . ' (' . $off_price_word . ') Conditions: ' . $off_conditions . ' With kind regards. Yours sincerely, ' . $use_name); #echo "<pre>".$offer_text."</pre>"; #exit; if (!$_GET["action"]) { $form = new Form(); $form->addForm("", "GET", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "stage", "", "2"); $form->addField("hidden", "off_id", "", $off_id); $form->addField("hidden", "return", "", $_GET["return"]); $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Submit Offer</div>'); #$form->addHtml($form->addHtml($deal_table)); #$form->addData($formData1,$_GET); $form->addRow("textarea", "send", "Letter to Vendor", $offer_text, array('style' => 'width:450px;height:450px')); $form->addRow("checkbox", "send", "Send By", array("Post", "Email"), array(), array('Post' => 'Post', 'Email' => 'Email')); $form->addHtml($form->addDiv($form->makeField("submit", $formName, "", "Send and Save", array('class' => 'submit')))); $form->addHtml("</fieldset>\n"); $form->addHtml("</div>\n"); $navbar_array = array('back' => array('title' => 'Back', 'label' => 'Back', 'link' => $_GET["return"]), 'search' => array('title' => 'Property Search', 'label' => 'Property Search', 'link' => 'property_search.php')); $navbar = navbar2($navbar_array);
} else { $errors[] = 'No property specified'; echo error_message($errors); exit; } if (!$_GET["action"]) { $formData1 = array('dea_launchdate' => array('type' => 'radio', 'label' => 'Release as new?', 'value' => 'No', 'required' => 2, 'options' => array('Yes' => 'Yes', 'No' => 'No'), 'tooltip' => 'Choosing yes will make this property the newest on the site')); if (!in_array('Production', $_SESSION["auth"]["roles"])) { $formData1['dea_launchdate']['attributes'] = array('disabled' => 'disabled'); } if (in_array('Mailshot', $_SESSION["auth"]["roles"])) { $formData1['mailshot'] = array('type' => 'radio', 'label' => 'Send mailshot?', 'value' => 'No', 'required' => 2, 'options' => array('Yes' => 'Yes', 'No' => 'No')); } $form = new Form(); $form->addForm("", "GET", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "dea_id", "", $dea_id); $form->addField("hidden", "searchLink", "", urlencode($_GET["searchLink"])); $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Release Property</div>'); $form->addData($formData1, $_GET); $form->addHtml($form->addDiv($form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit')))); $form->addHtml("</fieldset>\n"); $form->addHtml("</div>\n"); $navbar_array = array('back' => array('title' => 'Back', 'label' => 'Back', 'link' => $_GET["searchLink"]), 'search' => array('title' => 'Property Search', 'label' => 'Property Search', 'link' => 'property_search.php')); $navbar = navbar2($navbar_array); $page = new HTML_Page2($page_defaults); $page->setTitle("Release Property"); $page->addStyleSheet(getDefaultCss()); $page->addScript('js/global.js');
db_query($db_data, 'UPDATE', 'bug', 'bug_id', $bug_id); // send mail $subject = "Update on your {$bug_type}"; $msg = "Dear {$use_name},\n\nYou submitted a {$bug_type} on {$bug_date}. This {$bug_type} has been updated by " . $_SESSION["auth"]["use_fname"] . ' ' . $_SESSION["auth"]["use_sname"] . ".\n\n------------------------------------------------------------\nYour original {$bug_type}:\n" . wordwrap($db_data["bug_blurb"], 65, "\n") . "\n------------------------------------------------------------\n" . $_SESSION["auth"]["use_fname"] . ' ' . $_SESSION["auth"]["use_sname"] . "'s response:\n" . wordwrap($db_data["bug_response"], 65, "\n") . "\n------------------------------------------------------------\n\nThe status of this {$bug_type} has now been set to " . $db_data["bug_status"]; if ($_GET["send"] == 'Yes') { send_email($use_email, $_SESSION["auth"]["use_email"], $subject, $msg); } header("Location:superadmin_tools.php"); } // submit bug } else { $formData1 = array('bug_type' => array('type' => 'radio', 'label' => 'Type', 'value' => $bug_type, 'options' => db_enum("bug", "bug_type", "array"), 'default' => 'Question'), 'bug_blurb' => array('type' => 'textarea', 'label' => 'Description', 'value' => $bug_blurb, 'required' => 2, 'attributes' => array('style' => 'width:400px;height:80px')), 'bug_user' => array('type' => 'hidden', 'value' => $_SESSION["auth"]["use_id"]), 'bug_page' => array('type' => 'hidden', 'value' => $_GET["bug_page"])); if (!$_GET["action"]) { $form = new Form(); $form->addForm("", "GET", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "action", "", "save"); $formName = 'form1'; $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Assistance</div>'); $form->addHtml('<div id="' . $formName . '">'); $form->addData($formData1, $_GET); $buttons = $form->makeField("submit", "", "", "Submit", array('class' => 'submit')); $buttons .= $form->makeField("button", "", "", "Cancel", array('class' => 'button', 'onClick' => 'document.location.href = \'' . urldecode($_GET["bug_page"]) . '\'')); $form->addHtml($form->addDiv($buttons)); $form->addHtml("</div>\n"); $form->addHtml("</fieldset>\n"); $navbar_array = array('back' => array('title' => 'Back', 'label' => 'Back', 'link' => urldecode($_GET["bug_page"])), 'search' => array('title' => 'Search', 'label' => 'Search', 'link' => 'search.php')); $navbar = navbar2($navbar_array); // start a new page $page = new HTML_Page2($page_defaults);
die("db error: " . $q->getMessage() . $sql); } $numRows = $q->numRows(); if ($numRows !== 0) { while ($row = $q->fetchRow()) { $render .= '<label for="deal_' . $row["dea_id"] . '"><input type="checkbox" name="dea_id[]" id="deal_' . $row["dea_id"] . '" value="' . $row["dea_id"] . '" checked>' . $row["pro_addr"] . " " . format_price($row["dea_marketprice"]) . "</label><br />"; } } } if (!$render) { echo error_message(array('No properties selected (only available properties can be emailed)')); exit; } $form = new Form(); $form->addForm("", "GET", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "action", "", "send"); $form->addField("hidden", "dea_id_original", "", $_GET["dea_id"]); $form->addField("hidden", "searchLink", "", $_GET["searchLink"]); $formName = 'form1'; $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Send Email</div>'); $form->addHtml('<div id="inset">' . $render . '</div>'); $form->addData($formData1, $_GET); $form->addHtml($form->addDiv($form->makeField("submit", "", "", "Send", array('class' => 'submit')))); $form->addHtml("</fieldset>\n"); $navbar_array = array('back' => array('title' => 'Back', 'label' => 'Back', 'link' => $searchLink), 'search' => array('title' => 'Property Search', 'label' => 'Property Search', 'link' => 'property_search.php')); $navbar = navbar2($navbar_array); $page = new HTML_Page2($page_defaults); $page->setTitle("Send Email"); $page->addStyleSheet(getDefaultCss());
} // change sydenham, lettins branch to camberwell, as only one calendar in use if ($_SESSION["auth"]["use_branch"] == 4) { $branch = 3; } else { $branch = $_SESSION["auth"]["use_branch"]; } // show (unassigned) if user is not a neg if (!in_array('Negotiator', $_SESSION["auth"]["roles"])) { $user = 0; } else { $user = $_SESSION["auth"]["use_id"]; } $formData1 = array('calendarID' => array('type' => 'select_branch_2', 'label' => 'Branch', 'value' => $branch, 'attributes' => array('class' => 'medium')), 'app_user' => array('type' => 'select_user', 'label' => 'Negotiator', 'value' => $user, 'attributes' => array('class' => 'medium'), 'options' => array('' => '(unassigned)')), 'app_date' => array('type' => 'datetime', 'label' => 'Date', 'value' => $app_date, 'attributes' => array('class' => 'medium', 'readonly' => 'readonly'), 'tooltip' => 'Today\'s date is selected by default'), 'app_time' => array('type' => 'time', 'label' => 'Start Time', 'value' => $app_time), 'app_duration' => array('type' => 'select_duration', 'label' => 'Estimated Duration', 'value' => $duration, 'attributes' => array('class' => 'medium'), 'tooltip' => 'Duration is estimated at ' . $default_viewing_duration . ' minutes per property'), 'notes' => array('type' => 'textarea', 'label' => 'Notes', 'value' => $app["notes"], 'attributes' => array('class' => 'noteInput'))); $form = new Form(); $form->addHtml("<div id=\"standard_form\">\n"); $form->addForm("", "get"); $form->addField("hidden", "stage", "", "appointment"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "cli_id", "", $cli_id); $form->addField("hidden", "app_id", "", $_GET["app_id"]); $form->addField("hidden", "dea_id", "", $dea_id); $form->addField("hidden", "searchLink", "", $searchLink); $form->addField("hidden", "skip", "", $_GET["skip"]); $form->addHtml("<fieldset class=\"" . ($DIT ? "DIT-property" : "") . "\">\n"); $form->addHtml('<div class="block-header">Appointment</div>'); if ($DIT) { $form->addHtml('<div class="dit-notification">This is an appointment for DIT instruction.</div>'); } $form->addData($formData1, $_GET); $form->addHtml($form->addDiv($form->makeField("submit", "submit", "", "Save Changes", array('class' => 'submit'))));
/* #overwrite database values with POST values (probably empty) foreach ($_POST AS $key=>$val) { $$key = $val; } #overwrite database values with GET values when returning from error message foreach ($_GET AS $key=>$val) { $$key = $val; } */ $form1 = array('use_salutation' => array('type' => 'select', 'group' => 'Full Name', 'label' => 'Salutation', 'value' => $use_salutation, 'required' => 2, 'options' => db_enum("user", "use_salutation", "array"), 'attributes' => array('style' => 'width:60px')), 'use_fname' => array('type' => 'text', 'group' => 'Full Name', 'label' => 'Forename', 'value' => $use_fname, 'default' => 'Forename(s)', 'required' => 2, 'attributes' => array('style' => 'width:100px', 'onFocus' => 'javascript:clearField(this,\'Forename(s)\')'), 'function' => 'format_name'), 'use_sname' => array('type' => 'text', 'group' => 'Full Name', 'last_in_group' => 1, 'label' => 'Surname', 'value' => $use_sname, 'default' => 'Surname', 'required' => 2, 'attributes' => array('style' => 'width:152px', 'onFocus' => 'javascript:clearField(this,\'Surname\')'), 'function' => 'format_name'), 'use_ext' => array('type' => 'text', 'label' => 'Extension', 'value' => $use_ext, 'required' => 1, 'attributes' => array('class' => 'medium')), 'use_mobile' => array('type' => 'text', 'label' => 'Mobile', 'value' => $use_mobile, 'attributes' => array('class' => 'medium')), 'use_hometel' => array('type' => 'text', 'label' => 'Home Tel', 'value' => $use_hometel, 'attributes' => array('class' => 'medium'))); $form2 = array('pro_pcid' => array('type' => 'hidden', 'value' => $pro_pcid), 'pro_addr1' => array('type' => 'text', 'label' => 'House Number', 'value' => $pro_addr1, 'required' => 2, 'attributes' => array('class' => 'addr'), 'function' => 'format_street'), 'pro_addr2' => array('type' => 'text', 'label' => 'Building Name', 'value' => $pro_addr2, 'required' => 1, 'attributes' => array('class' => 'addr'), 'function' => 'format_street'), 'pro_addr3' => array('type' => 'text', 'label' => 'Street', 'value' => $pro_addr3, 'required' => 2, 'attributes' => array('class' => 'addr'), 'function' => 'format_street'), 'pro_addr4' => array('type' => 'text', 'label' => 'Town or Area', 'value' => $pro_addr4, 'required' => 3, 'attributes' => array('class' => 'addr'), 'function' => 'format_street'), 'pro_addr5' => array('type' => 'text', 'label' => 'City or County', 'value' => $pro_addr5, 'required' => 2, 'attributes' => array('class' => 'addr'), 'function' => 'format_street'), 'pro_postcode' => array('type' => 'text', 'label' => 'Postcode', 'value' => $pro_postcode, 'required' => 2, 'attributes' => array('class' => 'pc', 'maxlength' => 9), 'function' => 'format_postcode'), 'pro_country' => array('type' => 'select', 'label' => 'Country', 'value' => $pro_country, 'required' => 2, 'options' => db_lookup("use_country", "country", "array"), 'attributes' => array('class' => 'addr'))); if (!$_POST["action"]) { $form = new Form(); $form->addForm("form", "post", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "searchLink", "", $_GET["searchLink"]); ///////////////////////////////////////////////////////////////////////////////// $formName = 'form1'; $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">User</div>'); $form->addHtml('<div id="' . $formName . '">'); $form->addData(${$formName}, $_POST); $form->addHtml($form->addDiv($form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit')))); $form->addHtml("</div>\n"); $form->addHtml("</fieldset>\n"); ///////////////////////////////////////////////////////////////////////////////// $formName = 'form2'; $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Address</div>');
// only accesible to SuperAdmin and Administrator pageAccess($_SESSION["auth"]["roles"], array('SuperAdmin', 'Administrator')); $page = new HTML_Page2($page_defaults); $sql = "SELECT use_id,use_fname,use_sname FROM user"; $q = $db->query($sql); if (DB::isError($q)) { die("db error: " . $q->getMessage()); } while ($row = $q->fetchRow()) { $users[$row["use_id"]] = $row["use_fname"] . ' ' . $row["use_sname"]; } $formData1 = array('use_id' => array('type' => 'select', 'label' => 'User', 'value' => $use_id, 'options' => $users, 'attributes' => array('class' => 'addr'), 'required' => 2), 'use_password' => array('type' => 'text', 'label' => 'Password', 'value' => $use_password, 'attributes' => array('class' => 'addr'), 'required' => 2, 'tooltip' => 'Passwords must be at least 8 characters, and contain at least one number and one UPPER CASE letter')); if (!$_GET["action"]) { $form = new Form(); $form->addForm("", "get", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "action", "", "reset"); ///////////////////////////////////////////////////////////////////////////////// $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Reset Password</div>'); $form->addData($formData1, $_GET); $form->addHtml($form->addDiv($form->makeField("submit", "", "", "Save Changes", array('class' => 'submit')))); $form->addHtml("</fieldset>\n"); $form->addHtml('<pre>'); for ($i = 1; $i <= 5; ++$i) { $form->addHtml(random_string(16, 'safe') . "\n"); } $form->addHtml('</pre>'); $page->setTitle("Change Password"); $page->addStyleSheet(getDefaultCss()); $page->addScript(GLOBAL_URL . 'js/global.js');
<td class="label" valign="top">Tenant(s)</td> <td class="spaced">' . remove_lastchar($tenant_name, '<br />') . '</td> </tr>'; } $render .= ' <tr> <td class="label" valign="top">Key</td> <td>' . $key_info . '</td> </tr> </table> ' . renderNotes('viewing_arrangements', $dea_id, array('layout' => 'readonly', 'label' => 'View Times and Info')); $formData1 = array('d2a_cv' => array('type' => 'radio', 'label' => 'Confirm Status', 'value' => $d2a_cv, 'options' => db_enum("link_deal_to_appointment", "d2a_cv", "array")), 'notes' => array('type' => 'textarea', 'label' => 'Add Confirmation Note', 'attributes' => array('class' => 'noteInput'), 'tooltip' => 'Notes relating to the confirmation of this property only')); if (!$_GET["action"]) { $form = new Form(); $form->addForm("app_form", "GET", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "app_id", "", $app_id); $form->addField("hidden", "d2a_id", "", $d2a_id); $form->addField("hidden", "searchLink", "", urlencode($searchLink)); $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Confirm ' . $app_type . '</div>'); $form->addHtml($render); $form->addData($formData1, $_GET); $form->addHtml(renderNotes('confirm', $d2a_id, array('label' => 'Confirmation Notes'))); $form->addHtml($form->addDiv($form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit')))); $form->addHtml("</fieldset>\n"); $form->addHtml('</div>'); $navbar_array = array('back' => array('title' => 'Back', 'label' => 'Back', 'link' => $_GET["searchLink"]), 'search' => array('title' => 'Appointment Search', 'label' => 'Appointment Search', 'link' => 'appointment_search.php')); $navbar = navbar2($navbar_array); $page = new HTML_Page2($page_defaults);
die("db error: " . $q->getMessage() . $sql); } $numRows = $q->numRows(); if ($numRows !== 0) { while ($row = $q->fetchRow()) { foreach ($row as $key => $val) { ${$key} = $val; } } } $formData1 = array('cli_salemin' => array('type' => 'select_price', 'value' => $cli_salemin, 'label' => 'Minimum Price', 'group' => 'Price Range', 'required' => 2, 'options' => array('scope' => 'sales', 'default' => 'Minimum'), 'attributes' => array('style' => 'width:120px')), 'cli_salemax' => array('type' => 'select_price', 'value' => $cli_salemax, 'label' => 'Maximum Price', 'group' => 'Price Range', 'last_in_group' => 1, 'required' => 2, 'options' => array('scope' => 'sales', 'default' => 'Maximum'), 'attributes' => array('style' => 'width:120px')), 'cli_salebed' => array('type' => 'select_number', 'value' => $cli_salebed, 'label' => 'Minimum Beds', 'required' => 2), 'cli_saleemail' => array('type' => 'radio', 'value' => $cli_saleemail, 'label' => 'Email Updates', 'required' => 2, 'options' => db_enum("client", "cli_saleemail", "array"))); $ptype_sale = ptype("sale", explode("|", $cli_saleptype)); $formData2 = array('cli_letmin' => array('type' => 'select_price', 'value' => $cli_letmin, 'label' => 'Minimum Price', 'group' => 'Price Range', 'required' => 2, 'options' => array('scope' => 'lettings', 'default' => 'Minimum'), 'attributes' => array('style' => 'width:120px')), 'cli_letmax' => array('type' => 'select_price', 'value' => $cli_letmax, 'label' => 'Maximum Price', 'group' => 'Price Range', 'last_in_group' => 1, 'required' => 2, 'options' => array('scope' => 'lettings', 'default' => 'Maximum'), 'attributes' => array('style' => 'width:120px')), 'cli_letbed' => array('type' => 'select_number', 'value' => $cli_letbed, 'label' => 'Minimum Beds', 'required' => 2), 'cli_letemail' => array('type' => 'radio', 'value' => $cli_letemail, 'label' => 'Email Updates', 'required' => 2, 'options' => db_enum("client", "cli_letemail", "array"))); $ptype_let = ptype("let", explode("|", $cli_letptype)); $form = new Form(); $form->addHtml("<div id=\"standard_form\">\n"); $form->addForm("", "get"); $form->addField("hidden", "stage", "", "requirements"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "cli_id", "", $cli_id); $form->addField("hidden", "app_id", "", $_GET["app_id"]); $form->addField("hidden", "searchLink", "", $searchLink); $form->addHtml("<fieldset>\n"); $form->addLegend('Sales Requirements'); $form->addHtml($form->addLabel('cli_saleptype', 'Houses', $ptype_sale['house'], 'javascript:checkAll(document.forms[0], \'sale1\');')); $form->addHtml($form->addLabel('cli_saleptype', 'Apartments', $ptype_sale['apartment'], 'javascript:checkAll(document.forms[0], \'sale2\');')); $form->addHtml($form->addLabel('cli_saleptype', 'Others', $ptype_sale['other'], 'javascript:checkAll(document.forms[0], \'sale3\');')); $form->addData($formData1, $_GET); $form->addHtml($form->addDiv($form->makeField("submit", "submit", "", "Save Changes", array('class' => 'submit')))); $form->addHtml("</fieldset>\n"); $form->addHtml("<fieldset>\n");
$in_past = 1; } if (strtotime($app["end"]) < strtotime($date_mysql) - $default_appointment_expiry) { $expired = 1; } // reset the $expired var is user is calendar administrator if (in_array('Calendar Administrator', $_SESSION["auth"]["roles"])) { unset($expired); } // reset the $expired var is user LETTINGS if ($_SESSION["auth"]["default_scope"] == 'Lettings') { unset($expired); } $form = new Form(); $form->addForm("app_form", "POST", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "app_id", "", $app_id); $form->addField("hidden", "searchLink", "", urlencode($searchLink)); $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">' . $app["type"] . '</div>'); if ($expired) { $form->addHtml('<p class="appInfo">This appointment is read-only</p>'); } if ($app["status"] == "Deleted") { $form->addHtml('<p class="appInfo">This appointment has been deleted</p>'); } if ($app["status"] == "Cancelled") { $form->addHtml('<p class="appInfo">This appointment has been cancelled</p>'); $form->addHtml(renderNotes('appointment_cancel', $app_id, array('label' => 'Reason for Cancelling', 'layout' => 'readonly'))); }
} // reset status attributes for LETTINGS if ($_SESSION["auth"]["default_scope"] == 'Lettings') { $status_attributes = array('style' => 'width:300px'); } $formData4 = array('dea_status' => array('type' => 'select', 'label' => 'Status', 'value' => $dea_status, 'options' => $statuses, 'attributes' => $status_attributes), 'dea_notes_sot' => array('type' => 'textarea', 'label' => 'Add Status Note', 'attributes' => array('class' => 'noteInput', 'viewform' => 3))); } //if (compare_status($dea_status, 'Production') >= 0 && compare_status($dea_status, 'Not Instructed')) { $formData4['displayOnWebsite'] = array('type' => 'checkboxSingle', 'label' => 'Display on website', 'value' => $displayOnWebsite, 'options' => '1'); //} // viewing arrangements $formData5 = array('dea_key' => array('type' => 'text', 'label' => 'Key Number', 'value' => $dea_key, 'attributes' => array('class' => 'wide')), 'dea_notes_arr' => array('type' => 'textarea', 'label' => 'Add Viewing Info', 'attributes' => array('class' => 'noteInput'))); if (!$_GET["action"]) { $form = new Form(); $form->addForm("", "GET", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "stage", "", "1"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "dea_id", "", $dea_id); $form->addField("hidden", "pro_id", "", $pro_id); $form->addField("hidden", "searchLink", "", urlencode($searchLink)); $form->addHtml('<h1>' . $pro_addr . ' (' . $dea_type . ')</h1>'); $formName = 'form1'; $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Summary</div>'); $form->addHtml('<div id="' . $formName . '">'); $form->addHtml($form->addHtml($summary_table)); //$form->addHtml($form->addDiv($form->makeField("textarea",$formName,"General Notes","",array('class'=>'noteInput')))); $form->addHtml($form->addRow('textarea', 'dea_notes', 'Add General Note', '', array('class' => 'noteInput'), '', '')); $form->addHtml(renderNotes('deal_general', $dea_id, array('viewform' => '1', 'label' => 'General Notes'))); $buttons = $form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit'));
$letstatus_array[$row["cst_id"]] = $row["cst_title"]; } } $branches[0] = '(unassigned)'; $sql = "SELECT * FROM branch"; $q = $db->query($sql); while ($row = $q->fetchRow()) { $branches[$row["bra_id"]] = $row["bra_title"]; } $form8 = array('cli_source' => array('type' => 'select_multi', 'label' => 'Referer', 'value' => $cli_source, 'options' => $source), 'cli_neg' => array('type' => 'select_neg', 'label' => 'Assigned Negotiator', 'value' => $cli_neg, 'attributes' => array('class' => 'wide'), 'options' => array('' => '(unassigned)')), 'cli_branch' => array('type' => 'select', 'label' => 'Assigned Branch', 'value' => $cli_branch, 'attributes' => array('class' => 'wide'), 'options' => $branches), 'cli_salestatus' => array('type' => 'select', 'label' => 'Current Status (Sales)', 'value' => $cli_salestatus, 'options' => $salestatus_array, 'attributes' => array('class' => 'wide')), 'cli_letstatus' => array('type' => 'select', 'label' => '(Lettings)', 'value' => $cli_letstatus, 'options' => $letstatus_array, 'attributes' => array('class' => 'wide')), 'cli_solicitor' => array('type' => 'text', 'label' => 'Solicitor', 'value' => $con_name, 'attributes' => array('class' => 'wide')), 'cli_solicitor_id' => array('type' => 'hidden', 'value' => $cli_solicitor_id)); // form is not submitted, show the form if (!$_POST["action"]) { // start new form object $form = new Form(); $form->addForm("testForm", "post", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "cli_id", "", $cli_id); $form->addField("hidden", "searchLink", "", $searchLink); //$form->addHtml('<input type="hidden" name="action" value="update">'); $form->addHtml('<h1>' . $cli_fname . ' ' . $cli_sname . '</h1>'); $form->addHtml($alert); ///////////////////////////////////////////////////////////////////////////////// $formName = 'form1'; $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Contact</div>'); $form->addHtml('<div id="' . $formName . '">'); $form->addData(${$formName}, $_POST); $form->addHtml(renderNotes('client_general', $cli_id, array('viewform' => '1', 'label' => 'General Notes'))); //$form->addHtml($form->addDiv($form->makeField("submit",$formName,"","Save Changes",array('class'=>'submit')))); $buttons = $form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit'));
$q_area = $db->query($sql_area); while ($row_area = $q_area->fetchRow()) { $countries[$row_area["cou_id"]] = $row_area["cou_title"]; } // all are readonly except area for paf addresses if ($pro_pcid == '-1') { $attributes = array('class' => 'wide'); } else { $attributes = array('class' => 'wide', 'readonly' => 'readonly'); $info = '<p class="appInfo">This is a Royal Mail address, all you can edit is the Area</p>'; } $formData1 = array('pro_addr1' => array('type' => 'text', 'label' => 'House/Flat Number', 'value' => $pro_addr1, 'attributes' => $attributes, 'required' => 2, 'function' => 'format_street'), 'pro_addr2' => array('type' => 'text', 'label' => 'Building Name', 'value' => $pro_addr2, 'attributes' => $attributes, 'function' => 'format_street'), 'pro_addr3' => array('type' => 'text', 'label' => 'Street', 'value' => $pro_addr3, 'attributes' => $attributes, 'required' => 2, 'function' => 'format_street'), 'pro_area' => array('type' => 'select', 'label' => 'Area', 'value' => $pro_area, 'attributes' => array('class' => 'wide'), 'options' => $areas), 'pro_addr5' => array('type' => 'text', 'label' => 'City or County', 'value' => $pro_addr5, 'attributes' => $attributes, 'required' => 2, 'function' => 'format_street'), 'pro_country' => array('type' => 'select', 'label' => 'Country', 'value' => $pro_country, 'attributes' => $attributes, 'options' => $countries), 'pro_postcode' => array('type' => 'text', 'label' => 'Postcode', 'value' => $pro_postcode, 'attributes' => $attributes, 'required' => 2, 'function' => 'format_postcode'), 'pro_authority' => array('type' => 'text', 'label' => 'Local Authority', 'value' => $pro_authority, 'attributes' => $attributes), 'pro_east' => array('type' => 'text', 'label' => 'Easting', 'value' => $pro_east, 'attributes' => $attributes), 'pro_north' => array('type' => 'text', 'label' => 'Northing', 'value' => $pro_north, 'attributes' => $attributes), 'pro_latitude' => array('type' => 'text', 'label' => 'Latitude', 'value' => $pro_latitude, 'attributes' => $attributes), 'pro_longitude' => array('type' => 'text', 'label' => 'Longitude', 'value' => $pro_longitude, 'attributes' => $attributes)); if (!$_GET["action"]) { $form = new Form(); $form->addForm("app_form", "GET", $PHP_SELF); $form->addHtml("<div id=\"standard_form\" style=\"width:700px; float:left\">\n"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "pro_id", "", $pro_id); $form->addField("hidden", "searchLink", "", urlencode($searchLink)); $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Edit Address</div>'); $form->addHtml($info); //$form->addHtml($form->addRow("radio","saveas","Action","Save",array(),array('Save'=>'Save','Add as New'=>'Add as New'))); $form->addData($formData1, $_GET); //if ($pro_pcid == '-1') { $form->addHtml($form->addDiv($form->makeField("submit", "submit", "", "Save Changes", array('class' => 'submit')))); // } $form->addHtml("</fieldset>\n"); $form->addHtml("</div>\n"); $form->addHtml('<div style="padding-top: 30px;"><div id="map" style="width:500px; height:435px;"></div></div> <script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>
exit; } elseif ($app_type == "Inspection") { header("Location:inspection_add.php?date={$date}"); exit; } elseif ($app_type == "Lunch") { $formData1 = array('app_user' => array('type' => 'select_user', 'label' => 'User', 'default' => $_SESSION["auth"]["use_id"], 'value' => $app_user, 'attributes' => array('class' => 'medium'), 'options' => $negotiators), 'app_date' => array('type' => 'datetime', 'label' => 'Date', 'default' => $date_short, 'value' => $_GET["date"], 'attributes' => array('class' => 'medium', 'readonly' => 'readonly')), 'app_time' => array('type' => 'time', 'label' => 'Start Time', 'value' => $app_time, 'default' => date('G:i')), 'app_duration' => array('type' => 'select_duration', 'label' => 'Duration', 'value' => $duration, 'default' => 60, 'attributes' => array('class' => 'medium')), 'app_notes' => array('type' => 'textarea', 'label' => 'Notes', 'value' => $app_notes, 'attributes' => array('class' => 'wide'))); } elseif ($app_type == "Meeting") { $formData1 = array('app_subject' => array('type' => 'text', 'label' => 'Subject', 'value' => $app_subject, 'attributes' => array('class' => 'wide'), 'required' => 2), 'app_notes' => array('type' => 'textarea', 'label' => 'Notes', 'value' => $app_notes, 'attributes' => array('class' => 'wide', 'style' => 'height:50px')), 'calendarID' => array('type' => 'select_branch_2', 'label' => 'Branch', 'value' => $calendarID, 'attributes' => array('class' => 'medium'), 'options' => $branches), 'app_user' => array('type' => 'select_user', 'label' => 'Negotiator', 'default' => $_SESSION["auth"]["use_id"], 'value' => $app_user, 'attributes' => array('class' => 'medium'), 'options' => $negotiators), 'app_date' => array('type' => 'datetime', 'label' => 'Date', 'default' => $date_short, 'value' => $_GET["date"], 'attributes' => array('class' => 'medium', 'readonly' => 'readonly')), 'app_time' => array('type' => 'time', 'label' => 'Start Time', 'value' => $app_time, 'default' => date('G:i'), 'group' => 'Start Time'), 'app_allday' => array('type' => 'checkbox', 'label' => 'All day', 'value' => $app["allday"], 'options' => array('All day event' => 'Yes'), 'attributes' => array('onClick' => 'allDayCheck(\'app_allday[]\')'), 'group' => 'Start Time', 'last_in_group' => 1), 'app_duration' => array('type' => 'select_duration', 'label' => 'Duration', 'value' => $duration, 'default' => 30, 'attributes' => array('class' => 'medium'))); } elseif ($app_type == "Note") { $formData1 = array('app_notetype' => array('type' => 'select', 'label' => 'Type', 'value' => $app_notetype, 'attributes' => array('class' => 'wide'), 'options' => db_enum("appointment", "app_notetype", "array"), 'required' => 1), 'app_subject' => array('type' => 'text', 'label' => 'Subject', 'value' => $app_subject, 'attributes' => array('class' => 'wide'), 'required' => 1), 'app_notes' => array('type' => 'textarea', 'label' => 'Notes', 'value' => $app_notes, 'attributes' => array('class' => 'wide', 'style' => 'height:50px')), 'calendarID' => array('type' => 'select_branch_2', 'label' => 'Branch', 'value' => $calendarID, 'attributes' => array('class' => 'medium')), 'app_user' => array('type' => 'select_user', 'label' => 'User', 'default' => $_SESSION["auth"]["use_id"], 'value' => $app_user, 'attributes' => array('class' => 'medium'), 'options' => $negotiators), 'app_date' => array('type' => 'datetime', 'label' => 'Date', 'default' => $date_short, 'value' => $_GET["date"], 'attributes' => array('class' => 'medium', 'readonly' => 'readonly')), 'app_time' => array('type' => 'time', 'label' => 'Start Time', 'value' => $app_time, 'default' => date('G:i'), 'group' => 'Start Time'), 'app_allday' => array('type' => 'checkbox', 'label' => 'All day', 'value' => $app["allday"], 'options' => array('All day event' => 'Yes'), 'attributes' => array('onClick' => 'allDayCheck(\'app_allday[]\')'), 'group' => 'Start Time', 'last_in_group' => 1), 'app_duration' => array('type' => 'select_duration', 'label' => 'Duration', 'value' => $duration, 'default' => 30, 'attributes' => array('class' => 'medium'))); } // end app_type if if (!$_GET["action"]) { $form = new Form(); $form->addForm("app_form", "GET", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "app_id", "", $app_id); $form->addField("hidden", "app_type", "", $app_type); $form->addField("hidden", "searchLink", "", urlencode($searchLink)); $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Add ' . $app_type . '</div>'); $form->addData($formData1, $_GET); $form->addHtml($form->addDiv($form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit')))); $form->addHtml('</div>'); $navbar_array = array('search' => array('title' => 'Appointment Search', 'label' => 'Appointment Search', 'link' => 'appointment_search.php')); $navbar = navbar2($navbar_array); //replaceQueryStringArray($_GET["searchLink"],array('app_id')) $page = new HTML_Page2($page_defaults); $page->setTitle("Appointment"); $page->addStyleSheet(getDefaultCss());
$q = $db->query($sql); if (DB::isError($q)) { die("db error: " . $q->getMessage()); } while ($row = $q->fetchRow()) { $ctype[$row["cty_id"]] = $row["cty_title"]; } $form1 = array('com_title' => array('type' => 'text', 'label' => 'Company Name', 'value' => $com_title, 'required' => 2, 'attributes' => array('style' => 'width:320px')), 'com_type' => array('type' => 'select', 'label' => 'Business Type', 'value' => $com_type, 'required' => 2, 'attributes' => array('style' => 'width:320px'), 'options' => $ctype), 'con_tel' => array('type' => 'tel', 'label' => 'Telephone', 'value' => $telephone), 'con_email' => array('type' => 'text', 'label' => 'Email', 'value' => $con_email, 'required' => 3, 'attributes' => array('style' => 'width:320px', 'maxlength' => 255), 'tooltip' => 'Must be a valid email address'), 'con_web' => array('type' => 'text', 'label' => 'Website', 'value' => $con_web, 'init' => 'http://', 'required' => 1, 'attributes' => array('style' => 'width:320px', 'maxlength' => 255))); // address, this is only used for manual input resulting from ajax input (validation only) $form2 = array('pro_addr1' => array('type' => 'text', 'label' => 'House Number', 'value' => $pro_addr1, 'required' => 2, 'attributes' => array('class' => 'addr'), 'function' => 'format_street'), 'pro_addr2' => array('type' => 'text', 'label' => 'Building Name', 'value' => $pro_addr2, 'required' => 1, 'attributes' => array('class' => 'addr'), 'function' => 'format_street'), 'pro_addr3' => array('type' => 'text', 'label' => 'Street', 'value' => $pro_addr3, 'required' => 2, 'attributes' => array('class' => 'addr'), 'function' => 'format_street'), 'pro_addr4' => array('type' => 'text', 'label' => 'Town or Area', 'value' => $pro_addr4, 'required' => 3, 'attributes' => array('class' => 'addr'), 'function' => 'format_street'), 'pro_addr5' => array('type' => 'text', 'label' => 'City or County', 'value' => $pro_addr5, 'required' => 2, 'attributes' => array('class' => 'addr'), 'function' => 'format_street'), 'pro_postcode' => array('type' => 'text', 'label' => 'Postcode', 'value' => $pro_postcode, 'required' => 2, 'attributes' => array('class' => 'pc', 'maxlength' => 9), 'function' => 'format_postcode')); // form is not submitted, show the form if (!$_POST["action"]) { // start new form object $form = new Form(); $form->addForm("testForm", "post", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "con_id", "", $con_id); $form->addField("hidden", "searchLink", "", $searchLink); //$form->addHtml('<input type="hidden" name="action" value="update">'); $form->addHtml('<h1>' . $con_fname . ' ' . $con_sname . '</h1>'); ///////////////////////////////////////////////////////////////////////////////// $formName = 'form1'; $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header"><u>C</u>ontact</div>'); $form->addHtml('<div id="' . $formName . '">'); $form->addData(${$formName}, $_POST); $form->addHtml($form->addDiv($form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit')))); $form->addHtml("</div>\n"); $form->addHtml("</fieldset>\n"); /////////////////////////////////////////////////////////////////////////////////
if ($dea_type == 'Sales' && ($dea_status == 'Under Offer' || $dea_status == 'Exchanged')) { $formData2 = array('dea_status' => array('type' => 'select', 'label' => 'Status', 'value' => $dea_status, 'options' => $statuses, 'attributes' => array('readonly' => 'readonly', 'style' => 'width:300px')), 'dea_exchdate' => array('type' => 'datetime', 'label' => 'Exchange Date', 'value' => $dea_exchdate), 'dea_compdate' => array('type' => 'datetime', 'label' => 'Completion Date', 'value' => $dea_compdate), 'dea_notes_sot' => array('type' => 'textarea', 'label' => 'Add Status Note', 'attributes' => array('class' => 'noteInput', 'viewform' => 3))); } else { if ($dea_status == 'Available') { $status_attributes = array('style' => 'width:300px', 'onChange' => 'controlUnderOffer(this,\'dea_status\',\'' . $dea_status . '\');'); } else { $status_attributes = array('style' => 'width:300px'); } $formData2 = array('dea_status' => array('type' => 'select', 'label' => 'Status', 'value' => $dea_status, 'options' => $statuses, 'attributes' => $status_attributes), 'dea_notes_sot' => array('type' => 'textarea', 'label' => 'Add Status Note', 'attributes' => array('class' => 'noteInput', 'viewform' => 3))); } // viewing arrangements $formData3 = array('dea_key' => array('type' => 'text', 'label' => 'Key Number', 'value' => $dea_key, 'attributes' => array('class' => 'wide')), 'dea_notes_arr' => array('type' => 'textarea', 'label' => 'Add Viewing Info', 'attributes' => array('class' => 'noteInput'))); if (!$_GET["action"]) { $form = new Form(); $form->addForm("", "GET", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "stage", "", "1"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "dea_id", "", $dea_id); $form->addField("hidden", "pro_id", "", $pro_id); $form->addField("hidden", "searchLink", "", urlencode($searchLink)); $form->addHtml('<h1>' . $pro_addr . ' (' . $dea_type . ')</h1>'); $formName = 'form0'; $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Summary</div>'); $form->addHtml('<div id="' . $formName . '">'); $form->addHtml($form->addHtml($summary_table)); //$form->addHtml($form->addDiv($form->makeField("textarea",$formName,"General Notes","",array('class'=>'noteInput')))); $form->addHtml($form->addRow('textarea', 'dea_notes', 'Add General Note', '', array('class' => 'noteInput'), '', '')); $form->addHtml(renderNotes('deal_general', $dea_id, array('viewform' => '0', 'label' => 'General Notes'))); $buttons = $form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit'));