function showCheckInForm($clsForm, $item, $CICOrec, $formData, $strCICO_ID) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- global $genumDateFormat; openBlock('Check Out / Loan Inventory Item', ''); echoT('<table class="enpView">'); echoT($clsForm->strLabelRow('historyID', $strCICO_ID, 1)); echoT($clsForm->strLabelRow('Item', htmlspecialchars($item->strItemName), 1)); //---------------------- // Checked Out To //---------------------- echoT($clsForm->strLabelRow('Checked out to', htmlspecialchars($CICOrec->strCheckedOutTo), 1)); //---------------------- // Deposit //---------------------- echoT($clsForm->strLabelRow('Deposit', htmlspecialchars($CICOrec->strSecurity), 1)); //---------------------- // Date checked out //---------------------- echoT($clsForm->strLabelRow('Date checked out', date($genumDateFormat, $CICOrec->dteCheckedOut), 1)); //---------------------- // Date Returned //---------------------- echoT(strDatePicker('datepicker1', true, 1970)); $clsForm->strExtraFieldText = form_error('txtDateCICO'); echoT($clsForm->strGenericDatePicker('Date Checked In', 'txtDateCICO', true, $formData->txtDateCICO, 'frmCICO', 'datepicker1')); //---------------------- // Notes //---------------------- $clsForm->strExtraFieldText = form_error('txtCI_Notes'); $clsForm->strStyleExtraLabel = 'padding-top: 4px;'; echoT($clsForm->strNotesEntry('Check-in Notes', 'txtCI_Notes', false, $formData->txtCI_Notes, 3, 50)); }
function strRecurringOpts(&$displayData, &$clsForm, $selects, &$strForm, &$javaJoeRadio, $strDate, &$clsRecurring, $strDateField, $strDateLabel, $strRecurLabel, $strRecurringLabel) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- global $gbDateFormatUS; $strOut = ''; $clsForm->bValueEscapeHTML = false; $clsForm->strLabelClass = $clsForm->strLabelRowLabelClass = $clsForm->strLabelClassRequired = 'enpViewLabel'; $clsForm->strEntryClass = 'enpView'; $clsForm->strStyleExtraLabel = 'width: 100pt;'; $displayData['js'] .= strDatePicker('datepickerFuture', true, 2010); $displayData['js'] .= $javaJoeRadio->insertJavaJoeRadio(); //----------------------------- // hide/show recurring opts //----------------------------- /* $displayData['js'] .= ' <script type="text/javascript"> function unhide(divID) { var item = document.getElementById(divID); if (item) item.style.display=\'block\'; var item2 = document.getElementById(\'hrefShow\'); if (item2) item2.style.display=\'none\'; } </script> '; */ $clsForm->strExtraFieldText = form_error('txtStart'); $strOut .= $clsForm->strGenericDatePicker($strDateLabel, 'txtStart', true, $strDate, $strForm, 'datepickerFuture', ''); $clsRecurring->strRecurLabel = $strRecurringLabel; //'Display'; $strOut .= $clsForm->strLabelRow($strRecurLabel, $clsRecurring->strRecurringTable($strForm, $selects), 1, ' '); return $strOut; }
function showTest(&$clsForm, $strDatePickerName, $strDateFN, $strDateLabel, $strDateVal, $strFormName, &$QandA, $bPretest) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- $strPrePostLabel = $bPretest ? 'Pre' : 'Post'; $strDivName = 'divChk' . $strPrePostLabel; $strOut = ''; //-------------------------- // Pre/post-test date //-------------------------- $clsForm->strStyleExtraLabel = 'padding-top: 8px;'; echoT(strDatePicker($strDatePickerName, true)); $clsForm->strExtraFieldText = form_error($strDateFN); echoT($clsForm->strGenericDatePicker($strDateLabel, $strDateFN, true, $strDateVal, $strFormName, $strDatePickerName)); $strOut .= '<div id="' . $strDivName . '">'; $strOut .= '<table width="500"> <tr> <td style="text-align: center; width: 40pt;"> Check if<br> Correct </td> <td style="width: 20pt;"> </td> <td> <input type="button" value="Check All" onclick="checkByParent(\'' . $strDivName . '\', true);"> <input type="button" value="Uncheck All" onclick="checkByParent(\'' . $strDivName . '\', false);"> </tr>'; $idx = 1; foreach ($QandA as $QA) { $lQuestID = $QA->lKeyID; if ($bPretest) { $bCorrect = $QA->bPreTestRight; } else { $bCorrect = $QA->bPostTestRight; } $strOut .= '<tr class="makeStripe"> <td style="text-align: center; vertical-align: top;"> <input type="checkbox" name="chk' . $strPrePostLabel . $lQuestID . '" value="true" ' . ($bCorrect ? 'checked' : '') . '> </td> <td style="text-align: center; vertical-align: top;">' . $idx . ' </td> <td style="text-align: left; vertical-align: top;"><b>Q: </b>' . nl2br(htmlspecialchars($QA->strQuestion)) . '<br><br><b>A: </b><i>' . nl2br(htmlspecialchars($QA->strAnswer)) . '</i><br><br> </td> </tr>'; ++$idx; } $strOut .= '</table></div>'; echoT($clsForm->strLabelRow($strPrePostLabel . '-test', $strOut, 1)); }
//------------------------------- // Accounting country of Origin //------------------------------- $clsForm->strStyleExtraLabel = 'vertical-align: middle; width: 100pt; '; echoT($clsForm->strLabelRow('Accounting Country', $formData->strACORadio, 1)); //---------------------- // report start //---------------------- $clsForm->strStyleExtraLabel = 'vertical-align: top; padding-top: 6pt; '; echoT(strDatePicker('datepicker1', false)); $clsForm->strExtraFieldText = form_error('txtSDate'); echoT($clsForm->strGenericDatePicker('Start', 'txtSDate', true, $txtSDate, 'frmNewDeposit', 'datepicker1')); //---------------------- // report end //---------------------- echoT(strDatePicker('datepicker2', true)); $clsForm->strExtraFieldText = form_error('txtEDate'); echoT($clsForm->strGenericDatePicker('End', 'txtEDate', true, $txtEDate, 'frmNewDeposit', 'datepicker2')); //------------------------ // Bank //------------------------ $clsForm->strExtraFieldText = form_error('txtBank'); echoT($clsForm->strGenericTextEntry('Bank', 'txtBank', false, $formData->txtBank, 30, 80)); //------------------------ // Account //------------------------ $clsForm->strExtraFieldText = form_error('txtAccount'); echoT($clsForm->strGenericTextEntry('Account', 'txtAccount', false, $formData->txtAccount, 30, 80)); //---------------------- // Notes //----------------------
function addEditPayment($lPledgeID, $lGiftID, $dtePledge) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- global $gdteNow, $gbDateFormatUS, $gstrFormatDatePicker; $this->load->helper('dl_util/verify_id'); verifyID($this, $lPledgeID, 'pledge ID'); $displayData = array(); $displayData['lPledgeID'] = $lPledgeID = (int) $lPledgeID; $displayData['dtePledge'] = $dtePledge = (int) $dtePledge; $displayData['lGiftID'] = $lGiftID = (int) $lGiftID; $displayData['js'] = ''; if (!bTestForURLHack('dataEntryGifts')) { return; } $bNew = $lGiftID <= 0; // load models $params = array('enumStyle' => 'terse'); $this->load->library('generic_rpt', $params); $this->load->helper('dl_util/web_layout'); // $this->load->helper ('dl_util/email_web'); $this->load->helper('dl_util/time_date'); $this->load->model('admin/madmin_aco', 'clsACO'); $this->load->model('people/mpeople', 'clsPeople'); $this->load->model('biz/mbiz', 'clsBiz'); $this->load->model('donations/mdonations', 'clsGift'); $this->load->model('util/mlist_generic', 'clsList'); $this->load->model('donations/mpledges', 'clsPledges'); // load pledge $this->clsPledges->loadPledgeViaPledgeID($lPledgeID); $displayData['pledge'] = $pledge =& $this->clsPledges->pledges[0]; $bPeople = !$pledge->bBiz; $lFID = $pledge->lForeignID; // load gift associated with pledge $this->clsGift->loadGiftViaGID($lGiftID); $gifts =& $this->clsGift->gifts[0]; /* ------------------------------------- echo('<font class="debug">'.substr(__FILE__, strrpos(__FILE__, '\\')) .': '.__LINE__.'<br>$gifts <pre>'); echo(htmlspecialchars( print_r($gifts, true))); echo('</pre></font><br>'); // ------------------------------------- */ // validation rules $this->form_validation->set_error_delimiters('<div class="formError">', '</div>'); $this->form_validation->set_rules('txtAmount', 'Amount', 'trim|required|callback_stripCommas|numeric|callback_pledgeVerifyCommitment'); $this->form_validation->set_rules('txtDDate', 'Date', 'trim|required|callback_pledgeVerifyDateValid'); $this->form_validation->set_rules('txtNotes', 'Notes', 'trim'); $this->form_validation->set_rules('txtCheckNum', 'Check Number', 'trim'); $this->form_validation->set_rules('ddlPayType', 'Payment Type', 'callback_pledgeVerifyPayType'); $this->form_validation->set_rules('ddlGiftCat', 'Gift Category', 'trim'); $this->form_validation->set_rules('ddlAttrib', 'Attributed To', 'trim'); if ($this->form_validation->run() == FALSE) { $displayData['formData'] = new stdClass(); $this->load->library('generic_form'); $displayData['js'] .= strDatePicker('datepickerFuture', true); if (validation_errors() == '') { if ($bNew) { $displayData['formData']->strNotes = ''; $displayData['formData']->strCheckNum = ''; $displayData['formData']->txtDDate = date($gstrFormatDatePicker, $dtePledge); $displayData['formData']->txtAmount = number_format($pledge->curCommitment, 2, '.', ''); $this->clsList->strBlankDDLName = ' '; $this->clsList->enumListType = CENUM_LISTTYPE_GIFTPAYTYPE; $displayData['formData']->strDDLPayType = $this->clsList->strLoadListDDL('ddlPayType', true, -1); $this->clsList->enumListType = CENUM_LISTTYPE_MAJORGIFTCAT; $displayData['formData']->strDDLMajGiftType = $this->clsList->strLoadListDDL('ddlGiftCat', true, -1); } else { $displayData['formData']->strNotes = htmlspecialchars($gifts->strNotes); $displayData['formData']->strCheckNum = htmlspecialchars($gifts->gi_strCheckNum); $displayData['formData']->txtDDate = date($gstrFormatDatePicker, $gifts->gi_dteDonation); $displayData['formData']->txtAmount = number_format($gifts->gi_curAmnt, 2, '.', ''); $this->clsList->strBlankDDLName = ' '; $this->clsList->enumListType = CENUM_LISTTYPE_GIFTPAYTYPE; $displayData['formData']->strDDLPayType = $this->clsList->strLoadListDDL('ddlPayType', true, $gifts->gi_lPaymentType); $this->clsList->enumListType = CENUM_LISTTYPE_MAJORGIFTCAT; $displayData['formData']->strDDLMajGiftType = $this->clsList->strLoadListDDL('ddlGiftCat', true, $gifts->gi_lMajorGiftCat); } } else { setOnFormError($displayData); $displayData['formData']->txtDDate = set_value('txtDDate'); $displayData['formData']->txtAmount = set_value('txtAmount'); $displayData['formData']->strNotes = set_value('txtNotes'); $displayData['formData']->strCheckNum = set_value('txtCheckNum'); $this->clsList->strBlankDDLName = ' '; $this->clsList->enumListType = CENUM_LISTTYPE_GIFTPAYTYPE; $displayData['formData']->strDDLPayType = $this->clsList->strLoadListDDL('ddlPayType', true, set_value('ddlPayType')); $this->clsList->enumListType = CENUM_LISTTYPE_MAJORGIFTCAT; $displayData['formData']->strDDLMajGiftType = $this->clsList->strLoadListDDL('ddlGiftCat', true, set_value('ddlGiftCat')); } //-------------------------- // breadcrumbs //-------------------------- $displayData['mainTemplate'] = 'donations/pledge_payment_add_edit_view'; if ($bPeople) { $displayData['pageTitle'] = anchor('main/menu/people', 'People', 'class="breadcrumb"') . ' | ' . anchor('people/people_record/view/' . $lFID, 'Record', 'class="breadcrumb"') . ' | ' . ($bNew ? 'Add New' : 'Edit') . ' Pledge Payment'; $this->clsPeople->loadPeopleViaPIDs($lFID, false, false); $displayData['contextSummary'] = $this->clsPeople->peopleHTMLSummary(0); } else { $displayData['pageTitle'] = anchor('main/menu/biz', 'Businesses/Organizations', 'class="breadcrumb"') . ' | ' . anchor('biz/biz_record/view/' . $lFID, 'Record', 'class="breadcrumb"') . ' | ' . ($bNew ? 'Add New' : 'Edit') . ' Pledge Payment'; $this->clsBiz->loadBizRecsViaBID($lFID); $displayData['contextSummary'] = $this->clsBiz->strBizHTMLSummary(0); } $displayData['title'] = CS_PROGNAME . ' | Pledges'; $displayData['nav'] = $this->mnav_brain_jar->navData(); $this->load->vars($displayData); $this->load->view('template'); } else { $this->load->model('personalization/muser_fields', 'clsUF'); $this->load->model('personalization/muser_fields_create', 'clsUFC'); $this->load->model('admin/mpermissions', 'perms'); $this->load->helper('dl_util/util_db'); /* ------------------------------------- echo('<font class="debug">'.substr(__FILE__, strrpos(__FILE__, '\\')) .': '.__LINE__.'<br>$pledge <pre>'); echo(htmlspecialchars( print_r($pledge, true))); echo('</pre></font><br>'); // -------------------------------------*/ $gifts->gi_curAmnt = $curAmnt = trim((double) $_POST['txtAmount']); $gifts->gc_lKeyID = $pledge->lCampaignID; $gifts->gi_lSponsorID = null; $gifts->lACOID = $pledge->lACOID; $gifts->strNotes = trim($_POST['txtNotes']); $gifts->gi_strCheckNum = trim($_POST['txtCheckNum']); $gifts->gi_lAttributedTo = $pledge->lAttributedTo; // trim((integer)$_POST['ddlAttrib']); $gifts->gi_lGIK_ID = null; $gifts->gi_lPaymentType = trim((int) $_POST['ddlPayType']); $gifts->gi_lMajorGiftCat = trim((int) $_POST['ddlGiftCat']); $gifts->gi_lForeignID = $lFID; $gifts->lPledgeID = $lPledgeID; // if ($gifts->gi_lAttributedTo <= 0) $gifts->gi_lAttributedTo = null; // if ($gifts->gi_lGIK_ID <= 0) $gifts->gi_lGIK_ID = null; // $gifts->gi_bGIK = !is_null($gifts->gi_lGIK_ID); $strDate = trim($_POST['txtDDate']); MDY_ViaUserForm($strDate, $lMon, $lDay, $lYear, $gbDateFormatUS); $gifts->mdteDonation = strMoDaYr2MySQLDate($lMon, $lDay, $lYear); $this->session->set_flashdata('msg', 'A pledge payment of ' . $pledge->strACOCurSymbol . number_format($curAmnt, 2) . ' was ' . ($bNew ? 'added.' : 'updated.')); if ($bNew) { $lGiftID = $this->clsGift->lAddNewGiftRecord(); } else { $this->clsGift->updateGiftRecord(); } redirect('donations/pledge_record/view/' . $lPledgeID); } }
public function strEditUserTableEntries($lEditFieldID) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- global $genumDateFormat, $gbDateFormatUS; $strOut = ''; $clsACO = new madmin_aco(); if (is_null($this->lForeignID)) { screamForHelp('Class not initialized!<br>error on line ' . __LINE__ . ',<br>file ' . __FILE__ . ',<br>function ' . __FUNCTION__); } $bAnyEdit = $lEditFieldID > 0; $this->loadSingleDataRecord($this->lTableID, $this->lForeignID, $recInfo); $utable =& $this->userTables[0]; $enumTType = $utable->enumTType; $this->tableContext(0); $this->tableContextRecView(0); $strOut .= ' <fieldset class="enpFS" style="width: ' . $this->lFieldSetWidth . 'pt; align: left;"> <legend class="enpLegend"> <b><i>' . htmlspecialchars($utable->strUserTableName) . '</b></i> </legend>'; $strOut .= 'Entry for: ' . $this->strContextName . ' <i>(' . $this->strContextLabel . ')</i> ' . $this->strContextViewLink . '<br>'; if ($bAnyEdit) { $strOut .= strDatePicker('datepickerFuture', true); } $strOut .= ' <table class="enpRpt">'; for ($idx = 0; $idx < $this->lNumFields; ++$idx) { $enumType = $this->fields[$idx]->enumFieldType; if ($enumType == CS_FT_HEADING) { $strOut .= ' <tr> <td colspan="2" class="enpRptLabel">' . htmlspecialchars($this->fields[$idx]->pff_strFieldNameUser) . ' </td>'; } else { if ($enumType != CS_FT_LOG) { $userValue = $this->fields[$idx]->userValue; $lFieldID = $this->fields[$idx]->pff_lKeyID; $strFName = 'var' . $lEditFieldID; $bEditField = $lEditFieldID == $lFieldID; $strOut .= ' <tr> <td width="' . $this->lLabelWidth . '" class="enpRptLabel">' . htmlspecialchars($this->fields[$idx]->pff_strFieldNameUser) . ' </td> <td class="enpRpt" width="' . $this->lFieldValWidth . '" valign="left">'; if ($bEditField) { $strUserErr = form_error($strFName); // did user make an invalid entry? $bUserEntryErr = $strUserErr . '' != ''; $attributes = array('name' => $this->strFormName, 'id' => 'frmAddEdit'); $strOut .= form_open('admin/uf_user_edit/userAddEdit/' . $this->lTableID . '/' . $this->lForeignID . '/' . $lFieldID, $attributes); switch ($enumType) { case CS_FT_CHECKBOX: $strOut .= ' <input type="checkbox" value="TRUE" id="addEditEntry" name="' . $strFName . '" ' . ((bool) $userValue ? 'checked' : '') . '> '; break; case CS_FT_DATE: if ($bUserEntryErr) { $strDate = set_value($strFName); } else { if (is_null($userValue)) { $strDate = ''; } else { $strDate = strNumericDateViaMysqlDate($userValue, $gbDateFormatUS); } } initCalendarOpts($calOpts); $calOpts->strDate = $strDate; $calOpts->strForm = $this->strFormName; $calOpts->strTextObjName = $strFName; $calOpts->strTextBoxID = 'datepickerFuture'; $strOut .= strCalendarCell($calOpts) . ' '; //$strDate, $this->strFormName, $strFName, 'datepickerFuture') break; // case CS_FT_DATETIME: // echoT(date($genumDateFormat.' H:i:s', $userValue)); // break; // case CS_FT_DATETIME: // echoT(date($genumDateFormat.' H:i:s', $userValue)); // break; case CS_FT_TEXTLONG: $strOut .= '<textarea name="' . $strFName . '" rows=6 cols=64 id="addEditEntry" >' . htmlspecialchars($userValue) . '</textarea><br>'; break; case CS_FT_TEXT255: $strOut .= '<input type="text" size="50" maxlength="255" name="' . $strFName . '" value="' . htmlspecialchars($userValue) . '" id="addEditEntry" > '; break; case CS_FT_TEXT80: $strOut .= '<input type="text" size="50" maxlength="80" name="' . $strFName . '" value="' . htmlspecialchars($userValue) . '" id="addEditEntry" > '; break; case CS_FT_TEXT20: $strOut .= '<input type="text" size="20" maxlength="20" name="' . $strFName . '" value="' . htmlspecialchars($userValue) . '" id="addEditEntry" > '; break; case CS_FT_INTEGER: if ($bUserEntryErr) { $strNumber = set_value($strFName); } else { $strNumber = number_format($userValue); } $strOut .= '<input type="text" size="10" maxlength="10" name="' . $strFName . '" value="' . $strNumber . '" id="addEditEntry" > '; break; case CS_FT_CURRENCY: $clsACO->loadCountries(false, false, true, $this->fields[$idx]->pff_lCurrencyACO); if ($bUserEntryErr) { $strNumber = set_value($strFName); } else { $strNumber = number_format($userValue, 2, '.', ''); } $strOut .= $clsACO->countries[0]->strCurrencySymbol . ' ' . '<input type="text" size="10" maxlength="20" name="' . $strFName . '" value="' . $strNumber . '" id="addEditEntry" > ' . $clsACO->countries[0]->strFlagImg; break; case CS_FT_DDL: $strOut .= '<select name="' . $strFName . '" id="addEditEntry" >'; $strOut .= $this->strDisplayUF_DDL($lEditFieldID, $userValue); $strOut .= '</select> '; break; default: screamForHelp($enumType . ': invalid field type<br>error on line ' . __LINE__ . ',<br>file ' . __FILE__ . ',<br>function ' . __FUNCTION__); break; } // note: including the following line in the submit button prevents // the form from being submitted when unchecking a single check box ????? // onclick="this.disabled=1; this.form.submit();" $strOut .= '<input type="submit" name="cmdAdd" value="Save" style="font-size: 8pt; height: 13pt; text-align: text-top;" class="btn" onmouseover="this.className=\'btn btnhov\'" onmouseout="this.className=\'btn\'">' . $strUserErr; } else { $strOut .= strLinkEdit_UFTableEntries($enumTType, $this->lTableID, $this->lForeignID, $lFieldID, true, 'edit field', '') . ' '; if (is_null($userValue)) { $strOut .= ' '; } else { switch ($enumType) { case CS_FT_CHECKBOX: $strOut .= (bool) $userValue ? 'Yes' : 'No'; break; case CS_FT_DATE: $strOut .= strNumericDateViaMysqlDate($userValue, $gbDateFormatUS); break; // case CS_FT_DATETIME: // echoT(date($genumDateFormat.' H:i:s', $userValue)); // break; // case CS_FT_DATETIME: // echoT(date($genumDateFormat.' H:i:s', $userValue)); // break; case CS_FT_TEXTLONG: $strOut .= nl2br(htmlspecialchars($userValue)); break; case CS_FT_TEXT255: case CS_FT_TEXT80: case CS_FT_TEXT20: $strOut .= htmlspecialchars($userValue) . ' '; break; case CS_FT_INTEGER: $strOut .= number_format($userValue); break; case CS_FT_CURRENCY: $clsACO->loadCountries(false, false, true, $this->fields[$idx]->pff_lCurrencyACO); $strOut .= $clsACO->countries[0]->strCurrencySymbol . ' ' . number_format($userValue, 2) . ' ' . $clsACO->countries[0]->strFlagImg; break; case CS_FT_DDL: $strOut .= htmlspecialchars($this->strDDLValue($userValue)); break; default: screamForHelp($enumType . ': invalid field type<br>error on line ' . __LINE__ . ',<br>file ' . __FILE__ . ',<br>function ' . __FUNCTION__); break; } } } } } } $strOut .= '</table>'; if ($bAnyEdit) { $strOut .= '</form><script type="text/javascript">frmAddEdit.addEditEntry.focus();</script>'; } $strOut .= '</fieldset>'; return $strOut; }
$clsForm = new generic_form(); $clsForm->strLabelClass = 'enpRptLabel'; $clsForm->strLabelClass = $clsForm->strLabelRowLabelClass = $clsForm->strLabelClassRequired = 'enpViewLabel'; $clsForm->strTitleClass = 'enpViewTitle'; $clsForm->strEntryClass = 'enpView'; $lEntryID = $clsEntry->lKeyID; $attributes = array('name' => 'frmClientStat'); echoT(form_open('clients/client_rec_stat/addEditStatusEntry/' . $lClientID . '/' . $lStatusID, $attributes)); echoT('<table class="enpView">'); $lMatchID = $bNew ? -1 : $clsEntry->lStatusID; echoT($clsForm->strTitleRow(($bNew ? 'Add new ' : 'Update ') . 'status for ' . $client->strSafeName, 2, '')); //--------------------------- // status category and entry //--------------------------- echoT($clsForm->strLabelRow('Status Category', $client->strStatusCatName, 1)); $clsForm->strExtraFieldText = form_error('ddlStatus'); echoT($clsForm->strGenericDDLEntry('Status', 'ddlStatus', true, $statDDL)); //--------------------------- // Packet status? //--------------------------- $clsForm->strExtraFieldText = ' (if checked, this status will be included in packet export)'; echoT($clsForm->strGenericCheckEntry('Packet Status?', 'chkPacket', 'TRUE', false, $bPacketStatus)); //-------------------- // status date //-------------------- echoT(strDatePicker('datepicker1', false)); $clsForm->strExtraFieldText = form_error('txtDate'); echoT($clsForm->strGenericDatePicker('Date', 'txtDate', true, $txtDate, 'frmClientStat', 'datepicker1')); echoT($clsForm->strNotesEntry('Notes', 'txtNotes', false, $txtNotes, 5, 46)); echoT($clsForm->strSubmitEntry('Submit', 1, 'cmdSubmit', 'text-align: left;')); echoT('</table></form>');
$strComparisionVal = ''; break; case CS_FT_ID: case CS_FT_INTEGER: $strComparisionVal = '<input type="text" name="txtCompValue" value="' . $term->lCompVal . '" style="width: 50px; text-align: right;">' . form_error('txtCompValue'); break; case CS_FT_CURRENCY: $strComparisionVal = '<input type="text" name="txtCompValue" value="' . number_format($term->curCompVal, 2) . '" style="width: 70px; text-align: right;"> ' . $term->ACO->strFlagImg . form_error('txtCompValue'); break; case CS_FT_DATE: //---------------------- // Date //---------------------- $strComparisionVal = strDatePicker('datepicker1', true) . $clsForm->strGenericDatePicker('Date', 'txtDate', true, $term->strDteCompVal, 'fmrSearchTerm', 'datepicker1', '', true) . form_error('txtDate'); break; case CS_FT_TEXTLONG: case CS_FT_TEXT255: case CS_FT_TEXT80: case CS_FT_TEXT20: case CS_FT_TEXT: $strComparisionVal = '<input type="text" name="txtCompValue" value="' . $term->strCompVal . '" style="width: 150px;">' . form_error('txtCompValue'); break; case CS_FT_DDLMULTI: case CS_FT_DDL: $strComparisionVal = strLoadDDLCompare($term) . form_error('ddlCompareTo'); break; case CS_FT_DDL_SPECIAL: $strComparisionVal = strLoadDDLSpecialCompare($term) . form_error('ddlCompareTo');
<?php $attributes = array('name' => 'frmEventDate'); echoT(form_open('volunteers/event_dates_add_edit/addEditDate/' . $lEventID . '/' . $lDateID, $attributes)); $clsForm = new generic_form(); $clsForm->strLabelClass = $clsForm->strLabelRowLabelClass = $clsForm->strLabelClassRequired = 'enpViewLabel'; $clsForm->strEntryClass = 'enpView'; $clsForm->strStyleExtraLabel = 'width: 100pt;'; $clsForm->bValueEscapeHTML = false; echoT('<table>'); if ($bNew) { $strEventDateID = '<i>new</i>'; } else { $strEventDateID = str_pad($lDateID, 5, '0', STR_PAD_LEFT); } //---------------------- // event date //---------------------- echoT(strDatePicker('datepicker1', true, 2010)); $clsForm->strExtraFieldText = form_error('txtEDate'); echoT($clsForm->strGenericDatePicker('Event date', 'txtEDate', true, $formData->txtEDate, 'frmEventDate', 'datepicker1')); echoT($clsForm->strSubmitEntry('Save Date', 2, 'cmdSubmit', '')); echoT('</table></form>');
function initUTableDates(&$js, &$utable, $bNew, &$mRec) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- global $gbDateFormatUS; if ($utable->lNumEditableFields > 0) { foreach ($utable->ufields as $ufield) { $enumType = $ufield->enumFieldType; if ($enumType == CS_FT_DATE) { $strFN = $ufield->strFieldNameInternal; $js .= strDatePicker($strFN, true); if ($bNew && !isset($mRec->{$strFN})) { $ufield->txtValue = ''; } else { $vDateVal = $mRec->{$strFN}; if (is_null($vDateVal)) { $ufield->txtValue = ''; } else { $ufield->txtValue = strNumericDateViaMysqlDate($vDateVal, $gbDateFormatUS); } } } } } }
function addEditGift($lGiftID, $lFID = 0) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- global $gdteNow, $gclsChapterACO, $gbDateFormatUS; if (!bTestForURLHack('dataEntryGifts')) { return ''; } $this->load->helper('dl_util/verify_id'); if ($lGiftID . '' != '0') { verifyID($this, $lGiftID, 'donation ID'); } if ($lFID . '' != '0') { verifyID($this, $lFID, 'people/business ID'); } $displayData = array(); $displayData['lGiftID'] = $lGiftID = (int) $lGiftID; $displayData['lFID'] = $lFID = (int) $lFID; $displayData['js'] = ''; $displayData['bNew'] = $bNew = $lGiftID <= 0; if ($bNew) { if (!bTestForURLHack('dataEntryGifts')) { return; } } else { if (!bTestForURLHack('editGifts')) { return; } } // load models $params = array('enumStyle' => 'terse'); $this->load->library('generic_rpt', $params); $this->load->library('js_build/ajax_support'); $this->load->helper('dl_util/web_layout'); // $this->load->helper ('dl_util/email_web'); $this->load->helper('dl_util/time_date'); $this->load->model('admin/madmin_aco', 'clsACO'); $this->load->model('util/mlist_generic', 'clsList'); $this->load->model('people/mpeople', 'clsPeople'); $this->load->model('biz/mbiz', 'clsBiz'); $this->load->model('donations/maccts_camps', 'clsAC'); $this->load->model('donations/mdonations', 'clsGift'); $this->clsGift->loadGiftViaGID($lGiftID); $gifts =& $this->clsGift->gifts[0]; if ($bNew) { $bPeople = !$this->clsPeople->bBizRec($lFID); $gifts->ga_lKeyID = -1; $gifts->gi_dteDonation = $gdteNow; // $gifts->lACOID = $gclsChapterACO->lKeyID; $gifts->gi_curAmnt = 0.0; if ($bPeople) { $this->clsPeople->loadPeopleViaPIDs($lFID, false, false); $gifts->lACOID = $this->clsPeople->people[0]->lACO; } else { $this->clsBiz->loadBizRecsViaBID($lFID); $gifts->lACOID = $this->clsBiz->bizRecs[0]->lACO; } } else { $lFID = $this->clsGift->gifts[0]->gi_lForeignID; $bPeople = !$this->clsGift->gifts[0]->pe_bBiz; } $this->clsAC->loadAccounts(false, false, null); // validation rules $this->form_validation->set_error_delimiters('<div class="formError">', '</div>'); $this->form_validation->set_rules('txtAmount', 'Donation Amount', 'trim|required|callback_stripCommas|numeric'); $this->form_validation->set_rules('rdoACO', 'Accounting Country', 'trim|required'); $this->form_validation->set_rules('ddlAccount', 'Account', 'trim|required|callback_giftVerifyAccountValid'); $this->form_validation->set_rules('ddlCamps', 'Campaign', 'trim|callback_giftVerifyCampValid'); $this->form_validation->set_rules('ddlInKind', 'In-Kind', 'trim'); $this->form_validation->set_rules('ddlPayType', 'Payment Type', 'trim|callback_giftVerifyPayType'); $this->form_validation->set_rules('ddlGiftCat', 'Gift Category', 'trim'); $this->form_validation->set_rules('ddlAttrib', 'Attributed To', 'trim'); $this->form_validation->set_rules('txtCheck', 'Check #', 'trim'); $this->form_validation->set_rules('txtDDate', 'Donation date', 'trim|required|callback_giftVerifyDDateValid'); $this->form_validation->set_rules('txtNotes', 'Notes', 'trim'); if ($this->form_validation->run() == FALSE) { $displayData['formData'] = new stdClass(); $lSponID = $this->clsGift->gifts[0]->gi_lSponsorID; $displayData['bSponPayment'] = $bSponPayment = !is_null($lSponID); //------------------------------- // Acct/Camp and ajax interface //------------------------------- if ($bSponPayment) { redirect('sponsors/payments/addEditPayment/' . $lSponID . '/' . $lFID . '/' . $lGiftID); } else { $clsAjax = new ajax_support(); $displayData['js'] .= $clsAjax->showCreateXmlHTTPObject(); $displayData['js'] .= $clsAjax->showCampaignLoadViaAcctID(); } $this->load->library('generic_form'); $displayData['js'] .= strDatePicker('datepickerFuture', true); $displayData['formData']->strStaffCFName = $gifts->strStaffCFName; $displayData['formData']->strStaffCLName = $gifts->strStaffCLName; $displayData['formData']->dteOrigin = $gifts->dteOrigin; $displayData['formData']->strStaffLFName = $gifts->strStaffLFName; $displayData['formData']->strStaffLLName = $gifts->strStaffLLName; $displayData['formData']->dteLastUpdate = $gifts->dteLastUpdate; // first time displayed, no user data entry errors if (validation_errors() == '') { $this->clsAC->loadCampaigns(false, true, $gifts->ga_lKeyID, false, null); $displayData['formData']->txtAmount = number_format($gifts->gi_curAmnt, 2); $displayData['formData']->strACORadio = $this->clsACO->strACO_Radios($gifts->lACOID, 'rdoACO'); if (!$bSponPayment) { $displayData['formData']->strDDLAccts = $this->clsAC->strDDLAccts($gifts->ga_lKeyID, true, true); $displayData['formData']->strDDLCamps = $this->clsAC->strDDLCampaigns($gifts->gc_lKeyID, false); } $displayData['formData']->strNotes = htmlspecialchars($gifts->strNotes); $displayData['formData']->strCheckNum = htmlspecialchars($gifts->gi_strCheckNum); if (is_null($gifts->mdteDonation)) { $displayData['formData']->txtDDate = ''; } else { $displayData['formData']->txtDDate = strNumericDateViaMysqlDate($gifts->mdteDonation, $gbDateFormatUS); } $this->clsList->strBlankDDLName = 'n/a'; $this->clsList->enumListType = CENUM_LISTTYPE_INKIND; $displayData['formData']->strDDLGIK = $this->clsList->strLoadListDDL('ddlInKind', true, $gifts->gi_lGIK_ID); $this->clsList->strBlankDDLName = ' '; $this->clsList->enumListType = CENUM_LISTTYPE_GIFTPAYTYPE; $displayData['formData']->strDDLPayType = $this->clsList->strLoadListDDL('ddlPayType', true, $gifts->gi_lPaymentType); $this->clsList->enumListType = CENUM_LISTTYPE_MAJORGIFTCAT; $displayData['formData']->strDDLMajGiftType = $this->clsList->strLoadListDDL('ddlGiftCat', true, $gifts->gi_lMajorGiftCat); $this->clsList->enumListType = CENUM_LISTTYPE_ATTRIB; $displayData['formData']->strDDLAttrib = $this->clsList->strLoadListDDL('ddlAttrib', true, $gifts->gi_lAttributedTo); } else { setOnFormError($displayData); $this->clsAC->loadCampaigns(false, true, set_value('ddlAccount'), false, null); $displayData['formData']->txtDDate = set_value('txtDDate'); $displayData['formData']->txtAmount = set_value('txtAmount'); $displayData['formData']->strACORadio = $this->clsACO->strACO_Radios(set_value('rdoACO'), 'rdoACO'); if (!$bSponPayment) { $displayData['formData']->strDDLAccts = $this->clsAC->strDDLAccts(set_value('ddlAccount'), true, true); $displayData['formData']->strDDLCamps = $this->clsAC->strDDLCampaigns(set_value('ddlCamps'), false); } $displayData['formData']->strNotes = set_value('txtNotes'); $displayData['formData']->strCheckNum = set_value('txtCheck'); $this->clsList->strBlankDDLName = 'n/a'; $this->clsList->enumListType = CENUM_LISTTYPE_INKIND; $displayData['formData']->strDDLGIK = $this->clsList->strLoadListDDL('ddlInKind', true, set_value('ddlInKind')); $this->clsList->strBlankDDLName = ' '; $this->clsList->enumListType = CENUM_LISTTYPE_GIFTPAYTYPE; $displayData['formData']->strDDLPayType = $this->clsList->strLoadListDDL('ddlPayType', true, set_value('ddlPayType')); $this->clsList->enumListType = CENUM_LISTTYPE_MAJORGIFTCAT; $displayData['formData']->strDDLMajGiftType = $this->clsList->strLoadListDDL('ddlGiftCat', true, set_value('ddlGiftCat')); $this->clsList->enumListType = CENUM_LISTTYPE_ATTRIB; $displayData['formData']->strDDLAttrib = $this->clsList->strLoadListDDL('ddlAttrib', true, set_value('ddlAttrib')); } $displayData['gift'] =& $gifts; //-------------------------- // breadcrumbs //-------------------------- if ($bPeople) { $displayData['pageTitle'] = anchor('main/menu/people', 'People', 'class="breadcrumb"') . ' | ' . anchor('people/people_record/view/' . $lFID, 'Record', 'class="breadcrumb"') . ' | ' . ($bNew ? 'Add New' : 'Edit') . ' Donation Record'; $displayData['mainTemplate'] = array('donations/gift_add_edit_view'); $this->clsPeople->loadPeopleViaPIDs($lFID, false, false); $displayData['contextSummary'] = $this->clsPeople->peopleHTMLSummary(0); } else { $displayData['pageTitle'] = anchor('main/menu/biz', 'Businesses/Organizations', 'class="breadcrumb"') . ' | ' . anchor('biz/biz_record/view/' . $lFID, 'Record', 'class="breadcrumb"') . ' | ' . ($bNew ? 'Add New' : 'Edit') . ' Donation Record'; $displayData['mainTemplate'] = array('donations/gift_add_edit_view'); $this->clsBiz->loadBizRecsViaBID($lFID); $displayData['contextSummary'] = $this->clsBiz->strBizHTMLSummary(0); } $displayData['title'] = CS_PROGNAME . ' | Donations'; $displayData['nav'] = $this->mnav_brain_jar->navData(); $this->load->vars($displayData); $this->load->view('template'); } else { $this->load->model('personalization/muser_fields', 'clsUF'); $this->load->model('personalization/muser_fields_create', 'clsUFC'); $this->load->model('admin/mpermissions', 'perms'); $this->load->helper('dl_util/util_db'); $gifts->gi_curAmnt = (double) trim($_POST['txtAmount']); $gifts->gc_lKeyID = trim((int) $_POST['ddlCamps']); $gifts->gi_lSponsorID = null; $gifts->lACOID = (int) trim($_POST['rdoACO']); $gifts->strNotes = trim($_POST['txtNotes']); $gifts->gi_strCheckNum = trim($_POST['txtCheck']); $gifts->gi_lAttributedTo = (int) trim($_POST['ddlAttrib']); $gifts->gi_lGIK_ID = (int) trim($_POST['ddlInKind']); $gifts->gi_lPaymentType = (int) trim($_POST['ddlPayType']); $gifts->gi_lMajorGiftCat = (int) trim($_POST['ddlGiftCat']); $gifts->gi_lForeignID = $lFID; if ($gifts->gi_lAttributedTo <= 0) { $gifts->gi_lAttributedTo = null; } if ($gifts->gi_lGIK_ID <= 0) { $gifts->gi_lGIK_ID = null; } $gifts->gi_bGIK = !is_null($gifts->gi_lGIK_ID); $strDate = trim($_POST['txtDDate']); MDY_ViaUserForm($strDate, $lMon, $lDay, $lYear, $gbDateFormatUS); $gifts->mdteDonation = strMoDaYr2MySQLDate($lMon, $lDay, $lYear); //------------------------------------ // update db tables and return //------------------------------------ if ($bNew) { $lGiftID = $this->clsGift->lAddNewGiftRecord(); $this->session->set_flashdata('msg', 'Gift added'); } else { $this->clsGift->updateGiftRecord(); $this->session->set_flashdata('msg', 'Gift record updated'); } redirect('donations/gift_record/view/' . $lGiftID); } }
function showVisitBase(&$clsForm, &$formData) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- echoT($clsForm->strTitleRow('Patient Visit', 2, 'font-size: 13pt; border-bottom: 2px solid #000; padding-top: 10px;')); $clsForm->strStyleExtraLabel = 'padding-top: 4px;'; //---------------------- // Date of visit //---------------------- echoT(strDatePicker('datepicker1', false)); $clsForm->strExtraFieldText = form_error('txtDateOfVisit'); echoT($clsForm->strGenericDatePicker('Patient Visit Date', 'txtDateOfVisit', true, $formData->txtDateOfVisit, 'frmEditPVisit', 'datepicker1')); // medical record # $clsForm->strExtraFieldText = form_error('txtMedRecNum'); echoT($clsForm->strGenericTextEntry('Medical Record #', 'txtMedRecNum', true, $formData->txtMedRecNum, 20, 30)); // Start Time $clsForm->strExtraFieldText = form_error('ddlStart'); echoT($clsForm->strLabelRow('Start Time', $formData->ddlStart, 1)); // Duration $clsForm->strExtraFieldText = form_error('ddlDuration'); echoT($clsForm->strLabelRow('Duration', $formData->ddlDuration, 1)); // echoT('</table>'); // closeBlock(); }
function addEditAuctionItem($lPackageID, $lItemID, $lDonorID = null) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- global $gbDateFormatUS; if (!bTestForURLHack('showAuctions')) { return; } $this->load->helper('dl_util/verify_id'); verifyID($this, $lPackageID, 'package ID'); if ($lItemID . '' != '0') { verifyID($this, $lItemID, 'auction item ID'); } if (!is_null($lDonorID)) { verifyID($this, $lDonorID, 'people/business ID'); } $displayData = array(); $displayData['js'] = ''; $displayData['formData'] = new stdClass(); //------------------------- // models & helpers //------------------------- $this->load->helper('dl_util/time_date'); $this->load->model('auctions/mauctions', 'cAuction'); $this->load->model('auctions/mpackages', 'cPackages'); $this->load->model('auctions/mitems', 'cItems'); $this->load->model('admin/madmin_aco', 'clsACO'); $this->load->model('img_docs/mimage_doc', 'clsImgDoc'); $this->load->helper('dl_util/web_layout'); $this->load->helper('dl_util/link_auction'); $this->load->helper('auctions/auction'); $params = array('enumStyle' => 'terse'); $this->load->library('generic_rpt', $params); $this->load->library('generic_form'); //----------------------------------------- // load package and associated auction //----------------------------------------- setPackageContext($lPackageID, $lAuctionID, $displayData); $displayData['lAuctionID'] = $lAuctionID = (int) $lAuctionID; $displayData['lPackageID'] = $lPackageID = (int) $lPackageID; $displayData['lItemID'] = $lItemID = (int) $lItemID; $displayData['lDonorID'] = $lDonorID; $displayData['bNew'] = $bNew = $lItemID <= 0; $this->cItems->loadItemViaItemID($lItemID); $displayData['item'] = $item =& $this->cItems->items[0]; //------------------------- // validation rules //------------------------- $this->form_validation->set_error_delimiters('<div class="formError">', '</div>'); $this->form_validation->set_rules('txtItemName', 'Item Name', 'trim|required'); $this->form_validation->set_rules('txtDonorAck', 'Donor Acknowledgement', 'trim|required'); $this->form_validation->set_rules('txtPublicNotes', 'Public Notes', 'trim'); $this->form_validation->set_rules('txtPrivateNotes', 'Private Notes', 'trim'); $this->form_validation->set_rules('txtODate', 'Date Item Obtained', 'trim|required|callback_obtainedDateValid'); $this->form_validation->set_rules('txtEstValue', 'Estimated Value', 'trim|required|callback_stripCommas|numeric|callback_minPackageAmnt[0.01]'); $this->form_validation->set_rules('txtOutOfPocket', 'Out of Pocket Expenses', 'trim|required|callback_stripCommas|numeric|callback_minPackageAmnt[0.00]'); if ($this->form_validation->run() == FALSE) { $displayData['js'] .= strDatePicker('datepickerFuture', true); if (is_null($lDonorID)) { $lHoldDonorID = $item->lItemDonorID; $bBiz = $item->itemDonor_bBiz; $displayData['formData']->txtItemDonor = $item->itemDonor_safeName; $strTempAck = 'Anonymous'; } else { $lHoldDonorID = $lDonorID; $this->load->model('people/mpeople', 'clsPeople'); $this->clsPeople->peopleBizInfoViaPID($lDonorID, $pbInfo); $bBiz = $pbInfo->bBiz; $displayData['formData']->txtItemDonor = $strTempAck = $pbInfo->strSafeNameFL; } if ($bBiz) { $displayData['formData']->txtItemDonor .= ' <i>(business)</i>' . strLinkView_BizRecord($lHoldDonorID, 'View business record', true); } else { $displayData['formData']->txtItemDonor .= ' ' . strLinkView_PeopleRecord($lHoldDonorID, 'View people record', true); } // first time displayed, no user data entry errors if (validation_errors() == '') { if ($bNew) { $displayData['formData']->txtODate = ''; } else { $displayData['formData']->txtODate = strNumericDateViaMysqlDate($item->mdteItemObtained, $gbDateFormatUS); } $displayData['formData']->txtItemName = htmlspecialchars($item->strItemName); if ($item->strDonorAck . '' == '') { $displayData['formData']->txtDonorAck = $strTempAck; } else { $displayData['formData']->txtDonorAck = htmlspecialchars($item->strDonorAck); } $displayData['formData']->txtPublicNotes = htmlspecialchars($item->strDescription); $displayData['formData']->txtPrivateNotes = htmlspecialchars($item->strInternalNotes); $displayData['formData']->txtEstValue = number_format($item->curEstAmnt, 2); $displayData['formData']->txtOutOfPocket = number_format($item->curOutOfPocket, 2); } else { setOnFormError($displayData); $displayData['formData']->txtItemName = set_value('txtItemName'); $displayData['formData']->txtDonorAck = set_value('txtDonorAck'); $displayData['formData']->txtPublicNotes = set_value('txtPublicNotes'); $displayData['formData']->txtPrivateNotes = set_value('txtPrivateNotes'); $displayData['formData']->txtODate = set_value('txtODate'); $displayData['formData']->txtEstValue = set_value('txtEstValue'); $displayData['formData']->txtOutOfPocket = set_value('txtOutOfPocket'); } //-------------------------- // breadcrumbs //-------------------------- $displayData['pageTitle'] = GSTR_AUCTIONTOPLEVEL . ' | ' . anchor('auctions/auctions/auctionEvents', 'Silent Auctions', 'class="breadcrumb"') . ' | ' . anchor('auctions/auctions/viewAuctionRecord/' . $lAuctionID, 'Auction', 'class="breadcrumb"') . ' | ' . anchor('auctions/packages/viewPackageRecord/' . $lPackageID, 'Auction Package', 'class="breadcrumb"') . ' | ' . ($bNew ? 'Add New' : 'Edit') . ' Item'; $displayData['title'] = CS_PROGNAME . ' | Silent Auctions'; $displayData['nav'] = $this->mnav_brain_jar->navData(); $displayData['mainTemplate'] = 'auctions/add_edit_item_view'; $this->load->vars($displayData); $this->load->view('template'); } else { $strDate = trim($_POST['txtODate']); MDY_ViaUserForm($strDate, $lMon, $lDay, $lYear, $gbDateFormatUS); $item->mdteItemObtained = strMoDaYr2MySQLDate($lMon, $lDay, $lYear); $item->lPackageID = $lPackageID; $item->strItemName = trim($_POST['txtItemName']); $item->strDonorAck = trim($_POST['txtDonorAck']); $item->strDescription = trim($_POST['txtPublicNotes']); $item->strInternalNotes = trim($_POST['txtPrivateNotes']); $item->curEstAmnt = (double) trim($_POST['txtEstValue']); $item->curOutOfPocket = (double) trim($_POST['txtOutOfPocket']); //------------------------------------ // update db tables and return //------------------------------------ if ($bNew) { $lItemID = $this->cItems->addNewItem($lDonorID, $lPackageID); $this->session->set_flashdata('msg', 'Auction item record added'); } else { $this->cItems->updateItem($lItemID); $this->session->set_flashdata('msg', 'Auction item record updated'); } redirect('auctions/items/viewItemRecord/' . $lItemID); } }
function addEditAuction($lAuctionID) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- global $gdteNow, $gbDateFormatUS, $gclsChapterACO; if (!bTestForURLHack('showAuctions')) { return; } $this->load->helper('dl_util/verify_id'); if ($lAuctionID . '' != '0') { verifyID($this, $lAuctionID, 'auction ID'); } $displayData = array(); $displayData['formData'] = new stdClass(); $displayData['lAuctionID'] = $lAuctionID = (int) $lAuctionID; $displayData['bNew'] = $bNew = $lAuctionID <= 0; $displayData['js'] = ''; //------------------------- // models & helpers //------------------------- $this->load->helper('dl_util/time_date'); $this->load->helper('dl_util/link_auction'); $this->load->helper('auctions/auction'); $this->load->model('auctions/mauctions', 'cAuction'); $this->load->model('auctions/mbid_sheets', 'cBidSheets'); $this->load->model('admin/madmin_aco', 'clsACO'); $this->load->model('donations/maccts_camps', 'clsAC'); $this->load->helper('dl_util/web_layout'); $this->load->library('js_build/ajax_support'); $this->cAuction->loadAuctionByAucID($lAuctionID); $auction = $this->cAuction->auctions[0]; //------------------------- // validation rules //------------------------- $this->form_validation->set_error_delimiters('<div class="formError">', '</div>'); $this->form_validation->set_rules('txtAuctionName', 'Auction Name', 'trim|required|' . 'callback_verifyUniqueAuction[' . $lAuctionID . ']'); $this->form_validation->set_rules('txtContact', 'Contact', 'trim'); $this->form_validation->set_rules('txtDescription', 'Description', 'trim'); $this->form_validation->set_rules('txtLocation', 'Location', 'trim'); $this->form_validation->set_rules('txtEmail', 'Email', 'trim'); $this->form_validation->set_rules('txtPhone', 'Phone', 'trim'); $this->form_validation->set_rules('rdoACO', 'Accounting Country', 'trim'); $this->form_validation->set_rules('ddlDefBS', 'Default Bid Sheet', 'trim'); $this->form_validation->set_rules('txtADate', 'Auction Date', 'trim|required|callback_auctionDateValid'); $this->form_validation->set_rules('ddlAccount', 'Account', 'trim|required|callback_auctionVerifyAccountValid'); $this->form_validation->set_rules('ddlCamps', 'Campaign', 'trim|callback_auctionVerifyCampValid'); if ($this->form_validation->run() == FALSE) { $displayData['formData'] = new stdClass(); $this->load->library('generic_form'); $displayData['js'] .= strDatePicker('datepickerFuture', true); $this->clsAC->loadAccounts(false, false, null); $clsAjax = new ajax_support(); $displayData['js'] .= $clsAjax->showCreateXmlHTTPObject(); $displayData['js'] .= $clsAjax->showCampaignLoadViaAcctID(); // first time displayed, no user data entry errors if (validation_errors() == '') { //echo(__FILE__.' '.__LINE__.'<br>'."\n"); die; if ($bNew) { $auction->lACOID = $gclsChapterACO->lKeyID; $displayData['formData']->txtADate = ''; $auction->lAccountID = -1; $displayData['lNumBidSheets'] = 0; } else { $displayData['ddlDefBidSheet'] = $this->cBidSheets->strBidSheetListDDL($auction->lKeyID, $auction->lBidsheetID, 'ddlDefBS', true, $displayData['lNumBidSheets']); $displayData['formData']->txtADate = strNumericDateViaMysqlDate($auction->mdteAuction, $gbDateFormatUS); } $this->clsAC->loadCampaigns(false, true, $auction->lAccountID, false, null); $displayData['formData']->strDDLAccts = $this->clsAC->strDDLAccts($auction->lAccountID, true, true); $displayData['formData']->strDDLCamps = $this->clsAC->strDDLCampaigns($auction->lCampaignID, false); $displayData['formData']->txtAuctionName = htmlspecialchars($auction->strAuctionName); $displayData['formData']->txtDescription = htmlspecialchars($auction->strDescription); $displayData['formData']->txtLocation = htmlspecialchars($auction->strLocation); $displayData['formData']->txtContact = htmlspecialchars($auction->strContact); $displayData['formData']->txtEmail = htmlspecialchars($auction->strEmail); $displayData['formData']->txtPhone = htmlspecialchars($auction->strPhone); $displayData['formData']->strACORadio = $this->clsACO->strACO_Radios($auction->lACOID, 'rdoACO'); } else { setOnFormError($displayData); $displayData['formData']->txtAuctionName = set_value('txtAuctionName'); $displayData['formData']->txtDescription = set_value('txtDescription'); $displayData['formData']->txtLocation = set_value('txtLocation'); $displayData['formData']->txtContact = set_value('txtContact'); $displayData['formData']->txtEmail = set_value('txtEmail'); $displayData['formData']->txtPhone = set_value('txtPhone'); $displayData['formData']->txtADate = set_value('txtADate'); $displayData['formData']->strACORadio = $this->clsACO->strACO_Radios(set_value('rdoACO'), 'rdoACO'); if ($bNew) { $displayData['lNumBidSheets'] = 0; } else { $displayData['ddlDefBidSheet'] = $this->cBidSheets->strBidSheetListDDL($auction->lKeyID, set_value('ddlDefBS'), 'ddlDefBS', true, $displayData['lNumBidSheets']); } $this->clsAC->loadCampaigns(false, true, set_value('ddlAccount'), false, null); $displayData['formData']->strDDLAccts = $this->clsAC->strDDLAccts(set_value('ddlAccount'), true, true); $displayData['formData']->strDDLCamps = $this->clsAC->strDDLCampaigns(set_value('ddlCamps'), false); } //-------------------------- // breadcrumbs //-------------------------- $displayData['pageTitle'] = GSTR_AUCTIONTOPLEVEL . ' | ' . anchor('auctions/auctions/auctionEvents', 'Silent Auctions', 'class="breadcrumb"') . ' | ' . ($bNew ? 'Add New' : 'Edit') . ' Auction'; $displayData['title'] = CS_PROGNAME . ' | Silent Auctions'; $displayData['nav'] = $this->mnav_brain_jar->navData(); $displayData['mainTemplate'] = 'auctions/add_edit_auction_view'; $this->load->vars($displayData); $this->load->view('template'); } else { $strDate = trim($_POST['txtADate']); MDY_ViaUserForm($strDate, $lMon, $lDay, $lYear, $gbDateFormatUS); $auction->mdteAuction = strMoDaYr2MySQLDate($lMon, $lDay, $lYear); $auction->strAuctionName = trim($_POST['txtAuctionName']); $auction->strDescription = trim($_POST['txtDescription']); $auction->lACOID = trim($_POST['txtADate']); $auction->strLocation = trim($_POST['txtLocation']); $auction->strContact = trim($_POST['txtContact']); $auction->strPhone = trim($_POST['txtPhone']); $auction->strEmail = trim($_POST['txtEmail']); $auction->lACOID = (int) trim($_POST['rdoACO']); $auction->lCampaignID = (int) trim($_POST['ddlCamps']); $auction->lDefaultBidSheet = (int) trim(@$_POST['ddlDefBS']); if ($auction->lDefaultBidSheet <= 0) { $auction->lDefaultBidSheet = null; } //------------------------------------ // update db tables and return //------------------------------------ if ($bNew) { $lAuctionID = $this->cAuction->addNewAuction(); $this->session->set_flashdata('msg', 'Auction record added'); } else { $this->cAuction->updateAuction($lAuctionID); $this->session->set_flashdata('msg', 'Auction record updated'); } redirect('auctions/auctions/viewAuctionRecord/' . $lAuctionID); } }
function regForm($strHash) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- global $gbDev; global $gclsChapter, $glChapterID, $gbDateFormatUS, $gclsChapterACO; global $gErrMessages; global $gclsChapterVoc; $displayData = array(); $displayData['js'] = ''; $gErrMessages = array(); // load models & helpers $this->load->model('vol_reg/mvol_reg', 'volReg'); $this->load->model('admin/madmin_aco', 'clsACO'); $this->load->model('img_docs/mimage_doc', 'clsImgDoc'); $this->load->model('personalization/muser_fields', 'clsUF'); $this->load->model('admin/mpermissions', 'perms'); $this->load->model('util/mcaptcha', 'clsCaptcha'); $this->load->library('util/dl_date_time', '', 'clsDateTime'); $this->load->helper('img_docs/image_doc'); $this->load->helper('img_docs/link_img_docs'); $this->load->helper('dl_util/time_date'); $this->load->helper('email'); $this->load->helper('captcha'); $this->load->helper('dl_util/custom_forms'); $displayData['formData'] = new stdClass(); $displayData['title'] = 'Volunteer Registration'; if (!$this->verifyHash($strHash, $displayData, $lFormID)) { return; } $rRec =& $displayData['rRec']; $displayData['bCreateAcct'] = $bCreateAcct = $rRec->bPermEditContact || $rRec->bPermPassReset || $rRec->bPermViewGiftHistory || $rRec->bPermEditJobSkills || $rRec->bPermViewHrsHistory || $rRec->bPermAddVolHours || $rRec->bVolShiftSignup; //----------------------------- // validation rules //----------------------------- $this->form_validation->set_error_delimiters('<div class="formError">', '</div>'); $this->setValText($rRec->bShowFName, $rRec->bFNameRequired, 'txtFName', 'First Name'); $this->setValText($rRec->bShowLName, $rRec->bLNameRequired, 'txtLName', 'Last Name'); $this->setValText($rRec->bShowAddr, $rRec->bAddrRequired, 'txtAddr1', 'Address'); $this->setValText($rRec->bShowAddr, false, 'txtAddr2', 'Address 2'); $this->setValText($rRec->bShowAddr, $rRec->bAddrRequired, 'txtCity', 'City'); $this->setValText($rRec->bShowAddr, $rRec->bAddrRequired, 'txtState', 'State'); $this->setValText($rRec->bShowAddr, $rRec->bAddrRequired, 'txtZip', 'Zip'); $this->setValText($rRec->bShowAddr, $rRec->bAddrRequired, 'txtCountry', 'Country'); if ($rRec->bShowEmail) { if ($rRec->bEmailRequired) { $this->form_validation->set_rules('txtEmail', 'Email', 'required|callback_verifyEmail'); } else { $this->form_validation->set_rules('txtEmail', 'Email', 'callback_verifyEmail'); } } $this->setValText($rRec->bShowPhone, $rRec->bPhoneRequired, 'txtPhone', 'Phone'); $this->setValText($rRec->bShowCell, $rRec->bCellRequired, 'txtCell', 'Cell'); cusFormSetValDate($rRec->bShowBDay, $rRec->bBDateRequired, 'txtBDate', 'Birth Date', false); if ($rRec->bDisclaimerAckRqrd) { $this->form_validation->set_rules('chkDisclaimer', 'Disclaimer', 'callback_verifyDisclaimer'); } if ($rRec->bCaptchaRequired) { $this->form_validation->set_rules('txtCaptcha', 'Captcha', 'callback_verifyCaptcha'); } if ($bCreateAcct) { $this->form_validation->set_rules('txtPWord1', 'Password', 'callback_verifyPWords'); $this->form_validation->set_rules('txtPWord2', 'Password', 'trim'); } // basic info $displayData['basicInfo'] = array(); $this->setBasicInfo($displayData['basicInfo'][0], 'First Name', $rRec->bShowFName, $rRec->bFNameRequired, 'txtFName', 40, 80); $this->setBasicInfo($displayData['basicInfo'][1], 'Last Name', $rRec->bShowLName, $rRec->bLNameRequired, 'txtLName', 40, 80); $this->setBasicInfo($displayData['basicInfo'][2], 'Address', $rRec->bShowAddr, $rRec->bAddrRequired, 'txtAddr1', 40, 80); $this->setBasicInfo($displayData['basicInfo'][3], 'Address 2', $rRec->bShowAddr, false, 'txtAddr2', 40, 80); $this->setBasicInfo($displayData['basicInfo'][4], 'City', $rRec->bShowAddr, $rRec->bAddrRequired, 'txtCity', 20, 80); $this->setBasicInfo($displayData['basicInfo'][5], $gclsChapterVoc->vocState, $rRec->bShowAddr, $rRec->bAddrRequired, 'txtState', 20, 80); $this->setBasicInfo($displayData['basicInfo'][6], $gclsChapterVoc->vocZip, $rRec->bShowAddr, $rRec->bAddrRequired, 'txtZip', 20, 40); $this->setBasicInfo($displayData['basicInfo'][7], 'Country', $rRec->bShowAddr, $rRec->bAddrRequired, 'txtCountry', 20, 80); $this->setBasicInfo($displayData['basicInfo'][8], 'Email', $rRec->bShowEmail, $rRec->bEmailRequired, 'txtEmail', 40, 120); $this->setBasicInfo($displayData['basicInfo'][9], 'Phone', $rRec->bShowPhone, $rRec->bPhoneRequired, 'txtPhone', 20, 40); $this->setBasicInfo($displayData['basicInfo'][10], 'Cell', $rRec->bShowCell, $rRec->bCellRequired, 'txtCell', 20, 40); // job skills $this->volReg->loadVolRegFormSkills($lFormID, false); $displayData['lNumSkills'] = $lNumSkills = $this->volReg->lOnFormSkills; $displayData['skills'] = $jobSkills = arrayCopy($this->volReg->skills); $skills =& $displayData['skills']; if ($lNumSkills > 0) { foreach ($skills as $skill) { $skill->bChecked = false; $skill->checkFN = $strChkFN = 'chkJobSkill_' . $skill->lKeyID; $this->form_validation->set_rules($strChkFN, 'Job Skill', 'trim'); $displayData['formData']->txtPWord1 = $displayData['formData']->txtPWord2 = ''; } } // personalized tables and associated fields $this->volReg->loadPTablesForDisplay($lFormID, $this->clsUF); $displayData['utables'] = $utables =& $this->volReg->utables; $displayData['lNumTables'] = $lNumTables = $this->volReg->lNumTables; setValidationUTables($displayData['js'], $lNumTables, $utables); if ($this->form_validation->run() == FALSE) { $this->load->library('generic_form'); $this->load->model('util/mlist_generic', 'clsList'); $this->load->helper('dl_util/web_layout'); $displayData['strHash'] = $strHash; $this->volReg->setLogoImageTag(); // captcha setup if ($rRec->bCaptchaRequired) { $this->initCaptcha($displayData['imgCaptcha']); } if ($rRec->bShowBDay) { $displayData['js'] .= strDatePicker('datepickerBDate', false); } initUTableDates($displayData['js'], $lNumTables, $utables); initUTableDDLs($lNumTables, $utables); if (validation_errors() == '') { // basic info $displayData['basicInfo'][0]->value = $displayData['basicInfo'][1]->value = $displayData['basicInfo'][2]->value = $displayData['basicInfo'][3]->value = $displayData['basicInfo'][4]->value = $displayData['basicInfo'][5]->value = $displayData['basicInfo'][6]->value = $displayData['basicInfo'][7]->value = $displayData['basicInfo'][8]->value = $displayData['basicInfo'][9]->value = $displayData['basicInfo'][10]->value = ''; $displayData['formData']->txtBDate = ''; if ($rRec->bDisclaimerAckRqrd) { $rRec->bDisclaimerChecked = false; } // job skills if ($lNumSkills > 0) { foreach ($skills as $skill) { $skill->bChecked = false; } } // personalized tables setCustomUTableDDLs($lNumTables, $utables); } else { setOnFormError($displayData); $displayData['basicInfo'][0]->value = set_value('txtFName'); $displayData['basicInfo'][1]->value = set_value('txtLName'); $displayData['basicInfo'][2]->value = set_value('txtAddr1'); $displayData['basicInfo'][3]->value = set_value('txtAddr2'); $displayData['basicInfo'][4]->value = set_value('txtCity'); $displayData['basicInfo'][5]->value = set_value('txtState'); $displayData['basicInfo'][6]->value = set_value('txtZip'); $displayData['basicInfo'][7]->value = set_value('txtCountry'); $displayData['basicInfo'][8]->value = set_value('txtEmail'); $displayData['basicInfo'][9]->value = set_value('txtPhone'); $displayData['basicInfo'][10]->value = set_value('txtCell'); $displayData['formData']->txtBDate = set_value('txtBDate'); if (form_error('txtPWord1') == '') { $displayData['formData']->txtPWord1 = $displayData['formData']->txtPWord2 = set_value('txtPWord1'); } else { $displayData['formData']->txtPWord1 = $displayData['formData']->txtPWord2 = ''; } if ($rRec->bDisclaimerAckRqrd) { $rRec->bDisclaimerChecked = set_value('chkDisclaimer') == 'true'; } // job skills if ($lNumSkills > 0) { foreach ($skills as $skill) { $skill->bChecked = set_value($skill->checkFN) == 'true'; } } // personalized tables repopulateCustomTables($lNumTables, $utables); } //-------------------------- // breadcrumbs //-------------------------- $displayData['strOrg'] = $this->clsChapter->chapterRec->strChapterName; $displayData['errMessages'] = arrayCopy($gErrMessages); $this->load->vars($displayData); $this->load->view('vol_reg/register'); } else { $this->saveVolReg($rRec, $lNumTables, $utables, $lNumSkills, $jobSkills, $bCreateAcct); redirect('vol_reg/vol/submitted/' . $strHash); } }
function initUTableDates(&$js, $lNumTables, &$utables) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- if ($lNumTables == 0) { return; } foreach ($utables as $utable) { foreach ($utable->ufields as $ufield) { $enumType = $ufield->enumFieldType; if ($enumType == CS_FT_DATE) { $strFN = $ufield->strFieldNameInternal; $js .= strDatePicker($strFN, true); $ufield->txtValue = ''; } } } }
<?php global $glVolID; openBlock(($bNew ? 'Add New ' : 'Edit ') . ' Volunteer Activity by ' . $volRec->strSafeNameFL, ''); $attributes = array('name' => 'frmHrsLog'); echoT(form_open('hospice/vols/hospice_vol/otherActivity/' . $lActivityID . '/' . $lVolID, $attributes)); $clsForm = new generic_form(); $clsForm->strLabelClass = $clsForm->strLabelRowLabelClass = $clsForm->strLabelClassRequired = 'enpViewLabel'; $clsForm->strEntryClass = 'enpView'; $clsForm->strStyleExtraLabel = 'width: 100pt; padding-top: 4px;'; $clsForm->bValueEscapeHTML = false; echoT('<table>'); //---------------------- // activity date //---------------------- echoT(strDatePicker('datepicker1', false, 2000)); $clsForm->strExtraFieldText = form_error('txtDate'); echoT($clsForm->strGenericDatePicker('Date of vol. activity', 'txtDate', true, $formData->txtDate, 'frmHrsLog', 'datepicker1')); /*------------------------------- Start Time -------------------------------*/ $clsForm->strExtraFieldText = form_error('ddlStart'); echoT($clsForm->strGenericDDLEntry('Start Time', 'ddlStart', true, $formData->lStartTime)); /*------------------------------- Duration -------------------------------*/ $clsForm->strExtraFieldText = form_error('ddlDuration'); echoT($clsForm->strGenericDDLEntry('Duration', 'ddlDuration', true, $formData->enumDuration)); /*------------------------------- Activity -------------------------------*/
function cProgramEDefaultFields(&$clsForm, &$utable, &$errMessages, $strSafeEnrollLabel) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- //------------------------ // Enrollment Start Date //------------------------ echoT(strDatePicker('datepickerE1', true)); $clsForm->strExtraFieldText = form_error('txtEStart'); if (isset($errMessages['txtEStart'])) { $clsForm->strExtraFieldText .= $errMessages['txtEStart']; } echoT($clsForm->strGenericDatePicker($strSafeEnrollLabel . ' Start Date', 'txtEStart', true, $utable->cProgE->txtEStart, 'frmPTable', 'datepickerE1')); //------------------------ // Enrollment End Date //------------------------ echoT(strDatePicker('datepickerE2', true)); $clsForm->strExtraFieldText = '<br><i>Leave blank for on-going enrollment</i>' . form_error('txtEEnd'); if (isset($errMessages['txtEEnd'])) { $clsForm->strExtraFieldText .= $errMessages['txtEEnd']; } echoT($clsForm->strGenericDatePicker($strSafeEnrollLabel . ' End Date', 'txtEEnd', false, $utable->cProgE->txtEEnd, 'frmPTable', 'datepickerE2')); //------------------------ // Currently active? //------------------------ echoT($clsForm->strGenericCheckEntry('Active in Client Program?', 'chkEnrolled', 'true', false, $utable->cProgE->bEnrolled)); }
echoT($clsForm->strLabelRow('Payer', $strPayer, 1)); $clsForm->strStyleExtraLabel = 'padding-top: 4px;'; echoT($clsForm->strLabelRow('Payment ID', $strPayID, 1)); //------------------------------- // Payment Amount //------------------------------- $clsForm->strStyleExtraLabel = 'padding-top: 8px;'; $clsForm->strExtraFieldText = form_error('txtAmount'); echoT($clsForm->strGenericTextEntry('Payment Amount', 'txtAmount', true, $strAmount, 14, 20)); //------------------------------- // Accounting country of Origin //------------------------------- $clsForm->strExtraFieldText = form_error('txtPayDate'); echoT($clsForm->strLabelRow('Accounting Country*', $clsACO->strACO_Radios($lPayACO, 'rdoACO'), 1)); //------------------------ // Date of payment //------------------------ $clsForm->strExtraFieldText = form_error('txtPayDate'); echoT(strDatePicker('datepicker1', true, 1970)); echoT($clsForm->strGenericDatePicker('Date of Payment', 'txtPayDate', true, $strPayDate, 'frmEditSponPayment', 'datepicker1')); //------------------------------- // Check number //------------------------------- echoT($clsForm->strGenericTextEntry('Check number', 'txtCheck', false, $strCheckNum, 30, 255)); //------------------------------- // Payment type //------------------------------- $clsForm->strExtraFieldText = form_error('ddlPayType'); echoT($clsForm->strLabelRow('Payment type*', $formData->strDDLPayType, 1)); echoT($clsForm->strSubmitEntry('Save', 2, 'cmdSubmit', 'width: 100pt;')); echoT('</table></form><br><br>');
function setFulfill($lPackageID) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- global $gbDateFormatUS; if (!bTestForURLHack('showAuctions')) { return; } $this->load->helper('dl_util/verify_id'); verifyID($this, $lPackageID, 'package ID'); $displayData = array(); $displayData['js'] = ''; $displayData['formData'] = new stdClass(); $displayData['lPackageID'] = $lPackageID = (int) $lPackageID; //------------------------- // models & helpers //------------------------- $this->load->helper('dl_util/time_date'); $this->load->model('auctions/mauctions', 'cAuction'); $this->load->model('auctions/mpackages', 'cPackages'); $this->load->model('admin/madmin_aco', 'clsACO'); $this->load->model('img_docs/mimage_doc', 'clsImgDoc'); $this->load->model('donations/maccts_camps', 'clsAC'); $this->load->model('util/mlist_generic', 'clsList'); $this->load->helper('dl_util/web_layout'); $this->load->helper('dl_util/link_auction'); $this->load->helper('dl_util/time_date'); $this->load->helper('auctions/auction'); $params = array('enumStyle' => 'terse'); $this->load->library('generic_rpt', $params); $this->load->library('generic_form'); setPackageContext($lPackageID, $lAuctionID, $displayData); $package =& $displayData['package']; $displayData['js'] .= strDatePicker('datepickerFuture', true); //------------------------- // validation rules //------------------------- $this->form_validation->set_error_delimiters('<div class="formError">', '</div>'); $this->form_validation->set_rules('txtAmount', 'Amount', 'trim|required|callback_stripCommas|numeric|callback_minPackageAmnt[0.00]'); $this->form_validation->set_rules('txtCheckNum', 'Check Number', 'trim'); $this->form_validation->set_rules('ddlPayType', 'Payment Type', 'trim|callback_bidVerifyPayType'); $this->form_validation->set_rules('ddlGiftCat', 'Gift Category', 'trim'); $this->form_validation->set_rules('ddlAttrib', 'Attributed To', 'trim'); $this->form_validation->set_rules('txtDDate', 'Fulfillment date', 'trim|required|callback_bidVerifyFDateValid'); $this->form_validation->set_rules('txtNotes', 'Notes', 'trim'); if ($this->form_validation->run() == FALSE) { // first time displayed, no user data entry errors if (validation_errors() == '') { $displayData['formData']->txtAmount = number_format($package->curWinBidAmnt, 2); $displayData['formData']->txtCheckNum = ''; $displayData['formData']->txtDDate = ''; $displayData['formData']->txtNotes = ''; $this->clsList->strBlankDDLName = ' '; $this->clsList->enumListType = CENUM_LISTTYPE_GIFTPAYTYPE; $displayData['formData']->strDDLPayType = $this->clsList->strLoadListDDL('ddlPayType', true, -1); $this->clsList->enumListType = CENUM_LISTTYPE_MAJORGIFTCAT; $displayData['formData']->strDDLMajGiftType = $this->clsList->strLoadListDDL('ddlGiftCat', true, -1); $this->clsList->enumListType = CENUM_LISTTYPE_ATTRIB; $displayData['formData']->strDDLAttrib = $this->clsList->strLoadListDDL('ddlAttrib', true, -1); } else { setOnFormError($displayData); $displayData['formData']->txtAmount = set_value('txtAmount'); $displayData['formData']->txtCheckNum = set_value('txtCheckNum'); $displayData['formData']->txtDDate = set_value('txtDDate'); $displayData['formData']->txtNotes = set_value('txtNotes'); $this->clsList->strBlankDDLName = ' '; $this->clsList->enumListType = CENUM_LISTTYPE_GIFTPAYTYPE; $displayData['formData']->strDDLPayType = $this->clsList->strLoadListDDL('ddlPayType', true, set_value('ddlPayType')); $this->clsList->enumListType = CENUM_LISTTYPE_MAJORGIFTCAT; $displayData['formData']->strDDLMajGiftType = $this->clsList->strLoadListDDL('ddlGiftCat', true, set_value('ddlGiftCat')); $this->clsList->enumListType = CENUM_LISTTYPE_ATTRIB; $displayData['formData']->strDDLAttrib = $this->clsList->strLoadListDDL('ddlAttrib', true, set_value('ddlAttrib')); } //-------------------------- // breadcrumbs //-------------------------- $displayData['pageTitle'] = GSTR_AUCTIONTOPLEVEL . ' | ' . anchor('auctions/auctions/auctionEvents', 'Silent Auctions', 'class="breadcrumb"') . ' | ' . anchor('auctions/auctions/viewAuctionRecord/' . $lAuctionID, 'Auction', 'class="breadcrumb"') . ' | ' . anchor('auctions/packages/viewPackageRecord/' . $lPackageID, 'Auction Package', 'class="breadcrumb"') . ' | Fulfillment'; $displayData['title'] = CS_PROGNAME . ' | Silent Auctions'; $displayData['nav'] = $this->mnav_brain_jar->navData(); $displayData['mainTemplate'] = 'auctions/package_fulfillment_view'; $this->load->vars($displayData); $this->load->view('template'); } else { $auction =& $displayData['auction']; $this->load->model('personalization/muser_fields', 'clsUF'); $this->load->model('personalization/muser_fields_create', 'clsUFC'); $this->load->model('admin/mpermissions', 'perms'); $this->load->model('donations/mdonations', 'clsGift'); $this->load->helper('dl_util/util_db'); $this->clsGift->loadGiftViaGID(-1); $gifts =& $this->clsGift->gifts[0]; $gifts->gi_curAmnt = trim((double) $_POST['txtAmount']); $gifts->strNotes = trim($_POST['txtNotes']); $gifts->gi_strCheckNum = trim($_POST['txtCheckNum']); $gifts->gi_lAttributedTo = trim((int) $_POST['ddlAttrib']); $gifts->gi_lPaymentType = trim((int) $_POST['ddlPayType']); $gifts->gi_lMajorGiftCat = trim((int) $_POST['ddlGiftCat']); $gifts->lACOID = $auction->lACOID; $gifts->gi_lForeignID = $package->lBidWinnerID; $gifts->gc_lKeyID = $auction->lCampaignID; $gifts->gi_lSponsorID = null; $gifts->gi_lGIK_ID = null; $gifts->gi_bGIK = false; if ($gifts->gi_lAttributedTo <= 0) { $gifts->gi_lAttributedTo = null; } $strDate = trim($_POST['txtDDate']); MDY_ViaUserForm($strDate, $lMon, $lDay, $lYear, $gbDateFormatUS); $gifts->mdteDonation = strMoDaYr2MySQLDate($lMon, $lDay, $lYear); //------------------------------------ // update db tables and return //------------------------------------ $lGiftID = $this->clsGift->lAddNewGiftRecord(); $this->cPackages->setBidGiftID($lPackageID, $lGiftID); $this->session->set_flashdata('msg', 'Bid fulfilled / gift record <b>' . str_pad($lGiftID, 5, '0', STR_PAD_LEFT) . '</b> added'); redirect_AuctionPackageList($lAuctionID); } }
function tf_strRowUserDefined(&$opts) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- $clsForm = new generic_form(); $clsForm->strLabelClass = $clsForm->strLabelRowLabelClass = $clsForm->strLabelClassRequired = 'enpViewLabel'; $clsForm->strTitleClass = 'enpViewTitle'; $clsForm->strEntryClass = 'enpView'; $clsForm->strStyleExtraLabel = 'width: 90pt;'; $clsForm->bValueEscapeHTML = false; $strRadioFN = $opts->strRadioFN; $strOut = ''; $strOut .= ' <tr> <td valign="top"> <input type="radio" name="' . $strRadioFN . '" value="User" ' . ($opts->bDateRange ? 'checked' : '') . ' > </td> <td valign="middle"> <span onClick=setRadioOther(' . $opts->strFormName . '.' . $strRadioFN . ',\'User\')> define your report range:</span> <br>' . "\n"; //---------------------- // report start //---------------------- $strOut .= '<table >'; $strOut .= strDatePicker('datepicker1', false); $clsForm->strStyleExtraLabel = 'padding-top: 8px;'; $clsForm->strExtraFieldText = form_error($opts->strSDateFN); $clsForm->calOptsTextOnFocus = $clsForm->calOptsTextOnChange = ' setDateRadio(' . $opts->strFormName . '.' . $strRadioFN . ',\'User\') '; $strOut .= $clsForm->strGenericDatePicker('Start', $opts->strSDateFN, true, $opts->txtSDate, $opts->strFormName, 'datepicker1', ''); //---------------------- // report end //---------------------- $strOut .= strDatePicker('datepicker2', true); $clsForm->strExtraFieldText = form_error($opts->strEDateFN); $strOut .= $clsForm->strGenericDatePicker('End', $opts->strEDateFN, true, $opts->txtEDate, $opts->strFormName, 'datepicker2'); $clsForm->calOptsTextOnFocus = $clsForm->calOptsTextOnChange = ''; $strOut .= '</table>'; return $strOut; }
function showSponsorsPayments(&$sponInfo, &$clsForm, &$linkOpts, &$validation) { // $strSort, $lSponProgID, $lStartRec, $lRecsPerPage){ //--------------------------------------------------------------------- // //--------------------------------------------------------------------- openSponsorPaymentTable($clsForm, $linkOpts); foreach ($sponInfo as $spon) { $lSponID = $spon->lKeyID; $lFID = $spon->lForeignID; echoT('<input type="hidden" name="hdnAOCID[' . $lSponID . ']" value="' . $spon->lCommitACO . '">' . "\n"); echoT('<input type="hidden" name="hdnFID[' . $lSponID . ']" value="' . $spon->lForeignID . '">' . "\n"); if ($spon->bSponBiz) { $strFLink = 'bizID: ' . str_pad($lFID, 6, '0', STR_PAD_LEFT) . ' ' . strLinkView_BizRecord($lFID, 'View business record (new window)', true, 'target="_blank"'); } else { $strFLink = 'peopleID: ' . str_pad($lFID, 6, '0', STR_PAD_LEFT) . ' ' . strLinkView_PeopleRecord($lFID, 'View people record (new window)', true, 'target="_blank"'); } $strRadioName = 'rdoPayType' . $lSponID; $lClientID = $spon->lClientID; if (is_null($lClientID)) { $strClient = 'client: n/a'; } else { $strClient = 'client: ' . str_pad($lClientID, 6, '0', STR_PAD_LEFT) . strLinkView_ClientRecord($lClientID, 'View client record (new window)', true, 'target="_blank"') . ' ' . $spon->strClientSafeNameFL; } echoT(' <tr class="makeStripe"> <td class="enpRpt" style="text-align: center;">' . str_pad($lSponID, 6, '0', STR_PAD_LEFT) . ' ' . strLinkView_Sponsorship($lSponID, 'View sponsorship (new window)', true, 'target="_blank"') . ' </td>'); echoT(' <td class="enpRpt" style="width: 230pt;"><b>' . $spon->strSponSafeNameLF . '</b><br>' . $strFLink . '<br>' . $strClient . '<br> program: ' . htmlspecialchars($spon->strSponProgram) . ' </td>'); echoT(' <td class="enpRpt" style="text-align: right;">' . $spon->strCommitACOCurSym . ' ' . number_format($spon->curCommitment, 2) . ' ' . $spon->strCommitACOFlagImg . ' </td>'); echoT(' <td class="enpRpt" style="vertical-align: top;">' . $spon->strCommitACOCurSym . ' ' . '<input type="text" name="' . $spon->strAmountFN . '" style="width: 60pt; text-align: right;" onChange="bUserDataEntered = true;" value="' . $spon->txtAmount . '">' . $validation->amount[$lSponID] . '<br><span style="font-size: 8pt;">' . $spon->strLastPay . '</span> </td>'); echoT(' <td class="enpRpt"> <table cellpadding="0" cellspacing="0"> <tr> <td style="text-align: right; font-size: 8pt;"> check #: </td> <td> <input type="text" style="width: 60pt;" onChange="bUserDataEntered = true;" name="' . $spon->strCheckFN . '" value="' . $spon->txtCheckNum . '"> </tr>'); echoT(' <tr> <td style="text-align: right; vertical-align: top; font-size: 8pt; padding-top: 4px;"> payment type: </td> <td>' . $spon->strDDLPayType . $validation->paymentType[$lSponID] . ' </td> </tr>'); //---------------------- // Payment Date //---------------------- echoT(' <tr> <td style="text-align: right; vertical-align: top; font-size: 8pt; padding-top: 6px;"> payment date: </td> <td>' . $clsForm->strGenericDatePicker('', 'txtPayDate' . $lSponID, true, $spon->txtPayDate, 'frmBatchPayments', 'datepicker' . $lSponID, '', true) . $validation->paymentDate[$lSponID] . ' </td> </tr>'); echoT(' </table> </td>'); echoT(' </tr>'); echoT(strDatePicker('datepicker' . $lSponID, true)); } closeSponsorPaymentTable(); }