本文整理汇总了PHP中setOnFormError函数的典型用法代码示例。如果您正苦于以下问题:PHP setOnFormError函数的具体用法?PHP setOnFormError怎么用?PHP setOnFormError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setOnFormError函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: addEdit
public function addEdit($id)
{
//---------------------------------------------------------------------
//
//---------------------------------------------------------------------
if (!bTestForURLHack('showClients')) {
return;
}
$this->load->helper('dl_util/verify_id');
verifyIDsViaType($this, CENUM_CONTEXT_STATUSCAT, $id, true);
$id = (int) $id;
$bNew = $id <= 0;
$this->load->model('clients/mclient_status', 'clsClientStat');
$this->clsClientStat->loadClientStatCats(true, true, $id);
// validation rules
$this->form_validation->set_error_delimiters('<div class="formError">', '</div>');
$this->form_validation->set_rules('txtStatCatName', 'Status Category', 'trim|required|' . 'callback_verifyUniqueStatCat[' . $id . ']');
$this->form_validation->set_rules('txtNotes');
if ($this->form_validation->run() == FALSE) {
$displayData = array();
$displayData['formD'] = new stdClass();
$this->load->library('generic_form');
if ($bNew) {
$this->clsClientStat->loadClientStatCats(true, true, -1);
$this->clsClientStat->statCats[0]->lKeyID = -1;
$this->clsClientStat->statCats[0]->strCatName = '';
}
if (validation_errors() == '') {
$displayData['formD']->txtStatCatName = htmlspecialchars($this->clsClientStat->statCats[0]->strCatName);
$displayData['formD']->txtNotes = htmlspecialchars($this->clsClientStat->statCats[0]->strDescription);
} else {
setOnFormError($displayData);
$displayData['formD']->txtStatCatName = set_value('txtStatCatName');
$displayData['formD']->txtNotes = set_value('txtNotes');
}
//--------------------------
// breadcrumbs
//--------------------------
$displayData['pageTitle'] = anchor('main/menu/admin', 'Admin', 'class="breadcrumb"') . ' | ' . anchor('admin/alists/showLists', 'Lists', 'class="breadcrumb" ') . ' | ' . anchor('admin/admin_special_lists/clients/statCatView', 'Client Status Categories', 'class="breadcrumb" ') . ' | ' . ($bNew ? 'Add new status category' : 'Edit status category');
$displayData['title'] = CS_PROGNAME . ' | Lists';
$displayData['nav'] = $this->mnav_brain_jar->navData();
$displayData['id'] = $id;
$displayData['bNew'] = $bNew;
$displayData['statCats'] = $this->clsClientStat->statCats;
$displayData['mainTemplate'] = 'client/client_status_cat_add_edit';
$this->load->vars($displayData);
$this->load->view('template');
} else {
$this->clsClientStat->statCats[0]->strCatName = trim($_POST['txtStatCatName']);
$this->clsClientStat->statCats[0]->strDescription = trim($_POST['txtNotes']);
if ($id == 0) {
$id = $this->clsClientStat->addNewClientStatusCat();
$this->session->set_flashdata('msg', 'Your status category was added');
} else {
$this->clsClientStat->updateClientStatusCat($id);
$this->session->set_flashdata('msg', 'Your status category was updated');
}
redirect('admin/admin_special_lists/clients/statCatView');
}
}
开发者ID:simple-gifts,项目名称:Delightful-Labor,代码行数:60,代码来源:status_cat.php
示例2: addEditProg
function addEditProg($lSPID)
{
if (!bTestForURLHack('adminOnly')) {
return;
}
$displayData = array();
$displayData['lSPID'] = $lSPID = (int) $lSPID;
$displayData['bNew'] = $bNew = $lSPID <= 0;
//----------------------------
// validation rules
//----------------------------
$this->form_validation->set_error_delimiters('<div class="formError">', '</div>');
$this->form_validation->set_rules('txtProg', 'Program Name', 'trim|callback_sponProgBlankTest|callback_sponProgDupTest[' . $lSPID . ']');
$this->form_validation->set_rules('txtCommit', 'Commitment Amount', 'trim|required|callback_stripCommas|numeric|greater_than[-0.01]');
$this->form_validation->set_rules('rdoACO', 'Accounting Country', 'trim|callback_sponProgAcctCountry');
$this->load->model('sponsorship/msponsorship_programs', 'clsSponProg');
$this->load->model('admin/madmin_aco', 'clsACO');
$this->clsSponProg->lSPID = $lSPID;
$this->clsSponProg->loadSponProgsGeneric(true);
if ($this->form_validation->run() == FALSE) {
$this->load->library('generic_form');
if (validation_errors() == '') {
$displayData['strSponProg'] = htmlspecialchars($this->clsSponProg->sponProgs[0]->strProg);
$displayData['strACORadio'] = $this->clsACO->strACO_Radios($this->clsSponProg->sponProgs[0]->lACO, 'rdoACO');
$displayData['curDefMonthlyCommit'] = $this->clsSponProg->sponProgs[0]->curDefMonthlyCommit;
} else {
setOnFormError($displayData);
$displayData['strSponProg'] = set_value('txtProg');
$displayData['strACORadio'] = $this->clsACO->strACO_Radios(set_value('rdoACO'), 'rdoACO');
$displayData['curDefMonthlyCommit'] = set_value('txtCommit');
}
//----------------------
// set breadcrumbs
//----------------------
$displayData['nav'] = $this->mnav_brain_jar->navData();
$displayData['title'] = CS_PROGNAME . ' | Groups';
$displayData['pageTitle'] = anchor('main/menu/admin', 'Admin', 'class="breadcrumb"') . ' | ' . anchor('admin/alists/showLists', 'Lists', 'class="breadcrumb"') . ' | ' . anchor('admin/admin_special_lists/sponsorship_lists/sponProgView', 'Sponsorship Programs', 'class="breadcrumb"') . ' | ' . ($bNew ? 'Add New' : 'Edit');
$displayData['mainTemplate'] = 'sponsorship/spon_prog_add_edit';
$this->load->vars($displayData);
$this->load->view('template');
} else {
$this->clsSponProg->sponProgs[0]->bDefault = false;
$this->clsSponProg->sponProgs[0]->strProg = xss_clean($_POST['txtProg']);
$this->clsSponProg->sponProgs[0]->strNotes = '';
$this->clsSponProg->sponProgs[0]->curDefMonthlyCommit = (double) $_POST['txtCommit'];
$this->clsSponProg->sponProgs[0]->lACO = (int) $_POST['rdoACO'];
if ($bNew) {
$id = $this->clsSponProg->addNewSponProgram();
$this->session->set_flashdata('msg', 'Your sponsorship program was added');
} else {
$this->clsSponProg->sponProgs[0]->lKeyID = $lSPID;
$this->clsSponProg->updateSponProgram();
$this->session->set_flashdata('msg', 'Your sponsorship program was updated');
}
redirect('admin/admin_special_lists/sponsorship_lists/sponProgView');
}
}
开发者ID:simple-gifts,项目名称:Delightful-Labor,代码行数:57,代码来源:sponsorship_lists.php
示例3: searchOpts
function searchOpts($strViaAvailRpt = 'false')
{
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
if (!bTestForURLHack('showClients')) {
return;
}
$displayData = array();
$displayData['bViaAvailRpt'] = $bViaAvailRpt = $strViaAvailRpt == 'true';
//--------------------------------------------
// models/helpers
//--------------------------------------------
$this->load->library('Generic_form');
$this->load->helper('dl_util/web_layout');
$this->load->model('sponsorship/msponsorship_programs', 'clsSponProg');
$displayData['strSponProgDDL'] = $this->clsSponProg->strSponProgramDDL(-1);
//--------------------------
// validation rules
//--------------------------
$this->form_validation->set_error_delimiters('<div class="formError">', '</div>');
if (!$bViaAvailRpt) {
$this->form_validation->set_rules('txtSearch1', 'Client ID', 'trim|required|greater_than[0]');
$this->form_validation->set_rules('txtSearch2', 'Search', 'trim|required');
for ($idx = 1; $idx <= 2; ++$idx) {
$displayData['formErr'][$idx] = '';
}
}
if ($this->form_validation->run() == FALSE) {
if (validation_errors() == '') {
} else {
setOnFormError($displayData);
$lSearchIDX = (int) $_POST['searchIdx'];
if (form_error('txtSearch' . $lSearchIDX) == '') {
$this->runSearchSetup($lSearchIDX);
} else {
$displayData['formErr'][$lSearchIDX] = form_error('txtSearch' . $lSearchIDX);
}
}
//--------------------------
// breadcrumbs
//--------------------------
if ($bViaAvailRpt) {
$displayData['pageTitle'] = anchor('main/menu/reports', 'Reports', 'class="breadcrumb"') . ' | Client Available for Sponsorship';
} else {
$displayData['pageTitle'] = anchor('main/menu/client', 'Clients', 'class="breadcrumb"') . ' | Client Search';
}
$displayData['title'] = CS_PROGNAME . ' | Clients';
$displayData['nav'] = $this->mnav_brain_jar->navData();
$displayData['mainTemplate'] = 'client/search_opts';
$this->load->vars($displayData);
$this->load->view('template');
} else {
$this->runSearchSetup((int) $_POST['searchIdx']);
}
}
开发者ID:simple-gifts,项目名称:Delightful-Labor,代码行数:56,代码来源:client_search.php
示例4: daOpts
function daOpts()
{
//---------------------------------------------------------------------
//
//---------------------------------------------------------------------
global $gdteNow, $gbDateFormatUS, $glChapterID;
$displayData = array();
$displayData['js'] = '';
//------------------------------------------------
// models, libraries and utilities
//------------------------------------------------
$this->load->helper('dl_util/web_layout');
$this->load->library('generic_form');
$this->load->helper('dl_util/time_date');
// time frame support
$this->load->helper('reports/date_range_def');
$this->load->helper('reports/date_range');
$this->load->library('js_build/java_joe_radio');
$this->load->model('util/mserial_objects', 'cSO');
$displayData['js'] .= $this->java_joe_radio->insertJavaJoeRadio() . $this->java_joe_radio->insertSetDateRadio();
tf_initDateRangeMenu($displayData['viewOpts']);
$this->initViewOpts($displayData['viewOpts']);
// validation rules
$this->setValidationRules($displayData['viewOpts']);
if ($this->form_validation->run() == FALSE) {
$displayData['frmLink'] = 'reports/pre_data_entry/daOpts';
$this->load->library('generic_form');
$displayData['viewOpts']->blockLabel = 'Data Entry Log';
if (validation_errors() == '') {
$displayData['strRdoSrc'] = 'client';
$displayData['strRdoGroup'] = 'individual';
$this->setInitialRptVal($displayData['viewOpts'], $displayData['formData']);
} else {
setOnFormError($displayData);
$this->setErrRptVal($displayData['viewOpts'], $displayData['formData']);
$displayData['strRdoSrc'] = set_value('rdoSrc');
$displayData['strRdoGroup'] = set_value('rdoGroup');
// time frame support
$this->de_setDEOptsOnFormError($displayData['viewOpts']);
}
// time frame support
$displayData['dateRanges'] = $strRange = tf_strDateRangeMenu($displayData['viewOpts']);
//--------------------------
// breadcrumbs
//--------------------------
$displayData['pageTitle'] = anchor('main/menu/reports', 'Reports', 'class="breadcrumb"') . ' | Data Entry Log';
$displayData['title'] = CS_PROGNAME . ' | Reports';
$displayData['nav'] = $this->mnav_brain_jar->navData();
$displayData['mainTemplate'] = 'reports/pre_data_entry_view';
$this->load->vars($displayData);
$this->load->view('template');
} else {
$reportID = $this->strDataEntryLogRpt($displayData['viewOpts'], CENUM_REPORTNAME_DATAENTRYLOG);
redirect('reports/pre_data_entry/run/' . $reportID);
}
}
开发者ID:simple-gifts,项目名称:Delightful-Labor,代码行数:56,代码来源:pre_data_entry.php
示例5: searchOpts
function searchOpts()
{
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
$displayData = array();
$displayData['formData'] = new stdClass();
//--------------------------------------------
// models/helpers
//--------------------------------------------
$this->load->library('Generic_form');
$this->load->helper('dl_util/web_layout');
$this->load->model('util/mlist_generic', 'clsList');
$this->clsList->enumListType = 'bizCat';
//--------------------------
// validation rules
//--------------------------
$this->form_validation->set_error_delimiters('<div class="formError">', '</div>');
$this->form_validation->set_rules('txtSearch1', 'Business ID', 'trim|required|greater_than[0]');
$this->form_validation->set_rules('txtSearch2', 'Search', 'trim|required');
$this->form_validation->set_rules('ddlBizCat', 'Business Category', 'trim|required');
for ($idx = 1; $idx <= 3; ++$idx) {
$displayData['formErr'][$idx] = '';
}
$displayData['formData']->strBizList = $this->clsList->strLoadListDDL('ddlBizCat', true, -1);
if ($this->form_validation->run() == FALSE) {
if (validation_errors() == '') {
} else {
setOnFormError($displayData);
$lSearchIDX = (int) $_POST['searchIdx'];
// test for special searches
if ($lSearchIDX == 3) {
} else {
if (form_error('txtSearch' . $lSearchIDX) == '') {
$this->runSearchSetup($lSearchIDX);
} else {
$displayData['formErr'][$lSearchIDX] = form_error('txtSearch' . $lSearchIDX);
}
}
}
//--------------------------
// breadcrumbs
//--------------------------
$displayData['pageTitle'] = anchor('main/menu/biz', 'Businesses/Organizations', 'class="breadcrumb"') . ' | Business Search';
$displayData['title'] = CS_PROGNAME . ' | People';
$displayData['nav'] = $this->mnav_brain_jar->navData();
$displayData['mainTemplate'] = 'biz/search_opts_view';
$this->load->vars($displayData);
$this->load->view('template');
} else {
$this->runSearchSetup((int) $_POST['searchIdx']);
}
}
开发者ID:simple-gifts,项目名称:Delightful-Labor,代码行数:53,代码来源:biz_search.php
示例6: searchOpts
function searchOpts()
{
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
$displayData = array();
//--------------------------------------------
// models/helpers
//--------------------------------------------
$this->load->library('Generic_form');
$this->load->helper('dl_util/web_layout');
//--------------------------
// validation rules
//--------------------------
$this->form_validation->set_error_delimiters('<div class="formError">', '</div>');
$this->form_validation->set_rules('txtSearch1', 'People ID', 'trim|required|greater_than[0]');
$this->form_validation->set_rules('txtSearch2', 'Search', 'trim|required');
$this->form_validation->set_rules('txtSearch3', 'Search', 'trim|required');
$this->form_validation->set_rules('txtSearch4', 'Search', 'trim|required');
$this->form_validation->set_rules('txtSearch5', 'Search', 'trim|required');
$this->form_validation->set_rules('txtSearch6', 'Search', 'trim|required');
$this->form_validation->set_rules('txtSearch7', 'Search', 'trim|required');
for ($idx = 1; $idx <= 7; ++$idx) {
$displayData['formErr'][$idx] = '';
}
if ($this->form_validation->run() == FALSE) {
if (validation_errors() == '') {
} else {
setOnFormError($displayData);
$lSearchIDX = (int) $_POST['searchIdx'];
if (form_error('txtSearch' . $lSearchIDX) == '') {
$this->runSearchSetup($lSearchIDX);
} else {
$displayData['formErr'][$lSearchIDX] = form_error('txtSearch' . $lSearchIDX);
}
}
//--------------------------
// breadcrumbs
//--------------------------
$displayData['pageTitle'] = anchor('main/menu/people', 'People', 'class="breadcrumb"') . ' | People Search';
$displayData['title'] = CS_PROGNAME . ' | People';
$displayData['nav'] = $this->mnav_brain_jar->navData();
$displayData['mainTemplate'] = 'people/search_opts_view';
$this->load->vars($displayData);
$this->load->view('template');
} else {
$this->runSearchSetup((int) $_POST['searchIdx']);
}
}
开发者ID:simple-gifts,项目名称:Delightful-Labor,代码行数:49,代码来源:people_search.php
示例7: pw
function pw()
{
//---------------------------------------------------------------------
//
//---------------------------------------------------------------------
global $glUserID, $gbVolLogin;
$displayData = array();
$this->load->model('admin/muser_accts', 'clsUser');
$this->load->helper('dl_util/web_layout');
$this->load->library('generic_form');
//--------------------------
// validation rules
//--------------------------
$this->form_validation->set_error_delimiters('<div class="formError">', '</div>');
$this->form_validation->set_rules('txtPWord', 'Current Password', 'trim|required|callback_verifyGoodPW');
$this->form_validation->set_rules('txtPWord1', 'Password', 'trim|required|callback_verifyPWordMatch');
$this->form_validation->set_rules('txtPWord2', 'Password (again)', 'trim');
if ($this->form_validation->run() == FALSE) {
if (validation_errors() == '') {
} else {
setOnFormError($displayData);
}
//--------------------------
// breadcrumbs
//--------------------------
if ($gbVolLogin) {
$displayData['pageTitle'] = 'Change Password';
} else {
$displayData['pageTitle'] = anchor('main/menu/more', 'More', 'class="breadcrumb"') . ' | Change Password';
}
$displayData['title'] = CS_PROGNAME . ' | More';
$displayData['nav'] = $this->mnav_brain_jar->navData();
$displayData['mainTemplate'] = 'more/change_password_view';
$this->load->vars($displayData);
$this->load->view('template');
} else {
$strPWord = trim($_POST['txtPWord1']);
$this->clsUser->changePWord($glUserID, $strPWord);
$this->session->set_flashdata('msg', 'Your password was changed.');
if ($gbVolLogin) {
redirect_VolLoginGeneric();
} else {
redirect_userAcct();
}
}
}
开发者ID:simple-gifts,项目名称:Delightful-Labor,代码行数:46,代码来源:user_acct.php
示例8: opts
function opts()
{
//---------------------------------------------------------------------
//
//---------------------------------------------------------------------
global $gdteNow;
if (!bTestForURLHack('volMgr')) {
return;
}
$displayData = array();
$displayData['js'] = '';
//------------------------------------------------
// libraries and utilities
//------------------------------------------------
$this->load->helper('dl_util/web_layout');
$this->load->helper('dl_util/time_date');
$this->load->helper('js/jq_month_picker');
// validation rules
$this->form_validation->set_error_delimiters('<div class="formError">', '</div>');
$this->form_validation->set_rules('txtMonth', 'Report starting month', 'trim|required|callback_eventsStartMonth');
$this->form_validation->set_rules('ddlDuration', '# of months', 'trim');
if ($this->form_validation->run() == FALSE) {
$this->load->library('generic_form');
if (validation_errors() == '') {
$displayData['txtMonth'] = date('m/Y', $gdteNow);
} else {
setOnFormError($displayData);
$displayData['txtMonth'] = set_value('txtMonth');
}
//------------------------------------------------
// breadcrumbs / page setup
//------------------------------------------------
$displayData['js'] .= strMonthPicker(true);
$displayData['mainTemplate'] = 'hospice/reports/monthly_options_view';
$displayData['pageTitle'] = 'Monthly Volunteer Report Options';
$displayData['title'] = CS_PROGNAME . ' | Reports';
$displayData['nav'] = $this->mnav_brain_jar->navData();
$this->load->vars($displayData);
$this->load->view('template');
} else {
$moYr = explode('/', $_POST['txtMonth']);
$lMonth = (int) $moYr[0];
$lYear = (int) $moYr[1];
redirect('hospice/reports/monthly/runMonthlyReport/' . $lMonth . '/' . $lYear);
}
}
开发者ID:nhom5UET,项目名称:tichhophethong,代码行数:46,代码来源:monthly.php
示例9: viewEventsCalendar
function viewEventsCalendar()
{
//---------------------------------------------------------------------
//
//---------------------------------------------------------------------
global $gdteNow;
$displayData = array();
$displayData['js'] = '';
//------------------------------------------------
// libraries and utilities
//------------------------------------------------
$this->load->helper('dl_util/web_layout');
$this->load->helper('dl_util/time_date');
$this->load->helper('js/jq_month_picker');
// validation rules
$this->form_validation->set_error_delimiters('<div class="formError">', '</div>');
$this->form_validation->set_rules('txtMonth', 'Report starting month', 'trim|required|callback_eventsStartMonth');
$this->form_validation->set_rules('ddlDuration', '# of months', 'trim');
if ($this->form_validation->run() == FALSE) {
$this->load->library('generic_form');
if (validation_errors() == '') {
$displayData['txtMonth'] = date('m/Y', $gdteNow);
$displayData['lDuration'] = 3;
} else {
setOnFormError($displayData);
$displayData['txtMonth'] = set_value('txtMonth');
$displayData['lDuration'] = (int) set_value('ddlDuration');
}
//------------------------------------------------
// breadcrumbs / page setup
//------------------------------------------------
$displayData['js'] .= strMonthPicker(true);
$displayData['mainTemplate'] = 'vols/event_cal_view';
$displayData['pageTitle'] = anchor('main/menu/vols', 'Volunteers', 'class="breadcrumb"') . ' | Event Calendar';
$displayData['title'] = CS_PROGNAME . ' | Volunteers | Events Calendar';
$displayData['nav'] = $this->mnav_brain_jar->navData();
$this->load->vars($displayData);
$this->load->view('template');
} else {
$moYr = explode('/', $_POST['txtMonth']);
$lMonth = (int) $moYr[0];
$lYear = (int) $moYr[1];
$this->eventCal((int) $_POST['ddlDuration'], $lMonth, $lYear);
}
}
开发者ID:simple-gifts,项目名称:Delightful-Labor,代码行数:45,代码来源:events_cal.php
示例10: opts
public function opts()
{
//---------------------------------------------------------------------
//
//---------------------------------------------------------------------
if (!bTestForURLHack('showClients')) {
return;
}
// models and helpers
$this->load->helper('dl_util/web_layout');
$this->load->library('util/dl_date_time', '', 'clsDateTime');
$this->load->model('clients/mclients', 'clsClients');
// validation rules
$this->form_validation->set_error_delimiters('<div class="formError">', '</div>');
$this->form_validation->set_rules('txtGoodCID', '"Correct" Client ID', 'trim|required|callback_verifyGoodCID');
$this->form_validation->set_rules('txtBadCIDs', 'Duplicate Client IDs', 'trim|required|callback_verifyDupCID');
if ($this->form_validation->run() == FALSE) {
$displayData['formData'] = new stdClass();
$this->load->library('generic_form');
if (validation_errors() == '') {
$displayData['formData']->txtGoodCID = '';
$displayData['formData']->txtBadCIDs = '';
} else {
setOnFormError($displayData);
$displayData['formData']->txtGoodCID = set_value('txtGoodCID');
$displayData['formData']->txtBadCIDs = set_value('txtBadCIDs');
}
//--------------------------
// breadcrumbs
//--------------------------
$displayData['pageTitle'] = anchor('main/menu/client', 'Clients', 'class="breadcrumb"') . ' | Client Duplicates';
$displayData['title'] = CS_PROGNAME . ' | Clients';
$displayData['nav'] = $this->mnav_brain_jar->navData();
$displayData['mainTemplate'] = 'client/client_dup_opts_view';
$this->load->vars($displayData);
$this->load->view('template');
} else {
$reportID = $this->strClientDupRpt();
redirect('clients/client_dups/review/' . $reportID);
}
}
开发者ID:simple-gifts,项目名称:Delightful-Labor,代码行数:41,代码来源:client_dups.php
示例11: deactivate
function deactivate($lSponID)
{
//---------------------------------------------------------------------
//
//---------------------------------------------------------------------
global $gstrFormatDatePicker, $gdteNow, $gbDateFormatUS;
if (!bTestForURLHack('showSponsors')) {
return;
}
$this->load->helper('dl_util/verify_id');
verifyID($this, $lSponID, 'sponsor ID');
$displayData = array();
$displayData['formData'] = new stdClass();
$displayData['lSponID'] = $lSponID = (int) $lSponID;
//-------------------------
// models & helpers
//-------------------------
$this->load->helper('dl_util/time_date');
// for date verification
$params = array('enumStyle' => 'terse');
$this->load->library('generic_rpt', $params);
$this->load->model('sponsorship/msponsorship', 'clsSpon');
$this->load->model('admin/madmin_aco', 'clsACO');
$this->load->helper('dl_util/web_layout');
$this->load->library('util/dl_date_time', '', 'clsDateTime');
$this->clsSpon->sponsorInfoViaID($lSponID);
//-------------------------
// validation rules
//-------------------------
$this->form_validation->set_error_delimiters('<div class="formError">', '</div>');
$this->form_validation->set_rules('ddlTermReason', 'Termination reason', 'trim|callback_sponDeactivateTermType');
$this->form_validation->set_rules('txtDate', 'My date', 'trim|required' . '|callback_sponDeactivateDateValid');
if ($this->form_validation->run() == FALSE) {
$this->load->library('generic_form');
$displayData['clsForm'] =& $this->generic_form;
$this->load->model('util/mlist_generic', 'clsList');
$this->clsList->enumListType = CENUM_LISTTYPE_SPONTERMCAT;
// first time displayed, no user data entry errors
if (validation_errors() == '') {
$displayData['txtDate'] = date($gstrFormatDatePicker, $gdteNow);
$displayData['strTermList'] = $this->clsList->strLoadListDDL('ddlTermReason', true, -1);
} else {
setOnFormError($displayData);
$displayData['formData']->txtField1 = set_value('txtField1');
$displayData['txtDate'] = set_value('txtDate');
$displayData['strTermList'] = $this->clsList->strLoadListDDL('ddlTermReason', true, set_value('ddlTermReason'));
}
//--------------------------
// breadcrumbs
//--------------------------
$displayData['contextSummary'] = $this->clsSpon->sponsorshipHTMLSummary();
$displayData['pageTitle'] = anchor('main/menu/sponsorship', 'Sponsorship', 'class="breadcrumb"') . ' | ' . anchor('sponsors/view_spon_rec/viewViaSponID/' . $lSponID, 'Sponsorship Record', 'class="breadcrumb"') . ' | Terminate Sponsorship';
$displayData['title'] = CS_PROGNAME . ' | Sponsorship';
$displayData['nav'] = $this->mnav_brain_jar->navData();
$displayData['mainTemplate'] = 'sponsorship/deactivate_view';
$this->load->vars($displayData);
$this->load->view('template');
} else {
$lDeactivateReason = (int) trim($_POST['ddlTermReason']);
$strDate = trim($_POST['txtDate']);
MDY_ViaUserForm($strDate, $lMon, $lDay, $lYear, $gbDateFormatUS);
$dteDeactivate = strtotime($lMon . '/' . $lDay . '/' . $lYear);
$this->clsSpon->inactivateSponsorship($lSponID, $dteDeactivate, $lDeactivateReason);
$this->session->set_flashdata('msg', 'The sponsorship was deactivated.');
redirect_SponsorshipRecord($lSponID);
}
}
开发者ID:simple-gifts,项目名称:Delightful-Labor,代码行数:67,代码来源:add_edit_sponsorship.php
示例12: addEditTST
function addEditTST($lTSTID)
{
//---------------------------------------------------------------------
//
//---------------------------------------------------------------------
if (!bAllowAccess('adminOnly')) {
return;
}
$displayData = array();
$displayData['js'] = '';
$displayData['lTSTID'] = $lTSTID = (int) $lTSTID;
$displayData['bNew'] = $bNew = $lTSTID <= 0;
//-------------------------
// models & helpers
//-------------------------
$this->load->helper('staff/link_staff');
$this->load->helper('dl_util/web_layout');
$this->load->model('staff/mtime_sheets', 'cts');
$this->load->helper('staff/timesheet');
if ($bNew) {
$tst = new stdClass();
} else {
$this->cts->loadTimeSheetTemplateViaTSTID($lTSTID);
$displayData['tst'] = $tst =& $this->cts->timeSheetTemplates[0];
}
//-------------------------
// validation rules
//-------------------------
$this->form_validation->set_error_delimiters('<div class="formError">', '</div>');
$this->form_validation->set_rules('txtTemplateName', 'Template Name', 'trim|required|callback_verifyUniqueTemplate[' . $lTSTID . ']');
if ($bNew) {
$this->form_validation->set_rules('ddlTP', 'Time Period', 'callback_verifyDDLSet');
$this->form_validation->set_rules('ddlStart', 'Starting Day of Week', 'callback_verifyStartDOW');
}
$this->form_validation->set_rules('ddlTimeGrain', 'Time Granularity', 'callback_verifyDDLSet');
$this->form_validation->set_rules('chk24Hour', '24-Hour Format', '');
$this->form_validation->set_rules('chkHidden', 'Hidden', '');
$this->form_validation->set_rules('txtNotes', 'Notes', 'trim');
$this->form_validation->set_rules('txtAck', 'Acknowledgement Text', 'trim');
if ($this->form_validation->run() == FALSE) {
$displayData['formData'] = new stdClass();
$this->load->library('generic_form');
// first time displayed, no user data entry errors
if (validation_errors() == '') {
if ($bNew) {
$displayData['formData']->txtTemplateName = '';
$displayData['formData']->txtNotes = '';
$displayData['formData']->txtAck = '';
$displayData['formData']->b24HrTime = false;
$displayData['formData']->strTimePeriodDDL = ts_util\strTimePeriodDDL('ddlTP', true, -1);
$displayData['formData']->strStartSOWDDL = ts_util\strDaysOfWeekDDL('ddlStart', true, -1);
$displayData['formData']->strTimeGrainDDL = ts_util\strTimeGrainularityDDL('ddlTimeGrain', true, -1);
} else {
$displayData['formData']->txtTemplateName = $tst->strTSName;
$displayData['formData']->txtNotes = $tst->strNotes;
$displayData['formData']->txtAck = $tst->strAckText;
$displayData['formData']->b24HrTime = $tst->b24HrTime;
$displayData['formData']->bHidden = $tst->bHidden;
$displayData['formData']->strTimePeriodDDL = ts_util\strTimePeriodDDL('ddlTP', true, $tst->enumRptPeriod);
$displayData['formData']->strStartSOWDDL = ts_util\strDaysOfWeekDDL('ddlStart', true, $tst->lFirstDayOfWeek);
$displayData['formData']->strTimeGrainDDL = ts_util\strTimeGrainularityDDL('ddlTimeGrain', true, (int) $tst->enumGranularity);
}
} else {
setOnFormError($displayData);
$displayData['formData']->txtTemplateName = set_value('txtTemplateName');
$displayData['formData']->txtNotes = set_value('txtNotes');
$displayData['formData']->txtAck = set_value('txtAck');
$displayData['formData']->b24HrTime = set_value('chk24Hour') == 'true';
$displayData['formData']->bHidden = set_value('chkHidden') == 'true';
$displayData['formData']->strTimePeriodDDL = ts_util\strTimePeriodDDL('ddlTP', true, @$_POST['ddlTP']);
$displayData['formData']->strStartSOWDDL = ts_util\strDaysOfWeekDDL('ddlStart', true, (int) @$_POST['ddlStart']);
$displayData['formData']->strTimeGrainDDL = ts_util\strTimeGrainularityDDL('ddlTimeGrain', true, (int) @$_POST['ddlTimeGrain']);
}
//--------------------------
// breadcrumbs
//--------------------------
$displayData['pageTitle'] = anchor('main/menu/admin', 'Admin', 'class="breadcrumb"') . ' | ' . anchor('admin/timesheets/view_tst_record/viewTSTList', 'Staff Time Sheet Templates', 'class="breadcrumb"') . ' | ' . ($bNew ? 'Add New' : 'Edit') . ' Time Sheet Template';
$displayData['title'] = CS_PROGNAME . ' | Admin';
$displayData['nav'] = $this->mnav_brain_jar->navData();
$displayData['mainTemplate'] = 'admin/staff_tst_add_edit_view';
$this->load->vars($displayData);
$this->load->view('template');
} else {
$this->cts->timeSheetTemplates = array();
$this->cts->timeSheetTemplates[0] = new stdClass();
$outTst =& $this->cts->timeSheetTemplates[0];
$outTst->strTSName = trim($_POST['txtTemplateName']);
if ($bNew) {
$outTst->enumRptPeriod = trim($_POST['ddlTP']);
$outTst->lFirstDayOfWeek = (int) trim($_POST['ddlStart']);
} else {
$outTst->enumRptPeriod = $tst->enumRptPeriod;
$outTst->lFirstDayOfWeek = $tst->lFirstDayOfWeek;
}
$outTst->enumGranularity = (int) trim($_POST['ddlTimeGrain']);
$outTst->b24HrTime = trim(@$_POST['chk24Hour']) == 'true';
$outTst->bHidden = trim(@$_POST['chkHidden']) == 'true';
$outTst->strNotes = trim($_POST['txtNotes']);
$outTst->strAckText = trim($_POST['txtAck']);
//------------------------------------
//.........这里部分代码省略.........
开发者ID:simple-gifts,项目名称:Delightful-Labor,代码行数:101,代码来源:add_edit_tst_record.php
示例13: addEditEvent
function addEditEvent($lEventID)
{
//---------------------------------------------------------------------
//
//---------------------------------------------------------------------
global $gdteNow, $gbDateFormatUS;
if (!bTestForURLHack('editPeopleBizVol')) {
return;
}
$this->load->helper('dl_util/verify_id');
if ($lEventID . '' != '0') {
verifyID($this, $lEventID, 'event ID');
}
$displayData = array();
$displayData['formData'] = new stdClass();
$displayData['lEventID'] = $lEventID = (int) $lEventID;
$displayData['bNew'] = $bNew = $lEventID <= 0;
$displayData['js'] = '';
/*
//-------------------------------
// javascript verification
//-------------------------------
$this->load->library('js_build/js_verify');
$this->load->helper('js/verify_vol_event');
$this->load->helper('js/verify_recurring');
$this->load->helper('dl_util/page_title');
$this->js_verify = new js_verify;
$this->js_verify->clearEmbedOpts();
$this->js_verify->bShow_isValidDate =
$this->js_verify->bShow_bVerifyString =
$this->js_verify->bShow_bVerifyRadio =
$this->js_verify->bShow_strRadioSelValue =
$this->js_verify->bShow_trim = true;
$displayData['js'] .= $this->js_verify->loadJavaVerify();
$displayData['js'] .= volEventVerify();
$displayData['js'] .= verifyRecurring();
*/
//-------------------------
// models & helpers
//-------------------------
$this->load->helper('dl_util/time_date');
// for date verification
$this->load->library('generic_form');
$clsForm = new generic_form();
// note - this form uses javascript verification due to the recurring options
// (may be replaced by CI verification in the future)
$this->load->model('vols/mvol_events', 'clsVolEvents');
$this->load->model('vols/mvol_event_dates', 'clsVolEventDates');
$this->load->model('util/mrecurring', 'clsRecurring');
$this->load->helper('dl_util/recurring');
$this->load->helper('dl_util/web_layout');
$this->load->library('js_build/java_joe_radio');
$clsJJR = new java_joe_radio();
//-------------------------
// validation rules
//-------------------------
$this->form_validation->set_error_delimiters('<div class="formError">', '</div>');
$this->form_validation->set_rules('txtEvent', 'Event Name', 'trim|required');
$this->form_validation->set_rules('txtNote', 'Decscription', 'trim');
$this->form_validation->set_rules('txtLocation', 'Location', 'trim');
$this->form_validation->set_rules('txtContact', 'Contact', 'trim');
$this->form_validation->set_rules('txtPhone', 'Phone', 'trim');
$this->form_validation->set_rules('txtEmail', 'EMail', 'trim|valid_email');
$this->form_validation->set_rules('txtWebLink', 'Web Site', 'trim');
if ($bNew) {
$this->form_validation->set_rules('txtStart', 'Starting Date', 'trim|required|callback_verifyRecurring');
}
$this->clsVolEvents->loadEventsViaEID($lEventID);
$event = $this->clsVolEvents->events[0];
if ($this->form_validation->run() == FALSE) {
$displayData['formData'] = new stdClass();
$this->load->library('generic_form');
$displayData['clsForm'] =& $clsForm;
$displayData['strForm'] = $strForm = 'frmEditVolEvent';
// first time displayed, no user data entry errors
if (validation_errors() == '') {
$displayData['formData']->strEventName = htmlspecialchars($event->strEventName);
$displayData['formData']->strDescription = htmlspecialchars($event->strDescription);
$displayData['formData']->strLocation = htmlspecialchars($event->strLocation);
$displayData['formData']->strContact = htmlspecialchars($event->strContact);
$displayData['formData']->strPhone = htmlspecialchars($event->strPhone);
$displayData['formData']->strEmail = htmlspecialchars($event->strEmail);
$displayData['formData']->strWebSite = htmlspecialchars($event->strWebSite);
if ($bNew) {
$strDate = strNumericDateViaUTS($gdteNow, $gbDateFormatUS);
$selects = null;
$displayData['recurringOpts'] = strRecurringOpts($displayData, $clsForm, $selects, $strForm, $clsJJR, $strDate, $this->clsRecurring, 'txtStart', 'Event on', 'Event Schedule', 'Event on');
}
} else {
setOnFormError($displayData);
$strDate = set_value('txtStart');
$displayData['formData']->strEventName = set_value('txtEvent');
$displayData['formData']->strDescription = set_value('txtNote');
$displayData['formData']->strLocation = set_value('txtLocation');
$displayData['formData']->strContact = set_value('txtContact');
$displayData['formData']->strPhone = set_value('txtPhone');
$displayData['formData']->strEmail = set_value('txtEmail');
$displayData['formData']->strWebSite = set_value('txtWebLink');
if ($bNew) {
$selects = new stdClass();
//.........这里部分代码省略.........
开发者ID:simple-gifts,项目名称:Delightful-Labor,代码行数:101,代码来源:events_add_edit.php
示例14: addEditRegForm
//.........这里部分代码省略.........
$displayData['formData']->txtVolCoordinatorEmail = htmlspecialchars($rRec->strContactEmail);
$displayData['formData']->bCaptchaRequired = $rRec->bCaptchaRequired;
$displayData['formData']->bPermContactInfo = $rRec->bPermEditContact;
$displayData['formData']->bPermPassReset = $rRec->bPermPassReset;
$displayData['formData']->bPermGiftHistory = $rRec->bPermViewGiftHistory;
$displayData['formData']->bPermJobSkills = $rRec->bPermEditJobSkills;
$displayData['formData']->bPermViewVolLog = $rRec->bPermViewHrsHistory;
$displayData['formData']->bPermAddVolHrs = $rRec->bPermAddVolHours;
$displayData['formData']->bVolShiftSignup = $rRec->bVolShiftSignup;
$displayData['formData']->bShowAddr = $rRec->bShowAddr;
$displayData['formData']->bAddrRequired = $rRec->bAddrRequired;
$displayData['formData']->bShowEmail = $rRec->bShowEmail;
$displayData['formData']->bEmailRequired = $rRec->bEmailRequired;
$displayData['formData']->bShowPhone = $rRec->bShowPhone;
$displayData['formData']->bPhoneRequired = $rRec->bPhoneRequired;
$displayData['formData']->bShowCell = $rRec->bShowCell;
$displayData['formData']->bCellRequired = $rRec->bCellRequired;
$displayData['formData']->bShowBDay = $rRec->bShowBDay;
$displayData['formData']->bBDayRequired = $rRec->bBDateRequired;
$displayData['formData']->bShowDisclaimer = $rRec->bShowDisclaimer;
$displayData['formData']->txtDisclaimer = $rRec->strDisclaimer;
$displayData['formData']->txtDisclaimerAck = $rRec->strDisclaimerAck;
$displayData['formData']->strDDLCSS = $this->volReg->strCSSDropDown('ddlCSS', $rRec->strCSSFN, false);
$lLogoID = $rRec->lLogoImageID;
if ($lNumSkills > 0) {
foreach ($jobSkills as $skill) {
$skill->bShow = $skill->bOnForm;
}
}
}
// volunteer group ddl
$displayData['formData']->ddlVolGroup = $this->groups->strDDLAc
|
请发表评论