本文整理汇总了PHP中Validate::process方法的典型用法代码示例。如果您正苦于以下问题:PHP Validate::process方法的具体用法?PHP Validate::process怎么用?PHP Validate::process使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Validate
的用法示例。
在下文中一共展示了Validate::process方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
$db_data2["sot_status"] = $db_data["dea_status"];
$db_data2["sot_date"] = $date_mysql;
$db_data2["sot_notes"] = $_GET["notes"];
$db_data2["sot_user"] = $_SESSION["auth"]["use_id"];
$sot_id = db_query($db_data2, "INSERT", "sot", "sot_id");
}
// prompt: changed to production, ask if appointment should be booked....
if ($sot_id && $db_data2["sot_status"] == "Production") {
$prompt = "app_production";
}
} elseif ($_GET["form5"]) {
$fields = $form5;
$viewForm = 5;
$formData5 = join_arrays(array($formData5));
$result = new Validate();
$results = $result->process($formData5, $_GET);
$db_data = $results['Results'];
// build return link
$return = 'stage=1&dea_id=' . $dea_id . '&searchLink=' . $searchLink . '&';
// extract notes from db_data and store in notes table
if ($db_data["dea_notes_arr"]) {
$notes = $db_data["dea_notes_arr"];
$db_data_note = array('not_blurb' => $notes, 'not_row' => $dea_id, 'not_type' => 'viewing_arrangements', 'not_user' => $_SESSION["auth"]["use_id"], 'not_date' => $date_mysql);
db_query($db_data_note, "INSERT", "note", "not_id");
}
unset($db_data["dea_notes_arr"]);
if ($results['Errors']) {
if (is_array($results['Results'])) {
$return .= http_build_query($results['Results']);
}
echo error_message($results['Errors'], '?' . urlencode($return));
示例2: die
// if client has not default address, make the above property it
$sql = "SELECT con_pro FROM contact WHERE con_id = '" . $_POST["con_id"] . "'";
$q = $db->query($sql);
if (DB::isError($q)) {
die("db error: " . $q->getMessage());
}
while ($row = $q->fetchRow()) {
if ($row["con_pro"] == 0) {
$db_dataD["con_pro"] = $pro_id;
db_query($db_dataD, "UPDATE", "contact", "con_id", $_POST["con_id"]);
}
}
} else {
// if the manual input form is used, put values into array and insert into property table
// all manual entries are inserted with -1 as pcid, and should be checked by admin until a script does it automatically
$results = $result->process($form2, $_POST);
$db_data = $results['Results'];
// build return link
$redirect = $_SERVER['SCRIPT_NAME'] . '?';
if ($con_id) {
$redirect .= 'con_id=' . $con_id;
}
if ($viewForm) {
$redirect .= '&viewForm=' . $viewForm;
}
if ($searchLink) {
$redirect .= '&searchLink=' . urlencode($searchLink);
}
if ($results['Errors']) {
if (is_array($results['Results'])) {
$redirect .= '&' . http_build_query($results['Results']);
示例3: Validate
$page->addScriptDeclaration($source['js']);
$page->setBodyAttributes(array('onLoad' => $source['onload']));
$page->addBodyContent('<div id="content">');
$page->addBodyContent($menu);
$page->addBodyContent('<p><a href="image.php?dir_id=' . $dir_id . '">Images</a></p>');
$page->addBodyContent($form->renderForm());
$page->addBodyContent('</div>');
$page->display();
exit;
} else {
// if the form has been submitted
$result = new Validate();
$results = $result->process($formData1, $_POST);
$db_data = $results['Results'];
$result2 = new Validate();
$results2 = $result2->process($formData2, $_POST);
$db_data2 = $results2['Results'];
// build return link
$return = $_SERVER['SCRIPT_NAME'] . '?';
if ($cli_id) {
$results['Results']['dir_id'] = $dir_id;
}
if ($viewForm) {
$results['Results']['viewForm'] = $viewForm;
}
if (is_array($results['Results'])) {
$return .= http_build_query($results['Results']);
}
if ($results['Errors']) {
echo error_message($results['Errors'], urlencode($return));
exit;
示例4: unset
$page->addBodyContent($form2->renderForm());
$page->addBodyContent('</div>');
$page->display();
exit;
} else {
// if form is submitted
// build return link
$return = $_SERVER['SCRIPT_NAME'] . '?stage=2&dest=' . $_POST["dest"] . '&';
// if phone number is supplied, remove from initial db_data array
if (phone_validate($_POST["telnew"])) {
unset($formData1["cli_tel"]);
}
$return .= "telnew=" . $_POST["telnew"] . "&dea_id={$dea_id}&";
// validate first form
$result = new Validate();
$results = $result->process($formData1, $_POST);
$db_data = $results['Results'];
//print_r($results);
if (is_array($results['Results'])) {
$return .= http_build_query($results['Results']);
}
// validate second form, but this is only required is posctcode lookup isnt used
if (!$_POST["pro_pro_id"]) {
$results2 = $result->process($formData2, $_POST);
$db_data2 = $results2['Results'];
if (is_array($results2['Results'])) {
$return2 = http_build_query($results2['Results']);
}
} else {
// successfull postcode lookup, show read-only form?
$return2 = "pro_pro_id=" . $_POST["pro_pro_id"] . "&";
示例5: elseif
$page->display();
} else {
// if form is submitted
// first deal with the client status. if mulitple clients are linked to deal, update all
if ($dea_type == 'Sales') {
if ($_GET["cli_salestatus"]) {
$db_data_cli["cli_salestatus"] = $_GET["cli_salestatus"];
}
} elseif ($dea_type == 'Lettings') {
if ($_GET["cli_letstatus"]) {
$db_data_cli["cli_letstatus"] = $_GET["cli_letstatus"];
}
}
$result = new Validate();
$fields = join_arrays(array($formData1));
$results = $result->process($fields, $_GET);
$db_data = $results['Results'];
$cli_id = array2string($cli_id);
$redirect = $_SERVER['SCRIPT_NAME'] . '?dea_id=' . $dea_id . '&cli_id=' . $cli_id;
if ($return) {
$redirect .= '&return=' . $return;
}
if ($results['Errors']) {
if (is_array($results['Results'])) {
$redirect .= '&' . http_build_query($results['Results']);
}
echo error_message($results['Errors'], urlencode($redirect));
exit;
}
$db_data["off_deal"] = $_GET["dea_id"];
$db_data["off_date"] = $date_mysql;
示例6: Validate
$page->addScript('js/scriptaculous/prototype.js');
$page->addScript('js/scriptaculous/scriptaculous.js');
$page->addScriptDeclaration($additional_js);
$page->setBodyAttributes(array('onLoad' => $onLoad));
$page->addBodyContent($header_and_menu);
$page->addBodyContent('<div id="content">');
$page->addBodyContent($navbar);
$page->addBodyContent($form->renderForm());
$page->addBodyContent('</div>');
$page->display();
exit;
} else {
// if form is submitted
// validate and insert first form, get cli_id before adding property data (this may mean we lose address)
$result = new Validate();
$results = $result->process($form1, $_POST);
$db_data = $results['Results'];
// build return link
$redirect = $_SERVER['SCRIPT_NAME'] . '?stage=3&';
if ($use_id) {
$redirect .= 'use_id=' . $use_id;
}
if ($viewForm) {
$redirect .= '&viewForm=' . $viewForm;
}
if ($searchLink) {
$redirect .= '&searchLink=' . urlencode($searchLink);
}
if ($results['Errors']) {
if (is_array($results['Results'])) {
$redirect .= '&' . http_build_query($results['Results']);
示例7: unset
$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();
exit;
} else {
if ($_POST["med_measurement"] == "feet") {
$_POST["med_dims"] = ft2mtr($_POST["med_dims"]);
}
unset($_POST["med_measurement"]);
$result = new Validate();
$results = $result->process($formData, $_POST);
$db_data = $results['Results'];
if ($results['Errors']) {
if (is_array($results['Results'])) {
$return .= http_build_query($results['Results']);
}
echo error_message($results['Errors'], urlencode($return));
exit;
}
$med_id = db_query($db_data, "UPDATE", "media", "med_id", $med_id);
#header("Location:".urldecode($_POST["searchLink"]));
if ($_POST["searchLink"]) {
$tmpurl = $_POST["searchLink"];
} else {
$tmpurl = $_GET["searchLink"];
}
示例8: trim
#$_POST[$key] = trim($val);
}
if ($_POST["form1"]) {
$viewForm = 1;
// extract notes from _POST and store in notes table
if ($_POST["dea_notes_production"]) {
$notes = $_POST["dea_notes_production"];
$db_data_note = array('not_blurb' => $notes, 'not_row' => $dea_id, 'not_type' => 'deal_production', 'not_user' => $_SESSION["auth"]["use_id"], 'not_date' => $date_mysql);
db_query($db_data_note, "INSERT", "note", "not_id");
}
unset($_POST["dea_notes_production"]);
// add psubtype
$addFormData1 = array('dea_psubtype' => array('label' => 'Property Type', 'required' => 2, 'value' => $_POST["dea_psubtype"]));
$formData1 = join_arrays(array($formData1, $addFormData1));
#print_r($formData3);
$results = $result->process($formData1, $_POST);
$db_data = $results['Results'];
// build return link
$return = $_SERVER['SCRIPT_NAME'] . '?stage=1&dea_id=' . $dea_id . '&searchLink=' . $searchLink . '&viewForm=' . $viewForm . '&';
if ($results['Errors']) {
if (is_array($results['Results'])) {
$return .= http_build_query($results['Results']);
}
echo error_message($results['Errors'], urlencode($return));
exit;
}
$dea_id = db_query($db_data, "UPDATE", "deal", "dea_id", $dea_id);
if ($_POST["pro_area"]) {
db_query(array('pro_area' => $_POST["pro_area"]), "UPDATE", "property", "pro_id", $_POST["pro_id"]);
}
} elseif ($_POST["form2"]) {
示例9: urlencode
// build return link
$return = $_SERVER['SCRIPT_NAME'] . '?';
if ($dir_id) {
$results['Results']['dir_id'] = $dir_id;
}
if (is_array($results['Results'])) {
$return .= http_build_query($results['Results']);
}
if ($results['Errors']) {
echo error_message($results['Errors'], urlencode($return));
exit;
}
# add address manually, if postcode lookup is not used
if (!$pro_pro_id) {
$result2 = new Validate();
$results2 = $result2->process($formData2, $_GET);
$db_data2 = $results2['Results'];
$db_data2["pro_pcid"] = '-1';
$pro_pro_id = db_query($db_data2, "INSERT", "property", "pro_id");
}
# add any additional fields to data array
$db_data['dir_created'] = $date_mysql;
$db_data['dir_pro'] = $pro_pro_id;
$dir_id = db_query($db_data, "INSERT", "directory", "dir_id");
header("Location:index.php");
exit;
}
break;
###########################################################
# default
###########################################################