<?php echo db_enum("property", "garden", $intGarden); ?> </select></td> <td align="right" class="greyForm">Parking</td> <td colspan="3" class="greyForm"><select name="parking" style="width: 190px;"> <?php echo db_enum("property", "parking", $intParking); ?> </select></td> </tr> <tr> <td class="greyForm" align="right">Card</td> <td class="greyForm"><select name="card" style="width: 190px;"> <?php echo db_enum("property", "card", $intCard); ?> </select></td> <td align="right" class="greyForm"> </td> <td colspan="3" class="greyForm"> </td> </tr> </table> <?php if ($SaleLet == 1 && $intTenure != 1) { ?> <table align="center" width="600" border="0" cellspacing="3" cellpadding="4"> <tr> <td colspan="2"><EM>The following details have been provided by the vendor and have not been verified.</EM></td> </tr> <tr> <td><strong>Tenure:</strong> </td>
while ($row = $q->fetchRow()) { $matched_areas[$row["are_title"]] = $row["are_id"]; if ($numRows == 1) { $default_area = $row["are_title"]; } } if ($are_title) { $default_area = $are_title; } if ($matched_areas) { $formDataArea = array('pro_area' => array('type' => 'radio', 'label' => 'Area', 'value' => $default_area, 'options' => $matched_areas), 'pro_areanew' => array('type' => 'button', 'label' => 'New Area', 'value' => 'New Area', 'attributes' => array('class' => 'button', 'onClick' => 'javascript:addArea(\'' . $pc1 . '\',\'' . urlencode($_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING']) . '\')'))); } else { $formDataArea = array('pro_areanew' => array('type' => 'button', 'label' => 'New Area', 'value' => 'New Area', 'attributes' => array('class' => 'button', 'onClick' => 'javascript:addArea(\'' . $pc1 . '\',\'' . urlencode($_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING']) . '\')'))); } # build data arrays for property particulars $formData = array('dea_ptype' => array('type' => 'select_multi', 'label' => 'Property Type', 'required' => 2, 'options' => array('dd1' => $ptype['dd1'], 'dd2' => $ptype['dd2'])), 'dea_bedroom' => array('type' => 'select_number', 'label' => 'Bedrooms', 'value' => $dea_bedroom, 'attributes' => array('class' => 'narrow'), 'options' => array('blank' => 'blank')), 'dea_reception' => array('type' => 'select_number', 'label' => 'Receptions', 'value' => $dea_reception, 'attributes' => array('class' => 'narrow'), 'options' => array('blank' => 'blank')), 'dea_bathroom' => array('type' => 'select_number', 'label' => 'Bathrooms', 'value' => $dea_bathroom, 'attributes' => array('class' => 'narrow'), 'options' => array('blank' => 'blank')), 'dea_floor' => array('type' => 'select', 'label' => 'Floor', 'value' => $dea_floor, 'options' => join_arrays(array(array('blank' => ''), db_enum("deal", "dea_floor", "array"))), 'attributes' => array('class' => 'medium')), 'dea_floors' => array('type' => 'select_number', 'label' => 'Floors', 'options' => array('blank' => '', 'min' => '1'), 'value' => $dea_floors, 'attributes' => array('class' => 'narrow'))); // remove area from the equation #$formData = join_arrays(array($formDataArea,$formData)); if (!$_GET["action"]) { // start new form object $form = new Form(); $form->addForm("form", "get", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "stage", "", "particulars"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "cli_id", "", $cli_id); $form->addField("hidden", "pro_id", "", $pro_id); $form->addField("hidden", "dea_id", "", $dea_id); $form->addHtml("<fieldset>\n"); $form->addLegend('Property Particulars'); $form->addData($formDataArea, $_GET);
// vendor / landlord page $formData2 = array('dea_notes_arr' => array('type' => 'textarea', 'label' => 'Add Access Info', 'attributes' => array('class' => 'noteInput'))); // marketing info if ($dea_commissiontype == 'fixed') { $dea_commission = format_price($dea_commission); } if ($dea_type == 'Sales') { if ($dea_valueprice) { $dea_valueprice = format_price($dea_valueprice); } if ($dea_valuepricemax) { $dea_valuepricemax = format_price($dea_valuepricemax); } $formData3 = array('dea_valueprice' => array('type' => 'text', 'label' => 'Valuation Price', 'group' => 'Valuation Price', 'value' => $dea_valueprice, 'required' => 3, 'attributes' => array('style' => 'width: 100px', 'maxlength' => 12), 'function' => 'numbers_only'), 'dea_valuepricemax' => array('type' => 'text', 'label' => 'Valuation Price', 'group' => 'Valuation Price', 'last_in_group' => 1, 'value' => $dea_valuepricemax, 'required' => 3, 'attributes' => array('style' => 'width: 100px', 'maxlength' => 12), 'function' => 'numbers_only', 'tooltip' => 'You can enter a price range, or just enter a single price in the first field'), 'dea_marketprice' => array('type' => 'text', 'label' => 'Market Price', 'value' => format_price($dea_marketprice), 'required' => 3, 'attributes' => array('style' => 'width: 100px', 'maxlength' => 12), 'group' => 'Market Price', 'function' => 'numbers_only'), 'dea_qualifier' => array('type' => 'select', 'label' => 'Market Price', 'value' => $dea_qualifier, 'required' => 2, 'options' => db_enum('deal', 'dea_qualifier', 'array'), 'group' => 'Market Price', 'last_in_group' => 1, 'attributes' => array('style' => 'width: 100px')), 'dea_commission' => array('type' => 'text', 'label' => 'Commission', 'group' => 'Commission', 'value' => $dea_commission, 'required' => 3, 'attributes' => array('style' => 'width: 55px', 'maxlength' => 9), 'function' => 'numbers_only'), 'dea_commissiontype' => array('type' => 'select', 'label' => 'Commission', 'group' => 'Commission', 'last_in_group' => 1, 'value' => $dea_commissiontype, 'required' => 3, 'options' => db_enum('deal', 'dea_commissiontype', 'array')), 'dea_share' => array('type' => 'select', 'label' => 'Deal Share', 'value' => $dea_share, 'required' => 2, 'attributes' => array('style' => 'width: 70px'), 'options' => db_enum('deal', 'dea_share', 'array')), 'dea_chainfree' => array('type' => 'radio', 'label' => 'Chain Free', 'value' => $dea_chainfree, 'required' => 2, 'options' => db_enum('deal', 'dea_chainfree', 'array')), 'dea_tenure' => array('type' => 'select', 'label' => 'Tenure', 'value' => $dea_tenure, 'required' => 2, 'options' => db_enum("deal", "dea_tenure", "array"), 'attributes' => array('style' => 'width: 165px')), 'dea_leaseend' => array('type' => 'text', 'label' => 'Lease Expires', 'value' => $dea_leaseend, 'attributes' => array('style' => 'width: 165px'), 'tooltip' => 'This must be the year the lease expires, must be 4 digits long e.g. 2010'), 'dea_servicecharge' => array('type' => 'text', 'label' => 'Service Charge', 'value' => $dea_servicecharge, 'attributes' => array('style' => 'width: 165px')), 'dea_groundrent' => array('type' => 'text', 'label' => 'Ground Rent', 'value' => $dea_groundrent, 'attributes' => array('style' => 'width: 165px')), 'dea_board' => array('type' => 'select', 'label' => 'Board', 'value' => $dea_board, 'required' => 2, 'options' => db_enum("deal", "dea_board", "array"), 'attributes' => array('style' => 'width: 120px'), 'group' => 'Board'), 'dea_boardtype' => array('type' => 'select', 'label' => 'Board', 'value' => $dea_boardtype, 'required' => 2, 'options' => db_enum("deal", "dea_boardtype", "array"), 'attributes' => array('style' => 'width: 80px'), 'group' => 'Board'), 'dea_board_log' => array('type' => 'button', 'label' => 'History', 'value' => 'History', 'attributes' => array('class' => 'button', 'onClick' => 'window.open(\'changeLog.php?scope=board&dea_id=' . $dea_id . '\',\'logWin\',\'width=550,height=400,scrollbars=1\');'), 'group' => 'Board', 'last_in_group' => 1), 'dea_branch' => array('type' => 'select_branch', 'label' => 'Branch', 'value' => $dea_branch, 'required' => 2, 'attributes' => array('style' => 'width: 165px')), 'dea_neg' => array('type' => 'select_user', 'label' => 'Negotiator', 'value' => $dea_neg, 'required' => 3, 'attributes' => array('style' => 'width: 165px'), 'options' => array('' => '(unassigned)'))); } elseif ($dea_type == 'Lettings') { $formData3 = array('dea_marketprice' => array('type' => 'text', 'label' => 'Market Price (pw)', 'value' => format_price($dea_marketprice, 'GBP', true), 'required' => 2, 'attributes' => array('style' => 'width: 100px', 'maxlength' => 15), 'function' => 'numbers_only'), 'dea_commission' => array('type' => 'text', 'label' => 'Commission', 'group' => 'Commission', 'value' => $dea_commission, 'required' => 3, 'attributes' => array('style' => 'width: 70px', 'maxlength' => 7), 'function' => 'numbers_only'), 'dea_commissiontype' => array('type' => 'select', 'label' => 'Commission', 'group' => 'Commission', 'last_in_group' => 1, 'value' => $dea_commissiontype, 'required' => 3, 'options' => db_enum('deal', 'dea_commissiontype', 'array')), 'dea_share' => array('type' => 'select', 'label' => 'Deal Share', 'value' => $dea_share, 'required' => 2, 'attributes' => array('style' => 'width: 100px'), 'options' => db_enum('deal', 'dea_share', 'array')), 'dea_term' => array('type' => 'select', 'label' => 'Term', 'value' => $dea_term, 'required' => 3, 'attributes' => array('style' => 'width: 100px'), 'options' => join_arrays(array(array('' => ''), db_enum('deal', 'dea_term', 'array')))), 'dea_available' => array('type' => 'datetime', 'label' => 'Available Date', 'value' => $dea_available, 'attributes' => array('style' => 'width: 100px')), 'dea_managed' => array('type' => 'radio', 'label' => 'Managed by W&S', 'value' => $dea_managed, 'options' => db_enum('deal', 'dea_managed', 'array')), 'dea_board' => array('type' => 'select', 'label' => 'Board', 'value' => $dea_board, 'required' => 2, 'options' => db_enum("deal", "dea_board", "array"), 'attributes' => array('style' => 'width: 120px'), 'group' => 'Board'), 'dea_boardtype' => array('type' => 'select', 'label' => 'Board', 'value' => $dea_boardtype, 'required' => 2, 'options' => db_enum("deal", "dea_boardtype", "array"), 'attributes' => array('style' => 'width: 80px'), 'group' => 'Board'), 'dea_board_log' => array('type' => 'button', 'label' => 'History', 'value' => 'History', 'attributes' => array('class' => 'button', 'onClick' => 'window.open(\'changeLog.php?scope=board&dea_id=' . $dea_id . '\',\'logWin\',\'width=550,height=400,scrollbars=1\');'), 'group' => 'Board', 'last_in_group' => 1), 'dea_branch' => array('type' => 'select_branch', 'label' => 'Branch', 'value' => $dea_branch, 'required' => 2, 'attributes' => array('style' => 'width: 165px')), 'dea_neg' => array('type' => 'select_user', 'label' => 'Negotiator', 'value' => $dea_neg, 'required' => 3, 'attributes' => array('style' => 'width: 165px'), 'options' => array('' => '(unassigned)'))); } # build select of possible new statuses, and create any additional fields relating to the possible new statuses switch ($dea_status) { case "Valuation": $statuses = array('Valuation' => 'Valuation', 'Instructed' => 'Instructed', 'Not Instructed' => 'Not Instructed'); $additional_fields = array(); break; case "Instructed": $statuses = array('Instructed' => 'Instructed', 'Production' => 'Production', 'Withdrawn' => 'Withdrawn', 'Disinstructed' => 'Disinstructed'); $additional_fields = array(); break; case "Production": $statuses = array('Production' => 'Production', 'Proofing' => 'Proofing', 'Withdrawn' => 'Withdrawn', 'Disinstructed' => 'Disinstructed'); $additional_fields = array(); break;
<td>Bathrooms</td> <td>' . db_dropdown("pro_bathroom", "10", $pro_bathroom, "0", "NULL") . '</td> </tr> <tr> <td>Garden length</td> <td><input name="pro_gardenlength" type="text" size="10" value="' . $pro_gardenlength . '"> <input name="pro_gardenlength_unit" type="radio" value="mtr" checked> meters <input name="pro_gardenlength_unit" type="radio" value="ft"> feet </td> <td>Built</td> <td><input name="pro_built" type="text" size="10" value="' . $pro_built . '"></td> </tr> <tr> <td>Listed</td> <td>' . db_enum("property", "pro_listed", "select", $pro_listed, "NULL") . '</td> <td>Refurbished</td> <td><input name="pro_refurbed" type="text" size="10" value="' . $pro_refurbed . '"></td> </tr> </table> <input type="submit"> </form> '; echo html_header("Add Property", " onLoad=\"init(document.forms[0].pro_psubtype)\"", $_js); echo $render; echo $html_footer; // end of stage break; ///////////////////////////////////////////////////////////////////////////// // stage 5: validate and store info in property table /////////////////////////////////////////////////////////////////////////////
$render .= '</tr>' . "\n"; } } $render .= ' <tr> <th colspan="7"> <a href="?' . replaceQueryStringArray($query_string, array('d', 'm', 'y', 'app_highlight', 'jumpto')) . '&y=' . $Yesterday['y'] . '&m=' . $Yesterday['m'] . '&d=' . $Yesterday['d'] . '" title="Yesterday">«</a> <a href="?' . replaceQueryStringArray($query_string, array('d', 'm', 'y', 'app_highlight', 'jumpto')) . '&y=' . date('Y') . '&m=' . date('m') . '&d=' . date('j') . '">Today</a> <a href="?' . replaceQueryStringArray($query_string, array('d', 'm', 'y', 'app_highlight', 'jumpto')) . '&y=' . $Tomorrow['y'] . '&m=' . $Tomorrow['m'] . '&d=' . $Tomorrow['d'] . '" title="Tomorrow">»</a> </th> </tr> </table> </div> '; // caledar quick add foreach (db_enum("appointment", "app_type", "array") as $key => $val) { $render_type_q .= '<option value="' . $key . '"'; $render_type_q .= '>' . $val . '</option>' . "\n"; } $render .= ' <div id="calQuickAdd"> <form name="quickAdd" action="appointment_add.php"> <table> <tr> <th>Create Appointment</th> </tr> <tr> <td> <select name="app_type" style="width: 110px"> ' . $render_type_q . ' </select>
echo error_message($results['Errors'], urlencode($return)); exit; } $db_data["bug_date"] = $date_mysql; 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");
if ($numRows == 1) { $default_area = $row["are_title"]; } } if ($are_title) { $default_area = $are_title; } if ($matched_areas) { $formDataArea = array('pro_area' => array('type' => 'radio', 'label' => 'Area', 'value' => $default_area, 'options' => $matched_areas)); } else { $formDataArea = array('pro_areanew' => array('type' => 'button', 'label' => 'New Area', 'value' => 'New Area', 'attributes' => array('class' => 'button', 'onClick' => 'javascript:addArea(\'' . $pc1 . '\',\'' . urlencode($_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING']) . '\')'))); } # build data arrays for property particulars $formData = array('dea_ptype' => array('type' => 'select_multi', 'label' => 'Property Type', 'required' => 2, 'options' => array('dd1' => $ptype['dd1'], 'dd2' => $ptype['dd2'])), 'dea_bedroom' => array('type' => 'select_number', 'label' => 'Bedrooms', 'value' => $dea_bedroom, 'attributes' => array('class' => 'narrow'), 'options' => array('blank' => 'blank')), 'dea_reception' => array('type' => 'select_number', 'label' => 'Receptions', 'value' => $dea_reception, 'attributes' => array('class' => 'narrow'), 'options' => array('blank' => 'blank')), 'dea_bathroom' => array('type' => 'select_number', 'label' => 'Bathrooms', 'value' => $dea_bathroom, 'attributes' => array('class' => 'narrow'), 'options' => array('blank' => 'blank')), 'dea_floor' => array('type' => 'select', 'label' => 'Floor', 'value' => $dea_floor, 'options' => join_arrays(array(array('blank' => ''), db_enum("deal", "dea_floor", "array"))), 'attributes' => array('class' => 'medium')), 'dea_floors' => array('type' => 'select_number', 'label' => 'Floors', 'options' => array('blank' => '', 'min' => '1'), 'value' => $dea_floors, 'attributes' => array('class' => 'narrow'))); if ($dea_type == 'Sales') { $formData1 = array('dea_date' => array('type' => 'datetime', 'label' => 'Date Instructed', 'value' => $dea_date, 'required' => 2, 'attributes' => array('class' => 'medium')), 'dea_branch' => array('type' => 'select_branch', 'label' => 'Branch', 'value' => $_SESSION["auth"]["use_branch"], 'required' => 2, 'attributes' => array('class' => 'medium')), 'dea_neg' => array('type' => 'select_user', 'label' => 'Negotiator', 'value' => '', 'required' => 1, 'attributes' => array('class' => 'medium'), 'options' => array('' => '(unassigned)')), 'dea_marketprice' => array('type' => 'text', 'label' => 'Market Price', 'required' => 2, 'attributes' => array('class' => 'medium'), 'function' => 'numbers_only'), 'dea_commission' => array('type' => 'text', 'label' => 'Commission', 'group' => 'Commission', 'value' => $dea_commission, 'required' => 3, 'attributes' => array('style' => 'width: 55px', 'maxlength' => 9), 'function' => 'numbers_only'), 'dea_commissiontype' => array('type' => 'select', 'label' => 'Commission', 'group' => 'Commission', 'last_in_group' => 1, 'value' => $dea_commissiontype, 'required' => 3, 'options' => db_enum('deal', 'dea_commissiontype', 'array')), 'dea_tenure' => array('type' => 'select', 'label' => 'Tenure', 'value' => $dea_tenure, 'required' => 2, 'options' => db_enum("deal", "dea_tenure", "array"), 'attributes' => array('style' => 'width: 165px')), 'dea_servicecharge' => array('type' => 'text', 'label' => 'Service Charge', 'value' => $dea_servicecharge, 'attributes' => array('style' => 'width: 165px')), 'dea_groundrent' => array('type' => 'text', 'label' => 'Ground Rent', 'value' => $dea_groundrent, 'attributes' => array('style' => 'width: 165px'))); } elseif ($dea_type == 'Lettings') { $formData1 = array('dea_date' => array('type' => 'datetime', 'label' => 'Date Instructed', 'value' => $dea_date, 'required' => 2, 'attributes' => array('class' => 'medium')), 'dea_available' => array('type' => 'datetime', 'label' => 'Date Available', 'value' => $dea_available, 'required' => 3, 'attributes' => array('class' => 'medium')), 'dea_branch' => array('type' => 'select_branch', 'label' => 'Branch', 'value' => $_SESSION["auth"]["use_branch"], 'required' => 2, 'attributes' => array('class' => 'medium')), 'dea_neg' => array('type' => 'select_user', 'label' => 'Negotiator', 'value' => '', 'required' => 1, 'attributes' => array('class' => 'medium'), 'options' => array('' => '(unassigned)')), 'dea_marketprice' => array('type' => 'text', 'label' => 'Market Price', 'required' => 2, 'attributes' => array('class' => 'medium'), 'function' => 'numbers_only')); } if ($dea_status == 'Valuation') { unset($formData1["dea_neg"]); } if (!$_GET["action"]) { // start new form object $form = new Form(); $form->addForm("form", "get", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "stage", "", "particulars"); $form->addField("hidden", "action", "", "update"); $form->addField("hidden", "cli_id", "", $cli_id); $form->addField("hidden", "pro_id", "", $pro_id);
while ($rowFurn = $qFurn->fetchRow()) { echo '<option value="' . $rowFurn["Furnished_ID"] . '"'; if ($Furnished == $rowFurn["Furnished_ID"]) { echo ' selected'; } echo '>' . $rowFurn["Furnished_Title"] . '</option> '; } ?> </select></td> </tr> <tr> <td align="right" class="greyForm"> Term</td> <td class="greyForm"><select name="TermLet" style="width:120px"> <?php echo db_enum("clients", "TermLet", $TermLet); ?> </select></td> </tr> <tr> <td height="30" align="right" class="redForm">Email Updates</td> <td class="redForm"><label for="StatusYesLet"> <input type="radio" name="StatusLet" id="StatusYesLet" value="L" <?php if ($StatusLet == "L") { echo "checked"; } ?> > Yes</label> <label for="StatusNoLet"> <input type="radio" name="StatusLet" id="StatusNoLet" value="S" <?php if ($StatusLet == "S") {
echo '>' . $i . '</option>'; } ?> </select></td> </tr> <tr> <td class="greyForm" align="right">Garden</td> <td class="greyForm"><select name="garden" style="width: 190px;"> <?php echo db_enum("property", "garden", $intGarden); ?> </select></td> <td align="right" class="greyForm">Parking</td> <td colspan="3" class="greyForm"><select name="parking" style="width: 190px;"> <?php echo db_enum("property", "parking", $intParking); ?> </select></td> </tr> </table> <?php if ($SaleLet == 1 && $intTenure != 1) { ?> <table align="center" width="600" border="0" cellspacing="3" cellpadding="4"> <tr> <td colspan="2"><EM>The following details have been provided by the vendor and have not been verified.</EM></td> </tr> <tr> <td><strong>Tenure:</strong> </td> <td><em><?php echo $strTenureTitle;
$orderby = 'pro_addr3'; } if ($_GET['direction']) { $direction = $_GET['direction']; } else { $direction = 'ASC'; } $sql = "SELECT\ndeal.*,\npro_id,CONCAT(pro_addr1,' ',pro_addr2,' ',pro_addr3,' ',pro_addr4,' ',LEFT(pro_postcode, 4)) AS pro_addr,\nbra_id,bra_title\nFROM\ndeal\nLEFT JOIN property ON deal.dea_prop = property.pro_id\nLEFT JOIN branch ON deal.dea_branch = branch.bra_id\nWHERE\n(dea_status = 'Production' OR dea_status = 'Proofing' OR dea_status = 'Available' OR dea_status = 'Under Offer' OR dea_status = 'Exchanged' OR dea_status = 'Under Offer with Other')\nORDER BY {$orderby} {$direction}"; $q = $db->query($sql); if (DB::isError($q)) { die("db error: " . $q->getMessage() . $sql); } $numRows = $q->numRows(); if ($numRows !== 0) { while ($row = $q->fetchRow()) { $board_status = db_enum('deal', 'dea_board', 'array'); foreach ($board_status as $key => $val) { $status_select .= '<option value="' . $key . '"'; if ($row["dea_board"] == $val) { $status_select .= ' selected'; } $status_select .= '>' . $val . '</option>' . "\n"; } $status_select = '<select name="board[' . $row["dea_id"] . ']">' . $status_select . '</select>'; // onChange="document.boardForm.submit();" $data[] = ' <tr class="trOff" onMouseOver="trOver(this)" onMouseOut="trOut(this)"> <td class="bold">' . $row["pro_addr"] . '</td> <td width="100">' . $row["dea_status"] . '</td> <td width="150">' . $row["bra_title"] . '</td> <td width="80">' . $status_select . '</td>
<tr> <td>Any other requirements</td> <td><textarea name="textarea" rows="3" style="width: 220px"></textarea></td> </tr> </table> <br> <table width="600" border="1" align="center" cellpadding="5" cellspacing="0"> <tr> <th colspan="2">Lettings Property Requirements</th> </tr> <tr> <td>Property Type</td> <td><select name="PropertyTypeLet" style="width:220px"> <?php echo db_enum("clients", "PropertyType", $PropertyTypeLet); ?> </select> </td> </tr> <tr> <td>Price range</td> <td><select name="MinPriceLet" style="width: 100px"> <option value="0">Minimum</option> <?php for ($i = 50; $i <= 1000;) { echo '<option value="' . $i . '"'; if ($i == $MinPriceLet) { echo ' selected'; } echo '>' . price_format($i) . '</option>';
function addTel($_data) { $count = 1; $rows = count($_data); if ($rows) { foreach ($_data as $key => $val) { $_tels .= $this->makeField('text', 'tel' . $count, 'Telephone ' . $count, $val['number']); $_tels .= $this->makeField('select', 'tel' . $count . 'type', '', $val['type'], '', db_enum("tel", "tel_type", "array")) . ' '; // delete if ($rows > 1) { $_tels .= '<a href="tel.func.php?action=delete&tel_id=' . $val['id'] . '"><img src="' . GLOBAL_URL . 'img/icons/cross_sm.gif" border="0" alt="Delete this Telephone Number" /></a>'; } else { $_tels .= '<img src="' . GLOBAL_URL . 'img/icons/cross_sm_grey.gif" border="0" alt="Delete this Telephone Number" />'; } // move up if ($count == 1) { $_tels .= '<img src="' . GLOBAL_URL . 'img/icons/arrow_up_sm_grey.gif" border="0" alt="Move Up" />'; } else { $_tels .= '<a href="tel.func.php?action=reorder&tel_id=' . $val['id'] . '&cur=' . $count . '&new=' . ($count - 1) . '"><img src="' . GLOBAL_URL . 'img/icons/arrow_up_sm.gif" border="0" alt="Move Up" /></a>'; } // move down if ($count == $rows) { $_tels .= '<img src="' . GLOBAL_URL . 'img/icons/arrow_down_sm_grey.gif" border="0" alt="Move Down" />'; } else { $_tels .= '<a href="tel.func.php?action=reorder&tel_id=' . $val['id'] . '&cur=' . $count . '&new=' . ($count + 1) . '"><img src="' . GLOBAL_URL . 'img/icons/arrow_down_sm.gif" border="0" alt="Move Down" /></a>'; } $_output .= $this->addLabel('tel' . $count, 'Telephone ' . $count, $_tels); $_tels = ''; $count++; } } // add blank for new $_tels .= $this->makeField('text', 'telnew', 'New', ''); $_tels .= $this->makeField('select', 'telnewtype', '', '', '', db_enum("tel", "tel_type", "array")) . ' '; if ($rows) { $newtel_label = 'New Telephone'; } else { $newtel_label = 'Telephone'; } $_output .= $this->addLabel('New', $newtel_label, $_tels); $this->output .= $_output; }
case 1: if (!$_GET["action"]) { /* if (!$_GET["date_from"]) { $_GET["date_from"] = date('d/m/Y'); //23/11/2006 } if (!$_GET["date_to"]) { $_GET["date_to"] = date('d/m/Y'); } */ if ($_GET["type"] == 'Note') { $notetype_display = ""; } else { $notetype_display = "none"; } $formData1 = array('keyword' => array('type' => 'text', 'label' => 'Keyword(s)', 'value' => $_GET["keyword"], 'attributes' => array('class' => 'addr'), 'tooltip' => 'Seperate multiple keywords with commas'), 'branch' => array('type' => 'select_branch_2', 'label' => 'Branch', 'value' => $_GET["branch"], 'attributes' => array('class' => 'medium')), 'user' => array('type' => 'select_user', 'label' => 'User', 'value' => $_GET["user"], 'attributes' => array('class' => 'medium'), 'tooltip' => 'Lead user only (does not include attendees)', 'options' => array('' => 'Any')), 'type' => array('type' => 'select', 'label' => 'Appointment Type', 'group' => 'Appointment Type', 'value' => $_GET["type"], 'options' => join_arrays(array(array('' => 'Any'), db_enum("appointment", "app_type", "array"))), 'attributes' => array('class' => 'medium', 'onChange' => 'controlAppointmentType(this,\'type\');')), 'notetype' => array('type' => 'select', 'label' => 'Sub-Type', 'group' => 'Appointment Type', 'last_in_group' => 1, 'value' => $_GET["notetype"], 'options' => db_enum("appointment", "app_notetype", "array"), 'attributes' => array('style' => 'display:' . $notetype_display)), 'date_from' => array('type' => 'datetime', 'label' => 'Date (from)', 'value' => $_GET["date_from"], 'attributes' => array('class' => 'medium')), 'date_to' => array('type' => 'datetime', 'label' => 'Date (to)', 'value' => $_GET["date_to"], 'attributes' => array('class' => 'medium')), 'status' => array('type' => 'select', 'label' => 'Status', 'value' => $_GET["status"], 'options' => db_enum("appointment", "app_status", "array"), 'attributes' => array('class' => 'medium'))); $form = new Form(); $form->addForm("", "GET", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "stage", "", "1"); $form->addField("hidden", "action", "", "advanced_search"); $formName = 'form1'; $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Search Calendar</div>'); $form->addHtml('<div id="' . $formName . '">'); $form->addData($formData1, $_GET); $form->addHtml($form->addDiv($form->makeField("submit", "", "", "Search", array('class' => 'submit')))); $form->addHtml("</div>\n"); $form->addHtml("</fieldset>\n"); if (!$_GET["viewForm"]) { $viewForm = 1;
} else { $carry_deal = $_GET["dea_id"]; } header("Location:?stage=appointment&cli_id=" . $_GET["cli_id"] . "&dea_id=" . $carry_deal); } if (!$_GET["action"]) { if (!$_GET["scope"]) { $_GET["scope"] = $_SESSION["auth"]["default_scope"]; } // disable term (pw/pcm) unless term == let if ($_GET["scope"] == "Lettings") { $term_attributes = array(); } else { $term_attributes = array('disabled' => 'disabled'); } $formData1 = array('scope' => array('type' => 'radio', 'label' => 'Sales or Lettings', 'value' => $_GET["scope"], 'init' => 'Sales', 'options' => array('Sales' => 'sale', 'Lettings' => 'let'), 'attributes' => array('onClick' => 'javascript:toggleField(\'term\');')), 'keyword' => array('type' => 'text', 'label' => 'Keyword(s)', 'value' => $_GET["keyword"], 'attributes' => array('class' => 'addr'), 'tooltip' => 'Seperate multiple keywords with commas'), 'status' => array('type' => 'select', 'label' => 'Status', 'value' => $_GET["status"], 'default' => 'Instructed', 'options' => join_arrays(array(array('' => 'Any'), db_enum("deal", "dea_status", "array")))), 'price_min' => array('type' => 'text', 'label' => 'Price From', 'value' => $_GET["price"], 'group' => 'Price Range', 'init' => '(minimum)', 'attributes' => array('style' => 'width:100px', 'onFocus' => 'javascript:clearField(this,\'(minimum)\')')), 'price_max' => array('type' => 'text', 'label' => 'Price To', 'value' => $_GET["price"], 'group' => 'Price Range', 'init' => '(maximum)', 'attributes' => array('style' => 'width:100px', 'onFocus' => 'javascript:clearField(this,\'(maximum)\')')), 'term' => array('type' => 'select', 'label' => 'Term', 'value' => $_GET["term"], 'group' => 'Price Range', 'last_in_group' => '1', 'attributes' => $term_attributes, 'options' => array('per week' => 'per week', 'per month' => 'per month'), 'tooltip' => 'If you enter a price range, properties without a price will not appear'), 'bed' => array('type' => 'select_number', 'label' => 'Minimum Beds')); $form = new Form(); $form->addForm("", "GET", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "stage", "", "address"); $form->addField("hidden", "action", "", "advanced_search"); $form->addField("hidden", "cli_id", "", $cli_id); $form->addField("hidden", "app_id", "", $_GET["app_id"]); $form->addField("hidden", "date", "", $_GET["date"]); $formName = 'form1'; $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Property to Visit</div>'); $form->addHtml('<div id="' . $formName . '">'); $form->addData($formData1, $_GET); $form->addHtml($form->addDiv($form->makeField("submit", "", "", "Search", array('class' => 'submit')))); $form->addHtml("</div>\n");
exit; } db_query($db_data, "UPDATE", "branch", "bra_id", $bra_id); $msg = urlencode('Update Successful'); header("Location:{$redirect}&msg={$msg}"); exit; } break; ########################################################### # stage 3 - add ########################################################### ########################################################### # stage 3 - add ########################################################### case 3: $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, 'init' => '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, 'init' => 'Surname', 'required' => 2, 'attributes' => array('style' => 'width:152px', 'onFocus' => 'javascript:clearField(this,\'Surname\')'), 'function' => 'format_name'), 'use_status' => array('type' => 'radio', 'label' => 'Status', 'value' => $use_status, 'required' => 2, 'options' => db_enum("user", "use_status", "array")), 'use_username' => array('type' => 'text', 'label' => 'Username', 'value' => $use_username, 'required' => 2, 'attributes' => array('class' => 'addr'), 'function' => 'format_username'), 'use_password' => array('type' => 'text', 'label' => 'Password', 'default' => random_string(30), 'value' => $use_password, 'required' => 2, 'attributes' => array('class' => 'addr')), 'use_email' => array('type' => 'text', 'label' => 'Email', 'value' => $use_email, 'required' => 2, 'attributes' => array('class' => 'addr')), 'use_branch' => array('type' => 'select', 'label' => 'Branch', 'value' => $use_branch, 'required' => 2, 'options' => db_lookup("use_branch", "branch", "array"), 'attributes' => array('class' => 'medium')), 'use_scope' => array('type' => 'radio', 'label' => 'Default Scope', 'value' => $use_scope, 'required' => 2, 'options' => db_enum("user", "use_scope", "array")), 'use_colour' => array('type' => 'text', 'label' => 'Colour', 'value' => $use_colour, 'group' => 'Colour', 'attributes' => array('class' => 'medium', 'style' => 'font-weight:bold; color: #' . $use_colour . '; background-color: #' . $use_colour)), 'use_colour_pick' => array('type' => 'button', 'label' => 'Colour', 'value' => 'Pick', 'group' => 'Colour', 'last_in_group' => 1, 'attributes' => array('class' => 'button', 'onClick' => 'javascript:colourPickWindow();')), '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('use_pcid' => array('type' => 'hidden', 'value' => $use_pcid), 'use_addr1' => array('type' => 'text', 'label' => 'House Number', 'value' => $use_addr1, 'required' => 2, 'attributes' => array('class' => 'addr'), 'function' => 'format_street'), 'use_addr2' => array('type' => 'text', 'label' => 'Building Name', 'value' => $use_addr2, 'required' => 1, 'attributes' => array('class' => 'addr'), 'function' => 'format_street'), 'use_addr3' => array('type' => 'text', 'label' => 'Street', 'value' => $use_addr3, 'required' => 2, 'attributes' => array('class' => 'addr'), 'function' => 'format_street'), 'use_addr4' => array('type' => 'text', 'label' => 'Town or Area', 'value' => $use_addr4, 'required' => 3, 'attributes' => array('class' => 'addr'), 'function' => 'format_street'), 'use_addr5' => array('type' => 'text', 'label' => 'City or County', 'value' => $use_addr5, 'required' => 2, 'attributes' => array('class' => 'addr'), 'function' => 'format_street'), 'use_postcode' => array('type' => 'text', 'label' => 'Postcode', 'value' => $use_postcode, 'required' => 2, 'attributes' => array('class' => 'pc', 'maxlength' => 9), 'function' => 'format_postcode'), 'use_country' => array('type' => 'select', 'label' => 'Country', 'value' => $use_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", "stage", "", "3"); ///////////////////////////////////////////////////////////////////////////////// $formName = 'form1'; $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">User</div>'); $form->addData(${$formName}, $_POST); $form->addHtml($form->addDiv($form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit')))); $form->addHtml("</fieldset>\n"); /////////////////////////////////////////////////////////////////////////////////
<table cellpadding="2" cellspacing="2" border="0"> <tr> <td class="label" width="160">Date</td> <td>' . $date . '</td> </tr> <tr> <td class="label" width="160">Property</td> <td><a href="deal_summary.php?dea_id=' . $dea_id . '&searchLink=' . $searchLink . '">' . $pro_addr . '</a></td> </tr> <tr> <td class="label">Offer</td> <td class="bold">' . format_price($off_price) . '</td> </tr> </table> ' . renderClientOfferTable($clients, $off_id); $formData1 = array('off_status' => array('type' => 'select', 'label' => 'Status', 'value' => $off_status, 'required' => 2, 'attributes' => array('style' => 'width:300px'), 'options' => db_enum('offer', 'off_status', 'array')), 'off_neg' => array('type' => 'select_user', 'label' => 'Negotiator', 'value' => $off_neg, 'options' => $negotiators, 'attributes' => array('style' => 'width:300px')), 'off_conditions' => array('type' => 'textarea', 'label' => 'Conditions', 'value' => $off_conditions, 'attributes' => array('style' => 'width:300px;height:60px'), 'tooltip' => 'Any special conditions to this offer. This will be sent to the vendor'), 'off_notes' => array('type' => 'textarea', 'label' => 'Notes', 'value' => $off_notes, 'attributes' => array('style' => 'width:300px;height:60px'), 'tooltip' => 'Private notes, for internal use only')); 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", "off_id", "", $off_id); $form->addField("hidden", "dea_id", "", $dea_id); $form->addField("hidden", "searchLink", "", urlencode($_GET["searchLink"])); $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Edit Offer</div>'); $form->addHtml($form->addHtml($deal_table)); // if other offers are present, and current is not accepted, show advice $sql = "SELECT count(*) FROM offer WHERE off_deal = {$dea_id} AND off_id != {$off_id} AND off_status = 'Accepted'"; $off_count = $db->getOne($sql); if ($off_count && $off_status != 'Accepted') {
exit; } elseif ($app_type == "Valuation") { header("Location:valuation_add.php?date={$date}"); exit; } elseif ($app_type == "Production") { header("Location:production_add.php?date={$date}"); 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>');
while ($row = $q->fetchRow()) { foreach ($row as $key => $val) { ${$key} = $val; $render .= $key . "->" . $val . "<br>"; } } } # build select of possible new statuses, and create any additional fields relating to the possible new statuses switch ($dea_status) { case "Valuation": $statuses = array('Valuation' => 'Valuation', 'Instructed' => 'Instructed', 'Not Instructed' => 'Not Instructed'); $additional_fields = array('dea_valueprice' => array('type' => 'text', 'label' => 'Valuation price', 'value' => $dea_valueprice, 'required' => 3, 'attributes' => array('style' => 'width:100px'), 'function' => 'numbers_only'), 'dea_commission' => array('type' => 'text', 'label' => 'Agreed commission', 'value' => $dea_commission, 'required' => 3, 'attributes' => array('style' => 'width:100px')), 'dea_conditions' => array('type' => 'textarea', 'label' => 'Special conditions', 'value' => $dea_conditions, 'attributes' => array('style' => 'width:400px;height:40px')), 'dea_qualifier' => array('type' => 'radio', 'label' => 'Price prefix', 'value' => $dea_qualifier, 'options' => db_enum('deal', 'dea_qualifier', 'array')), 'dea_chainfree' => array('type' => 'radio', 'label' => 'Chain free', 'value' => $dea_chainfree, 'required' => 3, 'options' => db_enum('deal', 'dea_chainfree', 'array')), 'dea_share' => array('type' => 'radio', 'label' => 'Deal share', 'value' => $dea_share, 'required' => 2, 'options' => db_enum('deal', 'dea_share', 'array')), 'dea_otheragent' => array('type' => 'textarea', 'label' => 'Other agent(s)', 'value' => $dea_otheragent, 'attributes' => array('style' => 'width:400px;height:40px'))); break; case "Instructed": $statuses = array('Instructed' => 'Instructed', 'Proofing' => 'Proofing', 'Disinstructed' => 'Disinstructed'); $additional_fields = array('dea_valueprice' => array('type' => 'text', 'label' => 'Valuation price', 'value' => $dea_valueprice, 'required' => 3, 'attributes' => array('style' => 'width:100px'), 'function' => 'numbers_only'), 'dea_marketprice' => array('type' => 'text', 'label' => 'Market price', 'value' => $dea_marketprice, 'required' => 3, 'attributes' => array('style' => 'width:100px'), 'function' => 'numbers_only'), 'dea_commission' => array('type' => 'text', 'label' => 'Agreed commission', 'value' => $dea_commission, 'required' => 3, 'attributes' => array('style' => 'width:100px')), 'dea_conditions' => array('type' => 'textarea', 'label' => 'Special conditions', 'value' => $dea_conditions, 'attributes' => array('style' => 'width:400px;height:40px')), 'dea_qualifier' => array('type' => 'radio', 'label' => 'Price prefix', 'value' => $dea_qualifier, 'options' => db_enum('deal', 'dea_qualifier', 'array')), 'dea_chainfree' => array('type' => 'radio', 'label' => 'Chain free', 'value' => $dea_chainfree, 'required' => 3, 'options' => db_enum('deal', 'dea_chainfree', 'array')), 'dea_share' => array('type' => 'radio', 'label' => 'Deal share', 'value' => $dea_share, 'required' => 2, 'options' => db_enum('deal', 'dea_share', 'array')), 'dea_otheragent' => array('type' => 'textarea', 'label' => 'Other agent(s)', 'value' => $dea_otheragent, 'attributes' => array('style' => 'width:400px;height:40px'))); break; case "Proofing": $statuses = array('Proofing' => 'Proofing', 'Available' => 'Available'); $additional_fields = array(); break; case "Available": $statuses = array('Available' => 'Available', 'Under Offer' => 'Under Offer', 'Under Offer with Other' => 'Under Offer with Other', 'Withdrawn' => 'Withdrawn', 'Disinstructed' => 'Disinstructed'); $additional_fields = array(); break; case "Under Offer": $statuses = array('Under Offer' => 'Under Offer', 'Exchanged' => 'Exchanged', 'Collapsed' => 'Collapsed'); $additional_fields = array(); break; case "Exchanged": $statuses = array('Exchanged' => 'Exchanged', 'Completed' => 'Completed', 'Collapsed' => 'Collapsed');
$term_attributes = array('disabled' => 'disabled'); } $status_special_array = array('available' => 'Available <span style="color:#666666; font-size: 10px">Available only</span><br />', 'onsite' => 'On Website <span style="color:#666666; font-size: 10px">Available, Under Offer and Exchanged</span><br />', 'pending' => 'Coming On <span style="color:#666666; font-size: 10px">Instructions and Production</span><br />', 'won' => 'Won <span style="color:#666666; font-size: 10px">Completed with us</span><br />', 'lost' => 'Lost <span style="color:#666666; font-size: 10px">Withdrawn, Disinstructed and Sold by Other</span><br />', 'all' => 'Everything <span style="color:#666666; font-size: 10px">The whole lot</span><br />'); if (!$_GET["status_special"]) { $_GET["status_special"] = 'available'; } $status_special_selected = $status_special_array[$_GET["status_special"]]; // str_replace('<br /><br />','<br />',$status_special_array[$_GET["status_special"]]); unset($_GET["status_special"]); $status_special_array_flip = array_flip($status_special_array); $formData1 = array('scope' => array('type' => 'radio', 'label' => 'Sales or Lettings', 'value' => $_GET["scope"], 'default' => $_SESSION["auth"]["default_scope"], 'options' => array('Sales' => 'Sales', 'Lettings' => 'Lettings'), 'attributes' => array('onClick' => 'javascript:disableTermField(\'scope\',\'term\');javascript:disableTermField(\'scope\',\'dea_term\');')), 'keyword' => array('type' => 'text', 'label' => 'Keyword(s)', 'value' => $_GET["keyword"], 'attributes' => array('style' => 'width:400px'), 'tooltip' => 'Any part of property address, or vendor/landlord name(s). Seperate multiple keywords with commas'), 'type' => array('type' => 'select', 'label' => 'Property Type', 'value' => $_GET["type"], 'options' => array('' => 'Any', '1' => 'House', '2' => 'Apartment', '3' => 'Other'), 'attributes' => array('style' => 'width:150px')), 'status_special' => array('type' => 'radio', 'label' => 'Status<br><br><br><br><br><br><br><br><br>', 'value' => $status_special_selected, 'options' => $status_special_array_flip), 'price_min' => array('type' => 'text', 'label' => 'Price From', 'value' => $_GET["price"], 'group' => 'Price Range', 'init' => '(minimum)', 'attributes' => array('style' => 'width:100px', 'onFocus' => 'javascript:clearField(this,\'(minimum)\')')), 'price_max' => array('type' => 'text', 'label' => 'Price To', 'value' => $_GET["price"], 'group' => 'Price Range', 'init' => '(maximum)', 'attributes' => array('style' => 'width:100px', 'onFocus' => 'javascript:clearField(this,\'(maximum)\')')), 'term' => array('type' => 'select', 'label' => 'Term', 'value' => $_GET["term"], 'group' => 'Price Range', 'last_in_group' => '1', 'attributes' => $term_attributes, 'options' => array('per week' => 'per week', 'per month' => 'per month')), 'dea_term' => array('type' => 'select', 'label' => 'Rental Term', 'value' => $_GET["dea_term"], 'attributes' => $term_attributes, 'options' => join_arrays(array(array('' => 'Any'), db_enum('deal', 'dea_term', 'array')))), 'bed' => array('type' => 'select_number', 'label' => 'Minimum Beds', 'value' => $_GET["bed"]), 'maxBed' => array('type' => 'select_number', 'label' => 'Maximum Beds', 'value' => $_GET["maxBed"])); // prevent form class from select current user's branch if (!$_GET["branch"]) { $_GET["branch"] = "999"; } $formData2 = array('status' => array('type' => 'checkbox_table', 'label' => 'Status', 'value' => $_GET["status"], 'options' => array('Available' => 'Available', 'Under Offer' => 'Under Offer', 'Exchanged' => 'Exchanged', 'Completed' => 'Completed', 'Valuation' => 'Valuation', 'Instructed' => 'Instructed', 'Production' => 'Production', 'Proofing' => 'Proofing', 'U/O with Other' => 'U/O with Other', 'Collapsed' => 'Collapsed', 'Withdrawn' => 'Withdrawn', 'Not Instructed' => 'Not Instructed', 'Disinstructed' => 'Disinstructed', 'Comparable' => 'Comparable', 'Chain' => 'Chain', 'Unknown' => 'Unknown')), 'neg' => array('type' => 'select_user', 'label' => 'Negotiator', 'value' => $_GET["neg"], 'options' => array('' => 'Any'), 'attributes' => array('class' => 'wide')), 'branch' => array('type' => 'select_branch', 'label' => 'Branch', 'value' => $_GET["branch"], 'options' => array('' => 'Any'), 'attributes' => array('class' => 'wide')), 'contract' => array('type' => 'select', 'label' => 'Contract', 'value' => $_GET["contract"], 'options' => join_arrays(array(array('' => 'Any'), db_enum('deal', 'dea_contract', 'array'))), 'attributes' => array('class' => 'wide')), 'hip' => array('type' => 'select', 'label' => 'HIP', 'value' => $_GET["hip"], 'options' => join_arrays(array(array('' => 'Any'), db_enum('deal', 'dea_hip', 'array'))), 'attributes' => array('class' => 'wide')), 'board' => array('type' => 'select', 'label' => 'Board', 'value' => $_GET["board"], 'options' => join_arrays(array(array('' => 'Any'), db_enum('deal', 'dea_board', 'array'))), 'attributes' => array('class' => 'wide'))); $form = new Form(); $form->addForm("", "GET", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "stage", "", "1"); $form->addField("hidden", "action", "", "advanced_search"); $buttons = $form->makeField("submit", "", "", "Search", array('class' => 'submit')); $buttons .= $form->makeField("button", "", "", "Reset", array('class' => 'button', 'onClick' => 'javascript:location.href=\'' . $PHP_SELF . '\';')); $formName = 'form1'; $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Property Search</div>'); $form->addHtml('<div id="' . $formName . '">'); $form->addData($formData1, $_GET); $form->addHtml($form->addDiv($buttons)); $form->addHtml("</div>\n"); $form->addHtml("</fieldset>\n");
</tr>'; if ($tenant_name) { $render .= ' <tr> <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");
<td width="20%" align="right" class="greyForm">Type</td> <td class="greyForm"><select name="not_subject"> <?php echo db_enum("note", "not_subject"); ?> </select></td> </tr> <tr> <td align="right" class="greyForm">Note</td> <td class="greyForm"><textarea name="not_note" rows="4" id="newnote" style="width: 350px;"></textarea></td> </tr> <tr> <td align="right" class="greyForm">Flag</td> <td class="greyForm"><select name="not_flag"> <?php echo db_enum("note", "not_flag"); ?> </select></td> </tr> <tr> <td class="greyForm"> </td> <td class="greyForm"><input type="submit" name="SubmitNote" value="Add"></td> </tr> </table> <?php if ($Areas2) { ?> <br> <table align="center" width="600" border="0" cellspacing="3" cellpadding="4"> <tr> <th class="greyForm">Old Notes pre-2007 (readonly) </th>
'; if ($table == "clients") { $render_editnote .= '<select name="not_subject">' . db_enum("note", "not_subject", $not_subject); } elseif ($table == "property") { $render_editnote .= '<select name="not_subject2">' . db_enum("note", "not_subject2", $not_subject2); } $render_editnote .= ' </select></td> </tr> <tr> <td align="right" class="greyForm">Note</td> <td class="greyForm"><textarea name="not_note" rows="4" id="newnote" style="width: 350px;">' . $not_note . '</textarea></td> </tr> <tr> <td align="right" class="greyForm">Flag</td> <td class="greyForm"><select name="not_flag"> ' . db_enum("note", "not_flag", $not_flag) . ' </select></td> </tr> <tr> <td class="greyForm"><input type="hidden" name="not_id" value="' . $_GET["not_id"] . '"></td> <td class="greyForm"><input type="submit" name="SubmitNote" value="Save Changes"></td> </tr> </table> '; echo $render_editnote; // edit note page contains log of all changes $sqlLog = "SELECT *, date_format(changelog.cha_datetime, '%d/%m/%y %h:%i:%s') as cha_date \n\tFROM changelog, admin \n\tWHERE changelog.cha_user = admin.adm_id AND changelog.cha_table = 'note' AND changelog.cha_row = " . $_GET["not_id"] . " \n\tORDER BY changelog.cha_datetime DESC"; $qLog = $db->query($sqlLog); if (DB::isError($qLog)) { die("error: " . $qLog->getMessage()); }
echo '>' . $rowPropType["type_Title"] . '</option>'; } ?> </select></td> </tr> <tr> <td align="right" class="greyText">Area M²</td> <td nowrap><input name="M2From" type="text" style="width:90px"> to <input name="M2To" type="text" style="width:90px"></td> <td align="right" class="greyText">Board<!--Cards--></td> <td><span class="greyForm"> <select name="board" style="width: 200px;"> <option value="" selected>Any</option> <?php echo db_enum("property", "board", $intBoard); ?> </select> </span> <!--<select name="card" style="width: 200px;"> <option value="" selected>Any</option> <option value="1">Not Created</option> <option value="2">Created</option> <option value="3">Proofed</option> </select>--></td> </tr> <tr> <td align="right" class="greyText">Status</td> <td colspan="3"> <table width="100%"> <tr> <?php
<option value=""></option> <?php echo db_enum("clients", "Val"); ?> </select> </td> </tr> <tr> <td colspan="2" align="center" class="greyText"><input name="Status" type="checkbox" id="Status" value="S"> Include Archived and Lettings Clients</td> <td align="right" nowrap class="greyText">Mortgage Status </td> <td nowrap> <select name="Mortgage" style="width: 180px"> <option value=""></option> <?php echo db_enum("clients", "Mortgage"); ?> </select> </td> </tr><tr> <td height="30" colspan="4" align="center"><input type="submit" value="Search Clients"> <input type="hidden" name="action" value="Search"> <input type="reset" value="Reset"></td> </tr> </table> <table width="650" border="0" cellpadding="3" cellspacing="2"> <tr> <td class="head">Specific area(s)</td> </tr> <tr> <td>
$sql = "SELECT * FROM client WHERE cli_id = {$cli_id}"; $q = $db->query($sql); if (DB::isError($q)) { 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);
$renderReadOnlyValue = 'true'; $renderNotesArrayOptions = array('label' => 'Meeting Notes', 'layout' => 'readonly'); } else { $renderReadOnlyValue = NULL; $renderNotesArrayOptions = array('label' => 'Meeting Notes'); } $form->addData($formData1, $_POST); $form->addHtml(renderNotes('appointment', $app_id, $renderNotesArrayOptions)); $form->addHtml($form->addDiv($buttons)); //$form->addSeperator(); $form->addHtml(renderAttendeeTable($attendees, $app_id, $renderReadOnlyValue)); $form->addHtml("</fieldset>\n"); $form->addHtml('</div>'); break; case "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), 'calendarID' => array('type' => 'select_branch_2', 'label' => 'Branch', 'value' => $app["branch"], 'attributes' => array('class' => 'medium')), 'app_user' => array('type' => 'select_user', 'label' => 'User', 'value' => $app["user"], 'attributes' => array('class' => 'medium'), 'options' => array('' => '(unassigned)')), 'app_date' => array('type' => 'datetime', 'label' => 'Date', 'value' => $app["date"], 'attributes' => array('class' => 'medium', 'readonly' => 'readonly')), 'app_time' => array('type' => 'time', 'label' => 'Start Time', 'value' => $app["time"], 'group' => 'Start Time', 'attributes' => $timeAttributes), '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, 'attributes' => array('class' => 'medium')), 'notes' => array('type' => 'textarea', 'label' => 'Add ' . $app["type"] . ' Note', 'attributes' => array('class' => 'noteInput'))); if ($expired) { unset($formData1["notes"]); // dont allow new notes to be added $renderReadOnlyValue = 'true'; $renderNotesArrayOptions = array('label' => 'Notes', 'layout' => 'readonly'); } else { $renderReadOnlyValue = NULL; $renderNotesArrayOptions = array('label' => 'Notes'); } $form->addData($formData1, $_POST); $form->addHtml(renderNotes('appointment', $app_id, $renderNotesArrayOptions)); $form->addHtml($form->addDiv($buttons)); $form->addSeperator(); $form->addHtml(renderAttendeeTable($attendees, $app_id, $renderReadOnlyValue)); $form->addHtml("</fieldset>\n");
$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')))); } $form2->addHtml("</fieldset>\n"); $form2->addHtml("</div>\n"); $navbar_array = array('back' => array('title' => 'Back', 'label' => 'Back', 'link' => $return), 'search' => array('title' => 'Client Search', 'label' => 'Client Search', 'link' => 'client_search.php')); $navbar = navbar2($navbar_array); $additional_js = ' function validateForm() { if (document.forms.existing_clients_form.cli_id.value == "") { alert(\'You must select a client from the list\'); return false;
$form->addHtml('</div>'); if ($cli_lettings !== 'Yes') { $form->addHtml('<div id="let2">'); $form->addHtml($form->addDiv($form->makeField("button", $formName, "", "Register", array('class' => 'submit', 'onClick' => 'javascript:swapDiv(\'let\',\'let2\');')))); $form->addHtml('</div>'); } $form->addHtml("</div>\n"); $form->addHtml("</fieldset>\n"); ///////////////////////////////////////////////////////////////////////////////// // only show if client is registered for sales or lettings if ($cli_sales == "Yes" || $cli_lettings == "Yes") { $formName = 'form7'; $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Specifics</div>'); $form->addHtml('<div id="' . $formName . '">'); $feature_form = $form->makeField('select', 'status', 'Status', '', '', db_enum("link_client_to_feature", "status", "array")); $feature_form .= $form->makeField('select', 'featureId', 'Feature', '', '', db_lookup("feature", "feature", "array", "", "fea_title")); $feature_form .= $form->makeField("button", $formName, "", "Add", array('class' => 'button', 'onClick' => 'javascript:addFeature();')); $form->addHtml($fea_table); $form->addHtml($form->addLabel('Add Feature', 'Add Feature', $feature_form)); $form->addSeperator(); $form->addHtml('<p class="appInfo">Only enter special requirements below if they aren\'t listed in the options above.</p>'); $form->addData(${$formName}, $_POST); $form->addHtml(renderNotes('client_req', $cli_id, array('viewform' => 7, 'label' => 'Special Requirements'))); $form->addHtml($form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit'))); $form->addHtml("</div>\n"); $form->addHtml("</fieldset>\n"); $areas = area(explode("|", $areas)); $formName = 'form6'; $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Areas</div>');
$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"><u>A</u>ddress</div>'); $form->addHtml('<div id="' . $formName . '">'); // show old address from import if ($con_oldaddr && !$render_addresses) { $form->addHtml($form->addRow('textarea', 'con_oldaddr', 'Old Address', $con_oldaddr, array('style' => 'width:400px', 'readonly' => 'readonly'), '', 'Please re-enter this address into the form below')); } // add address table $form->addHtml($render_addresses); // add new address $form->addRow('radio', 'p2c_type', 'Type', 'Home', '', db_enum("pro2con", "p2c_type", "array")); $form->ajaxPostcode("by_freetext", "pro"); $form->addHtml("</div>\n"); $form->addHtml("</fieldset>\n"); $onLoad .= 'showForm(' . $viewForm . ');self.focus; '; // start a new page $page = new HTML_Page2($page_defaults); $additional_js = ' if (!previousID) { var previousID = "form' . $viewForm . '"; } '; if ($_GET["msg"]) { $onLoad .= 'javascript:hideMsg();'; $msg = '
</span> </div> '; } $areas = array('Camberwell' => '1', 'Sydenham' => '2'); $sql = "SELECT * FROM ptype WHERE pty_type IS NULL"; $q = $db->query($sql); while ($row = $q->fetchRow()) { $propertytypes[$row["pty_title"]] = $row["pty_id"]; } // 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">');