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
 public function field($class)
 {
     $form = new Form();
     return "<h4>" . $this->description . "</h4>" . $form->textArea("text", $this->value, 61, 20, $class) . "<br />";
 }
Example #4
0
 private function showForm($use_fckeditor = false, $require_email = false, $ask_website = false, $hidden = false, $editor_height = false)
 {
     global $CFG;
     $form = new Form('comments_' . $this->i, false, false, $this->class . '_form');
     $CFG->o_method_suppress = true;
     $form->hiddenInput('p_id');
     $CFG->o_method_suppress = true;
     $form->hiddenInput('url', false, $this->url);
     $CFG->o_method_suppress = true;
     $form->hiddenInput('record_id', false, $this->record_id);
     if (is_array($this->pass_vars)) {
         foreach ($this->pass_vars as $var => $val) {
             $CFG->o_method_suppress = true;
             $form->HTML('<input type="hidden" name="' . $var . '" value="' . $val . '" />');
         }
     }
     if ($CFG->backstage_mode) {
         $CFG->o_method_suppress = true;
         $form->HTML('<input type="hidden" name="current_url" value="' . $CFG->url . '" />');
         $CFG->o_method_suppress = true;
         $form->HTML('<input type="hidden" name="action" value="' . $CFG->action . '" />');
         $CFG->o_method_suppress = true;
         $form->HTML('<input type="hidden" name="is_tab" value="' . $CFG->is_tab . '" />');
         $CFG->o_method_suppress = true;
         $form->HTML('<input type="hidden" name="id" value="' . $CFG->id . '" />');
         $CFG->o_method_suppress = true;
         $form->HTML('<input type="hidden" name="return_to_self" value="1" />');
     }
     if (!User::isLoggedIn()) {
         $require_email = $require_email ? 'email' : false;
         $form->textInput('name', $CFG->comments_name_label, true);
         $form->textInput('email', $CFG->comments_email_label, $require_email);
         if ($ask_website) {
             $form->textInput('website', $CFG->comments_website_label);
         }
     } else {
         $CFG->o_method_suppress = true;
         $form->hiddenInput('user_id', false, User::$info['id']);
     }
     if ($use_fckeditor) {
         $CFG->o_method_suppress = true;
         $form->textEditor($hidden ? 'comments1' : 'comments', $CFG->comments_comments_label, true, false, false, false, false, true, false, $editor_height);
     } else {
         $CFG->o_method_suppress = true;
         $form->textArea($hidden ? 'comments1' : 'comments', $CFG->comments_comments_label, true);
     }
     $CFG->o_method_suppress = true;
     $form->submitButton('submit', $CFG->comments_submit, false, 'button');
     $form->display();
 }
/**
 * history_family_fields.php
 *
 * Fields of family antecedents
 *
 * Licensed under the GNU GPL. For full terms see the file LICENSE.
 *
 * @package   OpenClinic
 * @copyright 2002-2008 jact
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL
 * @version   CVS: $Id: history_family_fields.php,v 1.20 2008/03/23 12:00:17 jact Exp $
 * @author    jact <*****@*****.**>
 */
require_once dirname(__FILE__) . "/../lib/exe_protect.php";
executionProtection(__FILE__);
$tbody = array();
$row = Form::label("parents_status_health", _("Parents Status Health") . ":");
$row .= Form::textArea("parents_status_health", $formVar["parents_status_health"], array('rows' => 4, 'cols' => 90));
$tbody[] = $row;
$row = Form::label("brothers_status_health", _("Brothers and Sisters Status Health") . ":");
$row .= Form::textArea("brothers_status_health", $formVar["brothers_status_health"], array('rows' => 4, 'cols' => 90));
$tbody[] = $row;
$row = Form::label("spouse_childs_status_health", _("Spouse and Childs Status Health") . ":");
$row .= Form::textArea("spouse_childs_status_health", $formVar["spouse_childs_status_health"], array('rows' => 4, 'cols' => 90));
$tbody[] = $row;
$row = Form::label("family_illness", _("Family Illness") . ":");
$row .= Form::textArea("family_illness", $formVar["family_illness"], array('rows' => 4, 'cols' => 90));
$tbody[] = $row;
$tfoot = array(Form::button("update", _("Update")) . Form::generateToken());
$options = array('class' => 'large_area');
echo Form::fieldset($title, $tbody, $tfoot, $options);
Example #6
0
        $_SESSION = array();
        session_destroy();
        echo Msg::info(_("File installed correctly."));
        echo HTML::para(HTML::link(_("Go to OpenClinic"), '../home/index.php'));
        echo HTML::rule();
    }
}
/**
 * In Mozilla there no path file, only name and extension. Why? Is it an error?
 */
if (isset($_POST['view_file']) && !empty($_FILES['sql_file']['name']) && $_FILES['sql_file']['size'] > 0) {
    $sqlQuery = file_get_contents($_FILES['sql_file']['tmp_name']);
    //$sqlQuery = Check::safeText($sqlQuery, false);
    echo HTML::start('form', array('method' => 'post', 'action' => $_SERVER['PHP_SELF']));
    $body = array();
    $body[] = Form::textArea("sql_query", $sqlQuery, array('rows' => 15, 'cols' => 75, 'readonly' => true));
    $foot = array(Form::button("install_file", _("Install file")) . Form::generateToken());
    echo Form::fieldset(_("Install file"), $body, $foot);
    echo HTML::end('form');
    echo HTML::para(HTML::link(_("Cancel"), './index.php'));
    include_once "../layout/footer.php";
    exit;
}
// end if
require_once "../model/Query.php";
$installQ = new Query();
$installQ->captureError(true);
if ($installQ->isError()) {
    echo HTML::para(_("The connection to the database failed with the following error:"));
    echo Msg::error($installQ->getDbError());
    echo HTML::rule();
Example #7
0
 $ref = new ReflectionClass($class);
 $params = $ref->getMethod($method)->getParameters();
 $m_name = $ref->getMethod($method)->getName();
 if (is_array($params)) {
     foreach ($params as $param) {
         $name = $param->getName();
         $required = $param->isDefaultValueAvailable() ? false : true;
         if ($name == 'image_sizes' || $name == 'insert_array' || $name == 'formula_id_field' || $name == 'variables' || $m_name == 'addTable' && $name == 'filters') {
             $form->info['argument_' . $name] = String::fauxArray($form->info['argument_' . $name]);
             $form->textInput('argument_' . $name, ucfirst(str_replace('_', ' ', $name)), $required, false, false, false, false, false, false, true);
         } elseif ($m_name == 'catSelect' && $name == 'input_type') {
             $form->selectInput('argument_' . $name, ucfirst(str_replace('_', ' ', $name)), $required, false, array('' => 'Checkbox', 'textInput' => 'Text input'));
         } elseif ($name == 'color') {
             $form->colorPicker('argument_' . $name, ucfirst(str_replace('_', ' ', $name)), $required);
         } elseif ($name == 'formula') {
             $form->textArea('argument_' . $name, ucfirst(str_replace('_', ' ', $name)), $required);
         } elseif (($m_name == 'selectInput' || $m_name == 'filterSelect') && $name == 'level') {
             $form->selectInput('argument_' . $name, ucfirst(str_replace('_', ' ', $name)), $required, false, array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5));
         } elseif ($m_name == 'startArea' && $name == 'class') {
             $form->selectInput('argument_' . $name, ucfirst(str_replace('_', ' ', $name)), $required, false, array('box_left' => 'Box Left', 'box_right' => 'Box Right', 'box' => 'Box', 'left' => 'Left', 'right alert' => 'Right Alert', 'box_left alert' => 'Box Left Alert', 'box_right alert' => 'Box Right Alert', 'box alert' => 'Box Alert', 'left alert' => 'Left Alert', 'right alert' => 'Right Alert'));
         } elseif ($m_name == 'startRestricted' && ($name == 'groups' || $name == 'exclude_groups') || $name == 'download_encrypted_group') {
             $form->autoComplete('argument_' . $name, ucfirst(str_replace('_', ' ', $name)), $required, false, 1, false, 'admin_groups', array('name'));
         } elseif ($m_name == 'startRestricted' && ($name == 'users' || $name == 'exclude_users')) {
             $form->autoComplete('argument_' . $name, ucfirst(str_replace('_', ' ', $name)), $required, false, 1, false, 'admin_users', array('first_name', 'last_name'));
         } elseif ($name == 'create_db_field') {
             $form->selectInput('argument_' . $name, ucfirst(str_replace('_', ' ', $name)), $required, false, array('' => '', 'int' => 'INT', 'date' => 'DATE', 'datetime' => 'DATETIME', 'vchar' => 'VARCHAR', 'checkbox' => 'Y/N'));
         } elseif ($name == 'j' || $name == 'static' || $name == 'grid_input' || $name == 'inputs_array') {
             continue;
         } elseif ($name == 'is_inset') {
             $form->hiddenInput('argument_' . $name, false, 1);
         } elseif ($name == 'aggregate_function') {
 /**
  * this method is the underpinning of the front end form - it checks the state and displays either the input or the result (if form is submitted)
  * @param string $name - the name of this element, also it's ID.  We need ID for the label click to transfer focus to the input, and a name for JS.
  * @param string $value - Optional.  The default value attribute for the element. Default: ""
  * @param string $attributes - writes HTML attributes.  Optional.  Defaults to null
  * @param string $selected - Optional - This should be set to the key that will be selected by default (If null then the first element is selected). Default: null
  */
 public function getElementState($name, $type, $value = "", $attributes = null, $selcted = null)
 {
     $type = strtolower(trim($type));
     if ($this->defaultState()) {
         switch ($type) {
             case "text":
                 parent::textInput($name, $value, $attributes);
                 break;
             case "textarea":
                 parent::textArea($name, $value, $attributes);
                 break;
             case "hidden":
                 parent::hiddenInput($name, $value, $attributes);
                 break;
             case "file":
                 parent::fileInput($name, $value, $attributes);
                 break;
             case "select":
                 parent::select($name, $value, $selected, $attributes);
                 break;
             case "reset":
                 parent::resetButton($name, $value, $attributes);
                 break;
             case "button":
                 parent::button($name, $value, $attributes);
                 break;
             default:
                 parent::input($name, $type, $value, $attributes);
                 break;
         }
     } else {
         if ($this->outputOnStateChange($type)) {
             echo $this->getConfirmationElement($this->selectedValueOf($name));
         }
     }
 }
$tbody[] = $row;
$row = Form::label("feed", _("Horários de atendimento do beneficiário") . ":");
$row .= Form::textArea("feed", $formVar["feed"], array('rows' => 4, 'cols' => 90));
$tbody[] = $row;
$row = Form::label("habits", _("Hábitos pessoais") . ":");
$row .= Form::textArea("habits", $formVar["habits"], array('rows' => 4, 'cols' => 90));
$tbody[] = $row;
$row = Form::label("peristaltic_conditions", _("Condições periostálticas e/ou alimentares") . ":");
$row .= Form::textArea("peristaltic_conditions", $formVar["peristaltic_conditions"], array('rows' => 4, 'cols' => 90));
$tbody[] = $row;
$row = Form::label("psychological", _("Condições psicológicas") . ":");
$row .= Form::textArea("psychological", $formVar["psychological"], array('rows' => 4, 'cols' => 90));
$tbody[] = $row;
$row = Form::label("children_complaint", _("Queixas gerais (dores, tratamento familiar, etc.)") . ":");
$row .= Form::textArea("children_complaint", $formVar["children_complaint"], array('rows' => 4, 'cols' => 90));
$tbody[] = $row;
$row = Form::label("venereal_disease", _("Está com alguma doença crônica ou venéria? Se sim, quais?") . ":");
$row .= Form::textArea("venereal_disease", $formVar["venereal_disease"], array('rows' => 4, 'cols' => 90));
$tbody[] = $row;
$row = Form::label("accident_surgical_operation", _("Passou por sirurgia ou sofreu algum acidente? Caso sim, quais?") . ":");
$row .= Form::textArea("accident_surgical_operation", $formVar["accident_surgical_operation"], array('rows' => 4, 'cols' => 90));
$tbody[] = $row;
$row = Form::label("medicinal_intolerance", _("Possui intolerância a medicamentos? Se sim, quais?") . ":");
$row .= Form::textArea("medicinal_intolerance", $formVar["medicinal_intolerance"], array('rows' => 4, 'cols' => 90));
$tbody[] = $row;
$row = Form::label("mental_illness", _("Possui alguma doença mental? Se sim, qual?") . ":");
$row .= Form::textArea("mental_illness", $formVar["mental_illness"], array('rows' => 4, 'cols' => 90));
$tbody[] = $row;
$tfoot = array(Form::button("update", _("Atualizar dados")) . Form::generateToken());
$options = array('class' => 'large_area');
echo Form::fieldset($title, $tbody, $tfoot, $options);
Example #10
0
$settings->textInput('value_exists_error', 'Value Exists Error');
$settings->textInput('alt_url_label', 'Alt Url Label');
$settings->textInput('file_input_button', 'File Input Button Text');
$settings->textInput('table_created', 'Successfully created database table.');
$settings->textInput('form_save_message', 'Form saved successfully.');
$settings->textInput('form_update_message', 'Record [field] updated successfully.');
$settings->textInput('file_save_message', 'File [field] saved successfully.');
$settings->checkBox('auto_create_table', 'Auto-Create Tables');
$settings->textInput('fck_css_file', 'FCKEditor CSS File');
$settings->textInput('faux_no_options', 'Faux Select No Options');
$settings->textInput('faux_editor_caption', 'Faux Editor Caption');
$settings->endFieldset();
$settings->startFieldset('File System Options');
$settings->textInput('temp_file_location', 'Temp File Dir');
$settings->textInput('default_upload_location', 'Default Uploads Dir');
$settings->textArea('accepted_file_formats', 'Accepted File Formats', false, false, false, false, false, false, true);
$settings->textArea('accepted_image_formats', 'Accepted Image Formats', false, false, false, false, false, false, true);
$settings->textArea('accepted_audio_formats', 'Accepted Audio Formats', false, false, false, false, false, false, true);
$settings->textArea('image_sizes', 'Image Sizes', false, false, false, false, false, false, true);
$settings->endFieldset();
$settings->startFieldset('Date Picker Options');
$settings->textInput('date_picker_icon', 'DatePicker Icon');
$settings->textInput('date_picker_css', 'DatePicker CSS File');
$settings->endFieldset();
$settings->startFieldset('Default Date Format');
$settings->textInput('default_date_format', 'Default Date Format');
$settings->textInput('default_time_format', 'Default Time Format');
$settings->textInput('default_timezone', 'Timezone');
$settings->endFieldset();
$settings->startFieldset('Media Gallery Options');
$settings->textInput('placeholder_image', 'Placeholder Image');
Example #11
0
echo Form::hidden("adminPhone", $_POST['adminPhone'], array('id' => 'h_adminPhone'));
echo Form::hidden("passwd", $_POST['passwd'], array('id' => 'h_passwd'));
echo Form::hidden("email", preg_replace("/ /", "", $_POST['email']), array('id' => 'h_email'));
echo Form::hidden("adminTheme", $_POST['adminTheme'], array('id' => 'h_adminTheme'));
echo HTML::start('div', array('id' => 'window'));
echo HTML::section(1, _("OpenClinic Install Wizard"));
//echo "<!-- End Header -->\n";
/**
 * Step 2: License
 */
if (isset($_POST['buttonPressed']) && ($_POST['buttonPressed'] == "next1" || $_POST['buttonPressed'] == "back2")) {
    $focusFormField = "license";
    //Error::debug(OPEN_LANGUAGE);
    echo HTML::section(2, sprintf(_("Step %d of %d: "), 2, 7) . _("License"));
    echo HTML::para(_("OpenClinic is free software, distributed under GNU General Public License (GPL). Please read the license and, if you agree, click on 'I accept' button."));
    echo HTML::para(Form::textArea("license", file_get_contents("../LICENSE"), array('rows' => 15, 'cols' => 75)), array('class' => 'center'));
    echo HTML::start('div', array('id' => 'buttons'));
    _showButton("back1", _("Back"), "back");
    _showButton("next2", _("I accept"));
    echo HTML::end('div');
    echo HTML::para(_("Read the license before continue"), array('id' => 'status'));
} elseif (isset($_POST['buttonPressed']) && ($_POST['buttonPressed'] == "next2" || $_POST['buttonPressed'] == "back3")) {
    $focusFormField = "dbHost";
    echo HTML::section(2, sprintf(_("Step %d of %d: "), 3, 7) . _("MySQL Database Settings"));
    echo HTML::para(sprintf(_("Install script create OpenClinic database. These following values will be written in %s file. All fields are required."), HTML::tag('code', 'config/database_constants.php')));
    $tbody = array();
    $tbody[] = array(Form::label("dbHost", _("Database Host:")), Form::text("dbHost", $_POST['dbHost'], array('size' => 25, 'maxlength' => 100)), _("e. g.") . " localhost");
    $tbody[] = array(Form::label("dbUser", _("Database User:"******"dbUser", $_POST['dbUser'], array('size' => 25, 'maxlength' => 100)), _("e. g.") . " openclinic_user");
    $tbody[] = array(Form::label("dbPasswd", _("Database Password:"******"dbPasswd", $_POST['dbPasswd'], array('size' => 25, 'maxlength' => 100)), _("e. g.") . " s45gh72cv");
    $tbody[] = array(Form::label("dbName", _("Database Name:")), Form::text("dbName", $_POST['dbName'], array('size' => 25, 'maxlength' => 100)), _("e. g.") . " openclinic");
    $thead = array('' => array('colspan' => 3));
Example #12
0
    $languageList = I18n::languageList();
    $row .= Form::select("language", $languageList, $formVar["language"]);
    $body[] = $row;
} elseif (defined("OPEN_DEMO") && OPEN_DEMO) {
    $row = Form::hidden("language", "en");
    $body[] = $row;
}
$row = Form::label("id_theme", _("Theme by default") . ":");
$row .= Form::selectTable("theme_tbl", "id_theme", $formVar["id_theme"], "theme_name");
$body[] = $row;
$appFields = Form::fieldset(_("Application"), $body);
$body = array();
$row = Form::label("clinic_name", _("Clinic Name") . ":");
$row .= Form::text("clinic_name", isset($formVar["clinic_name"]) ? $formVar["clinic_name"] : null, array('size' => 40, 'maxlength' => 128, 'error' => isset($formError["clinic_name"]) ? $formError["clinic_name"] : null));
$body[] = $row;
$row = Form::label("clinic_hours", _("Clinic Hours") . ":");
$row .= Form::text("clinic_hours", isset($formVar["clinic_hours"]) ? $formVar["clinic_hours"] : null, array('size' => 40, 'maxlength' => 128, 'error' => isset($formError["clinic_hours"]) ? $formError["clinic_hours"] : null));
$body[] = $row;
$row = Form::label("clinic_address", _("Clinic Address") . ":");
$row .= Form::textArea("clinic_address", isset($formVar["clinic_address"]) ? $formVar["clinic_address"] : null, array('rows' => 3, 'cols' => 30));
$body[] = $row;
$row = Form::label("clinic_phone", _("Clinic Phone") . ":");
$row .= Form::text("clinic_phone", isset($formVar["clinic_phone"]) ? $formVar["clinic_phone"] : null, array('size' => 40, 'error' => isset($formError["clinic_phone"]) ? $formError["clinic_phone"] : null));
$body[] = $row;
$row = Form::label("clinic_url", _("Clinic URL") . ":");
$row .= Form::text("clinic_url", isset($formVar["clinic_url"]) ? $formVar["clinic_url"] : null, array('size' => 40, 'maxlength' => 300, 'error' => isset($formError["clinic_url"]) ? $formError["clinic_url"] : null));
$body[] = $row;
$clinicFields = Form::fieldset(_("Clinic"), $body);
$body = array($appFields, $clinicFields);
$foot = array(Form::button("update", _("Update")) . Form::generateToken());
echo Form::fieldset($title, $body, $foot);
Example #13
0
<?php

/**
 * theme_fields.php
 *
 * Fields of theme data
 *
 * Licensed under the GNU GPL. For full terms see the file LICENSE.
 *
 * @package   OpenClinic
 * @copyright 2002-2008 jact
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL
 * @version   CVS: $Id: theme_fields.php,v 1.21 2008/03/23 11:58:57 jact Exp $
 * @author    jact <*****@*****.**>
 */
require_once dirname(__FILE__) . "/../lib/exe_protect.php";
executionProtection(__FILE__);
$tbody = array();
$row = Form::label("theme_name", _("Theme Name") . ":", array('class' => 'required'));
$row .= Form::text("theme_name", isset($formVar["theme_name"]) ? $formVar["theme_name"] : null, array('size' => 50, 'error' => isset($formError["theme_name"]) ? $formError["theme_name"] : null));
$tbody[] = $row;
$row = Form::label("css_file", _("CSS File") . ":", array('class' => 'required'));
$row .= Form::text("css_file", isset($formVar["css_file"]) ? $formVar["css_file"] : null, array('size' => 50, 'error' => isset($formError["css_file"]) ? $formError["css_file"] : null));
$tbody[] = $row;
$row = Form::label("css_rules", _("CSS Rules") . ":", array('class' => 'required'));
$row .= Form::textArea("css_rules", isset($formVar["css_rules"]) ? $formVar["css_rules"] : null, array('rows' => 25, 'cols' => 80, 'error' => isset($formError["css_rules"]) ? $formError["css_rules"] : null));
$tbody[] = $row;
$tfoot = array(Form::button("save", _("Submit"), array('type' => 'button', 'onclick' => 'editTheme();')) . Form::generateToken());
$options = array('class' => 'large_area');
echo Form::fieldset($title, $tbody, $tfoot, $options);
Example #14
0
}
$tbody[] = $row;
$row = Form::label("nts", _("RG") . ":");
$row .= Form::text("nts", isset($formVar["nts"]) ? $formVar["nts"] : null, array('size' => 30, 'error' => isset($formError["nts"]) ? $formError["nts"] : null));
$tbody[] = $row;
$row = Form::label("nss", _("CPF") . ":");
$row .= Form::text("nss", isset($formVar["nss"]) ? $formVar["nss"] : null, array('size' => 30, 'error' => isset($formError["nss"]) ? $formError["nss"] : null));
$tbody[] = $row;
$row = Form::label("family_situation", _("Informações complementares") . ":");
$row .= Form::textArea("family_situation", $formVar["family_situation"], array('rows' => 3, 'cols' => 30));
$tbody[] = $row;
$row = Form::label("labour_situation", _("Trabalho dos familiares") . ":");
$row .= Form::textArea("labour_situation", $formVar["labour_situation"], array('rows' => 3, 'cols' => 30));
$tbody[] = $row;
$row = Form::label("education", _("Procedência do encaminhamento") . ":");
$row .= Form::textArea("education", $formVar["education"], array('rows' => 3, 'cols' => 30));
$tbody[] = $row;
$row = Form::label("insurance_company", _("CID") . ":");
$row .= Form::text("insurance_company", isset($formVar["insurance_company"]) ? $formVar["insurance_company"] : null, array('size' => 30, 'error' => isset($formError["insurance_company"]) ? $formError["insurance_company"] : null));
$tbody[] = $row;
$staffQ = new Query_Staff();
$array = null;
$array[0] = "";
// to permit null value
if ($staffQ->selectType('D')) {
    while ($staff = $staffQ->fetch()) {
        $array[$staff->getIdMember()] = $staff->getFirstName() . " " . $staff->getSurname1() . " " . $staff->getSurname2();
    }
    $staffQ->freeResult();
}
$staffQ->close();
Example #15
0
require_once dirname(__FILE__) . "/../lib/exe_protect.php";
executionProtection(__FILE__);
$tbody = array();
$row = Form::label("nif", _("Protocolo de atendimento") . ":");
$row .= Form::text("nif", isset($formVar["nif"]) ? $formVar["nif"] : null, array('size' => 20, 'error' => isset($formError["nif"]) ? $formError["nif"] : null));
$tbody[] = $row;
if (isset($memberType) && $memberType == "D" || isset($formVar["member_type"]) && substr($formVar["member_type"], 0, 1) == "D") {
    $row = Form::label("collegiate_number", _("Collegiate Number") . ":", array('class' => 'required'));
    $row .= Form::text("collegiate_number", isset($formVar["collegiate_number"]) ? $formVar["collegiate_number"] : null, array('size' => 20, 'error' => isset($formError["collegiate_number"]) ? $formError["collegiate_number"] : null));
    $tbody[] = $row;
}
$row = Form::label("first_name", _("First Name") . ":", array('class' => 'required'));
$row .= Form::text("first_name", isset($formVar["first_name"]) ? $formVar["first_name"] : null, array('size' => 25, 'error' => isset($formError["first_name"]) ? $formError["first_name"] : null));
$tbody[] = $row;
$row = Form::label("surname1", _("Surname 1") . ":", array('class' => 'required'));
$row .= Form::text("surname1", isset($formVar["surname1"]) ? $formVar["surname1"] : null, array('size' => 30, 'error' => isset($formError["surname1"]) ? $formError["surname1"] : null));
$tbody[] = $row;
$row = Form::label("surname2", _("Surname 2") . ":");
$row .= Form::text("surname2", isset($formVar["surname2"]) ? $formVar["surname2"] : null, array('size' => 30, 'error' => isset($formError["surname2"]) ? $formError["surname2"] : null));
$tbody[] = $row;
$row = Form::label("address", _("Address") . ":");
$row .= Form::textArea("address", isset($formVar["address"]) ? $formVar["address"] : null, array('rows' => 2, 'cols' => 30));
$tbody[] = $row;
$row = Form::label("phone_contact", _("Phone Contact") . ":");
$row .= Form::textArea("phone_contact", isset($formVar["phone_contact"]) ? $formVar["phone_contact"] : null, array('rows' => 2, 'cols' => 30));
$tbody[] = $row;
$row = Form::label("login", _("Login") . ":");
$row .= Form::text("login", isset($formVar["login"]) ? $formVar["login"] : null, array('size' => 20, 'error' => isset($formError["login"]) ? $formError["login"] : null));
$tbody[] = $row;
$tfoot = array(Form::button("save", _("Submit")) . Form::generateToken());
echo Form::fieldset($title, $tbody, $tfoot);
Example #16
0
Form::macro('decimal', function ($attributeName, $value, $options) {
    foreach (['js/plugins/input-mask/jquery.inputmask.js', 'js/plugins/input-mask/jquery.inputmask.numeric.extensions.js'] as $file) {
        $jsFilename = moduleAsset('admin', $file);
        if (!in_array($jsFilename, @Asset::$js['footer'] ?: array())) {
            Asset::add($jsFilename);
        }
    }
    $options['data-inputmask'] = "'alias': 'decimal', 'radixPoint': ','";
    $script = "\$('*[data-inputmask]').inputmask();";
    if (!in_array($script, @Asset::$scripts['footer'] ?: array())) {
        Asset::addScript($script);
    }
    $value = str_replace('.', ',', $value);
    return Form::text($attributeName, $value, $options);
});
/**
 * Creates a Html Editor
 */
Form::macro('editor', function ($attributeName, $value = null, $options = array()) {
    Asset::add(moduleAsset('system', 'js/ckeditor/ckeditor.js'));
    Asset::addScript("\n        CKEDITOR.config.allowedContent = true;\n        var editor = CKEDITOR.replace('{$attributeName}', {\n            filebrowserBrowseUrl : '" . URL::to(moduleAsset('system', 'ckfinder/ckfinder.html')) . "',\n            filebrowserImageBrowseUrl : '" . URL::to(moduleAsset('system', 'ckfinder/ckfinder.html?type=Images')) . "',\n            filebrowserFlashBrowseUrl : '" . URL::to(moduleAsset('system', 'ckfinder/ckfinder.html?type=Flash')) . "',\n            filebrowserUploadUrl : '" . URL::to(moduleAsset('system', 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files')) . "',\n            filebrowserImageUploadUrl : '" . URL::to(moduleAsset('system', 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images')) . "',\n            filebrowserFlashUploadUrl : '" . URL::to(moduleAsset('system', 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash')) . "'\n        });\n        CKFinder.setupCKEditor( editor, '../' );\n    ", 'ready');
    return Form::textArea($attributeName, $value, $options);
});
/**
 * Validates a Recaptcha input
 * Obs: Recapctha package already provide a "captcha" macro to form.
 */
Form::macro('makeCaptchaValidator', function ($input) {
    $v = Validator::make($input, ['g-recaptcha-response' => 'required|recaptcha'])->setAttributeNames(['g-recaptcha-response' => 'Recaptcha']);
    return $v;
});
Example #17
0
<?php

include 'lib/common.php';
$input_type = $_REQUEST['input_type'] ? $_REQUEST['input_type'] : 'textarea';
$elem_id = $_REQUEST['elem_id'];
$caption = urldecode($_REQUEST['label_caption']);
$current_val = urldecode($_REQUEST['current_val']);
if (stristr($elem_id, 'file_desc')) {
    $elem_parts = explode('__', $elem_id);
    $elem_parts1 = explode('_', $elem_parts[1]);
    $table = $elem_parts1[0];
    $db_fields = DB::getTableFields($table . '_files', 1);
    if (!in_array('file_desc', $db_fields)) {
        $sql = "ALTER TABLE {$table}_files ADD file_desc TEXT NOT NULL ";
        db_query($sql);
    }
}
$form = new Form('zoom');
switch ($input_type) {
    case 'textarea':
        $form->textArea($_REQUEST['elem_id'], $caption, false, $current_val);
        break;
}
$form->button(false, $CFG->ok_button, false, false, false, false, 'onclick="fieldZoomOut(\'' . $_REQUEST['elem_id'] . '\')"');
$form->display();