$salestatuses[$row["cst_id"]] = $row["cst_title"]; } else { $lettingstatuses[$row["cst_id"]] = $row["cst_title"]; } } $formData1 = array('scope' => array('type' => 'radio', 'label' => 'Sales or Lettings', 'value' => $_GET["scope"], 'default' => 'Sales', 'options' => array('Sales' => 'sale', 'Lettings' => 'let'), 'attributes' => array('onClick' => 'javascript:disableTermField(\'scope\',\'term\');showHideStatusRow(\'scope\');')), 'keyword' => array('type' => 'text', 'label' => 'Name or Email', 'value' => $_GET["keyword"], 'attributes' => array('class' => 'addr')), 'feature' => array('type' => 'text', 'label' => 'Keywords(s)', 'value' => $_GET["feature"], 'attributes' => array('class' => 'addr'), 'tooltip' => 'Areas, postcodes, and any specific property requirements. e.g. Garden'), 'price' => array('type' => 'text', 'label' => 'Price', 'value' => $_GET["price"], 'group' => 'Price', 'attributes' => array('style' => 'width:120px')), 'term' => array('type' => 'select', 'label' => 'Term', 'value' => $_GET["term"], 'group' => 'Price', 'last_in_group' => '1', 'attributes' => $term_attributes, 'options' => array('pw' => 'per week', 'pcm' => 'per month')), 'bedmin' => array('type' => 'select_number', 'label' => 'Bedrooms', 'value' => $_GET["bedmin"], 'group' => 'Bedrooms'), 'bedmax' => array('type' => 'select_number', 'label' => 'Bedrooms', 'value' => $_GET["bedmax"], 'group' => 'Bedrooms', 'last_in_group' => 1), 'date_range' => array('type' => 'select', 'label' => 'Registered', 'value' => $_GET["date_range"], 'attributes' => array('style' => 'width:200px'), 'options' => array('' => 'Anytime', $past_week => 'in the past week', $past_month => 'in the past month', $past_month6 => 'in the past 6 months', $past_year => 'in the past 12 months')), 'cli_neg' => array('type' => 'select_neg', 'label' => 'Assigned Negotiator', 'value' => $_GET["cli_neg"], 'options' => array('' => ''), 'attributes' => array('style' => 'width:200px')), 'cli_branch' => array('type' => 'select_branch', 'label' => 'Assigned Branch', 'value' => $_GET["cli_branch"], 'options' => array('' => ''), 'attributes' => array('style' => 'width:200px')), 'cli_method' => array('type' => 'select', 'label' => 'Initial Contact Method', 'value' => $_GET["cli_method"], 'options' => array('' => '', 'Website' => 'Self-registration on our site', 'Telephone' => 'Telephone', 'Email' => 'Email', 'Internet' => 'Internet (portal)', 'Walk-in' => 'Walk-in'), 'attributes' => array('style' => 'width:200px')), 'cli_salestatus' => array('type' => 'select', 'label' => 'Current Status (Sales)', 'value' => $_GET["cli_salestatus"], 'options' => $salestatuses, 'attributes' => array('style' => 'width:200px')), 'cli_letstatus' => array('type' => 'select', 'label' => 'Current Status (Lettings)', 'value' => $_GET["cli_letstatus"], 'options' => $lettingstatuses, 'attributes' => array('style' => 'width:200px')), 'has_email' => array('type' => 'radio', 'label' => 'Has email address?', 'value' => $_GET["has_email"], 'options' => array('Yes' => 'Yes', 'No' => 'No'))); $form = new Form(); $form->addForm("client_form", "GET", $PHP_SELF); $form->addHtml("<div id=\"standard_form\">\n"); $form->addField("hidden", "stage", "", "1"); $form->addField("hidden", "action", "", "advanced_search"); $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Search Applicants</div>'); $form->addData($formData1, $_GET); $form->addSeperator(); $ptype_data = ptype("sale", explode("|", $_GET["cli_saleptype"])); $form->addHtml('<div id="sale" style="display:' . $sale_display . '">'); // $form->addHtml($form->addLabel('type', 'Houses', $ptype_data['house'], 'javascript:checkAll(document.forms[0], \'sale1\');')); // $form->addHtml($form->addLabel('type', 'Apartments', $ptype_data['apartment'], 'javascript:checkAll(document.forms[0], \'sale2\');')); // $form->addHtml($form->addLabel('type', 'Others', $ptype_data['other'], 'javascript:checkAll(document.forms[0], \'sale3\');')); $buttons = $form->makeField("submit", "", "", "Search", array('class' => 'submit')); $buttons .= $form->makeField("button", "", "", "Reset", array('class' => 'button', 'onClick' => 'javascript:location.href=\'' . $PHP_SELF . '\';')); $form->addHtml($form->addDiv($buttons)); $form->addHtml("</fieldset>\n"); if (!$_GET["viewForm"]) { $viewForm = 1; } $additional_js = ' if (!previousID) { var previousID = "form' . $viewForm . '"; }
$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); $form->addHtml($form->addDiv($form->makeField("submit", "submit", "", "Save Changes", array('class' => 'submit'))));
$q = $db->query($sql); if (DB::isError($q)) { die("db error: " . $q->getMessage()); } while ($row = $q->fetchRow()) { $cli_sales = $row["cli_sales"]; $cli_lettings = $row["cli_lettings"]; } # build data arrays if ($cli_sales == "Yes") { $formData1 = array('cli_salemin' => array('type' => 'select_price', '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', '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', 'label' => 'Minimum Beds', 'required' => 2), 'cli_saleemail' => array('type' => 'radio', 'label' => 'Email Updates', 'required' => 2, 'options' => db_enum("client", "cli_saleemail", "array"))); $ptype_sale = ptype("sale", explode("|", $_GET["cli_saleptype"])); } if ($cli_lettings == "Yes") { $formData2 = array('cli_letmin' => array('type' => 'select_price', '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', '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', 'label' => 'Minimum Beds', 'required' => 2), 'cli_letemail' => array('type' => 'radio', 'label' => 'Email Updates', 'required' => 2, 'options' => db_enum("client", "cli_letemail", "array"))); $ptype_let = ptype("let", explode("|", $_GET["cli_letptype"])); } 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", "cli_id", "", $cli_id); ///////////////////////////////////////////////////////////////////////////////// if ($cli_sales == "Yes") { $form->addHtml("<fieldset>\n"); $form->addHtml('<div class="block-header">Sales Requirements</div>'); $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\');'));