public function getFormAddModRecord($id = '') { $ess_menu = new ess_menu(); if ($id) { $ess_menu->find($id); } $arrIcons = array(array('img/imgfolder.gif', 'imgfolder', 'Image folder'), array('img/musicfolder.gif', 'musicfolder', 'Music folder'), array('img/page.gif', 'page', 'Page'), array('img/cd.gif', 'cd', 'Cd'), array('img/base.gif', 'osezno', 'Osezno PHP Framefork logo'), array('img/globe.gif', 'globe', 'Globe'), array('img/question.gif', 'question', 'Question'), array('img/trash.gif', 'trash', 'Trash')); $myForm = new OPF_myForm('FormAddModRecord'); $htmlInconsel = '<select name="icon" id="icon" class="' . $myForm->styleClassFields . '">'; $htmlInconsel .= '<option>' . OPF_myLang::getPhrase('LABEL_FIRST_OPT_SELECT_FIELD') . '</option>'; foreach ($arrIcons as $icon) { $sel = ''; if ($ess_menu->icon == $icon[0] && $ess_menu->icon) { $sel = 'selected'; } $htmlInconsel .= '<option ' . $sel . ' value="' . $icon[0] . '" id="' . $icon[1] . '">' . $icon[2] . '</option>'; } $htmlInconsel .= '</select>'; $myForm->styleClassForm = ''; $myForm->addText(OPF_myLang::getPhrase('OPF_MENU_4'), 'description:2', $ess_menu->description, 15, 50); $myForm->selectStringFirstLabelOption = '/'; $myForm->addSelect(OPF_myLang::getPhrase('OPF_MENU_5'), 'menu_id:2', $this->arrOpt, $ess_menu->menu_id); $myForm->addText(OPF_myLang::getPhrase('OPF_MENU_6'), 'ord:2', $ess_menu->ord, 2, 3, true); $myForm->addFreeObject('fo1:2', 'Icono:', $htmlInconsel); $myForm->addTextArea(OPF_myLang::getPhrase('OPF_MENU_7'), 'url:2', $ess_menu->url, 50, 2); $myForm->addButton('btn_dir', OPF_myLang::getPhrase('OPF_MENU_8'), 'find.gif'); $myForm->addButton('btn_save', OPF_myLang::getPhrase('LABEL_BTN_SAVE'), 'save.gif'); $myForm->addEvent('btn_save', 'onclick', 'onClickSave', $id); $myForm->addEvent('btn_dir', 'onclick', 'onClickFindMod'); return $myForm->getForm(2); }
public function getFormAgrUsr($user_id = '') { $ess_profiles = new ess_profiles(); $profilesArray = array(); foreach ($ess_profiles->find() as $profile) { $profilesArray[$profile->id] = $profile->name; } $ess_system_users = new ess_system_users(); $myForm = new OPF_myForm('getFormAgrUsr'); if ($user_id) { $ess_system_users->find($user_id); $myForm->addDisabled('user_name'); } $myForm->styleClassForm = ''; $myForm->addText(OPF_myLang::getPhrase('OPF_ADMUSR_1'), 'user_name', $ess_system_users->user_name, 15); $myForm->addText(OPF_myLang::getPhrase('OPF_ADMUSR_2'), 'name', $ess_system_users->name, 15); $myForm->addText(OPF_myLang::getPhrase('OPF_ADMUSR_3'), 'lastname', $ess_system_users->lastname, 15); $myForm->addPassword(OPF_myLang::getPhrase('OPF_ADMUSR_4'), 'passwd1', $ess_system_users->passwd, 15); $myForm->addPassword(OPF_myLang::getPhrase('OPF_ADMUSR_5'), 'passwd', $ess_system_users->passwd, 15); $myForm->addSelect(OPF_myLang::getPhrase('OPF_ADMUSR_6'), 'profile_id', $profilesArray, $ess_system_users->profile_id); $status = false; if ($ess_system_users->status == 1) { $status = true; } $myForm->addCheckBox(OPF_myLang::getPhrase('OPF_ADMUSR_7'), 'status', $status); $myForm->addButton('btnsave', OPF_myLang::getPhrase('LABEL_BTN_SAVE'), 'save.gif'); $myForm->addEvent('btnsave', 'onclick', 'onClickSaveRecord', $user_id); return $myForm->getForm(1); }
public function default_event() { $myForm = new OPF_myForm('new_form'); $myForm->addText('Nombre:', 'nombre'); $myForm->addButton('btn1', 'Enviar'); $myForm->addEvent('btn1', 'onclick', 'getData'); $this->formulario = $myForm->getForm(2); }
public function getFormChngPasswd() { $myForm = new OPF_myForm('ChngPasswd'); $myForm->addText(OPF_myLang::getPhrase('OPF_PASSWD_4'), 'user_name'); $myForm->addPassword(OPF_myLang::getPhrase('OPF_PASSWD_5'), 'passwd'); $myForm->addPassword(OPF_myLang::getPhrase('OPF_PASSWD_6'), 'passwd1'); $myForm->addPassword(OPF_myLang::getPhrase('OPF_PASSWD_7'), 'passwd2'); $myForm->addButton('btn_save', OPF_myLang::getPhrase('LABEL_BTN_SAVE'), 'save.gif'); $myForm->addEvent('btn_save', 'onclick', 'onClikSavePasswd'); return $myForm->getForm(1); }
public function __construct($nA, $nM, $nDp, $update, $form_name = '') { $nDp = intval($nDp); $sw = false; $nSem = intval(date('W', mktime(0, 0, 0, $nM, 1, $nA))); $nDsh = $nMsh = ''; $arrMonth = array(); foreach ($this->arrMonth as $id => $month) { $arrMonth[$nDp . '_' . $id . '_' . $nA] = $month; } /** * Construimos un arreglo de datos para los años */ for ($aIni = $nA - 30; $aIni < $nA + 5; ++$aIni) { if ($aIni >= 1902) { $this->arrYears[$nDp . '_' . $nM . '_' . $aIni] = $aIni; } } $objMyForm = new OPF_myForm(); $iniCell = '<td class="cellday" onmouseover="this.className=\'cellday_over\'" onmouseout="this.className=\'cellday\'" {onclick}>'; $endCell = '</td>'; $htm = ''; $htm .= '<table cellpadding="0" cellspacing="0"><tr><td class="tablecal">'; $htm .= '<table cellpadding="1" cellspacing="1" border=0>'; $htm .= '<tr>'; $htm .= '<td class="celldays">' . CAL_WK_LABEL . '</td>'; foreach ($this->arrDsem as $id => $le) { $htm .= '<td class="celldays">' . $le . '</td>'; } $htm .= '</tr>'; $nDmax = date('d', mktime(0, 0, 0, $nM + 1, 0, $nA)); $nD = 1; $cDpm = 1; $fNdf = 0; $cDam = 0; $toShow = true; while ($nD <= $nDmax) { foreach ($this->arrDsem as $id => $le) { $w = date('N', mktime(0, 0, 0, $nM, $nD, $nA)); if ($w == 1 || !$sw) { $htm .= '<tr>'; $sw = true; $htm .= '<td class="cell_week">' . $nSem . '</td>'; } if ($nD <= $nDmax) { if ($w == $id) { $nMsh = $nM; if ($nM < 10) { $nMsh = '0' . $nM; } $nDsh = $nD; if ($nD < 10) { $nDsh = '0' . $nD; } if (!$fNdf) { $fNdf = $id; } $onclick = 'onclick="selectDate(\'' . $nA . '-' . $nMsh . '-' . $nDsh . '\',\'' . $update . '\',\'' . $form_name . '\')"'; $iniA = '<a href="javascript:;" class="celldays_a" ' . $onclick . '>'; $endA = '</a>'; if ($nM . $nD . $nA == date('mjY')) { $htm .= '<td class="cellday_today" ' . $onclick . '>' . $iniA . $nD . $endA . $endCell; } else { $htm .= str_replace('{onclick}', $onclick, $iniCell) . $iniA . $nD . $endA . $endCell; } ++$nD; } else { if (!$cDam) { $cDam = date('t', mktime(0, 0, 0, $nM, 0, $nA)) - ($w - 2); } $htm .= $iniCell . '<div class="cell_other_days">' . $cDam . '</div>' . $endCell; ++$cDam; } } else { $htm .= $iniCell . '<div class="cell_other_days">' . $cDpm . '</div>' . $endCell; ++$cDpm; } } $nSem = intval(date('W', mktime(0, 0, 0, $nM, $nD, $nA))); } $objMyForm->setParamTypeOnEvent('field'); $objMyForm->selectUseFirstValue = false; $objMyForm->styleClassFields = 'select_calendar'; $objMyForm->addEvent('cal_month', 'onchange', 'MYFORM_calOnChange', $update, $form_name); $objMyForm->addEvent('cal_year', 'onchange', 'MYFORM_calOnChange', $update, $form_name); $objMyForm->addEvent('close_call', 'onclick', 'closeCalendarWindow', $update); $htm .= '<tr>'; $htm .= '<td colspan="8" class="cell_control">' . '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>' . '<td>' . $objMyForm->getSelect('cal_month', $arrMonth, $nDp . '_' . $nM . '_' . $nA) . '</td>' . '<td>' . $objMyForm->getSelect('cal_year', $this->arrYears, $nDp . '_' . $nM . '_' . $nA) . '</td>' . '<td align="right">' . $objMyForm->getButton('close_call', 'X') . '</td>' . '</tr></table>' . '</td>'; $htm .= '</tr>'; $htm .= '</table>'; $htm .= '</td></tr></table>'; $this->calOut = $htm; }
public static function formNewScaffStep1() { $myForm = new OPF_myForm('formNewScaffStep1'); $myForm->addComment('cm1:3', ''); $myForm->addComment('cm2:3', ''); $myForm->addComment('cm3:3', ''); $myForm->addComment('cm4:3', ''); $myForm->addComment('cm5:3', ''); $myForm->addComment('cm6:3', ''); $myForm->addComment('cm7:3', ''); $table = ''; if (isset($_SESSION['temp_scaff_info']['table_name'])) { $table = $_SESSION['temp_scaff_info']['table_name']; } $myForm->addHelp('table_name', OPF_myLang::getPhrase('OPF_SCAFF_39')); $myForm->addText(OPF_myLang::getPhrase('OPF_SCAFF_38'), 'table_name:3', $table); $myForm->addComment('cm8:3', ''); $myForm->addComment('cm9:3', ''); $myForm->addComment('cm10:3', ''); $myForm->addComment('cm11:3', ''); $myForm->addComment('cm12:3', ''); $myForm->addComment('cm13:3', ''); $myForm->addComment('cm14:3', ''); $myForm->addComment('cm15', ''); $myForm->addComment('cm16', ''); $myForm->addButton('btn1', OPF_myLang::getPhrase('OPF_SCAFF_14'), 'next.gif'); $myForm->addEvent('btn1', 'onclick', 'toScaffStep2'); return $myForm->getForm(3); }
private function getFirstRuleOnQueryForm() { $html = ''; if (count($this->arrayAliasSetInQuery) && $this->numAffectedRows) { $arFields = array(); $objMyForm = new OPF_myForm($idForm = $this->idList . 'QueryForm'); $objMyForm->cellPadding = 0; $objMyForm->styleTypeHelp = 2; $objMyForm->selectUseFirstValue = false; ++$this->numRuleQuery; $html .= '<table border="0" id="rule_gp_' . $this->idList . '_' . $this->numRuleQuery . '" width="100%" cellpadding="0" cellspacing="0">'; $html .= '<tr>'; $html .= '<td width="10%" align="center"><div id="status_' . $this->idList . '_' . $this->numRuleQuery . '" class="rule_cancel" id=""></div></td>'; $objMyForm->addHelp('logic_' . $this->numRuleQuery, LABEL_LOGIC_FIELD_ADD_RULE_FORM); $html .= '<td width="20%" align="center">' . $objMyForm->getHidden('logic_' . $this->numRuleQuery, 'AND') . '</td>'; foreach ($this->arrayFieldsOnQuery as $field) { if (!isset($this->arrayEventOnColumn[$field]) && isset($this->arrayAliasSetInQuery[$field])) { $etq = $field; if (isset($this->arrayAliasSetInQuery[$field])) { $data = $this->arrayAliasSetInQuery[$field]; } else { $data = $field; } $arFields[$field] = $etq; } } $objMyForm->addHelp('field_' . $this->numRuleQuery, LABEL_FIELD_LIST_ADD_RULE_FORM); $html .= '<td width="20%" align="center">' . $objMyForm->getSelect('field_' . $this->numRuleQuery, $arFields) . '</td>'; $spaCha = ' '; $objMyForm->addEvent('relation_' . $this->numRuleQuery, 'onchange', 'MYLIST_caseSensitiveCheckBox', 'case_sensitive_' . $this->numRuleQuery, 'relation_' . $this->numRuleQuery); $objMyForm->addHelp('relation_' . $this->numRuleQuery, LABEL_RELATION_FIELD_ADD_RULE_FORM); $html .= '<td width="20%" align="center">' . $objMyForm->getSelect('relation_' . $this->numRuleQuery, $this->myDinamicListRel) . '</td>'; $objMyForm->addHelp('value_' . $this->numRuleQuery, LABEL_FIELD_VALUE_ADD_RULE_FORM); $objMyForm->addHelp('case_sensitive_' . $this->numRuleQuery, LABEL_CASE_SENSITIVE_LIST_ADD_RULE_FORM); $html .= '<td width="20%" align="center"><table cellpadding="0" border="0" cellspacing="0"><tr><td>' . $objMyForm->getText('value_' . $this->numRuleQuery, NULL, 12) . '</td><td>' . $objMyForm->getCheckBox('case_sensitive_' . $this->numRuleQuery) . '</td></tr></table></td>'; $objMyForm->addHelp($this->idList . '_remove_rule_' . $this->numRuleQuery, LABEL_HELP_REM_RULE_FORM); $objMyForm->addEvent($this->idList . '_remove_rule_' . $this->numRuleQuery, 'onclick', 'MYLIST_removeRuleQuery', $this->idList, $this->numRuleQuery); $html .= '<td align="center">' . $objMyForm->getButton($this->idList . '_remove_rule_' . $this->numRuleQuery, NULL, 'remove.gif') . '</td>'; $html .= '</tr>'; $html .= '</table>'; } return $html; }
/** * Abre una ventana modal con un formulario que permite agregar una regla a la consulta actual de la lista dinamica. * @ignore * @param $datForm Datos de form * @param $idList Id lista * @return string */ public function MYLIST_addRuleQuery($datForm, $idList, $showFirstRule) { $objList = new OPF_myList($idList); $arAlsInQry = $objList->getVar('arrayAliasSetInQuery'); if ($objList->getVar('numAffectedRows')) { if (count($arAlsInQry)) { $objMyForm = new OPF_myForm($idForm = $idList . 'QueryForm'); $objMyForm->cellPadding = 0; $objMyForm->styleTypeHelp = 2; $objMyForm->selectUseFirstValue = false; $arFields = array(); $arFldOnQry = $objList->getVar('arrayFieldsOnQuery'); $arEvnOnClm = $objList->getVar('arrayEventOnColumn'); $objList->setVar('numRuleQuery', $numRuleQuery = $objList->getVar('numRuleQuery') + 1); $html = '<table border="0" id="rule_gp_' . $idList . '_' . $numRuleQuery . '" width="100%" cellpadding="0" cellspacing="0">'; $html .= '<tr>'; $html .= '<td width="10%" align="center"><div id="status_' . $idList . '_' . $numRuleQuery . '" class="rule_cancel" id=""></div></td>'; $objMyForm->addHelp('logic_' . $numRuleQuery, LABEL_LOGIC_FIELD_ADD_RULE_FORM); $html .= '<td width="20%" align="center">' . $objMyForm->getSelect('logic_' . $numRuleQuery, array('AND' => LABEL_RELATION_OPTAND_ADD_RULE_FORM, 'OR' => LABEL_RELATION_OPTOR_ADD_RULE_FORM)) . '</td>'; foreach ($arFldOnQry as $field) { if (!isset($arEvnOnClm[$field]) && isset($arAlsInQry[$field])) { $etq = $field; if (isset($arAlsInQry[$field])) { $data = $arAlsInQry[$field]; } else { $data = $field; } $arFields[$field] = $etq; } } $objMyForm->addHelp('field_' . $numRuleQuery, LABEL_FIELD_LIST_ADD_RULE_FORM); $html .= '<td width="20%" align="center">' . $objMyForm->getSelect('field_' . $numRuleQuery, $arFields) . '</td>'; $spaCha = ' '; $objMyForm->addEvent('relation_' . $numRuleQuery, 'onchange', 'MYLIST_caseSensitiveCheckBox', 'case_sensitive_' . $numRuleQuery, 'relation_' . $numRuleQuery); $objMyForm->addHelp('relation_' . $numRuleQuery, LABEL_RELATION_FIELD_ADD_RULE_FORM); $html .= '<td width="20%" align="center">' . $objMyForm->getSelect('relation_' . $numRuleQuery, $this->myDinamicListRel) . '</td>'; $objMyForm->addHelp('value_' . $numRuleQuery, LABEL_FIELD_VALUE_ADD_RULE_FORM); $objMyForm->addHelp('case_sensitive_' . $numRuleQuery, LABEL_CASE_SENSITIVE_LIST_ADD_RULE_FORM); $html .= '<td width="20%" align="center"><table cellpadding="0" border="0" cellspacing="0"><tr><td>' . $objMyForm->getText('value_' . $numRuleQuery, NULL, 12) . '</td><td>' . $objMyForm->getCheckBox('case_sensitive_' . $numRuleQuery) . '</td></tr></table></td>'; $objMyForm->addHelp($idList . '_remove_rule_' . $numRuleQuery, LABEL_HELP_REM_RULE_FORM); $objMyForm->addEvent($idList . '_remove_rule_' . $numRuleQuery, 'onclick', 'MYLIST_removeRuleQuery', $idList, $numRuleQuery); $html .= '<td align="center">' . $objMyForm->getButton($idList . '_remove_rule_' . $numRuleQuery, NULL, 'remove.gif') . '</td>'; $html .= '</tr>'; $html .= '</table>'; $this->append('rule_for_' . $idList, 'innerHTML', $html); $chkPref = 'case_sensitive_'; $len = strlen($chkPref); foreach ($datForm as $id => $value) { if (!strcmp(substr($id, 0, $len), $chkPref)) { if ($datForm[$id]) { $this->assign($id, 'checked', true); } } else { $this->assign($id, 'value', $value); } } if (!$showFirstRule) { $this->script("blockFirstElementForm('" . $idForm . "')"); } } else { $this->notificationWindow(MSG_FAILED_SHOW_FILTER_MUST_PROVIDE_REAL_NAME, 4, 'warning'); } } else { $this->notificationWindow(MSG_FAILED_SHOW_FILTER_NO_RECORDS_FOUND, 4, 'warning'); } return $this->response; }
public function getFormLogin() { $myForm = new OPF_myForm('frm_login'); $myForm->setAutoComplete('user_opf_ess', false); $user_opf_ess = ''; $mark = false; if (isset($_COOKIE['user_opf_ess'])) { $user_opf_ess = $_COOKIE['user_opf_ess']; $mark = true; } $myForm->addText(OPF_myLang::getPhrase('OPF_LOGIN_2'), 'user_opf_ess', $user_opf_ess); $myForm->addPassword(OPF_myLang::getPhrase('OPF_LOGIN_3'), 'passwd_opf_ess'); $myForm->addCheckBox(OPF_myLang::getPhrase('OPF_LOGIN_5'), 'rem_usr', $mark); $myForm->addButton('btn_log', OPF_myLang::getPhrase('OPF_LOGIN_4'), 'ok.gif'); $myForm->addEvent('btn_log', 'onclick', 'onClickLogIn'); return $myForm->getForm(1); }
public function getFormAdmItemTable_register($detail_id = '') { $ess_master_tables_detail = new ess_master_tables_detail(); if ($detail_id) { $ess_master_tables_detail->find($detail_id); } $myForm = new OPF_myForm('FormAdmItemTable_register'); $myForm->styleClassForm = ''; $myForm->addText(OPF_myLang::getPhrase('OPF_ADMTABLAS_3'), 'item_cod', $ess_master_tables_detail->item_cod); $myForm->addText(OPF_myLang::getPhrase('OPF_ADMTABLAS_2'), 'item_desc', $ess_master_tables_detail->item_desc); $myForm->addButton('btn_save_detail', OPF_myLang::getPhrase('LABEL_BTN_SAVE'), 'save.gif'); $myForm->addEvent('btn_save_detail', 'onclick', 'onClickSaveItemTable', $this->table_id, $detail_id); return $myForm->getForm(1); }
public function getFormAddModProfile($id = '') { $myForm = new OPF_myForm('FormAddModProfile'); $ess_profiles = new ess_profiles(); if ($id) { $ess_profiles->find($id); } $myForm->styleClassForm = ''; $myForm->addText(OPF_myLang::getPhrase('OPF_PROFILES_5'), 'name', $ess_profiles->name, 20, 50); $myForm->addTextArea(OPF_myLang::getPhrase('OPF_PROFILES_6'), 'description', $ess_profiles->description, 40, 6); $myForm->addButton('btn_save', OPF_myLang::getPhrase('LABEL_BTN_SAVE'), 'save.gif'); $myForm->addEvent('btn_save', 'onclick', 'onClickSave', $id); return $myForm->getForm(1); }