本文整理汇总了PHP中processForm函数的典型用法代码示例。如果您正苦于以下问题:PHP processForm函数的具体用法?PHP processForm怎么用?PHP processForm使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了processForm函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: buildAgencyForm
// is the result of an error message
if (!isset($agency)) {
$aAgency['name'] = $GLOBALS['strUntitled'];
$aAgency['contact'] = '';
$aAgency['email'] = '';
$aAgency['logout_url'] = '';
}
}
/*-------------------------------------------------------*/
/* MAIN REQUEST PROCESSING */
/*-------------------------------------------------------*/
//build agency form
$agencyForm = buildAgencyForm($aAgency);
if ($agencyForm->validate()) {
//process submitted values
processForm($aAgency, $agencyForm);
} else {
//either validation failed or form was not submitted, display the form
displayPage($aAgency, $agencyForm);
}
/*-------------------------------------------------------*/
/* Build form */
/*-------------------------------------------------------*/
function buildAgencyForm($aAgency)
{
$form = new OA_Admin_UI_Component_Form("agencyform", "POST", $_SERVER['SCRIPT_NAME']);
$form->forceClientValidation(true);
$form->addElement('hidden', 'agencyid', $aAgency['agencyid']);
$form->addElement('header', 'header_basic', $GLOBALS['strBasicInformation']);
$form->addElement('text', 'name', $GLOBALS['strName']);
$form->addElement('text', 'contact', $GLOBALS['strContact']);
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:31,代码来源:agency-edit.php
示例2: buildZoneForm
$zone['zonename'] .= $GLOBALS['strDefault'];
$zone['description'] = '';
$zone['width'] = '468';
$zone['height'] = '60';
$zone['delivery'] = phpAds_ZoneBanner;
$zone['comments'] = null;
}
$zone['affiliateid'] = $affiliateid;
/*-------------------------------------------------------*/
/* MAIN REQUEST PROCESSING */
/*-------------------------------------------------------*/
//build form
$zoneForm = buildZoneForm($zone);
if ($zoneForm->validate()) {
//process submitted values
$errors = processForm($zoneForm);
if (!empty($errors)) {
}
}
//display the page - show any validation errors that may have occured
displayPage($zone, $zoneForm, $errors);
/*-------------------------------------------------------*/
/* Build form */
/*-------------------------------------------------------*/
function buildZoneForm($zone)
{
global $conf;
// Initialise Ad Networks
$oAdNetworks = new OA_Central_AdNetworks();
$form = new OA_Admin_UI_Component_Form("zoneform", "POST", $_SERVER['PHP_SELF']);
$form->forceClientValidation(true);
开发者ID:villos,项目名称:tree_admin,代码行数:31,代码来源:zone-edit.php
示例3: showForm
function showForm($option, $fid)
{
global $mainframe, $limitstart, $acl, $formeConfig;
$my =& JFactory::getUser();
$processform = JRequest::getVar('form', array(), 'POST');
$database =& JFactory::getDBO();
if (!$fid) {
//get first cid
$database->setQuery("SELECT id FROM #__forme_forms WHERE published = 1 LIMIT 1");
$fid = (int) $database->loadResult();
}
//check language
//first check global joomfish
$check = false;
if (isset($_COOKIE['mbfcookie']['lang'])) {
$check = $_COOKIE['mbfcookie']['lang'];
}
if (isset($_COOKIE['jfcookie']['lang'])) {
$check = $_COOKIE['jfcookie']['lang'];
}
if (isset($_REQUEST['lang'])) {
$check = JRequest::getVar('lang', false);
}
if ($check) {
$oldform = new forme_forms($database);
$oldform->load($fid);
//check if we find something similar
$database->setQuery("SELECT id FROM #__forme_forms WHERE lang='{$check}' AND name='{$oldform->name}' ");
$newfid = $database->loadResult();
if ($newfid) {
$fid = $newfid;
}
}
processForm($fid, $processform);
$query = "SELECT * FROM #__forme_forms WHERE id = '{$fid}' AND published = '1'";
$database->setQuery($query);
$form = $database->loadObjectList();
//load fields
$query = "SELECT * FROM #__forme_fields WHERE form_id = '{$fid}' AND published = '1' ORDER BY ordering";
$database->setQuery($query);
$fields = $database->loadObjectList();
$form = $form[0];
if (!$form->published) {
$mainframe->redirect(JURI::base(), _NOT_EXIST);
}
//Output
forme_HTML::showForm($option, $form, $fields);
}
开发者ID:RangerWalt,项目名称:ecci,代码行数:48,代码来源:forme.php
示例4: buildZoneForm
$aZone['appendtype'] = phpAds_ZoneAppendRaw;
}
//extract chainzone
if (ereg("^zone:([0-9]+)\$", $aZone['chain'], $regs)) {
$aZone['chainzone'] = $regs[1];
} else {
$aZone['chainzone'] = '';
}
/*-------------------------------------------------------*/
/* MAIN REQUEST PROCESSING */
/*-------------------------------------------------------*/
//build zone adv form
$zoneForm = buildZoneForm($aZone);
if ($zoneForm->validate()) {
//process submitted values
processForm($aZone, $zoneForm);
} else {
//either validation failed or form was not submitted, display the form
displayPage($aZone, $zoneForm);
}
/*-------------------------------------------------------*/
/* Build form */
/*-------------------------------------------------------*/
function buildZoneForm($aZone)
{
$form = new OA_Admin_UI_Component_Form("zoneform", "POST", $_SERVER['PHP_SELF']);
$form->forceClientValidation(true);
$form->addElement('hidden', 'zoneid', $aZone['zoneid']);
$form->addElement('hidden', 'affiliateid', $aZone['affiliateid']);
buildChainSettingsFormSection($form, $aZone);
buildDeliveryCappingFormSection($form, $GLOBALS['strCappingZone'], $aZone);
开发者ID:villos,项目名称:tree_admin,代码行数:31,代码来源:zone-advanced.php
示例5: buildWebsiteForm
//set some default
$affiliate['website'] = 'http://';
}
/*-------------------------------------------------------*/
/* MAIN REQUEST PROCESSING */
/*-------------------------------------------------------*/
// check if Thorium plugin is enabled
$oComponent = null;
if (isset($GLOBALS['_MAX']['CONF']['plugins']['openXThorium']) && $GLOBALS['_MAX']['CONF']['plugins']['openXThorium']) {
$oComponent =& OX_Component::factory('admin', 'oxThorium', 'oxThorium');
}
//build form
$websiteForm = buildWebsiteForm($affiliate);
if ($websiteForm->validate()) {
//process submitted values
$oPublisherDll = processForm($affiliateid, $websiteForm, $oComponent);
if ($oPublisherDll->_errorMessage || $oPublisherDll->_noticeMessage) {
displayPage($affiliateid, $websiteForm, $oPublisherDll);
}
} else {
//either validation failed or form was not submitted, display the form
displayPage($affiliateid, $websiteForm);
}
/*-------------------------------------------------------*/
/* Build form */
/*-------------------------------------------------------*/
function buildWebsiteForm($affiliate)
{
$form = new OA_Admin_UI_Component_Form("affiliateform", "POST", $_SERVER['SCRIPT_NAME']);
$form->forceClientValidation(true);
$form->addElement('hidden', 'affiliateid', $affiliate['affiliateid']);
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:31,代码来源:affiliate-edit.php
示例6: processForm
<?php
if (isset($_POST["submitButton"])) {
processForm();
} else {
displayForm(array());
}
function validateField($fieldName, $missingFields)
{
if (in_array($fieldName, $missingFields)) {
return ' class="error"';
}
}
function setValue($fieldName)
{
if (isset($_POST[$fieldName])) {
return htmlspecialchars($_POST[$fieldName]);
}
}
function setChecked($fieldName, $fieldValue)
{
if (isset($_POST[$fieldName]) and $_POST[$fieldName] == $fieldValue) {
return ' checked="checked"';
}
}
function setSelected($fieldName, $fieldValue)
{
if (isset($_POST[$fieldName]) and $_POST[$fieldName] == $fieldValue) {
return ' selected="selected"';
}
}
开发者ID:raynaldmo,项目名称:php-education,代码行数:31,代码来源:registration.php
示例7: switch
Application::sendJson(["err" => "UNDEFINED_ACTION"]);
}
$action = $_POST['action'];
if (!isset($_POST['id'])) {
Application::sendJson(["err" => "UNDEFINED_EVENT_ID"]);
}
$event = GreaseRatEvent::retrieveByPK(intval($_POST['id']));
if (!$event) {
Application::sendJson(["err" => "UNDEFINED_EVENT"]);
}
switch ($action) {
case "DELETE":
$event->delete();
Application::sendJson(["err" => "OK"]);
break;
case "MOVE":
if (!isset($_POST["data"])) {
Application::sendJson(["err" => "UNDEFINED_FORM_DATA"]);
}
$_POST["data"]["id"] = intval($_POST['id']);
Application::sendJson(processForm($_POST["data"]));
break;
default:
Application::sendJson(["err" => "UNDEFINED_ACTION"]);
break;
}
});
Macaw::error(function () {
echo '404 :: Not Found';
});
Macaw::dispatch();
开发者ID:vugluskr86,项目名称:_autoservice,代码行数:31,代码来源:index.php
示例8: buildAdvertiserForm
$aAdvertiser['contact'] = '';
$aAdvertiser['comments'] = '';
$aAdvertiser['email'] = '';
$aAdvertiser['reportdeactivate'] = 'f';
$aAdvertiser['report'] = 'f';
$aAdvertiser['reportinterval'] = 7;
}
}
/*-------------------------------------------------------*/
/* MAIN REQUEST PROCESSING */
/*-------------------------------------------------------*/
//build advertiser form
$advertiserForm = buildAdvertiserForm($aAdvertiser);
if ($advertiserForm->validate()) {
//process submitted values
processForm($aAdvertiser, $advertiserForm);
} else {
//either validation failed or form was not submitted, display the form
displayPage($aAdvertiser, $advertiserForm);
}
/*-------------------------------------------------------*/
/* Build form */
/*-------------------------------------------------------*/
function buildAdvertiserForm($aAdvertiser)
{
$form = new OA_Admin_UI_Component_Form("clientform", "POST", $_SERVER['SCRIPT_NAME']);
$form->forceClientValidation(true);
$form->addElement('hidden', 'clientid', $aAdvertiser['clientid']);
$form->addElement('header', 'header_basic', $GLOBALS['strBasicInformation']);
$nameElem = $form->createElement('text', 'clientname', $GLOBALS['strName']);
if (!OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:31,代码来源:advertiser-edit.php
示例9: getDividerType
}
function getDividerType($dividerType)
{
switch ($dividerType) {
case "Space":
return " ";
break;
case "Hyphen":
return "-";
break;
case "Underscore":
return "_";
break;
}
}
function formatWord($formatType, $wordToFormat)
{
switch ($formatType) {
case "Uppercase":
return strtoupper($wordToFormat);
break;
case "Lowercase":
return strtolower($wordToFormat);
break;
case "Pascal":
return ucfirst($wordToFormat);
break;
}
}
$finalPassword = processForm($word_array, $char_array, $num_array);
开发者ID:DaleMcIntyre,项目名称:CSCI-E-15-P2,代码行数:30,代码来源:controller.php
示例10: pageController
function pageController()
{
$errors['count'] = 0;
if (!empty($_GET['id'])) {
$adID = $_GET['id'];
$adObject = AdModel::find($adID);
}
$imageSuccessMessage = "";
//if an image was submitted - validate it even before validating the rest of the form
if (!empty($_POST['upload-image']) && $_FILES['fileToUpload']['name'] != '') {
try {
$postImage = Input::getImage();
//image was successfully uploaded
$imageSuccessMessage = "Image: " . basename($_FILES['fileToUpload']['name']) . " has been uploaded!";
//store image in the session
$_SESSION['image'] = $postImage;
} catch (Exception $e) {
$errors['image'] = 'Image: ' . $e->getMessage();
$errors['count']++;
}
}
//clicked on the upload image button without selecting a photo
if (!empty($_POST['upload-image']) && $_FILES['fileToUpload']['name'] == '') {
$errors['image'] = "Image: Select an image to upload!";
$errors['count']++;
}
//an image has been submitted; use the image stored in the $_SESSION
if (isset($_SESSION['image'])) {
$postImage = $_SESSION['image'];
} else {
//use the image stored in the database
$postImage = "Database Image";
}
//if there weren't any errors with the image; then, process then rest of the form
if ($errors['count'] == 0) {
$errors = processForm($adObject, $postImage);
// $errors = processForm($adObject->category, $adObject->date_posted, $postImage);
}
return array('adObject' => $adObject, 'errorMessages' => $errors);
}
开发者ID:LZJCodeup,项目名称:AdLister,代码行数:40,代码来源:ads.edit.php
示例11: array
global $session;
$aVersion['major'] = 0;
$aVersion['minor'] = 0;
$aVersion['build'] = 1;
$aVersion['status'] = '-dev';
$aValues['name'] = $name ? $name : $oTrans->translate("myPlugin");
$aValues['email'] = $email ? $email : $session['user']->aUser['email_address'];
$aValues['author'] = $author ? $author : $session['user']->aUser['contact_name'];
$aValues['url'] = $url ? $url : $GLOBALS['HTTP_SERVER_VARS']['HTTP_HOST'];
$aValues['licence'] = $licence ? $licence : 'GPL';
$aValues['description'] = $description ? $description : $oTrans->translate("My New Plugin");
$aValues['group'] = $group ? $group : array();
$aValues['version'] = $version ? $version : $aVersion;
$form = buildForm();
if ($form->validate()) {
$aMessages = processForm($form, $aValues);
} else {
$form->setDefaults($aValues);
}
displayPage($form, $aMessages);
function &buildForm()
{
global $oTrans;
$form = new OA_Admin_UI_Component_Form("oxToolBoxForm", "POST", $_SERVER['SCRIPT_NAME'], null, array("enctype" => "multipart/form-data"));
$form->forceClientValidation(true);
$form->addElement('header', 'header', $oTrans->translate("New Plugin"));
$form->addElement('text', 'name', $oTrans->translate("Plugin Name"), array('class' => 'medium'));
$form->addElement('text', 'email', $oTrans->translate("Author Email"));
$form->addElement('text', 'author', $oTrans->translate("Author Name"));
$form->addElement('text', 'url', $oTrans->translate("Author URL"));
$form->addElement('text', 'licence', $oTrans->translate("Licence Info"));
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:31,代码来源:oxPlugin-index.php
示例12: saveData
*/
function saveData($vote, $comment = "", $sourceId)
{
if ($vote > 0 && $vote < 10) {
global $db;
$sql = "INSERT INTO pgn_rating (VOTE, COMMENT, SOURCEID) VALUES({$vote}, '" . addslashes($comment) . "', {$sourceId})";
$query = new query($db, $sql);
$query->free();
return true;
}
return false;
}
$sourceId = value("source", "NUMERIC", "");
$out .= '<table style="font-face:arial; font-size:12px;">' . "<tr>";
$out .= '<form name="rate" method="post">';
if (processForm($sourceId)) {
$out .= '<td class="rate_copy">Thank your for your vote and opinion.</td></tr><tr>';
} else {
$out .= '<td colspan="11" class="rate_label">Is this article helpful?</td></tr><tr>';
$out .= '<td colspan="11" class="rate_copy"><img src="sys/ptrans.gif" border="0" height="5" width="1">' . "</td></tr><tr>";
$out .= '<td class="rate_label" width="10%"> <input type="hidden" name="pgnratingsend' . $sourceId . '" value="1"></td>';
for ($i = 1; $i < 10; $i++) {
$out .= '<td class="rate_copy" align="center" width="10%">' . $i . '</td>';
}
$out .= '<td class="rate_copy" width="10%"> </td>' . "</tr><tr>";
$out .= '<td class="rate_label" width="10%">Poor</td>';
for ($i = 1; $i < 10; $i++) {
$out .= '<td class="rate_copy" align="center" width="10%"><input type="radio" name="pgnrating' . $sourceId . '" value="' . $i . '"></td>';
}
$out .= '<td class="rate_copy" width="10%">Great</td>' . "</tr><tr>";
$out .= '<td colspan="11" class="rate_copy"><img src="sys/ptrans.gif" border="0" height="5" width="1">' . "</td></tr><tr>";
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:31,代码来源:rater.php
示例13: pageController
function pageController()
{
$errors = processForm();
return array('errorMessages' => $errors);
}
开发者ID:LZJCodeup,项目名称:AdLister,代码行数:5,代码来源:users.create.php
示例14: isset
}
$tracker['trackername'] .= $strDefault . " " . $strTracker;
$tracker['status'] = isset($pref['tracker_default_status']) ? $pref['tracker_default_status'] : MAX_CONNECTION_STATUS_APPROVED;
$tracker['type'] = isset($pref['tracker_default_type']) ? $pref['tracker_default_type'] : MAX_CONNECTION_TYPE_SALE;
$tracker['linkcampaigns'] = $pref['tracker_link_campaigns'] == true ? 't' : 'f';
$tracker['description'] = '';
$tracker['clientid'] = $clientid;
}
/*-------------------------------------------------------*/
/* MAIN REQUEST PROCESSING */
/*-------------------------------------------------------*/
//build form
$trackerForm = buildTrackerForm($tracker);
if ($trackerForm->validate()) {
//process submitted values
processForm($trackerForm);
} else {
//either validation failed or form was not submitted, display the form
displayPage($tracker, $trackerForm);
}
/*-------------------------------------------------------*/
/* Build form */
/*-------------------------------------------------------*/
function buildTrackerForm($tracker)
{
$form = new OA_Admin_UI_Component_Form("trackerform", "POST", $_SERVER['SCRIPT_NAME']);
$form->forceClientValidation(true);
$form->addElement('hidden', 'trackerid', $tracker['trackerid']);
$form->addElement('hidden', 'clientid', $tracker['clientid']);
$form->addElement('hidden', 'move', $tracker['move']);
$form->addElement('header', 'basic_info', $GLOBALS['strTrackerInformation']);
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:31,代码来源:tracker-edit.php
示例15: buildZoneForm
$zone['zonename'] .= $GLOBALS['strDefault'];
$zone['description'] = '';
$zone['width'] = '468';
$zone['height'] = '60';
$zone['delivery'] = phpAds_ZoneBanner;
$zone['comments'] = null;
}
$zone['affiliateid'] = $affiliateid;
/*-------------------------------------------------------*/
/* MAIN REQUEST PROCESSING */
/*-------------------------------------------------------*/
//build form
$zoneForm = buildZoneForm($zone, $oComponent);
if ($zoneForm->validate()) {
//process submitted values
$errors = processForm($zoneForm, $oComponent);
if (!empty($errors)) {
}
}
//display the page - show any validation errors that may have occurred
displayPage($zone, $zoneForm, $errors);
/*-------------------------------------------------------*/
/* Build form */
/*-------------------------------------------------------*/
function buildZoneForm($zone, $oComponent = null)
{
global $conf;
$newZone = empty($zone['zoneid']);
$form = new OA_Admin_UI_Component_Form("zoneform", "POST", $_SERVER['SCRIPT_NAME']);
$form->forceClientValidation(true);
$form->addElement('hidden', 'zoneid', $zone['zoneid']);
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:31,代码来源:zone-edit.php
示例16: define
* @license GPLv2 http://files.syscp.org/misc/COPYING.txt
* @package Panel
* @version $Id$
*/
define('AREA', 'admin');
/**
* Include our init.php, which manages Sessions, Language etc.
*/
$need_db_sql_data = true;
$need_root_db_sql_data = true;
require "./lib/init.php";
if (($page == 'settings' || $page == 'overview') && $userinfo['change_serversettings'] == '1') {
$settings_data = loadConfigArrayDir('./actions/admin/settings/');
$settings = loadSettings(&$settings_data, &$db);
if (isset($_POST['send']) && $_POST['send'] == 'send') {
if (processForm(&$settings_data, &$_POST, array('filename' => $filename, 'action' => $action, 'page' => $page))) {
standard_success('settingssaved', '', array('filename' => $filename, 'action' => $action, 'page' => $page));
}
} else {
$fields = buildForm(&$settings_data);
eval("echo \"" . getTemplate("settings/settings") . "\";");
}
} elseif ($page == 'rebuildconfigs' && $userinfo['change_serversettings'] == '1') {
if (isset($_POST['send']) && $_POST['send'] == 'send') {
$log->logAction(ADM_ACTION, LOG_INFO, "rebuild configfiles");
inserttask('1');
inserttask('4');
inserttask('5');
redirectTo('admin_index.php', array('s' => $s));
} else {
ask_yesno('admin_configs_reallyrebuild', $filename, array('page' => $page));
开发者ID:HobbyNToys,项目名称:SysCP,代码行数:31,代码来源:admin_settings.php
示例17: pageController
function pageController()
{
$errors['count'] = 0;
$arrayCategoriesArray = CategoryModel::all();
foreach ($arrayCategoriesArray as $categoriesArray) {
$categorySelectionList[] = $categoriesArray['category_name'];
}
$imageSuccessMessage = "";
//if an image was submitted - validate it even before validating the rest of the form
if (isset($_FILES['fileToUpload']) && $_FILES['fileToUpload']['name'] != '') {
try {
$postImage = Input::getImage('fileToUpload');
//image was successfully uploaded
$imageSuccessMessage = "Image: " . basename($_FILES['fileToUpload']['name']) . " has been uploaded!";
//store image in the session
$_SESSION['image'] = $postImage;
} catch (Exception $e) {
$errors['image'] = 'Image: ' . $e->getMessage();
$errors['count']++;
}
}
//clicked on the upload image button without selecting a photo
if (isset($_FILES['fileToUpload']) && $_FILES['fileToUpload']['name'] == '') {
$errors['image'] = "Image: Select an image to upload!";
$errors['count']++;
}
//if the session['image'] is empty; then, no image was submitted
if (!isset($_SESSION['image'])) {
//no image was submitted - use placeholder image
$postImage = "http://placehold.it/350x300";
} else {
//an image has been submitted; use the image stored in the $_SESSION
$postImage = $_SESSION['image'];
}
//if there weren't any errors with the image; then, process then rest of the form
if ($errors['count'] == 0) {
$errors = processForm($postImage);
}
return array('categorySelectionList' => $categorySelectionList, 'errorMessages' => $errors, 'imageSuccessMessage' => $imageSuccessMessage);
}
开发者ID:LZJCodeup,项目名称:AdLister,代码行数:40,代码来源:ads.create.php
示例18: buildZoneForm
$aZone['appendtype'] = phpAds_ZoneAppendRaw;
}
//extract chainzone
if (ereg("^zone:([0-9]+)\$", $aZone['chain'], $regs)) {
$aZone['chainzone'] = $regs[1];
} else {
$aZone['chainzone'] = '';
}
/*-------------------------------------------------------*/
/* MAIN REQUEST PROCESSING */
/*-------------------------------------------------------*/
//build zone adv form
$zoneForm = buildZoneForm($aZone, $oComponent);
if ($zoneForm->validate()) {
//process submitted values
processForm($aZone, $zoneForm, $oComponent);
} else {
//either validation failed or form was not submitted, display the form
displayPage($aZone, $zoneForm);
}
/*-------------------------------------------------------*/
/* Build form */
/*-------------------------------------------------------*/
function buildZoneForm($aZone, $oComponent = null)
{
$form = new OA_Admin_UI_Component_Form("zoneform", "POST", $_SERVER['SCRIPT_NAME']);
$form->forceClientValidation(true);
$form->addElement('hidden', 'zoneid', $aZone['zoneid']);
$form->addElement('hidden', 'affiliateid', $aZone['affiliateid']);
buildChainSettingsFormSection($form, $aZone);
if ($oComponent && method_exists($oComponent, 'extendZoneAdvancedForm')) {
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:31,代码来源:zone-advanced.php
示例19: array
$user->setMemberId(7);
$start = array('year' => date('Y', strtotime('+2 week')), 'month' => (int) date('m', strtotime('+2 week')), 'day' => (int) date('d', strtotime('+2 week')));
$start_t = array('hour' => '12', 'minute' => '0');
$end = array('year' => date('Y', strtotime('+2 week')), 'month' => (int) date('m', strtotime('+2 week')), 'day' => (int) date('d', strtotime('+2 week')));
$end_t = array('hour' => '12', 'minute' => '15');
$resources = array(1 => '3', 2 => '', 3 => '', 4 => '', 5 => '');
$t->cmp_ok(processForm($start, $start_t, $end, $end_t, $resources, array($user->getMemberId())), '===', false, 'member_id 7 が二週間後の12:00〜12:15のスケジュール作成, 小会議室Aを1つ予約:isValid() false を返す');
$schedule->delete();
$resources = array(1 => '', 2 => '3', 3 => '3', 4 => '', 5 => '');
$t->isa_ok(processForm($start, $start_t, $end, $end_t, $resources, array($user->getMemberId())), 'Schedule', 'member_id 13 がスケジュールを削除したため、member_id 2 が再度二週間後の12:00〜12:15のスケジュール作成, 小会議室Aを2つ予約:Schedule インスタンスを返す');
$user->clearSessionData();
$user->setAuthenticated(true);
$user->setMemberId(4);
$t->cmp_ok(processForm($start, $start_t, $end, $end_t, $resources, array($user->getMemberId())), '===', false, 'member_id 4が二週間後の12:00〜12:15のスケジュール作成, 小会議室Aを1つ予約:isValid() false を返す');
Doctrine::getTable('Member')->find(7)->delete();
$t->isa_ok(processForm($start, $start_t, $end, $end_t, $resources, array($user->getMemberId())), 'Schedule', 'member_id 7 が退会したので member_id 4が二週間後の12:00〜12:15のスケジュール作成, 小会議室Aを1つ予約:Schedule インスタンスを返す');
/*
* テスト用processForm
*/
function processForm($start, $start_t, $end, $end_t, $schedule_resorces, $schedule_members = array(1), $public_flag = 1, $isUseCSRF = true)
{
$form = new ScheduleForm();
$form->getObject()->setMemberId(sfContext::getInstance()->getUser()->getMemberId());
$params = array('title' => 'test', 'body' => 'test', 'start_date' => $start, 'start_time' => $start_t, 'end_date' => $end, 'end_time' => $end_t, 'public_flag' => $public_flag, 'schedule_member' => $schedule_members, '_csrf_token' => $isUseCSRF ? $form->getCSRFToken() : '');
for ($i = 1; $i <= 5; $i++) {
$params['schedule_resource_lock_' . $i] = array('schedule_resource_id' => $schedule_resorces[$i]);
}
$form->bind($params);
if ($form->isValid()) {
return $form->save();
}
开发者ID:te-koyama,项目名称:openpne,代码行数:31,代码来源:PluginScheduleResourceLockFormTest.php
示例20: phpAds_SessionDataStore
}
if (!empty($affiliateid)) {
/*-------------------------------------------------------*/
/* Store preferences */
/*-------------------------------------------------------*/
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['affiliateid'] = $affiliateid;
phpAds_SessionDataStore();
}
/*-------------------------------------------------------*/
/* MAIN REQUEST PROCESSING */
/*-------------------------------------------------------*/
//build form
$channelForm = buildChannelForm($channel);
if ($channelForm->validate()) {
//process submitted values
processForm($channelForm);
} else {
//either validation failed or form was not submitted, display the form
displayPage($channel, $channelForm);
}
/*-------------------------------------------------------*/
/* Build form */
/*-------------------------------------------------------*/
function buildChannelForm($channel)
{
$form = new OA_Admin_UI_Component_Form("channelform", "POST", $_SERVER['PHP_SELF']);
$form->forceClientValidation(true);
$form->addElement('hidden', 'agencyid', OA_Permission::getAgencyId());
$form->addElement('hidden', 'affiliateid', $channel['affiliateid']);
$form->addElement('hidden', 'channelid', $channel['channelid']);
$form->addElement('header', 'header_basic', $GLOBALS['strBasicInformation']);
开发者ID:villos,项目名称:tree_admin,代码行数:31,代码来源:channel-edit.php
注:本文中的processForm函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论