Example #1
0
 public function fields()
 {
     echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="POST">';
     $form = new Form();
     echo "<h4>Titel</h4>" . $form->field("text", "title", $this->entryPlace->getResultRow("title"), 60, 60, "fieldClass") . "<br />";
     echo "<h4>Beskrivning</h4>" . $form->textArea("description", $this->entryPlace->getResultRow("description"), 60, 20, "fieldClass") . "<br />";
     echo "<h4>Bild</h4><br />";
     echo "<h3>N&ouml;dv&auml;ndiga f&auml;lt</h3>";
     echo $form->checkBox("requiredTitle", $this->entryPlace->getResultRow("requiredTitle"), "fieldClass") . "Titel<br />\n";
     echo $form->checkBox("requiredDescription", $this->entryPlace->getResultRow("requiredDescription"), "fieldClass") . "Beskriving<br />\n";
     echo $form->checkBox("requiredText", $this->entryPlace->getResultRow("requiredText"), "fieldClass") . "Text<br />\n";
     echo $form->checkBox("requiredImage", $this->entryPlace->getResultRow("requiredImage"), "fieldClass") . "Bild<br />\n";
     echo $form->checkBox("requiredComments", $this->entryPlace->getResultRow("requiredComments"), "fieldClass") . "Kommentarer<br />\n";
     echo $form->checkBox("requiredRate", $this->entryPlace->getResultRow("requiredRate"), "fieldClass") . "Betyg<br />\n";
     echo $form->hiddenField("entryPlaceTitle", $this->entryPlaceTitle);
     if ($this->entryPlace->getNumRows() < 1) {
         echo $form->submitButton("fieldClass", "Skapa");
     } else {
         echo $form->submitButton("fieldClass", "Uppdatera");
     }
     echo '<hr size="1"/></form>';
 }
Example #2
0
unset($array);
$tbody[] = $row;
$row = Form::label("meeting_place", _("Local e Data de atendimento") . ":");
$row .= Form::text("meeting_place", isset($formVar["meeting_place"]) ? $formVar["meeting_place"] : null, array('size' => 40, 'error' => isset($formError["meeting_place"]) ? $formError["meeting_place"] : null));
$tbody[] = $row;
$row = Form::label("wording", _("Resumo") . ":", array('class' => 'required'));
$row .= Form::textArea("wording", isset($formVar["wording"]) ? $formVar["wording"] : null, array('rows' => 4, 'cols' => 90, 'error' => isset($formError["wording"]) ? $formError["wording"] : null));
$tbody[] = $row;
$row = Form::label("subjective", _("Informações pedagógicas") . ":");
$row .= Form::textArea("subjective", isset($formVar["subjective"]) ? $formVar["subjective"] : null, array('rows' => 4, 'cols' => 90));
$tbody[] = $row;
if (in_array($_SESSION['auth']['login_session'], $userArray)) {
    $row = Form::label("objective", _("Informações psicológicas (Campo restrito ao psicologo)") . ":");
    $row .= Form::textArea("objective", isset($formVar["objective"]) ? $formVar["objective"] : null, array('rows' => 4, 'cols' => 90));
}
$tbody[] = $row;
$row = Form::label("appreciation", _("Evoluções") . ":");
$row .= Form::textArea("appreciation", isset($formVar["appreciation"]) ? $formVar["appreciation"] : null, array('rows' => 4, 'cols' => 90));
$tbody[] = $row;
$row = Form::label("action_plan", _("Próximos passos") . ":");
$row .= Form::textArea("action_plan", isset($formVar["action_plan"]) ? $formVar["action_plan"] : null, array('rows' => 4, 'cols' => 90));
$tbody[] = $row;
$row = Form::label("prescription", _("Prescrições") . ":");
$row .= Form::textArea("prescription", isset($formVar["prescription"]) ? $formVar["prescription"] : null, array('rows' => 4, 'cols' => 90));
$tbody[] = $row;
$row = Form::label("closed_problem", _("<font color=red>Marque <u>somente se</u> o atendimento estiver concluído</font>") . ":");
$row .= Form::checkBox("closed_problem", "closed", array('checked' => isset($formVar["closed_problem"]) ? $formVar["closed_problem"] != "" : false));
$tbody[] = $row;
$tfoot = array(Form::button("save", _("Submit")) . Form::generateToken());
$options = array('class' => 'large_area');
echo Form::fieldset($title, $tbody, $tfoot, $options);
Example #3
0
                     $added_fields = DB::getTableFields($added_table, false, true);
                     if (is_array($added_fields)) {
                         $table_fields = is_array($table_fields) ? $table_fields : array();
                         $table_fields = array_merge($table_fields, $added_fields);
                     }
                 }
             }
             $form->autoComplete('argument_' . $name, ucfirst(str_replace('_', ' ', $name)), $required, false, true, $table_fields, false, false, false, false, false, false, false, $t_field, false, false, false, false, false, false, false, false, false, 1);
         } elseif ($name == 'name' && $m_name == 'field' && $class != 'Calendar') {
             $table_fields = DB::getTableFields($_REQUEST['c_table'], false, true);
             $form->autoComplete('argument_' . $name, ucfirst(str_replace('_', ' ', $name)), $required, false, false, $table_fields);
         } elseif ((stristr($name, 'table') || stristr($m_name, 'table') && $name == 'name') && !stristr($name, 'id') && !stristr($name, 'enable')) {
             $form->autoComplete('argument_' . $name, ucfirst(str_replace('_', ' ', $name)), $required, $fields_table, false, $db_tables);
             $t_field = 'argument_' . $name;
         } elseif ($name == 'checked' || $name == 'is_media' || $name == 'accept_children' || $name == 'dragdrop' || $name == 'show_buttons' || $name == 'filter' || $name == 'return_to_self' || $name == 'not_equals') {
             $form->checkBox('argument_' . $name, ucfirst(str_replace('_', ' ', $name)));
         } elseif (stristr($name, 'target') && $class != 'Form') {
             $form->selectInput('argument_' . $name, ucfirst(str_replace('_', ' ', $name)), $required, 'content', array('content' => 'Main', 'edit_box' => 'Popup'));
         } elseif ($name == 'disable_if_no_record_id') {
             $form->textInput('argument_' . $name, ucfirst(str_replace('_', ' ', $name)), $required);
         } elseif (!stristr($name, 'record_id') && !stristr($name, 'error') && $name != 'action' && $name != 'is_navigation') {
             $form->textInput('argument_' . $name, ucfirst(str_replace('_', ' ', $name)), $required);
         }
     }
 }
 if ($m_name == 'textInput' && $parent_method_id > 0) {
     $form->textInput('argument_show_total', 'Show total');
 }
 $form->hiddenInput('order', false, $_REQUEST['order']);
 $form->button(false, $CFG->ok_button, false, false, false, 'primary', 'onclick="saveForm(this,\'pm_editor\',\'index.php?tab_bypass=1&current_url=' . $CFG->url . '&id=' . $next_page_id . '&action=' . $next_page_action . '&is_tab=' . $is_tab . '\')"');
 $form->button(false, $CFG->cancel_button, false, false, false, false, 'onclick="closePopup(this)"');
Example #4
0
    function show_filters()
    {
        global $CFG;
        if ($this->inset_id > 0 || $CFG->is_form_inset) {
            return false;
        }
        if (is_array($this->filters) || $this->mode == 'graph' || $this->mode == 'graph_line' || $this->mode == 'graph_pie') {
            $form_filters = new Form('form_filters' . $this->i, false, 'GET', 'form_filters', false);
            $form_filters->show_errors();
            $filter_results = $this->filter_results ? $this->filter_results : array();
            $form_filters_info = $form_filters->info ? $form_filters->info : array();
            $form_filters->info = array_merge($filter_results, $form_filters_info);
            if (is_array($this->filters)) {
                foreach ($this->filters as $filter) {
                    $name = $filter['field_name'];
                    $caption = !empty($filter['caption']) ? $caption : $name;
                    $value = $this->filter_results[$name] ? $this->filter_results[$name] : $filter['value'];
                    if ($filter['type'] != 'radio' && $filter['type'] != 'start_date' && $filter['type'] != 'end_date' && $group) {
                        $form_filters->endGroup();
                        $group = false;
                    }
                    switch ($filter['type']) {
                        case 'per_page':
                            $options_array = is_array($filter['options_array']) ? $filter['options_array'] : array(10 => 10, 30 => 30, 50 => 50);
                            $caption = !empty($filter['caption']) ? $filter['caption'] : $CFG->results_per_page_text;
                            $CFG->o_method_id = $filter['method_id'];
                            $CFG->o_method_name = 'filterPerPage';
                            $form_filters->selectInput('per_page', $caption, false, $this->rows_per_page, $options_array, false, false, false, false, $filter['class']);
                            break;
                        case 'search':
                            $search_i = $search_i > 0 ? $search_i + 1 : 1;
                            $CFG->o_method_id = $filter['method_id'];
                            $CFG->o_method_name = 'filterSearch';
                            $form_filters->textInput('search' . '|' . $search_i, $filter['caption'], false, $value, false, false, $filter['class']);
                            foreach ($filter['subtable_fields'] as $s_field => $s_subtable) {
                                $s_subtable = $s_subtable && $s_subtable != $s_field ? $s_subtable : $this->table;
                                $CFG->o_method_suppress = true;
                                $form_filters->HTML('<input type="hidden" name="search_fields' . $this->i . '[' . $s_field . '|' . $search_i . ']" value="' . $s_subtable . '" />');
                                $CFG->o_method_suppress = false;
                            }
                            break;
                        case 'autocomplete':
                            $CFG->o_method_id = $filter['method_id'];
                            $CFG->o_method_name = 'filterAutocomplete';
                            $form_filters->autoComplete($name, $filter['caption'], false, $value, false, $filter['options_array'], $filter['subtable'], $filter['subtable_fields'], false, false, $filter['class']);
                            break;
                        case 'tokenizer':
                            $CFG->o_method_id = $filter['method_id'];
                            $CFG->o_method_name = 'filterTokenizer';
                            $form_filters->autoComplete($name, $filter['caption'], false, $value, false, $filter['options_array'], $filter['subtable'], $filter['subtable_fields'], false, false, $filter['class'], false, false, false, false, false, false, false, false, false, false, false, 1);
                            break;
                        case 'cats':
                            $CFG->o_method_id = $filter['method_id'];
                            $CFG->o_method_name = 'filterCats';
                            //$form_filters->fauxSelect('catsel',$filter['caption'],0,false,false,false,$filter['subtable'],$filter['subtable_fields'],false,$filter['class'],false,false,false,false,false,false,false,false,false,false,false,$filter['concat_char'],1);
                            $form_filters->catSelect($filter['subtable'], $filter['caption'], 0, $filter['class'], false, false, false, $filter['subtable_fields'], $filter['concat_char'], false, false, 1);
                            break;
                        case 'first_letter':
                            $range = range('A', 'Z');
                            $HTML = '';
                            foreach ($range as $l) {
                                $HTML .= Link::url($this->link_url, $l, 'fl' . $this->i . '=' . $l . '&fl_field' . $this->i . '=' . $name . '&fl_subtable' . $this->i . '=' . $filter['subtable'] . '&is_tab=' . $this->is_tab, false, false, 'content');
                            }
                            $CFG->o_method_id = $filter['method_id'];
                            $CFG->o_method_name = 'filterFirstLetter';
                            $form_filters->HTML($HTML);
                            break;
                        case 'select':
                            $CFG->o_method_id = $filter['method_id'];
                            $CFG->o_method_name = 'filterSelect';
                            $form_filters->selectInput($name, $filter['caption'], false, $value, $filter['options_array'], $filter['use_enum_values'] && !$filter['subtable'] ? $this->table : $filter['subtable'], $filter['subtable_fields'], $filter['f_id'], false, $filter['class'], false, false, $filter['f_id_field'], false, $filter['depends_on'], false, false, false, false, false, $filter['level'], $filter['use_enum_values']);
                            break;
                        case 'checkbox':
                            $CFG->o_method_id = $filter['method_id'];
                            $CFG->o_method_name = 'filterCheckbox';
                            $form_filters->checkBox($name, $filter['caption'], false, false, $filter['class'], false, false, $value);
                            break;
                        case 'radio':
                            if (!$group) {
                                $CFG->o_method_suppress = true;
                                $form_filters->startGroup();
                            }
                            $CFG->o_method_id = $filter['method_id'];
                            $CFG->o_method_name = 'filterRadio';
                            $form_filters->radioInput($name, $filter['caption'], false, $value, false, $filter['class'], false, false, $filter['checked']);
                            if (!$group) {
                                $group = true;
                            } else {
                                $CFG->o_method_suppress = true;
                                $form_filters->endGroup();
                                $group = false;
                            }
                            break;
                        case 'start_date':
                            $CFG->o_method_id = $filter['method_id'];
                            $CFG->o_method_name = 'filterDateStart';
                            $form_filters->dateWidget($name, $filter['caption'], false, $filter['time'], $filter['ampm'], $filter['req_start'], $filter['req_end'], $value, false, false, $filter['class'], $filter['format']);
                            $form_filters->dateWidget($name, $CFG->grid_until_label, false, $filter['time'], $filter['ampm'], $filter['req_start'], $filter['req_end'], $value, $filter['link_to'], false, $filter['class'], $filter['format'], false, false, true);
                            break;
                        case 'month':
                            $CFG->o_method_id = $filter['method_id'];
                            $CFG->o_method_name = 'filterMonth';
                            $form_filters->selectInput($name . '_month', $filter['caption'], false, $value, String::getMonthNames($filter['language']));
                            $CFG->o_method_suppress = true;
                            $form_filters->HTML('<input type="hidden" name="month_fields[]" value="' . $name . '_month" />');
                            break;
                        case 'year':
                            $CFG->o_method_id = $filter['method_id'];
                            $CFG->o_method_name = 'filterYear';
                            $back_to = $filter['back_to'] ? $filter['back_to'] : 1975;
                            $years = range(date('Y'), $back_to);
                            $years = array_combine($years, $years);
                            $form_filters->selectInput($name . '_year', $filter['caption'], false, $value, $years);
                            $CFG->o_method_suppress = true;
                            $form_filters->HTML('<input type="hidden" name="year_fields[]" value="' . $name . '_year" />');
                            break;
                    }
                }
            }
            if ($this->mode == 'graph' || $this->mode == 'graph_line' || $this->mode == 'graph_pie') {
                $CFG->o_method_suppress = true;
                $form_filters->selectInput('graph_value_column', $CFG->value_column_label, false, false, $this->value_columns);
                $CFG->o_method_suppress = true;
                $form_filters->selectInput('graph_name_column', $CFG->name_column_label, false, false, $this->name_columns);
                if ($this->mode != 'graph_pie') {
                    $CFG->o_method_suppress = true;
                    $form_filters->selectInput('graph_x_axis', $CFG->x_axis, false, false, $this->x_columns);
                    $CFG->o_method_suppress = true;
                    $form_filters->checkBox('graph_combine', $CFG->combine_label, false);
                }
            }
            if ($group) {
                $form_filters->endGroup();
            }
            $CFG->o_method_suppress = true;
            $form_filters->HTML('<input type="hidden" name="mode" value="' . $this->mode . '" />');
            $CFG->o_method_suppress = true;
            $form_filters->HTML('<div class="clear"></div>');
            $CFG->o_method_suppress = true;
            $form_filters->submitButton('submit', $CFG->filter_submit_text, false, 'not_method');
            $CFG->o_method_suppress = true;
            $form_filters->resetButton($CFG->grid_default_reset, false, 'not_method');
            echo '
			<div class="grid_filters area">
				<div class="box_tl"></div>
				<div class="box_tr"></div>
				<div class="box_bl"></div>
				<div class="box_br"></div>
				<div class="t_shadow"></div>
				<div class="r_shadow"></div>
				<div class="b_shadow"></div>
				<div class="l_shadow"></div>
				<div class="box_b"></div>
				<div class="box_t"></div>
				<div class="contain">';
            $form_filters->display();
            echo '</div></div>';
        }
    }
Example #5
0
                <?php 
$currencies_list = array();
if ($CFG->currencies) {
    foreach ($CFG->currencies as $key => $currency) {
        if (is_numeric($key) || $currency['currency'] == 'BTC') {
            continue;
        }
        $currencies_list[$key] = $currency;
    }
}
//$register->textInput('first_name',Lang::string('settings-first-name'),false);
//$register->textInput('last_name',Lang::string('settings-last-name'),false);
//$register->selectInput('country',Lang::string('settings-country'),false,false,$countries,false,array('name'));
$register->textInput('email', Lang::string('settings-email'), 'email');
$register->selectInput('default_currency', Lang::string('default-currency'), 1, false, $currencies_list, false, array('currency'));
$register->checkBox('terms', Lang::string('settings-terms-accept'), false, false, false, false, false, false, 'checkbox_label');
$register->captcha(Lang::string('settings-capcha'));
$register->HTML('<div class="form_button"><input type="submit" name="submit" value="' . Lang::string('home-register') . '" class="but_user" /></div>');
$register->hiddenInput('uniq', 1, $_SESSION["register_uniq"]);
$register->display();
?>
            	<div class="clear"></div>
            </div>
            <div class="mar_top8"></div>
        </div>
	</div>
	<?php 
include 'includes/sidebar_account.php';
?>
</div>
<?php 
Example #6
0
if ($action == "new" || isset($_GET["all"])) {
    $row = Form::label("pwd", _("Password") . ":", array('class' => 'required'));
    $row .= Form::password("pwd", isset($formVar["pwd"]) ? $formVar["pwd"] : null, array('size' => 20, 'error' => isset($formError["pwd"]) ? $formError["pwd"] : null));
    $row .= Form::hidden("md5");
    $tbody[] = $row;
    $row = Form::label("pw2", _("Re-enter Password") . ":", array('class' => 'required'));
    $row .= Form::password("pwd2", isset($formVar["pwd2"]) ? $formVar["pwd2"] : null, array('size' => 20, 'error' => isset($formError["pwd2"]) ? $formError["pwd2"] : null));
    $row .= Form::hidden("md5_confirm");
    $tbody[] = $row;
}
$row = Form::label("email", _("Email") . ":");
$row .= Form::text("email", isset($formVar["email"]) ? $formVar["email"] : null, array('size' => 40, 'error' => isset($formError["email"]) ? $formError["email"] : null));
$tbody[] = $row;
if (!isset($_GET["all"])) {
    $row = Form::label("actived", _("Actived") . ":");
    $row .= Form::checkBox("actived", 1, array('checked' => isset($formVar["actived"]) ? $formVar["actived"] != "" : false));
    $tbody[] = $row;
    if (!isset($formVar["id_profile"]) || $formVar["id_profile"] == "") {
        $formVar["id_profile"] = OPEN_PROFILE_DOCTOR;
        // by default doctor profile
    }
    $array = array(OPEN_PROFILE_ADMINISTRATOR => _("Administrator"), OPEN_PROFILE_ADMINISTRATIVE => _("Administrative"), OPEN_PROFILE_DOCTOR => _("Doctor"));
    $row = Form::label("id_profile", _("Profile") . ":", array('class' => 'required'));
    $row .= Form::select("id_profile", $array, $formVar["id_profile"]);
    unset($array);
    $tbody[] = $row;
}
$row = Form::label("id_theme", _("Theme") . ":");
$row .= Form::selectTable("theme_tbl", "id_theme", isset($formVar["id_theme"]) ? $formVar["id_theme"] : null, "theme_name");
$tbody[] = $row;
$tfoot = array(Form::button("save", _("Submit")) . Form::generateToken());
Example #7
0
if (is_array($skins_raw)) {
    foreach ($skins_raw as $skin) {
        $skins[$skin] = $skin;
    }
}
$settings = new Form('new_settings', false, false, false, 'settings', true);
$settings->record_id = 1;
$settings->info = Settings::getStructured();
$settings->show_errors();
$settings->show_messages();
$settings->startFieldset('Appearance');
$settings->fileInput('logo', 'Logo', false, false, false, false, array('logo' => array('width' => 190, 'height' => 55)), 1, false, false, false, false, 1, 1);
$settings->autoComplete('skin', 'Skin', false, false, false, $skins);
$settings->endFieldset();
$settings->startFieldset('URL Rewriting');
$settings->checkBox('url_rewrite', 'Url Rewrite');
$settings->endFieldset();
$settings->startFieldset('Locale');
$settings->textInput('locale', 'Locale');
$settings->endFieldset();
$settings->startFieldset('Form Behavior');
$settings->textInput('pass_regex', 'Pass Regex');
$settings->textInput('verify_default_error', 'Default Verify Error');
$settings->textInput('verify_email_error', 'Email Error');
$settings->textInput('verify_phone_error', 'Phone Error');
$settings->textInput('verify_file_type_error', 'File Type Error');
$settings->textInput('verify_file_size_error', 'File Size Error');
$settings->textInput('verify_file_misc_error', 'File Miscelaneous Error');
$settings->textInput('verify_file_required_error', 'File Required Error');
$settings->textInput('verify_password_error', 'Password Error');
$settings->textInput('verify_zip_error', 'Zip Code Error');
Example #8
0
     }
 }
 if (!in_array('one_record', $table_fields)) {
     $sql = "ALTER TABLE admin_tabs ADD {$_REQUEST['table']}.one_record ENUM( 'Y', 'N' ) NOT NULL";
     db_query($sql);
 }
 $form = new Form('tabs_form', false, false, false, $_REQUEST['table']);
 $form->verify();
 $form->save();
 $form->get($_REQUEST['id']);
 $form->show_errors();
 $form->show_messages();
 $form->textInput('name', 'Name', true);
 $form->textInput('url', 'Url');
 $form->textInput('order', 'Order', false, '0');
 $form->checkBox('one_record', 'Auto First Record?');
 if ($_REQUEST['table'] == 'admin_tabs') {
     $form->checkBox('hidden', 'Hidden?');
     $form->checkBox('is_ctrl_panel', 'Is Control Panel?');
     $form->selectInput('for_group', 'For Group' . false, false, false, false, 'admin_groups', array('name'));
 } elseif ($_REQUEST['table'] == 'admin_pages') {
     if (in_array('icon', $table_fields)) {
         $form->textInput('icon', 'Icon');
     }
 }
 if ($_REQUEST['from_editor']) {
     $next_page_id = $_REQUEST['pm_page_id'];
     $next_page_action = $_REQUEST['pm_action'];
     $form->button(false, $CFG->ok_button, false, false, false, false, 'onclick="saveForm(this,\'pm_editor\',\'index.php?tab_bypass=1&current_url=edit_page&id=' . $next_page_id . '&action=' . $next_page_action . '&is_tab=1\')"');
 } else {
     $form->submitButton('save', $CFG->save_caption);
Example #9
0
 function show_filters()
 {
     global $CFG;
     if ($this->inset_id > 0) {
         return false;
     }
     if (is_array($this->filters)) {
         $form_filters = new Form('form_filters', false, 'GET', 'form_filters', false);
         $form_filters->show_errors();
         $form_filters->info = $form_filters->info ? $form_filters->info : $this->filter_results;
         foreach ($this->filters as $filter) {
             $name = $filter['field_name'];
             $caption = !empty($filter['caption']) ? $caption : $name;
             if ($filter['type'] != 'radio' && $filter['type'] != 'start_date' && $filter['type'] != 'end_date' && $group) {
                 $form_filters->endGroup();
                 $group = false;
             }
             switch ($filter['type']) {
                 case 'per_page':
                     $options_array = is_array($filter['options_array']) ? $filter['options_array'] : array(10 => 10, 30 => 30, 50 => 50);
                     $caption = !empty($filter['caption']) ? $filter['caption'] : $CFG->results_per_page_text;
                     $CFG->o_method_id = $filter['method_id'];
                     $CFG->o_method_name = 'filterPerPage';
                     $form_filters->selectInput('per_page', $caption, false, $this->rows_per_page, $options_array, false, false, false, false, $filter['class']);
                     break;
                 case 'search':
                     $CFG->o_method_id = $filter['method_id'];
                     $CFG->o_method_name = 'filterSearch';
                     $form_filters->textInput('search', $filter['caption'], false, false, false, false, $filter['class']);
                     foreach ($filter['subtable_fields'] as $s_field => $s_subtable) {
                         $s_subtable = $s_subtable && $s_subtable != $s_field ? $s_subtable : $this->table;
                         $CFG->o_method_suppress = true;
                         $form_filters->HTML('<input type="hidden" name="search_fields[' . $s_field . ']" value="' . $s_subtable . '" />');
                     }
                     break;
                 case 'autocomplete':
                     $CFG->o_method_id = $filter['method_id'];
                     $CFG->o_method_name = 'filterAutocomplete';
                     $form_filters->autoComplete($name, $filter['caption'], false, $filter['value'], false, $filter['options_array'], $filter['subtable'], $filter['subtable_fields'], false, false, $filter['class']);
                     $CFG->o_method_suppress = true;
                     $form_filters->HTML('<input type="hidden" name="subtables[' . $name . '][subtable]" value="' . $filter['subtable'] . '" />');
                     $CFG->o_method_suppress = true;
                     $form_filters->HTML('<input type="hidden" name="subtables[' . $name . '][subtable_fields]" value="' . implode('|', $filter['subtable_fields']) . '" />');
                     $CFG->o_method_suppress = true;
                     $form_filters->HTML('<input type="hidden" name="subtables[' . $name . '][f_id_field]" value="' . $filter['f_id_field'] . '" />');
                     break;
                 case 'tokenizer':
                     $CFG->o_method_id = $filter['method_id'];
                     $CFG->o_method_name = 'filterTokenizer';
                     $form_filters->autoComplete($name, $filter['caption'], false, $filter['value'], false, $filter['options_array'], $filter['subtable'], $filter['subtable_fields'], false, false, $filter['class'], false, false, false, false, false, false, false, false, false, false, false, 1);
                     break;
                 case 'cats':
                     $CFG->o_method_id = $filter['method_id'];
                     $CFG->o_method_name = 'filterCats';
                     $form_filters->catSelect($filter['subtable'], $filter['caption'], 0, $filter['class'], false, false, false, $filter['subtable_fields'], $filter['concat_char']);
                     break;
                 case 'first_letter':
                     $range = range('A', 'Z');
                     $HTML = '';
                     foreach ($range as $l) {
                         $HTML .= Link::url($this->link_url, $l, 'fl=' . $l . '&fl_field=' . $name . '&fl_subtable=' . $filter['subtable'] . '&is_tab=' . $this->is_tab, false, false, 'content');
                     }
                     $CFG->o_method_id = $filter['method_id'];
                     $CFG->o_method_name = 'filterFirstLetter';
                     $form_filters->HTML($HTML);
                     break;
                 case 'select':
                     $CFG->o_method_id = $filter['method_id'];
                     $CFG->o_method_name = 'filterSelect';
                     $form_filters->selectInput($name, $filter['caption'], false, false, $filter['options_array'], $filter['subtable'], $filter['subtable_fields'], false, false, $filter['class'], false, false, $filter['f_id_field'], false, $filter['depends_on']);
                     $CFG->o_method_suppress = true;
                     $form_filters->HTML('<input type="hidden" name="subtables[' . $name . '][subtable]" value="' . $filter['subtable'] . '" />');
                     $CFG->o_method_suppress = true;
                     $form_filters->HTML('<input type="hidden" name="subtables[' . $name . '][subtable_fields]" value="' . implode('|', $filter['subtable_fields']) . '" />');
                     $CFG->o_method_suppress = true;
                     $form_filters->HTML('<input type="hidden" name="subtables[' . $name . '][f_id_field]" value="' . $filter['f_id_field'] . '" />');
                     break;
                 case 'checkbox':
                     $CFG->o_method_id = $filter['method_id'];
                     $CFG->o_method_name = 'filterCheckbox';
                     $form_filters->checkBox($name, $filter['caption'], false, false, $filter['class'], false, false, $filter['checked']);
                     break;
                 case 'radio':
                     if (!$group) {
                         $CFG->o_method_suppress = true;
                         $form_filters->startGroup();
                     }
                     $CFG->o_method_id = $filter['method_id'];
                     $CFG->o_method_name = 'filterRadio';
                     $form_filters->radioInput($name, $filter['caption'], false, $filter['value'], false, $filter['class'], false, false, $filter['checked']);
                     if (!$group) {
                         $group = true;
                     } else {
                         $CFG->o_method_suppress = true;
                         $form_filters->endGroup();
                         $group = false;
                     }
                     break;
                 case 'start_date':
                     $CFG->o_method_id = $filter['method_id'];
                     $CFG->o_method_name = 'filterDateStart';
                     $form_filters->dateWidget($name, $filter['caption'], false, $filter['time'], $filter['ampm'], $filter['req_start'], $filter['req_end'], $filter['value'], false, false, $filter['class'], $filter['format']);
                     break;
                 case 'end_date':
                     $CFG->o_method_id = $filter['method_id'];
                     $CFG->o_method_name = 'filterDateEnd';
                     $form_filters->dateWidget($name, $filter['caption'], false, $filter['time'], $filter['ampm'], $filter['req_start'], $filter['req_end'], $filter['value'], $filter['link_to'], false, $filter['class'], $filter['format'], false, false, true);
                     break;
                 case 'month':
                     $CFG->o_method_id = $filter['method_id'];
                     $CFG->o_method_name = 'filterMonth';
                     $form_filters->selectInput($name . '_month', $filter['caption'], false, false, String::getMonthNames($filter['language']));
                     $CFG->o_method_suppress = true;
                     $form_filters->HTML('<input type="hidden" name="month_fields[]" value="' . $name . '_month" />');
                     break;
                 case 'year':
                     $CFG->o_method_id = $filter['method_id'];
                     $CFG->o_method_name = 'filterYear';
                     $back_to = $filter['back_to'] ? $filter['back_to'] : 1975;
                     $years = range(date('Y'), $back_to);
                     $years = array_combine($years, $years);
                     $form_filters->selectInput($name . '_year', $filter['caption'], false, false, $years);
                     $CFG->o_method_suppress = true;
                     $form_filters->HTML('<input type="hidden" name="year_fields[]" value="' . $name . '_year" />');
                     break;
             }
         }
         if ($group) {
             $form_filters->endGroup();
         }
         $CFG->o_method_suppress = true;
         $form_filters->HTML('<input type="hidden" name="mode" value="' . $this->mode . '" />');
         $CFG->o_method_suppress = true;
         $form_filters->submitButton('submit', $CFG->filter_submit_text, false, 'not_method');
         $CFG->o_method_suppress = true;
         $form_filters->resetButton('Reset', false, 'not_method');
         $form_filters->display();
     }
 }
Example #10
0
echo HTML::para(HTML::link(_("Install dump from file"), '../install/index.php') . ' | ' . HTML::link(_("Optimize Database"), '../admin/dump_optimize_db.php'));
if ($numTables < 1) {
    // @todo message
    require_once "../layout/footer.php";
    exit;
}
echo HTML::insertScript('dump_functions.js');
echo HTML::start('form', array('method' => 'post', 'action' => './dump_process.php'));
$i = 0;
$table = null;
while ($i < $numTables) {
    DUMP_MYSQL_INT_VERSION >= 32303 ? $table[$tables[$i]['Name']] = $tables[$i]['Name'] : ($table[$tables[$i]] = $tables[$i]);
    $i++;
}
$fieldArray = array(Form::select("table_select", $table, null, array('size' => 15)));
unset($table);
$fieldFoot = array(HTML::link(_("Select all"), '#', null, array('id' => 'select_all')) . ' / ' . HTML::link(_("Unselect all"), '#', null, array('id' => 'unselect_all')));
echo Form::fieldset(_("View dump of database"), $fieldArray, $fieldFoot, array('id' => 'dump_tables'));
$fieldArray = null;
$fieldArray[] = Form::radioButton("what", "data", array('id' => 'radio_dump_data', 'checked' => true)) . Form::label("radio_dump_data", _("Structure and data"));
$fieldArray[] = Form::radioButton("what", "structure", array('id' => 'radio_dump_structure')) . Form::label("radio_dump_structure", _("Structure only"));
$fieldArray[] = Form::radioButton("what", "dataonly", array('id' => 'radio_dump_dataonly')) . Form::label("radio_dump_dataonly", _("Data only"));
$fieldArray[] = Form::radioButton("what", "xml", array('id' => 'radio_dump_xml')) . Form::label("radio_dump_xml", _("Export to XML format"));
$fieldArray[] = Form::radioButton("what", "excel", array('id' => 'radio_dump_csv')) . Form::label("radio_dump_csv", _("Export to CSV format (data only)"));
echo Form::fieldset(_("Options"), $fieldArray, null, array('id' => 'dump_options'));
$fieldArray = array(Form::checkBox("drop", "yes") . Form::label("drop", _("Add 'DROP TABLE'")), Form::checkBox("show_columns", "yes") . Form::label("show_columns", _("Complete 'INSERTs'")), Form::checkBox("extended_inserts", "yes") . Form::label("extended_inserts", _("Extended 'INSERTs'")), Form::checkBox("use_backquotes", "yes") . Form::label("use_backquotes", _("Enclose table and field names with backquotes")), Form::checkBox("add_delete", "yes") . Form::label("add_delete", _("Add 'DELETE * FROM __table__'")), Form::checkBox("use_dbname", "yes") . Form::label("use_dbname", _("Add 'USE __dbname__'")), Form::checkBox("create_db", "yes") . Form::label("create_db", _("Add 'CREATE DATABASE __dbname__'")), Form::checkBox("as_file", "sendit") . Form::label("as_file", _("Save as file")));
echo Form::fieldset(_("Extended options"), $fieldArray, null, array('id' => 'dump_extended'));
echo HTML::para(Form::button("dump", _("Submit")) . Form::generateToken(), array('class' => 'center'));
echo HTML::end('form');
echo Msg::hint(_("Note: Some check options are exclusive. Be carefully!"));
require_once "../layout/footer.php";
Example #11
0
        }
    }
}
if ($logical == OPEN_NOT) {
    $query .= " NOT ";
}
$query .= $word[$num - 1] . ")";
echo HTML::insertScript('checkboxes.js');
echo HTML::start('form', array('method' => 'post', 'action' => '../medical/relative_new.php'));
echo Form::hidden("id_patient", $idPatient, array('id' => 'r_id_patient'));
$thead = array(sprintf(_("Search Results From Query: %s"), $query) => array('colspan' => 2));
$options = array(0 => array('align' => 'right'));
$tbody = array();
while ($pat = $patQ->fetch()) {
    $row = $patQ->getCurrentRow() . '.';
    $row .= Form::checkBox("check[]", $pat->getIdPatient(), array('id' => String::numberToAlphabet($patQ->getCurrentRow())));
    $row .= OPEN_SEPARATOR;
    $row .= $pat->getSurname1() . ' ' . $pat->getSurname2() . ' ' . $pat->getFirstName();
    if ($val != "") {
        $row .= "<br />" . $key . " ";
        eval("\$row .= {$val};");
    }
    $tbody[] = explode(OPEN_SEPARATOR, $row);
}
// end while
$patQ->freeResult();
$patQ->close();
unset($patQ);
$tfoot = array(0 => HTML::link(_("Select all"), '#', null, array('id' => 'select_all_checks')) . ' / ' . HTML::link(_("Unselect all"), '#', null, array('id' => 'unselect_all_checks')), 1 => Form::button("add", _("Add selected to Relatives List")) . Form::generateToken());
echo HTML::table($thead, $tbody, $tfoot, $options);
echo HTML::end('form');
Example #12
0
    $edit = new Form('users_form', false, false, false, $_REQUEST['table']);
    $edit->get($_REQUEST['id']);
    if ($_REQUEST['table'] == 'admin_groups') {
        $edit->textInput('name', 'Name');
        if ($_REQUEST['id']) {
            $edit->permissionEditor('admin', $_REQUEST['id']);
        }
    } else {
        $edit->passiveField('id', 'ID');
        $edit->textInput('user', $CFG->user_username, true, false, false, false, false, false, false, false, 1, $CFG->user_unique_error);
        $edit->passwordInput('pass', $CFG->user_password, true);
        $edit->passwordInput('pass1', $CFG->user_password, true, false, false, false, false, false, 'pass');
        $edit->textInput('first_name', $CFG->user_first_name, true);
        $edit->textInput('last_name', $CFG->user_last_name, true);
        $edit->textInput('phone', $CFG->user_phone);
        $edit->textInput('country_code', 'Country Code');
        $edit->textInput('email', $CFG->user_email);
        $edit->selectInput('f_id', $CFG->user_group, false, $_REQUEST['f_id'], false, 'admin_groups', array('name'));
        $edit->checkBox('is_admin', $CFG->user_is_admin);
        $edit->checkBox('verified_authy', 'Use Authy?');
    }
    $edit->submitButton('submit', $CFG->save_caption);
    //$edit->button(false,$CFG->cancel_button,false,false,false,false,'onclick="$(\'#edit_box\').fadeOut(\'slow\');"');
    $edit->cancelButton($CFG->cancel_button);
    $edit->display();
} else {
    $users = new MultiList(false, true, $CFG->path_users);
    $users->addTable('admin_groups', array('name'), $CFG->url, false, false, 'edit_box');
    $users->addTable('admin_users', array('id', 'first_name', 'last_name', 'company'), $CFG->url, 'admin_groups', false, 'edit_box');
    $users->display();
}
Example #13
0
    function show_filters()
    {
        global $CFG;
        if ($this->inset_id > 0) {
            return false;
        }
        if (is_array($this->filters)) {
            $form_filters = new Form('form_filters', false, 'GET', 'form_filters cal', false);
            $form_filters->show_errors();
            foreach ($this->filters as $filter) {
                $name = $filter['field_name'];
                $caption = !empty($filter['caption']) ? $caption : $name;
                if ($filter['type'] != 'radio' && $filter['type'] != 'start_date' && $filter['type'] != 'end_date' && $group) {
                    $form_filters->endGroup();
                    $group = false;
                }
                switch ($filter['type']) {
                    case 'autocomplete':
                        $CFG->o_method_id = $filter['method_id'];
                        $CFG->o_method_name = 'filterAutocomplete';
                        $form_filters->autoComplete($name, $filter['caption'], false, $filter['value'], false, $filter['options_array'], $filter['subtable'], $filter['subtable_fields'], false, false, $filter['class']);
                        break;
                    case 'tokenizer':
                        $CFG->o_method_id = $filter['method_id'];
                        $CFG->o_method_name = 'filterTokenizer';
                        $row = DB::getRecord($filter['subtable'], $this->record_id, 0, 1);
                        if (is_array($filter['subtable_fields'])) {
                            foreach ($filter['subtable_fields'] as $field) {
                                $row1[] = $row[$field];
                            }
                            $show = implode(' ', $row1);
                        } else {
                            $show = implode(' ', $row);
                        }
                        $filter['value'] = !empty($filter['value']) && $this->mode == 'day' ? $filter['value'] : array($this->record_id => $show);
                        $form_filters->autoComplete($name, $filter['caption'], false, $filter['value'], false, $filter['options_array'], $filter['subtable'], $filter['subtable_fields'], false, false, $filter['class'], false, false, false, false, false, false, false, false, false, false, false, 1);
                        break;
                    case 'select':
                        $CFG->o_method_id = $filter['method_id'];
                        $CFG->o_method_name = 'filterSelect';
                        $form_filters->selectInput($name, $filter['caption'], false, false, $filter['options_array'], $filter['subtable'], $filter['subtable_fields'], false, false, $filter['class'], false, false, $filter['f_id_field'], false, $filter['depends_on']);
                        break;
                    case 'checkbox':
                        $CFG->o_method_id = $filter['method_id'];
                        $CFG->o_method_name = 'filterCheckbox';
                        $form_filters->checkBox($name, $filter['caption'], false, false, $filter['class'], false, false, $filter['checked']);
                        break;
                }
            }
            if ($group) {
                $form_filters->endGroup();
            }
            $CFG->o_method_suppress = true;
            $form_filters->HTML('
			<input type="hidden" id="cal_mode" name="mode" value="' . $this->mode . '" />
			<input type="hidden" id="cal_y" name="' . 'cal_' . $this->i . '_y' . '" value="' . $this->y . '" />
			<input type="hidden" id="cal_m" name="' . 'cal_' . $this->i . '_m' . '" value="' . $this->m . '" />
			<input type="hidden" id="cal_d" name="' . 'cal_' . $this->i . '_d' . '" value="' . $this->d . '" />
			');
            $CFG->o_method_suppress = true;
            $form_filters->submitButton('submit', $CFG->filter_submit_text, false, 'not_method');
            $CFG->o_method_suppress = true;
            $form_filters->resetButton('Reset', false, 'not_method');
            $form_filters->display();
        }
    }
    $problemQ->close();
    echo Msg::info(_("No medical problems defined for this patient."));
    include_once "../layout/footer.php";
    exit;
}
echo HTML::section(2, _("Medical Problems List:"));
/**
 * New form
 */
echo HTML::start('form', array('method' => 'post', 'action' => '../medical/connection_new.php'));
echo Form::hidden("id_problem", $idProblem);
echo Form::hidden("id_patient", $idPatient);
$thead = array(_("Order Number"), _("Wording"));
$tbody = array();
while ($problem = $problemQ->fetch()) {
    $row = $problem->getOrderNumber() . '.';
    $row .= Form::checkBox("check[]", $problem->getIdProblem(), array('id' => String::numberToAlphabet($problem->getOrderNumber())));
    $row .= OPEN_SEPARATOR;
    $row .= $problem->getWording();
    $tbody[] = explode(OPEN_SEPARATOR, $row);
}
// end while
$problemQ->freeResult();
$problemQ->close();
unset($problemQ);
unset($problem);
$tfoot = array(Form::button("add", _("Add selected to Connection Problems List")) . Form::generateToken());
$options = array(0 => array('align' => 'right'), 'tfoot' => array('align' => 'center'));
echo HTML::table($thead, $tbody, $tfoot, $options);
echo HTML::end('form');
require_once "../layout/footer.php";