Example #1
0
 }
 $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");
 $form->addLegend('Lettings Requirements');
 $form->addHtml($form->addLabel('cli_letptype', 'Houses', $ptype_let['house'], 'javascript:checkAll(document.forms[0], \'sale1\');'));
 $form->addHtml($form->addLabel('cli_letptype', 'Apartments', $ptype_let['apartment'], 'javascript:checkAll(document.forms[0], \'sale2\');'));
 $form->addHtml($form->addLabel('cli_letptype', 'Others', $ptype_let['other'], 'javascript:checkAll(document.forms[0], \'sale3\');'));
 $form->addData($formData2, $_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' => urldecode($searchLink)), 'search' => array('title' => 'Property Search', 'label' => 'Property Search', 'link' => 'property_search.php'));
Example #2
0
        getQueryResults('DELETE FROM user WHERE id=' . $request->get('post', 'member_id'));
        header('Location: ' . $config->get('web', 'root') . '/admin/?msg=User+deleted');
        exit;
    }
} else {
    if (!is_null($member_id) && '' != $member_id && 'new' != $member_id) {
        $member = reset(getQueryResults('SELECT * FROM ' . $config->get('database', 'tablePrefix') . 'user WHERE id=' . $member_id));
    } elseif ('new' == $member_id) {
        $member = array('id' => 'new', 'firstname' => $request->get('post', 'firstname') ? $request->get('post', 'firstname') : '', 'lastname' => $request->get('post', 'lastname') ? $request->get('post', 'lastname') : '', 'type' => 'reviewer', 'camra_number' => $request->get('post', 'camra_number') ? $request->get('post', 'camra_number') : '', 'postcode' => $request->get('post', 'postcode') ? $request->get('post', 'postcode') : '', 'email' => $request->get('post', 'email') ? $request->get('post', 'email') : '', 'active' => $request->get('post', 'active') != 1 ? 0 : 1);
    } else {
        $members = getQueryResults('SELECT id, CONCAT(lastname, \', \', firstname) as name FROM `' . $config->get('database', 'tablePrefix') . 'user` ORDER BY `lastname`,`firstname`;');
    }
}
if (isset($members)) {
    $form->addField('member_id', 'select');
    $form->addLabel('Select Member');
    $form->addOptions(array('new' => 'Add New Member'));
    $form->addOptions($members, 'id', 'name');
    $form->addField('selectMember', 'submit', 'Select Member');
    $form->addInputClass('btnSubmit');
} else {
    $form->addField('member_id', 'hidden', $member['id']);
    $form->addField('firstname', 'text', $member['firstname']);
    $form->addLabel('Firstname');
    $form->addFieldValidation('required');
    $form->addField('lastname', 'text', $member['lastname']);
    $form->addLabel('Lastname');
    $form->addFieldValidation('required');
    $form->addField('email', 'text', $member['email']);
    $form->addLabel('Email Address');
    $form->addFieldValidation('email');
Example #3
0
include DOCROOT . '/skin/header.php';
$form = new Form('nbssv2login');
$form->class = 'neoAdminForm';
$form->validationerrormsg = 'The following fields must be completed:';
if ($form->submitted && $form->submiterrors == 0) {
    $user = getUserLogin(md5(strtoupper(trim(ltrim($request->get('post', 'membershipno'), '0')))), md5(strtoupper(str_replace(' ', '', $request->get('post', 'postcode')))));
    if ($user !== false) {
        Session::set('user', $user);
        Session::set('welcomed', false);
        getQueryResults('UPDATE ' . $config->get('database', 'tablePrefix') . 'user SET lastlogin='******'YmdHis', time()) . ' WHERE id=' . $user['id']);
        header('Location: ' . $config->get('web', 'root') . '/');
        exit;
    } else {
        $form->submiterrormsg .= 'Invalid membership number, postcode or inactive account.';
    }
}
$form->addFieldsetOpen('Login');
$form->addField('membershipno', 'text', $request->get('post', 'membershipno'));
$form->addLabel('Membership Number');
$form->addFieldValidation('required');
$form->addHelp('Please use the membership number from your CAMRA membership card.');
$form->addField('postcode', 'text', $request->get('post', 'postcode'));
$form->addLabel('Postcode');
$form->addFieldValidation('required');
$form->addHelp('Enter your postcode from your normal residence (You know, where CAMRA sends your &quot;What\'s Brewing&quot;.)');
$form->addFieldsetClose();
$form->addField('login', 'submit', 'Login');
$form->addInputClass('btnSubmit');
$form->addContent('<div class="reset"><a href="' . $config->get('web', 'root') . '/signup/" class="btnSubmit fleft" title="sign up for an account">Sign up for an account</a></div>');
echo $form->submiterrormsg . $form->display();
include DOCROOT . '/skin/loginfooter.php';
Example #4
0
        }
    }
} else {
    /* Form has not been submitted */
    if ('' != $town_id) {
        $town = reset(getQueryResults('SELECT * FROM ' . $config->get('database', 'tablePrefix') . 'town WHERE id=' . $town_id));
        if (!isset($pub)) {
            $pub = array('id' => 'new', 'town_id' => $town_id, 'name' => '', 'abv' => '', 'og' => '', 'notes' => '');
        }
    } else {
        $towns = getQueryResults('SELECT id, name FROM ' . $config->get('database', 'tablePrefix') . 'town WHERE active=1 ORDER BY name;');
    }
}
if (isset($towns)) {
    $form->addField('town_id', 'select');
    $form->addLabel('Select town');
    $form->addOptions(array('' => 'Select town first'));
    $form->addOptions($towns, 'id', 'name');
    $form->addField('selectTown', 'submit', 'Select this town');
    $form->addInputClass('btnSubmit');
} else {
    print '<h3>pubs for ' . $town['name'] . '</h3>';
    if ('' != $pub_id) {
        if ('new' != $pub_id) {
            $pub = reset(getQueryResults('SELECT * FROM ' . $config->get('database', 'tablePrefix') . 'pub WHERE id=' . $pub_id));
        }
        $form->addField('town_id', 'hidden', $town_id);
        $form->addField('pub_id', 'hidden', $pub_id);
        $form->addField('name', 'text', $pub['name']);
        $form->addLabel('pub Name');
        $form->addFieldValidation('required');
Example #5
0
            exit;
        }
    }
} else {
    /* Form has not been submitted */
    if (!is_null($town_id) && '' != $town_id && 'new' != $town_id) {
        $town = reset(getQueryResults('SELECT * FROM ' . $config->get('database', 'tablePrefix') . 'town WHERE id=' . $town_id));
    } elseif ('new' == $town_id) {
        $town = array('id' => 'new', 'name' => '', 'active' => 1);
    } else {
        $towns = getQueryResults('SELECT id, name FROM ' . $config->get('database', 'tablePrefix') . 'town WHERE active=1 ORDER BY name;');
    }
}
if (isset($towns)) {
    $form->addField('town_id', 'select');
    $form->addLabel('Select town');
    $form->addOptions(array('new' => 'Add new town'));
    $form->addOptions($towns, 'id', 'name');
    $form->addField('selecttown', 'submit', 'Select town');
    $form->addInputClass('btnSubmit');
} else {
    $form->addField('town_id', 'hidden', $town['id']);
    $form->addField('name', 'text', $town['name']);
    $form->addLabel('Town Name');
    $form->addFieldValidation('required');
    $form->addField('active', 'checkbox', $town['active']);
    $form->addLabel('Active', null, 'right');
    $form->addOptions(array(1, 0));
    if ('new' == $town_id) {
        $form->addField('updateTown', 'submit', 'Create town');
    } else {
         $form->addForm("existing_clients_form", "GET", $goto_found, "", 'onSubmit="return validateForm();"');
     } else {
         $form->addForm("existing_clients_form", "GET", $goto, "", 'onSubmit="return validateForm();"');
     }
     $form->addHtml("<div id=\"standard_form\">\n");
     $form->addField("hidden", "dest", "", $_GET["dest"]);
     // dea_id is used when arranging a viewing (optional) or when adding a vendor to a deal (required)
     $form->addField("hidden", "dea_id", "", $_GET["dea_id"]);
     // 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");
Example #7
0
    $form->addField("hidden", "returnTo", "", $_GET["returnTo"]);
    //$form->addHtml('<input type="hidden" name="action" value="update">');
    $form->addHtml('<h1>New Company for ' . $con_name . '</h1>');
    /////////////////////////////////////////////////////////////////////////////////
    $formName = 'form1';
    $form->addHtml("<fieldset>\n");
    $form->addHtml('<div class="block-header">New Company</div>');
    $form->addHtml('<div id="' . $formName . '">');
    $form->addData($formData1, $_POST);
    $form->addHtml($form->addDiv($form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit'))));
    $form->addHtml("</div>\n");
    $form->addHtml("</fieldset>\n");
    $form->addHtml("<fieldset>\n");
    $form->addHtml('<div class="block-header">Address</div>');
    if ($associated_property) {
        $form->addHtml($form->addLabel("existing", "Business Address", '<table cellspacing="0" cellpadding="2">' . $render . '</table>
	<div id="inset"><p>If the business address is not listed above, <br>please complete the following form</p></div>'));
    }
    $form->ajaxPostcode("by_freetext", "pro");
    $form->addField("hidden", "p2c_type", "", 'Work');
    $form->addHtml("</fieldset>\n");
    // start a new page
    $page = new HTML_Page2($page_defaults);
    $navbar_array = array('back' => array('title' => 'Back', 'label' => 'Back', 'link' => $searchLink), 'search' => array('title' => 'Contact Search', 'label' => 'Contact Search', 'link' => 'contact.php'));
    $navbar = navbar2($navbar_array);
    $page->setTitle("New Company");
    $page->addStyleSheet(getDefaultCss());
    $page->addScript('js/global.js');
    $page->addScript('js/scriptaculous/prototype.js');
    $page->addScript('js/scriptaculous/scriptaculous.js');
    $page->addScriptDeclaration($additional_js);
    $page->setBodyAttributes(array('onLoad' => $onLoad));
Example #8
0
  </tr>
  <tr>
    <td class="label" valign="top">Last edited</td>
	<td>' . $not_edited . '</td>
  </tr>
</table>');
        $form->addData($formData1, $_GET);
        $buttons = $form->makeField("submit", "", "", "Save Changes", array('class' => 'submit'));
        if ($not_status == 'Deleted') {
            $buttons .= $form->makeField("button", "", "", "UnDelete", array('class' => 'button', 'onClick' => 'document.location.href = \'?not_id=' . $not_id . '&action=undelete&return=' . urlencode($_GET["return"]) . '\';'));
        } else {
            $buttons .= $form->makeField("button", "", "", "Delete", array('class' => 'button', 'onClick' => 'document.location.href = \'?not_id=' . $not_id . '&action=delete&return=' . urlencode($_GET["return"]) . '\';'));
        }
        $form->addHtml($form->addDiv($buttons));
        $form->addSeperator();
        $form->addHtml($form->addLabel('cha', 'Changes History', $changelog));
        $form->addHtml("</div>\n");
        $form->addHtml("</fieldset>\n");
        $navbar_array = array('back' => array('title' => 'Back', 'label' => 'Back', 'link' => urldecode($return)), 'search' => array('title' => 'Property Search', 'label' => 'Property Search', 'link' => 'property_search.php'));
        $navbar = navbar2($navbar_array);
        // start a new page
        $page = new HTML_Page2($page_defaults);
        $page->setTitle("Edit Note");
        $page->addStyleSheet(getDefaultCss());
        $page->addScript('js/global.js');
        $page->addBodyContent($header_and_menu);
        $page->addBodyContent('<div id="content">');
        $page->addBodyContent($navbar);
        $page->addBodyContent($form->renderForm());
        $page->addBodyContent('</div>');
        $page->display();
 $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", "searchLink", "", urlencode($searchLink));
 $form->addHtml("<fieldset>\n");
 $form->addHtml('<div class="block-header">Summary</div>');
 $form->addData($formData1, $_GET);
 $form->addData($formData2, $_GET);
 $form->addHtml($form->addDiv($form->makeField("submit", "", "", "Save Changes", array('class' => 'submit'))));
 $form->addHtml("</fieldset>\n");
 $form->addHtml("<fieldset>\n");
 $form->addHtml('<div class="block-header">State of Trade</div>');
 $form->addHtml($form->addLabel('history', 'Status history', $sot_table));
 $buttons = $form->makeField("button", $formName, "", "Change Status", array('onClick' => 'javascript:document.location.href=\'deal_change.php?dea_id=' . $dea_id . '&return=' . $_SERVER['PHP_SELF'] . urlencode('?' . $_SERVER['QUERY_STRING']) . '\';', 'class' => 'submit'));
 $form->addHtml($form->addDiv($buttons));
 $form->addHtml("</fieldset>\n");
 $form->addHtml("<fieldset>\n");
 $form->addHtml('<div class="block-header">Offers</div>');
 $form->addHtml($form->addLabel('offers', 'Offers', $offers_table));
 $buttons = $form->makeField("button", $formName, "", "Submit Offer", array('onClick' => 'javascript:document.location.href=\'deal_offer.php?dea_id=' . $dea_id . '&return=' . $_SERVER['PHP_SELF'] . urlencode('?' . $_SERVER['QUERY_STRING']) . '\';', 'class' => 'submit'));
 $form->addHtml($form->addDiv($buttons));
 $form->addHtml("</fieldset>\n");
 $form->addHtml("<fieldset>\n");
 $form->addHtml('<div class="block-header">Statistics</div>');
 $form->addHtml($form->addLabel('statistics', 'Statistics', $statistics_table));
 $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);
Example #10
0
            getQueryResults($sql);
        }
    }
} else {
    /* Form has not been submitted */
    if (!is_null($brewery_id) && '' != $brewery_id && 'new' != $brewery_id) {
        $brewery = reset(getQueryResults('SELECT * FROM ' . $config->get('database', 'tablePrefix') . 'brewery WHERE id=' . $brewery_id));
    } elseif ('new' == $brewery_id) {
        $brewery = array('id' => 'new', 'name' => '', 'location' => '', 'active' => 1);
    } else {
        $breweries = getQueryResults('SELECT id, name FROM ' . $config->get('database', 'tablePrefix') . 'brewery WHERE active=1 ORDER BY name;');
    }
}
if (isset($breweries)) {
    $form->addField('brewery_id', 'select');
    $form->addLabel('Select Brewery');
    $form->addOptions(array('new' => 'Add New Brewery'));
    $form->addOptions($breweries, 'id', 'name');
    $form->addField('selectBrewery', 'submit', 'Select Brewery');
    $form->addInputClass('btnSubmit');
} else {
    $form->addField('brewery_id', 'hidden', $brewery['id']);
    $form->addField('name', 'text', $brewery['name']);
    $form->addLabel('Brewery Name');
    $form->addFieldValidation('required');
    $form->addField('location', 'text', $brewery['location']);
    $form->addLabel('Location');
    $form->addField('active', 'checkbox', $brewery['active']);
    $form->addLabel('Active', null, 'right');
    $form->addOptions(array(1, 0));
    if ('new' == $brewery_id) {
Example #11
0
        $currDate = strtotime($request->get('post', 'date_nojs'));
    } else {
        $currDate = strtotime($request->get('post', 'date'));
    }
    Session::set('date', $currDate);
    if (0 == $form->submiterrors && 'enterReviews' == $form->submittedaction) {
        Session::set('submission', $request->get('post'));
        header('Location: ' . $config->get('web', 'root') . '/enter/confirm/');
        exit;
    } elseif ('addPub' == $form->submittedaction) {
        $pubCount++;
    }
}
$form->addFieldsetOpen('Review by ' . $user['firstname'] . ' ' . $user['lastname']);
$form->addField('date_nojs', 'text', date('d-M-Y', $currDate));
$form->addLabel('Date of Visit');
$form->addFieldValidation('required');
if (is_null($town_id) || '' == $town_id) {
    $form->addFieldsetOpen('Town');
    $form->addField('town_id', 'select', $town_id);
    $form->addLabel('Town');
    $form->addOptions(array('' => 'Select town'));
    $form->addOptions($towns, 'id', 'name');
    $form->addField('selectTown', 'submit', 'Select this town');
    $form->addInputClass('btnSubmit');
    $pubs = array(array('id' => '', 'name' => 'Select town first'));
} else {
    $town = getItemFromArray($town_id, $towns);
    $pubs = array('' => 'Select Pub');
    $pubs = array_merge($pubs, getQueryResults("SELECT * FROM " . $config->get('database', 'tablePrefix') . "pub WHERE town_id={$town_id} AND active=1 ORDER BY name"));
    if (2 == sizeof($pubs) && $pubs[0]['id'] != '') {
         }
     }
     $render_client = '<table><tr><td>' . $render_client . '</td></tr></table>';
 }
 $formData1 = array('subject' => array('type' => 'text', 'label' => 'Subject', 'value' => $subject, 'required' => 2, 'attributes' => array('style' => 'width:400px;')), 'message' => array('type' => 'textarea', 'label' => 'Message', 'value' => $message, 'required' => 2, 'attributes' => array('style' => 'width:400px;height:100px')));
 $form = new Form();
 $form->addForm("", "GET", $PHP_SELF);
 $form->addHtml("<div id=\"standard_form\">\n");
 $form->addField("hidden", "action", "", "send");
 $form->addField("hidden", "return", "", $_GET["return"]);
 //$form->addHtml($hidden_field);
 $formName = 'form1';
 $form->addHtml("<fieldset>\n");
 $form->addHtml('<div class="block-header">Send Message</div>');
 $form->addHtml('<div id="' . $formName . '">');
 $form->addHtml($form->addLabel('', 'Recipient(s)', $render_client));
 $form->addData($formData1, $_GET);
 $buttons = $form->makeField("submit", "", "", "  Send  ", array('class' => 'submit'));
 $buttons .= $form->makeField("button", "", "", "Cancel", array('class' => 'button', 'onClick' => 'document.location.href=\'' . urldecode($_GET["return"]) . '\';'));
 $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["return"])));
 $navbar = navbar2($navbar_array);
 // start a new page
 $page = new HTML_Page2($page_defaults);
 $page->setTitle("Send Message");
 $page->addStyleSheet(getDefaultCss());
 $page->addScript('js/global.js');
 $page->addBodyContent($header_and_menu);
 $page->addBodyContent('<div id="content">');
Example #13
0
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/validation.js"></script>
</head>
<body>
<div align='center'>
<?php 
include_once 'FormCreator/Form.php';
//FormHelper ile amele işlerin yaptırılacağı bir class yazılabilir.
try {
    $form = new Form("test.php");
    $form->setFormAttributes(array('id' => 'formId'));
    $form->setTableAttributes(array("class" => "table"));
    $form->addInput("text", "name", "Email")->setValidation(array("required" => true, "min" => 3));
    $form->addInput("password", "pass", "Şifre")->setValidation(array("required" => true, "min" => 8));
    $form->addInput("text", "yas", "Yaş");
    $form->addLabel("Cinsiyet:");
    $form->addRadioButton("cinsiyet", "erkek", "Erkek", array("checked" => "checked"));
    $form->addRadioButton("cinsiyet", "bayan", "Bayan");
    $form->addComboBox("carbrand", "Arabanızın Markası", array('mercedes' => 'Mercedes', 'bmw' => 'BMW'));
    //$form->addTextArea(32, 5, "adres","Adres");
    //$form->addCheckBox("termofuse", "read", "Kullanmıcı Sözleşmesini okudum")->setValidation(array("mustBeChecked"=>true));
    $form->addTermsOfUse("files/file.txt", true);
    $form->addInput("submit", "dugme", "Kaydet");
    echo $form->show();
} catch (Exception $ex) {
    echo $ex->getMessage();
}
?>
</div>
</body>
</html>
        break;
    case "Chain":
        $statuses = array('Chain' => 'Chain');
        $additional_fields = array();
        break;
}
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", "dea_id", "", $dea_id);
    $form->addField("hidden", "return", "", urlencode($_GET["return"]));
    $form->addHtml("<fieldset>\n");
    $form->addHtml('<div class="block-header">Change Status</div>');
    $form->addHtml($form->addLabel('current_status', 'Current status', $form->makeField("text", "", "", $dea_status, array('class' => 'inputInvisible'))));
    $form->addData($formData1, $_GET);
    foreach ($statuses as $key => $val) {
        $buttons .= '<input type="button" value="' . $val . '" class="button" onClick="javascript:toggleDiv(\'' . $key . '\')"> ';
    }
    $form->addHtml($form->addDiv($form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit'))));
    $form->addHtml($form->addLabel('current_status', 'New Status', $buttons));
    #$form->addHtml('<div id="inset">'.$buttons.'</div>');
    $form->addHtml('<div id="form2" style="display:none">');
    $form->addData($formData2, $_GET);
    $form->addHtml($form->addDiv($form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit'))));
    $form->addHtml("</div>\n");
    $form->addHtml('<div id="form3" style="display:none">');
    $form->addData($formData3, $_GET);
    $form->addHtml($form->addDiv($form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit'))));
    $form->addHtml("</div>\n");
Example #15
0
        $headers = 'From: No Reply <signup@' . $_SERVER['HTTP_HOST'] . '>' . CRLF;
        $subject = 'Your account signup at ' . $_SERVER['HTTP_HOST'];
        $content = 'Thank you for your request for any account.' . CR . CR;
        $content .= 'To validate your signup please follow the link below' . CR;
        $content .= 'http://' . $_SERVER['HTTP_HOST'] . $config->get('web', 'root') . '/signup/at8/?v=' . md5($member['camra_number']) . CR;
        $content .= CR . CR . 'Thank you.';
        mail($member['email'], $subject, $content, $headers);
        header('Location: ' . $config->get('web', 'root') . '/signup/thankyou/');
        exit;
    } else {
        $form->submiterrormsg .= '<p class="error">Username/CAMRA Number is already registered.</p><p> Please choose another one or check with your system administrator.</p>';
    }
}
$form->addFieldsetOpen('Signup');
$form->addField('firstname', 'text', $member['firstname']);
$form->addLabel('Firstname');
$form->addFieldValidation('required');
$form->addField('lastname', 'text', $member['lastname']);
$form->addLabel('Lastname');
$form->addFieldValidation('required');
$form->addField('email', 'text', $member['email']);
$form->addLabel('Email Address');
$form->addFieldValidation('required email');
$form->addField('camra_number', 'text', $member['camra_number']);
if ($config->get('web', 'signupNonCamra')) {
    $form->addLabel('CAMRA Membership Number/Username');
    $form->addFieldValidation('required');
} else {
    $form->addLabel('CAMRA Membership Number');
    $form->addFieldValidation('required numeric');
}
Example #16
0
    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;
    }
}
                    }
                }
            }
            $form = new Form();
            $form->addForm("form", "get", $PHP_SELF);
            $form->addField("hidden", "stage", "", "valuation_address");
            $form->addField("hidden", "action", "", "new_property");
            $form->addField("hidden", "cli_id", "", $cli_id);
            $form->addHtml("<div id=\"standard_form\">\n");
            $form->addHtml("<fieldset>\n");
            $form->addLegend('Instructed Property');
            $form->addData($formData1, $_GET);
            if ($render) {
                $render .= '</table>
<div id="inset"><p>If the instructed property is not listed above, <br>please complete the following form</p></div>';
                $form->addHtml($form->addLabel("existing", "Associated Property", '<table>' . $render));
            }
            if (!$pro_pcid) {
                $form->ajaxPostcode("by_freetext", "pro");
            } else {
                $form->addData($formData3, $_GET);
                $form->addHtml($form->addDiv($form->makeField("submit", "", "", "Save Changes", array('class' => 'submit'))));
            }
            $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->setTitle("New Instruction");
            $page->addStyleSheet('css/styles.css');
            $page->addScript('js/global.js');
            $page->addScript('js/scriptaculous/prototype.js');
            $page->addBodyContent($header_and_menu);
            $page->addBodyContent('<div id="content">');
Example #18
0
        }
    }
} else {
    /* Form has not been submitted */
    if ('' != $town_id) {
        $town = reset(getQueryResults('SELECT * FROM ' . $config->get('database', 'tablePrefix') . 'town WHERE id=' . $town_id));
        if (!isset($pub)) {
            $pub = array('id' => 'new', 'town_id' => $town_id, 'name' => '', 'abv' => '', 'og' => '', 'notes' => '');
        }
    } else {
        $towns = getQueryResults('SELECT id, name FROM ' . $config->get('database', 'tablePrefix') . 'town WHERE active=1 ORDER BY name;');
    }
}
if (isset($towns)) {
    $form->addField('town_id', 'select');
    $form->addLabel('Select town');
    $form->addOptions(array('' => 'Select town first'));
    $form->addOptions($towns, 'id', 'name');
    $form->addField('selectTown', 'submit', 'Select this town');
    $form->addInputClass('btnSubmit');
} else {
    if ('' != $pub_id) {
        $pub = reset(getQueryResults('SELECT * FROM ' . $config->get('database', 'tablePrefix') . 'pub WHERE id=' . $pub_id));
        $form->addField('town_id', 'hidden', $town_id);
        $form->addField('pub_id', 'hidden', $pub_id);
        $form->addField('name', 'hidden', $pub['name']);
        $form->addField('date', 'text', date('d-M-Y', time()));
        $form->addLabel('Date of Change');
        $form->addFieldValidation('required');
        $form->addContent('<img id="cal1Open" src="' . $config->get('web', 'root') . '/skin/images/cal.gif" /><div id="cal1Container"></div>');
        $form->addField('notes', 'textarea', $pub['notes']);
Example #19
0
     $form->addHtml(renderNotes('sot', $dea_id, array('viewform' => 4, 'label' => 'Status Notes')));
     $buttons = $form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit'));
 } else {
     if (is_array($additional_fields)) {
         $form->addData($additional_fields, $_GET);
     }
     $form->addData($formData4, $_GET);
     $form->addHtml(renderNotes('sot', $dea_id, array('viewform' => 4, 'label' => 'Status Notes')));
     $buttons = $form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit'));
 }
 if ($_GET["prompt"] == "app_production") {
     $buttons .= $form->makeField("button", "", "", "Book Production Appointment", array('class' => 'button', 'onClick' => 'document.location.href=\'production_add.php?stage=vendor&dea+id=' . $dea_id . '\''));
 }
 $form->addHtml($buttons);
 $form->addSeperator();
 $form->addHtml($form->addLabel('history', 'Status history', $sot_table));
 $form->addHtml('</div>');
 $form->addHtml("</fieldset>\n");
 $formName = 'form5';
 $form->addHtml("<fieldset>\n");
 $form->addLegend('Keys & Viewing Times', array('style' => 'cursor:pointer', 'onClick' => 'javascript:showHide(\'' . $formName . '\');'));
 $form->addHtml('<div id="' . $formName . '" style="display:none">');
 $form->addHtml($key_table);
 $form->addData($formData5, $_GET);
 $form->addHtml(renderNotes('viewing_arrangements', $dea_id, array('viewform' => 5, 'label' => 'View Times and Info')));
 $form->addHtml($form->addDiv($form->makeField("submit", $formName, "", "Save Changes", array('class' => 'submit'))));
 $form->addHtml('</div>');
 $form->addHtml("</fieldset>\n");
 $formName = 'form6';
 $form->addHtml("<fieldset>\n");
 $form->addLegend('Viewings (' . $countViewing . ')', array('style' => 'cursor:pointer', 'onClick' => 'javascript:showHide(\'' . $formName . '\');'));
Example #20
0
        $content .= 'About:  ' . $request->get('post', 'about') . CR;
        $content .= 'Message:' . CR;
        $content .= '--------------------------------------' . CR;
        $content .= $request->get('post', 'message') . CR;
        $content .= '--------------------------------------' . CR;
        $content .= 'Post from IP address: ' . $_SERVER['REMOTE_ADDR'] . CR;
        $content .= 'On: ' . date('D jS M Y H:i:s');
        $content .= CR . CR . 'Thank you.';
        mail($config->get('web', 'feedbackEmail'), $subject, $content, $headers);
        header('Location: ' . $config->get('web', 'root') . '/feedback/thankyou/');
        exit;
    }
    $form->addFieldsetOpen('Feedback');
    $form->addContent('<div><p class="fieldSubstitute"><span class="label">From:</span><span class="input">' . $user['firstname'] . ' ' . $user['lastname'] . '</span></p></div>');
    $form->addField('about', 'select');
    $form->addLabel('About');
    $form->addOptions(array('' => 'Select a subject', 'missbeer' => 'Missing Beer', 'missbrewery' => 'Missing Brewery', 'misspubs' => 'Missing Pub', 'misstowns' => 'Missing Town', 'newlandlord' => 'New Landlords', 'suggestion' => 'NBSS Suggestions', 'other' => 'Other'));
    $form->addFormValidationErrorMessage('required');
    $form->addField('message', 'textarea');
    $form->addLabel('Text');
    $form->addFormValidationErrorMessage('required');
    $form->addField('send', 'submit', 'Send');
    $form->addInputClass('btnSubmit');
    $form->addField('reset', 'reset', 'Clear');
    $form->addInputClass('btnReset');
    $form->addFieldsetClose();
    print $form->display();
} else {
    ?>
	<h2>Feedback disabled</h2>
	<p>The administrator has disabled feedback for this site.</p>