public function getFormSetProfile($profile_id)
 {
     $ess_profiles_detail = new ess_profiles_detail();
     $itemOnProfile = array();
     foreach ($ess_profiles_detail->find('profiles_id = ' . $profile_id) as $row) {
         $itemOnProfile[$row->menu_id] = $row->id;
     }
     $this->walkItems(0);
     $myForm = new OPF_myForm('FormSetProfile');
     $myForm->styleClassForm = '';
     $myForm->useRowSeparator = true;
     foreach ($this->arrItems as $opt) {
         list($numSpaces, $id, $desc) = explode(':', $opt);
         for ($i = 0; $i < $numSpaces; ++$i) {
             $add = '&nbsp;';
             if ($i == $numSpaces - 1) {
                 $add = '->';
             }
             $myForm->addFreeObject('cm1_' . $i . '_' . $id, '', $add);
             $this->groups[] = 'cm1_' . $i . '_' . $id;
         }
         $sts = false;
         if (isset($itemOnProfile[$id])) {
             $sts = true;
         }
         $myForm->addCheckBox($desc, 'chk_' . $id, $sts);
         $this->groups[] = 'chk_' . $id;
         for ($j = $numSpaces + 1; $j < $this->maxCols + 1; ++$j) {
             $myForm->addComment('cm2_' . $j . '_' . $id, '&nbsp;');
             $this->groups[] = 'cm2_' . $j . '_' . $id;
         }
     }
     $myForm->addButton('btn_save_', OPF_myLang::getPhrase('LABEL_BTN_SAVE'), 'save.gif');
     $myForm->addButton('btn_cancel_', OPF_myLang::getPhrase('LABEL_BTN_CANCEL'), 'cancel.gif');
     $myForm->addEvent('btn_cancel_', 'onclick', 'onClickCancelConfirm');
     $myForm->addEvent('btn_save_', 'onclick', 'onClickSaveProfileDet', $profile_id);
     $myForm->border = 0;
     $myForm->width = ($this->maxCols + 1) * 180;
     $myForm->addGroup('resources', OPF_myLang::getPhrase('OPF_PROFILES_4'), $this->groups, $this->maxCols + 1);
     return $myForm->getForm(2);
 }
 public function getPHPCodeTable($id)
 {
     $code = '<?php' . "\n\n";
     $code .= '#' . OPF_myLang::getPhrase('OPF_ADMTABLAS_10') . "\n";
     $code .= 'class ess_master_tables_detail extends OPF_myActiveRecord {' . "\n\n";
     $code .= "\t" . 'public $id;' . "\n\n";
     $code .= "\t" . 'public $item_cod;' . "\n\n";
     $code .= "\t" . 'public $item_desc;' . "\r\n\n";
     $code .= '}' . "\n\n";
     $code .= '#' . OPF_myLang::getPhrase('OPF_ADMTABLAS_11') . "\n";
     $code .= '$ess_master_tables_detail = new ess_master_tables_detail;' . "\n\n";
     $code .= '#' . OPF_myLang::getPhrase('OPF_ADMTABLAS_12') . "\n";
     $code .= 'foreach ($ess_master_tables_detail->find(\'master_tables_id = ' . $id . '\') as $row){' . "\n\n";
     $code .= "\t" . 'echo $row->item_cod;' . "\n\n";
     $code .= "\t" . 'echo $row->item_desc;' . "\n\n";
     $code .= '}' . "\n\n";
     $code .= '?>' . "\n";
     $myForm = new OPF_myForm('frm_code_master_tables');
     $myForm->addComment('cm1', highlight_string($code, true));
     return $myForm->getForm(1);
 }
    public function getFormConfigApp($datForm)
    {
        $code = '' . '<?php
 	
	#/config/configApplication.php

	$database = \'' . $datForm['db'] . '\';
	
	$engine = \'' . $datForm['engine'] . '\';
 	
	$host = \'' . $datForm['host_db'] . '\';
 	
	$user = \'' . $datForm['user_db'] . '\';
 	
	$password = \'' . $datForm['passwd_db'] . '\';
 	
	$port = ' . $datForm['host_port'] . ';

?>
' . '';
        $myForm = new OPF_myForm('config_app');
        $myForm->addComment('cmmt', OPF_myLang::getPhrase('OPF_LOGIN_26'));
        return $myForm->getForm(1) . '<br><div class="formulario">' . highlight_string($code, true) . '</div>';
    }
 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);
 }
 /**
  * Construye el Html del formulario de consulta
  * @return string
  */
 private function buildQueryForm($showFirstRule)
 {
     $arFields = array();
     $objMyForm = new OPF_myForm($nomForm = $this->idList . 'QueryForm');
     $objMyForm->width = '98%';
     $objMyForm->border = 0;
     $objMyForm->styleClassTags = 'texto_formularios';
     $objMyForm->styleClassForm = 'form_cont_filter';
     $htble = '';
     /**
      * Helps
      */
     $objMyForm->styleTypeHelp = 2;
     $objMyForm->addDisabled('cancel_query_' . $this->idList);
     $objMyForm->addDisabled('save_query_' . $this->idList);
     $htble .= '<table border="0" width="100%" cellpadding="0" cellspacing="0"><tr>';
     $anyBut = false;
     $objMyForm->addHelp('pdf_' . $this->idList, LABEL_HELP_PDF_BUTTON_FORM);
     if (!$this->arrayDataTypeExport['pdf']) {
         $objMyForm->addDisabled('pdf_' . $this->idList);
     } else {
         $anyBut = true;
     }
     $objMyForm->addEvent('pdf_' . $this->idList, 'onclick', 'MYLIST_exportData', 'pdf', $this->idList);
     $htble .= '<td width="10%" align="left">' . $objMyForm->getButton('pdf_' . $this->idList, '', 'pdf.gif') . '</td>';
     $objMyForm->addHelp('xls_' . $this->idList, LABEL_HELP_EXCEL_BUTTON_FORM);
     if (!$this->arrayDataTypeExport['xls']) {
         $objMyForm->addDisabled('xls_' . $this->idList);
     } else {
         $anyBut = true;
     }
     $objMyForm->addEvent('xls_' . $this->idList, 'onclick', 'MYLIST_exportData', 'xls', $this->idList);
     $htble .= '<td width="10%" align="left">' . $objMyForm->getButton('xls_' . $this->idList, '', 'excel.gif') . '</td>';
     $objMyForm->addHelp('html_' . $this->idList, LABEL_HELP_HTML_BUTTON_FORM);
     if (!$this->arrayDataTypeExport['html']) {
         $objMyForm->addDisabled('html_' . $this->idList);
     } else {
         $anyBut = true;
     }
     $objMyForm->addEvent('html_' . $this->idList, 'onclick', 'MYLIST_exportData', 'html', $this->idList);
     $htble .= '<td width="10%" align="left">' . $objMyForm->getButton('html_' . $this->idList, '', 'html.gif') . '</td>';
     if (!$anyBut) {
         $objMyForm->addDisabled('not_pg_' . $this->idList);
     }
     $htble .= '<td width="10%">&nbsp;</td>';
     $htble .= '<td width="10%">&nbsp;</td>';
     $htble .= '<td width="10%">&nbsp;</td>';
     $objMyForm->addEvent('help_' . $this->idList, 'onclick', 'MYLIST_help');
     $objMyForm->addHelp('help_' . $this->idList, TITLE_WINDOW_HELP_MYLIST);
     $htble .= '<td width="10%" align="right">' . $objMyForm->getButton('help_' . $this->idList, '', 'help.gif') . '</td>';
     $objMyForm->addHelp($this->idList . '_reload_list', LABEL_HELP_RELOAD_LIST_FORM);
     $objMyForm->addEvent($this->idList . '_reload_list', 'onclick', 'MYLIST_reload', $this->idList);
     $htble .= '<td width="10%" align="right">' . $objMyForm->getButton($this->idList . '_reload_list', NULL, 'reload.gif') . '</td>';
     $objMyForm->addHelp($this->idList . '_apply_rule', LABEL_HELP_APPLY_RULE_FORM);
     $objMyForm->addEvent($this->idList . '_apply_rule', 'onclick', 'MYLIST_applyRuleQuery', $this->idList);
     $htble .= '<td width="10%" align="right">' . $objMyForm->getButton($this->idList . '_apply_rule', NULL, 'ok.gif') . '</td>';
     $objMyForm->addHelp('add_rule_' . $this->idList, LABEL_HELP_ADD_RULE_QUERY_BUTTON_FORM);
     $objMyForm->addEvent('add_rule_' . $this->idList, 'onclick', 'MYLIST_addRuleQuery', $this->idList, $showFirstRule);
     $htble .= '<td width="10%" align="right">' . $objMyForm->getButton('add_rule_' . $this->idList, '', 'find.gif') . '</td>';
     $htble .= '</tr></table>';
     $objMyForm->addComment('options', $htble);
     $htmFirstRule = '';
     if ($showFirstRule) {
         $htmFirstRule = $this->getFirstRuleOnQueryForm();
     }
     $objMyForm->addComment('rule_for', '<div class="form_rule_for_list" id="rule_for_' . $this->idList . '">' . $htmFirstRule . '</div>');
     return $objMyForm->getForm(1);
 }
 /**
  * Cuarda el resultado de la consulta de una lista dinamica segun el filtro aplicado al disco
  * @ignore
  * @param $datForm	Datos de form
  * @param $format	Formato
  * @param $idList	Id lista
  */
 public function MYLIST_exportData($datForm, $format, $idList)
 {
     $arrFields = array();
     $arrSelects = array();
     $this->notificationWindow(MSG_SELECT_FIELD_TO_SHOW, 8, 'ok');
     $myForm = new OPF_myForm('export_data_select_fields_' . $idList);
     $myForm->selectUseFirstValue = false;
     $myList = new OPF_myList($idList);
     $arFldOnQry = $myList->getVar('arrayFieldsOnQuery');
     $arEvnOnQry = $myList->getVar('arrayEventOnColumn');
     $nomImg = '';
     switch ($format) {
         case 'xls':
             $nomImg = 'excel';
             break;
         case 'pdf':
             $nomImg = 'pdf';
             break;
         case 'html':
             $nomImg = 'html';
             break;
     }
     $i = 1;
     foreach ($arFldOnQry as $field) {
         if (!isset($arEvnOnQry[$field])) {
             $arrFields['field_' . $i] = $field;
             $arrSelects[] = 'field_' . $i;
         }
         ++$i;
     }
     $myForm->border = 0;
     $myForm->styleTypeHelp = 2;
     $myForm->styleClassFields = 'select_fields_to_show';
     $myForm->addHelp('fields_export', LABEL_HELP_SELECT_FILEDS_TOSHOW);
     $myForm->addComment('cm1:2', '<div align="center">' . $myForm->getSelect('fields_export', $arrFields, $arrSelects, 8, 0, true) . '</center>');
     $myForm->styleClassFields = 'caja';
     $myForm->addHelp('not_pg_' . $idList, LABEL_HELP_USELIMIT_RULE_FORM);
     $myForm->addCheckBox(LABEL_USELIMIT_RULE_FORM . ':', 'not_pg_' . $idList, true);
     $myForm->addButton('button_export_data', LABEL_BUTTON_DOWNLOAD_FILE_EXPORT, $nomImg . '.gif');
     $myForm->addEvent('button_export_data', 'onclick', 'MYLIST_exportDataOk', $format, $idList, $i);
     $this->modalWindow($myForm->getForm(2), TITLE_MWINDOW_FILEDS_TO_SHOW, 220, 222, 2);
     return $this->response;
 }