/**
  * Display Field
  */
 function _display_field($data, $field_name)
 {
     global $DSP;
     $this->prep_field_data($data);
     $r = form_hidden($field_name, 'n') . form_multiselect($field_name . '[]', $this->settings['options'], $data);
     return $r;
 }
Example #2
0
 function display_field($data)
 {
     $this->EE->load->helper('custom_field');
     $values = decode_multi_field($data);
     $field_options = $this->_get_field_options($data);
     return form_multiselect($this->field_name . '[]', $field_options, $values, 'dir="' . $this->settings['field_text_direction'] . '" id="' . $this->field_id . '"');
 }
Example #3
0
 /**
  * Получение данных фильтра для вставки в шаблон
  */
 private function _get_tpl_filter($filter = false)
 {
     $this->load->model('servers');
     if (!$filter) {
         $filter = $this->users->get_filter('servers_list');
     }
     $this->servers->select_fields('game, server_ip');
     $games_array = array();
     $ip_array = array();
     if ($servers_list = $this->servers->get_list()) {
         foreach ($servers_list as $server) {
             if (!in_array($server['game'], $games_array)) {
                 $games_array[] = $server['game'];
             }
             if (!in_array($server['server_ip'], $ip_array)) {
                 $ip_array[$server['server_ip']] = $server['server_ip'];
             }
         }
     }
     if (empty($this->games->games_list)) {
         $this->games->get_active_games_list();
     }
     foreach ($this->games->games_list as &$game) {
         $games_option[$game['code']] = $game['name'];
     }
     $tpl_data['filter_name'] = isset($filter['name']) ? $filter['name'] : '';
     $tpl_data['filter_ip'] = isset($filter['ip']) ? $filter['ip'] : '';
     $tpl_data['filter_ip_dropdown'] = form_multiselect('filter_ip[]', $ip_array, $tpl_data['filter_ip']);
     $default = isset($filter['game']) ? $filter['game'] : null;
     $tpl_data['filter_games_dropdown'] = form_multiselect('filter_game[]', $games_option, $default);
     return $tpl_data;
 }
 function display_field($data)
 {
     ee()->load->helper('custom_field');
     $values = decode_multi_field($data);
     $field_options = $this->_get_field_options($data);
     $text_direction = isset($this->settings['field_text_direction']) ? $this->settings['field_text_direction'] : 'ltr';
     return form_multiselect($this->field_name . '[]', $field_options, $values, 'dir="' . $text_direction . '" class="multiselect_input" id="field_id_' . $this->field_id . '"');
 }
Example #5
0
 public function FilterArr()
 {
     $query = $this->Selectbd->query('FilterArr', $this->input->post('id'));
     foreach ($query->result_array() as $row) {
         $Temparr[] = $row[$this->Selectbd->ColTabel[$this->input->post('id')]];
     }
     echo form_multiselect('select', $Temparr);
 }
 /**
  * Display Field
  */
 function _display_field($data, $field_name)
 {
     if (empty($this->settings['options'])) {
         return $this->no_options_set();
     }
     $this->prep_field_data($data);
     $r = form_hidden($field_name, 'n') . form_multiselect($field_name . '[]', $this->settings['options'], $data);
     return $r;
 }
Example #7
0
 function display_field($data)
 {
     ee()->load->helper('custom_field');
     $values = decode_multi_field($data);
     $field_options = $this->_get_field_options($data);
     $text_direction = isset($this->settings['field_text_direction']) ? $this->settings['field_text_direction'] : 'ltr';
     if (REQ == 'CP') {
         return ee('View')->make('multi_select:publish')->render(array('field_name' => $this->field_name, 'values' => $values, 'options' => $field_options));
     }
     return form_multiselect($this->field_name . '[]', $field_options, $values, 'dir="' . $text_direction . '" class="multiselect_input"');
 }
Example #8
0
 function simbanic_multiselect($multiselect_name, $options = array(), $default_selectmulti = array(), $data = array())
 {
     if (!empty($data)) {
         $static_data = '';
         foreach ($data as $key => $value) {
             $static_data .= $key . '=' . '"' . $value . '" ';
         }
     } else {
         $static_data = '';
     }
     return form_multiselect($multiselect_name, $options, $default_selectmulti, $static_data) . simbanic_validation($multiselect_name);
 }
function print_input_multiselect($input)
{
    $extra = 'class="multiselect" ';
    if (isset($input['id']) && $input['id'] != '') {
        $extra .= 'id="' . $input['id'] . '" ';
    }
    if (isset($input['tabindex']) && $input['tabindex'] != '') {
        $extra .= 'tabindex="' . $input['tabindex'] . '" ';
    }
    $html = form_multiselect($input['name'] . '[]', $input['options'], $input['value'], $extra);
    return $html;
}
Example #10
0
function input_multiselect($name, $options, $value, $opt = array())
{
    $opt['type'] = 'multiselect';
    $input = input_merge_opt($name, $value, $opt);
    $attr = attr(array_diff_key(clean_opt($input), array_fill_keys(array('name', 'value'), 0)));
    foreach ($options as $val => $label) {
        $label = lang($val);
        if ($label) {
            $options[$val] = $label;
        }
    }
    $input['form_input'] = form_multiselect($input['name'], $options, explode('|', $input['value']), $attr);
    return input_markup($input);
}
 function form_multiselect_and_label($name, $options, $selected = array(), $extra = '', $div = 'pure-control-group')
 {
     $label_name = lang($name);
     if (empty($selected) && isset($_POST[$name])) {
         $selected = $_POST[$name];
     }
     $oldname = $name;
     $name .= '[]';
     // CodeIgniter POST array syntax
     $extra .= ' class="chosen-select" data-placeholder="' . $label_name . '"';
     $div_start = empty($div) ? '' : '<div class="' . $div . '">';
     $label = form_label($label_name, $name);
     $dropdown = form_multiselect($name, $options, $selected, 'id="' . $name . '"' . $extra);
     $error_box = form_error($oldname);
     $div_end = empty($div) ? '' : '</div>';
     return $div_start . $label . $dropdown . $error_box . $div_end;
 }
Example #12
0
    function tes()
    {
        $options = array('small' => 'Small Shirt', 'med' => 'Medium Shirt', 'large' => 'Large Shirt', 'xlarge' => 'Extra Large Shirt');
        echo '<!DOCTYPE html>
			<html>
			<body>

			<form action="' . base_url() . 'index.php/dinas/tes_proses" method="post">
				' . form_multiselect('shirts[]', $options, 'large') . '
				<input type="submit" />
			</form>

			<p>Hold down the Ctrl (windows) / Command (Mac) button to select multiple options.</p>

			</body>
			</html>	';
    }
 /**
  * Display settings sub-form for this variable type
  *
  * @param	mixed	$var_id			The id of the variable: 'new' or numeric
  * @param	array	$var_settings	The settings of the variable
  * @return	array
  */
 function display_settings($var_id, $var_settings)
 {
     // -------------------------------------
     //  Init return value
     // -------------------------------------
     $r = array();
     // -------------------------------------
     //  Check current value from settings
     // -------------------------------------
     $folders = $this->get_setting('folders', $var_settings);
     // -------------------------------------
     //  Get all folders
     // -------------------------------------
     $all_folders = low_flatten_results($this->_get_upload_preferences(), 'name', 'id');
     // -------------------------------------
     //  Build options setting
     // -------------------------------------
     $r[] = array($this->setting_label(lang('file_folders')), form_multiselect($this->input_name('folders', TRUE), $all_folders, $folders));
     // -------------------------------------
     //  Build setting: Allow uploads?
     // -------------------------------------
     $upload_folders = array('0' => lang('no_uploads')) + $all_folders;
     $upload = $this->get_setting('upload', $var_settings);
     $overwrite = $this->get_setting('overwrite', $var_settings) == 'y';
     $r[] = array($this->setting_label(lang('upload_folder'), lang('upload_folder_help')), form_dropdown($this->input_name('upload'), $upload_folders, $upload, 'id="low-select-upload-folder"') . '<label class="low-checkbox low-inline" id="low-overwrite-files">' . form_checkbox($this->input_name('overwrite'), 'y', $overwrite) . lang('overwrite_existing_files_label') . '</label>');
     // -------------------------------------
     //  Build setting: multiple?
     // -------------------------------------
     $multiple = $this->get_setting('multiple', $var_settings) == 'y';
     $r[] = array($this->setting_label(lang('allow_multiple_files')), '<label class="low-checkbox">' . form_checkbox($this->input_name('multiple'), 'y', $multiple, 'class="low-allow-multiple"') . lang('allow_multiple_files_label') . '</label>');
     // -------------------------------------
     //  Build setting: separator
     // -------------------------------------
     $separator = $this->get_setting('separator', $var_settings);
     $r[] = array($this->setting_label(lang('separator_character')), $this->separator_select($separator));
     // -------------------------------------
     //  Build setting: multi interface
     // -------------------------------------
     $multi_interface = $this->get_setting('multi_interface', $var_settings);
     $r[] = array($this->setting_label(lang('multi_interface')), $this->interface_select($multi_interface, array('drag-list-thumbs' => lang('drag-list-thumbs'))));
     // -------------------------------------
     //  Return output
     // -------------------------------------
     return $r;
 }
 /**
  * Display the settings form for each custom field
  * 
  * @access public
  * @param $data mixed The field settings
  * @return string Override the field custom settings with custom html
  * 
  * In this case we add an extra row to the table. Not sure how the table is built
  */
 public function display_settings($data)
 {
     $this->EE->lang->loadfile('nsm_entry_select');
     $this->EE->load->model('channel_model');
     $data = array_merge(array("field_channels" => array(), "field_ui_mode" => FALSE, "field_size" => 1), $data);
     $entry_channels_query = $this->EE->channel_model->get_channels()->result();
     $entry_channels = array();
     foreach ($entry_channels_query as $channel) {
         $entry_channels[$channel->channel_id] = $channel->channel_title;
     }
     $this->EE->table->add_row(form_hidden($this->field_id . '_field_fmt', 'none') . form_hidden('field_show_fmt', 'n') . lang("Restrict entry selection to:", 'field_channels'), form_multiselect($this->field_id . '_field_settings[field_channels][]', $entry_channels, $data["field_channels"], "id='field_channels'"));
     $select_opts = array();
     foreach (self::$ui_modes as $key) {
         $select_opts[$key] = lang($key);
     }
     $this->EE->table->add_row(lang("UI Mode:", 'field_ui_mode'), form_dropdown($this->field_id . '_field_settings[field_ui_mode]', $select_opts, $data["field_ui_mode"], "id='field_ui_mode'"));
     $this->EE->table->add_row(lang("Size", 'field_size') . "<br />Determines the multi-select height and number of results returned in the autocomplete", form_input($this->field_id . '_field_settings[field_size]', $data["field_size"], "id='field_size'"));
 }
 /**
  * Display settings sub-form for this variable type
  *
  * @param	mixed	$var_id			The id of the variable: 'new' or numeric
  * @param	array	$var_settings	The settings of the variable
  * @return	array	
  */
 function display_settings($var_id, $var_settings)
 {
     // -------------------------------------
     //  Init return value
     // -------------------------------------
     $r = array();
     // -------------------------------------
     //  Build setting: Channel ids
     //  First, get all channels for this site
     // -------------------------------------
     $query = $this->EE->db->query("SELECT channel_id, channel_title FROM exp_channels\n\t\t\t\t\t\t\tWHERE site_id = '" . $this->EE->db->escape_str($this->EE->config->item('site_id')) . "'\n\t\t\t\t\t\t\tORDER BY channel_title ASC");
     $all_channels = $this->flatten_results($query->result_array(), 'channel_id', 'channel_title');
     // -------------------------------------
     //  Then, get current channel ids from settings
     // -------------------------------------
     $current = $this->get_setting('channel_ids', $var_settings);
     $r[] = array($this->setting_label(lang('channel_ids')), form_multiselect($this->input_name('channel_ids', TRUE), $all_channels, $current));
     // -------------------------------------
     //  Build setting: multiple?
     // -------------------------------------
     $multiple = $this->get_setting('multiple', $var_settings);
     $r[] = array($this->setting_label(lang('allow_multiple_channels')), '<label class="low-checkbox">' . form_checkbox($this->input_name('multiple'), 'y', $multiple, 'class="low-allow-multiple"') . lang('allow_multiple_channels_label') . '</label>');
     // -------------------------------------
     //  Build setting: separator
     // -------------------------------------
     $separator = $this->get_setting('separator', $var_settings);
     $r[] = array($this->setting_label(lang('separator_character')), $this->separator_select($separator));
     // -------------------------------------
     //  Build setting: multi interface
     // -------------------------------------
     $multi_interface = $this->get_setting('multi_interface', $var_settings);
     $r[] = array($this->setting_label(lang('multi_interface')), $this->interface_select($multi_interface));
     // -------------------------------------
     //  Return output
     // -------------------------------------
     return $r;
 }
 /**
  * Display settings sub-form for this variable type
  *
  * @param	mixed	$var_id			The id of the variable: 'new' or numeric
  * @param	array	$var_settings	The settings of the variable
  * @return	array
  */
 function display_settings($var_id, $var_settings)
 {
     // -------------------------------------
     //  Init return value
     // -------------------------------------
     $r = array();
     // -------------------------------------
     //  Build setting: category groups
     //  First, get all groups for this site
     // -------------------------------------
     $query = ee()->db->select('group_id, group_name')->from('category_groups')->where('site_id', ee()->config->item('site_id'))->order_by('group_name')->get();
     $all_groups = $this->flatten_results($query->result_array(), 'group_id', 'group_name');
     // -------------------------------------
     //  Then, get current groups from settings
     // -------------------------------------
     $current = $this->get_setting('category_groups', $var_settings);
     $r[] = array($this->setting_label(lang('category_groups')), form_multiselect($this->input_name('category_groups', TRUE), $all_groups, $current));
     // -------------------------------------
     //  Build setting: multiple?
     // -------------------------------------
     $multiple = $this->get_setting('multiple', $var_settings);
     $r[] = array($this->setting_label(lang('allow_multiple_categories')), '<label class="low-checkbox">' . form_checkbox($this->input_name('multiple'), 'y', $multiple, 'class="low-allow-multiple"') . lang('allow_multiple_categories_label') . '</label>');
     // -------------------------------------
     //  Build setting: separator
     // -------------------------------------
     $separator = $this->get_setting('separator', $var_settings);
     $r[] = array($this->setting_label(lang('separator_character')), $this->separator_select($separator));
     // -------------------------------------
     //  Build setting: multi interface
     // -------------------------------------
     $multi_interface = $this->get_setting('multi_interface', $var_settings);
     $r[] = array($this->setting_label(lang('multi_interface')), $this->interface_select($multi_interface));
     // -------------------------------------
     //  Return output
     // -------------------------------------
     return $r;
 }
Example #17
0
           ?>
                   <?php 
           echo form_error($input['name']);
           ?>
               <?php 
       }
       ?>
           <?php 
   }
   ?>
           <div id="extender">
               <?php 
   echo form_multiselect('select1[]', $empleadosProyectos, '', 'id="select1"');
   ?>
               <?php 
   echo form_multiselect('empleados[]', $empleadosNotas, '', 'id="select2"');
   ?>
               <br>
               <a href="#" id="add">Añadir <i class="icon-arrow-right"></i></a>    
               <a href="#" id="remove"><i class="icon-arrow-left"></i>  Eliminar </a>
           </div>
           <br>
           <div>
               <?php 
   echo form_submit($boton, 'Guardar');
   ?>
           </div>    
           <?php 
   echo form_close();
   ?>
 
               <div class="span6">
                  <div class="widget">
                     <div class="widget-title">
                        <h4><i class="icon-reorder"></i>系統管理者設置</h4>
                     </div>
                     <div class="widget-body form">
                     	<form action="<?php 
echo site_url('/cash/config/update');
?>
" method="POST" class="form-horizontal">
                     		
							<div class="control-group">
					            <label class="control-label">超級管理者</label>
					            <div class="controls">
									<?php 
echo form_multiselect("admin_ID[]", isset($admin_ID_select_options) ? $admin_ID_select_options : array(), isset($admin_ID) ? $admin_ID : array(), "class='span12 chosen'");
?>
								</div>
							</div>
							<div class="form-actions">
								<button type="submit" class="btn btn-primary">送出</button>
							</div>
                     	</form>
                 		
						
                     </div>
                  </div>
               </div>
			</div>
            <!-- END PAGE CONTENT-->         
         </div>
    /**
     * Esta funcion arma el HTML de una tabla dinamica.
     * Tambien hace la funcion de tabla sumativa, para
     * mostrar totales en el footer de la tabla.
     *
     * @param $campos
     * @return string
     */
    private function armar_tabla_dinamica($campos = array())
    {
        if (empty($campos)) {
            return false;
        }
        $tipo_tabla = !empty($campos["tabla-dinamica"]) ? "tabla-dinamica" : "tabla-dinamica-sumativa";
        $campos = !empty($campos["tabla-dinamica"]) ? $campos["tabla-dinamica"] : $campos["tabla-dinamica-sumativa"];
        $tabla = '<div class="table-responsive"><table id="' . $campos[0]["agrupador"] . 'Table" class="table table-noline tabla-dinamica">';
        /**
         * Armar los titulos <THEAD>
         */
        $tabla .= '<thead><tr>';
        $botones = false;
        foreach ($campos as $campo) {
            if (empty($campo["type"])) {
                continue;
            }
            if ($campo["type"] == "button") {
                if ($botones == false) {
                    $tabla .= '<th colspan="2" >&nbsp;</th>';
                    $botones = true;
                }
            } else {
                //Si campo es hidden
                if ($campo['type'] == "hidden") {
                    continue;
                }
                $requerido = !empty($campo["data-rule-required"]) ? '<span class="required">*</span>' : '';
                $tabla .= '<th  >' . $campo["label"] . ' ' . $requerido . '</th>';
            }
        }
        $tabla .= '</tr></thead>';
        /**
         * Armar las filas que van dentro de <TBODY>
         */
        $tabla .= '<tbody>';
        //Verificar si hay un valor que mostrar de la DB
        if (!empty(self::$values_from_DB[$campos[0]["agrupador"]])) {
            $j = 0;
            $button_load = false;
            foreach (self::$values_from_DB[$campos[0]["agrupador"]] as $data) {
                /**
                 * Armar las filas que van dentro de <TBODY>
                 */
                $tabla .= '<tr id="' . $campos[0]["agrupador"] . $j . '">';
                foreach ($campos as $campo) {
                    $nombre_campo = !empty($campo["nombre_campo"]) ? str_replace("][", "", $campo["nombre_campo"]) : "";
                    //Verificar si hay valor que mostrar para este campo
                    $valor = !empty($data[$nombre_campo]) ? $data[$nombre_campo] : "";
                    if ($campo["type"] == "text") {
                        $campo['name'] = str_replace("[0]", '[' . $j . ']', $campo['name']);
                        $campo["value"] = $valor;
                        $campo["id"] = $campo["id"] . $j;
                        unset($campo["label"]);
                        unset($campo["agrupador"]);
                        unset($campo["data-columns"]);
                        unset($campo["nombre_campo"]);
                        $tabla .= '<td>' . form_input($campo) . '</td>';
                    }
                    if ($campo["type"] == "hidden") {
                        $campo['name'] = str_replace("[0]", '[' . $j . ']', $campo['name']);
                        $campo["value"] = $valor;
                        unset($campo["label"]);
                        unset($campo["agrupador"]);
                        unset($campo["data-columns"]);
                        unset($campo["nombre_campo"]);
                        unset($campo["id"]);
                        $tabla .= form_input($campo);
                    }
                    if ($campo["type"] == "fecha") {
                        $campo['name'] = str_replace("[0]", '[' . $j . ']', $campo['name']);
                        $campo["value"] = $valor;
                        $campo["id"] = $campo["id"] . $j;
                        unset($campo["label"]);
                        unset($campo["agrupador"]);
                        unset($campo["data-columns"]);
                        unset($campo["nombre_campo"]);
                        $tabla .= '<td>' . form_input($campo) . '</td>';
                    }
                    if ($campo["type"] == "input-right-addon") {
                        $campo['name'] = str_replace("[0]", '[' . $j . ']', $campo['name']);
                        $campo["value"] = $valor;
                        $campo["id"] = $campo["id"] . $j;
                        unset($campo["label"]);
                        unset($campo["agrupador"]);
                        unset($campo["data-columns"]);
                        unset($campo["nombre_campo"]);
                        $button_text_icon = !empty($campo['data-addon-icon']) && $campo['data-addon-icon'] != "" ? '<i class="fa ' . $campo['data-addon-icon'] . '"></i>' : (!empty($campo['data-addon-text']) ? $campo['data-addon-text'] : "");
                        $tabla .= '<td>' . '<div class="input-group">' . form_input($campo) . '<span class="input-group-addon">' . $button_text_icon . '</span>' . '</div></td>';
                    }
                    if ($campo["type"] == "input-left-addon") {
                        $campo['name'] = str_replace("[0]", '[' . $j . ']', $campo['name']);
                        $campo["value"] = $valor;
                        $campo["id"] = $campo["id"] . $j;
                        unset($campo["label"]);
                        unset($campo["agrupador"]);
                        unset($campo["data-columns"]);
                        unset($campo["nombre_campo"]);
                        $button_text_icon = !empty($campo['data-addon-icon']) && $campo['data-addon-icon'] != "" ? '<i class="fa ' . $campo['data-addon-icon'] . '"></i>' : (!empty($campo['data-addon-text']) ? $campo['data-addon-text'] : "");
                        $tabla .= '<td>' . '<div class="input-group">' . '<span class="input-group-addon">' . $button_text_icon . '</span>' . form_input($campo) . '</div></td>';
                    } else {
                        if ($campo['type'] == 'select-right-button-addon') {
                            $campo['name'] = str_replace("[0]", '[' . $j . ']', $campo['name']);
                            preg_match('/\\[(.*?)\\]/i', $campo['name'], $matches);
                            $id = !empty($matches) ? $matches[1] : "";
                            $id = str_replace("]", "", $id);
                            $button_text_icon = !empty($campo['data-button-icon']) && $campo['data-button-icon'] != "" ? '<i class="fa ' . $campo['data-button-icon'] . '"></i>' : $campo['data-button-text'];
                            $selected = !empty($valor) ? $valor : "";
                            $attrs = 'id="' . $campo["id"] . $j . '" class="' . $campo['class'] . ' chosen-select" data-placeholder="Seleccione" ' . (!empty($campo['multiple']) ? 'multiple="multiple" ' : "") . (!empty($campo['disabled']) ? 'disabled="disabled"' : "");
                            unset($campo['data-button-icon']);
                            unset($campo['data-button-text']);
                            unset($campo['label']);
                            unset($campo['data-addon-icon']);
                            unset($campo['data-addon-text']);
                            unset($campo['data-columns']);
                            unset($campo["nombre_campo"]);
                            $tabla .= '<td>';
                            $tabla .= '<div class="input-group">
							      ' . form_dropdown($campo['name'], $campo['options'], $selected, $attrs) . '
								  <span class="input-group-btn">
										<button id="' . $id . 'Btn" class="btn btn-default" type="button">' . $button_text_icon . '</button>
									</span>
							    </div>';
                            $tabla .= '</td>';
                        } else {
                            if ($campo['type'] == 'select-checkbox-addon') {
                                $campo['name'] = str_replace("[0]", '[' . $j . ']', $campo['name']);
                                preg_match('/\\[(.*?)\\]/i', $campo['name'], $matches);
                                $id = !empty($matches) ? $matches[1] : "";
                                $id = str_replace("]", "", $id);
                                $label = !empty($campo['label']) ? $campo['label'] . " " . $requerido : "";
                                $attrs = 'id="' . $campo["id"] . $j . '" class="' . $campo['class'] . ' chosen-select" data-placeholder="Seleccione" ' . (!empty($campo['multiple']) ? 'multiple="multiple" ' : "") . (!empty($campo['disabled']) ? 'disabled="disabled"' : "");
                                $selected = !empty($valor) ? $valor : "";
                                unset($campo['label']);
                                unset($campo['data-button-icon']);
                                unset($campo['data-button-text']);
                                unset($campo['label']);
                                unset($campo['data-addon-icon']);
                                unset($campo['data-addon-text']);
                                unset($campo['data-columns']);
                                unset($campo["nombre_campo"]);
                                $tabla .= '<td>';
                                $tabla .= '<div class="input-group">
								  <span class="input-group-addon">
							      	<input type="checkbox" id="' . $id . 'Check">
							      </span>';
                                //Vertificar si es un select multiple
                                if (!empty($campo['multiple'])) {
                                    $tabla .= form_multiselect($campo['name'], $campo['options'], $selected, $attrs);
                                } else {
                                    $tabla .= form_dropdown($campo['name'], $campo['options'], $selected, $attrs);
                                }
                                $tabla .= '</div>';
                                $tabla .= '</td>';
                            } else {
                                if ($campo['type'] == 'select') {
                                    $campo['name'] = str_replace("[0]", '[' . $j . ']', $campo['name']);
                                    $attrs = 'id="' . $campo["id"] . $j . '" class="' . $campo['class'] . '"';
                                    $selected = !empty($valor) ? $valor : "";
                                    $tabla .= '<td>' . form_dropdown($campo['name'], $campo['options'], $selected, $attrs) . '</td>';
                                    $selected = '';
                                } else {
                                    if ($campo['type'] == 'radio') {
                                        $div = '';
                                        if (!empty($campo['values'])) {
                                            foreach ($campo['values'] as $id_cat => $valor) {
                                                if (empty($valor)) {
                                                    continue;
                                                }
                                                $campo["value"] = $id_cat;
                                                unset($campo['values']);
                                                $div .= '<label class="radio" style="margin-top:0px;margin-bottom:0px;">';
                                                $div .= form_radio($campo) . " " . $valor;
                                                $div .= '</label>';
                                            }
                                        }
                                        $tabla .= '<td>' . $div . '</td>';
                                    } else {
                                        if ($campo['type'] == 'relate') {
                                            $campo['name'] = str_replace("[0]", '[' . $j . ']', $campo['name']);
                                            $attrs = 'class="' . $campo['class'] . '" id="' . $campo["id"] . '0"';
                                            $selected = !empty($valor) ? $valor : "";
                                            $tabla .= '<td>';
                                            $tabla .= form_dropdown($campo['name'], $campo['options'], $selected, $attrs);
                                            $tabla .= '</td>';
                                        } else {
                                            if ($campo["type"] == "button") {
                                                //Si el boton es "Agregar", cargarlo solo UNA vez
                                                if (!preg_match("/eliminar/i", $campo["class"]) && $button_load == true) {
                                                    continue;
                                                }
                                                if (!preg_match("/eliminar/i", $campo["class"]) && $button_load == false) {
                                                    $button_load = true;
                                                    $input_hidden = '<input type="hidden" name="" />';
                                                }
                                                $campo["content"] = html_entity_decode($campo["content"]);
                                                $campo["data-index"] = $j;
                                                //Borrar atributos inecesarios
                                                unset($campo["name"]);
                                                unset($campo["data-columns"]);
                                                unset($campo["id"]);
                                                //Recorrer el arreglo para encontrar el
                                                //campo uuid_ y asignarlo como atributo
                                                foreach ($data as $indice => $valor) {
                                                    if (preg_match("/id_/i", $indice)) {
                                                        $campo["data-id"] = $valor;
                                                        break;
                                                    }
                                                }
                                                $tabla .= '<td>' . form_button($campo) . '</td>';
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                $j++;
            }
        } else {
            /**
             * Armar las filas que van dentro de <TBODY>
             */
            $tabla .= '<tr id="' . $campos[0]["agrupador"] . '0">';
            foreach ($campos as $campo) {
                $options = array("" => "Seleccione");
                if (!empty($campo['options'])) {
                    $options = $campo['options'];
                }
                if (empty($campo["type"])) {
                    return false;
                }
                if ($campo["type"] == "text") {
                    $campo["id"] = $campo["id"] . "0";
                    $tabla .= '<td>' . form_input($campo) . '</td>';
                }
                if ($campo["type"] == "fecha") {
                    $campo["id"] = $campo["id"] . "0";
                    $tabla .= '<td>' . form_input($campo) . '</td>';
                } else {
                    if ($campo['type'] == 'select') {
                        $attrs = 'id="' . $campo["id"] . '0" class="' . $campo['class'] . '"';
                        $selected = !empty($campo['selected']) ? $campo['selected'] : "";
                        $tabla .= '<td>' . form_dropdown($campo['name'], $options, $selected, $attrs) . '</td>';
                    } else {
                        if ($campo["type"] == "fecha") {
                            $campo["id"] = $campo["id"] . "0";
                            $tabla .= '<td>' . form_input($campo) . '</td>';
                        } else {
                            if ($campo['type'] == 'input-left-addon') {
                                $campo["id"] = $campo["id"] . "0";
                                $button_text_icon = !empty($campo['data-addon-icon']) && $campo['data-addon-icon'] != "" ? '<i class="fa ' . $campo['data-addon-icon'] . '"></i>' : $campo['data-addon-text'];
                                unset($campo['label']);
                                unset($campo['data-addon-icon']);
                                unset($campo['data-addon-text']);
                                unset($campo['data-columns']);
                                unset($campo["nombre_campo"]);
                                $tabla .= '<td>';
                                $tabla .= '<div class="input-group">
								<span class="input-group-addon">' . $button_text_icon . '</span>
							      ' . form_input($campo) . '
							    </div>';
                                $tabla .= '</td>';
                            } else {
                                if ($campo['type'] == 'input-right-addon') {
                                    $campo["id"] = $campo["id"] . "0";
                                    $button_text_icon = !empty($campo['data-addon-icon']) && $campo['data-addon-icon'] != "" ? '<i class="fa ' . $campo['data-addon-icon'] . '"></i>' : (!empty($campo['data-addon-text']) ? $campo['data-addon-text'] : "");
                                    unset($campo['label']);
                                    unset($campo['data-addon-icon']);
                                    unset($campo['data-addon-text']);
                                    unset($campo['data-columns']);
                                    unset($campo["nombre_campo"]);
                                    $tabla .= '<td>';
                                    $tabla .= '<div class="input-group">
							      ' . form_input($campo) . '
								  <span class="input-group-addon">' . $button_text_icon . '</span>
							    </div>';
                                    $tabla .= '</td>';
                                } else {
                                    if ($campo['type'] == 'select-right-button-addon') {
                                        $attrs = 'class="' . $campo['class'] . ' chosen-select" data-placeholder="Seleccione" ' . (!empty($campo['multiple']) ? 'multiple="multiple" ' : "") . (!empty($campo['disabled']) ? 'disabled="disabled"' : "");
                                        preg_match('/\\[(.*?)\\]/i', $campo['name'], $matches);
                                        $id = !empty($matches) ? $matches[1] : "";
                                        $id = str_replace("]", "", $id);
                                        $button_text_icon = !empty($campo['data-button-icon']) && $campo['data-button-icon'] != "" ? '<i class="fa ' . $campo['data-button-icon'] . '"></i>' : $campo['data-button-text'];
                                        $selected = !empty($campo['selected']) ? $campo['selected'] : "";
                                        unset($campo['data-button-icon']);
                                        unset($campo['data-button-text']);
                                        unset($campo['label']);
                                        unset($campo['data-addon-icon']);
                                        unset($campo['data-addon-text']);
                                        unset($campo['data-columns']);
                                        unset($campo["nombre_campo"]);
                                        $tabla .= '<td>';
                                        $tabla .= '<div class="input-group">
							      ' . form_dropdown($campo['name'], $campo['options'], $selected, $attrs) . '
								  <span class="input-group-btn">
										<button id="' . $id . 'Btn" class="btn btn-default" type="button">' . $button_text_icon . '</button>
									</span>
							    </div>';
                                        $tabla .= '</td>';
                                    } else {
                                        if ($campo['type'] == 'select-checkbox-addon') {
                                            $attrs = 'class="' . $campo['class'] . ' chosen-select" data-placeholder="Seleccione" multiple="multiple" ' . (!empty($campo['disabled']) ? 'disabled="disabled"' : "");
                                            $selected = !empty($campo['selected']) ? $campo['selected'] : "";
                                            //$id = str_replace("campo[", "", $campo['name']);
                                            //$id = str_replace("]", "", $id);
                                            preg_match('/\\[(.*?)\\]/i', $campo['name'], $matches);
                                            $id = !empty($matches) ? $matches[1] : "";
                                            $id = str_replace("]", "", $id);
                                            $label = !empty($campo['label']) ? $campo['label'] . " " . $requerido : "";
                                            unset($campo['label']);
                                            unset($campo['data-button-icon']);
                                            unset($campo['data-button-text']);
                                            unset($campo['label']);
                                            unset($campo['data-addon-icon']);
                                            unset($campo['data-addon-text']);
                                            unset($campo['data-columns']);
                                            unset($campo["nombre_campo"]);
                                            $tabla .= '<td>';
                                            $tabla .= '<div class="input-group">
								  <span class="input-group-addon">
							      	<input type="checkbox" id="' . $id . 'Check">
							      </span>
								' . form_dropdown($campo['name'], $campo['options'], $selected, $attrs) . '
							    </div>';
                                            $tabla .= '</td>';
                                        } else {
                                            if ($campo['type'] == 'relate') {
                                                $attrs = 'class="' . $campo['class'] . '" id="' . $campo["id"] . '0"';
                                                $selected = !empty($campo['selected']) ? $campo['selected'] : "";
                                                $tabla .= '<td>';
                                                $tabla .= form_dropdown($campo['name'], $campo['options'], $selected, $attrs);
                                                $tabla .= '</td>';
                                            } else {
                                                if ($campo['type'] == 'radio') {
                                                    $div = '';
                                                    if (!empty($campo['values'])) {
                                                        foreach ($campo['values'] as $id_cat => $valor) {
                                                            if (empty($valor)) {
                                                                continue;
                                                            }
                                                            $campo["value"] = $id_cat;
                                                            unset($campo['values']);
                                                            $div .= '<label class="radio" style="margin-top:0px;margin-bottom:0px;">';
                                                            $div .= form_radio($campo) . " " . $valor;
                                                            $div .= '</label>';
                                                        }
                                                    }
                                                    $tabla .= '<td>' . $div . '</td>';
                                                } else {
                                                    if ($campo["type"] == "button") {
                                                        $campo["content"] = html_entity_decode($campo["content"]);
                                                        //Borrar atributos inecesarios
                                                        unset($campo["name"]);
                                                        unset($campo["data-columns"]);
                                                        unset($campo["id"]);
                                                        unset($campo["nombre_campo"]);
                                                        $tabla .= '<td>' . form_button($campo) . '</td>';
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        $tabla .= '</tr></tbody>';
        /**
         * Si la tabla es sumativa y se necesitan
         * mostrar valores en el footer de la tabla
         * verificar los atributos de los campos.
         */
        if (preg_match("/sumativa/i", $tipo_tabla)) {
            $tabla .= '<tfoot><tr>';
            foreach ($campos as $campo) {
                if (!empty($campo["data-table-footer-sum-column"]) && $campo["data-table-footer-sum-column"] == true) {
                    if ($campo["type"] != "button" || $campo["type"] != "hidden" || $campo["type"] != "submit") {
                        $field = array("readonly" => "readonly", "id" => "total" . str_replace(" ", "", ucwords(str_replace("_", " ", $campo["id"]))), "class" => "form-control");
                        if ($campo['type'] == 'input-left-addon') {
                            $campo["id"] = $campo["id"] . "0";
                            $button_text_icon = !empty($campo['data-addon-icon']) && $campo['data-addon-icon'] != "" ? '<i class="fa ' . $campo['data-addon-icon'] . '"></i>' : $campo['data-addon-text'];
                            $tabla .= '<td>';
                            $tabla .= '<div class="input-group">
								<span class="input-group-addon">' . $button_text_icon . '</span>
							      ' . form_input($field) . '
							    </div>';
                            $tabla .= '</td>';
                        } else {
                            if ($campo['type'] == 'input-right-addon') {
                                $campo["id"] = $campo["id"] . "0";
                                $button_text_icon = !empty($campo['data-addon-icon']) && $campo['data-addon-icon'] != "" ? '<i class="fa ' . $campo['data-addon-icon'] . '"></i>' : (!empty($campo['data-addon-text']) ? $campo['data-addon-text'] : "");
                                $tabla .= '<td>';
                                $tabla .= '<div class="input-group">
							      ' . form_input($field) . '
								  <span class="input-group-addon">' . $button_text_icon . '</span>
							    </div>';
                                $tabla .= '</td>';
                            } else {
                                $tabla .= '<td>' . form_input($field) . '</td>';
                            }
                        }
                    }
                } else {
                    $text_or_empty = !empty($campo["data-table-footer-text"]) ? '<h3>' . $campo["data-table-footer-text"] . '</h3>' : "&nbsp;";
                    $tabla .= '<td>' . $text_or_empty . '</td>';
                }
            }
            $tabla .= '</tr></tfoot>';
        }
        $tabla .= '</table></div>';
        return $tabla;
    }
Example #20
0
</label>
				<?php 
echo form_dropdown('target', array('' => lang('nav:link_target_self'), '_blank' => lang('nav:link_target_blank')), $link->target);
?>
			</li>

			<li class="<?php 
echo alternator('even', '');
?>
">
				<label for="restricted_to[]"><?php 
echo lang('nav:restricted_to');
?>
</label>
				<?php 
echo form_multiselect('restricted_to[]', array(0 => lang('global:select-any')) + $group_options, strpos($link->restricted_to, ",") ? explode(",", $link->restricted_to) : $link->restricted_to, 'size="' . (($count = count($group_options)) > 1 ? $count : 2) . '"');
?>
			</li>
	
			<li class="<?php 
echo alternator('', 'even');
?>
">
				<label for="class"><?php 
echo lang('nav:class_label');
?>
</label>
				<?php 
echo form_input('class', $link->class);
?>
			</li>
        </div>
       
        <div class="form-group">
            <label for="status">Member Status</label>    
            <?php 
    echo form_dropdown('status', $status_options, $info->status, 'id="status_select" class="form-control modal-form"');
    ?>
                                                                                     
            <p class="form_error status_error">        
            </p>
        </div>
        
        <div class="form-group">
            <label for="privileges">Special Privileges</label>    
            <?php 
    echo form_multiselect('privileges[]', $privileges, explode(',', $info->privilege), 'id=privileges_select" class="form-control modal-form"');
    ?>
                                                                                     
            <p class="form_error privileges_error">        
            </p>
        </div>
       
        <div class="form-group">
            <label for="initial_ob">Initial Balance</label>    
            <input class="form-control modal-form" type="text" name="initial_ob" id="initial_ob" placeholder="Initial Balance" value="<?php 
    echo $info->initial_ob;
    ?>
"/>                                                                                                 
            <p class="form_error initial_ob_error">        
            </p>
        </div>
Example #22
0
            <?php 
echo form_open('admin/settings/save_section', array('id' => 'saveSection'));
?>
            <div class="panel panel-default">
                <div class="panel-body">
                    <div class="field-row">
                        <?php 
echo form_label(lang('Title'), 'title');
echo form_input(array('class' => 'form-control', 'name' => 'title', 'value' => isset($section->title) ? $section->title : ''));
?>
                    </div>
                    <div class="field-row">
                        <?php 
echo form_label(lang('Access'), 'access[]');
echo form_multiselect('access[]', access_A(), isset($section->access) ? explode(',', $section->access) : array(1), 'class="form-control"');
?>
                    </div>
                </div>
                <div class="panel-footer text-right">
                    <?php 
echo isset($section->id) ? form_hidden('id', $section->id) : '';
?>
                    <a href="<?php 
_u('admin/settings');
?>
" class="btn btn-default btn-sm">
                        <i class="fa fa-arrow-circle-left"></i>
                        <?php 
__('Cancel');
?>
}
?>
 name="access" type="radio"
                                                                                             id="access_4"
                                                                                             value="user"/></td>
            <td>
                <?php 
echo __('Selected Users');
?>
                <br/>
<?php 
$users = array();
foreach ($user as $g) {
    $users[$g['user_id']] = $g['firstname'] . ' ' . $g['lastname'] . ' (' . $g['email'] . ')';
}
echo form_multiselect('user[]', $users, set_value('user[]'), 'class="txtFld"');
?>
            </td>
        </tr>
    </table>

    <p class="clear">&nbsp;</p>

    <label>&nbsp;</label><input class="btn btn-primary" name="create" type="submit" id="create" value="Upload"/>
    &nbsp;<?php 
echo anchor('admin/file/manage-file', __('BACK'));
?>

    <p class="clear">&nbsp;</p>
</div>
Example #24
0
    /**
     * Template Preferences Manager
     *
     * @access	public
     * @return	type
     */
    function template_preferences_manager($message = '')
    {
        if (!$this->cp->allowed_group('can_access_design') or !$this->cp->allowed_group('can_admin_templates')) {
            show_error($this->lang->line('unauthorized_access'));
        }
        if ($this->input->get_post('id') !== '') {
            $group_id = $this->input->get_post('id');
        }
        $vars['message'] = $message;
        $vars['show_template_manager'] = TRUE;
        // in an error condition, this will go false
        if ($this->session->userdata['group_id'] != 1 && (count($this->session->userdata['assigned_template_groups']) == 0 or $this->cp->allowed_group('can_admin_templates') == FALSE)) {
            $vars['message'] = $this->lang->line('no_templates_assigned');
            $vars['show_template_manager'] = FALSE;
            return $this->load->view('design/template_preferences_manager', $vars);
        }
        $this->load->helper('form');
        $this->load->library('table');
        $this->javascript->output('		
			// select all options for template access restrictions
			$("input.select_all").click(function(){
				$("input[class="+$(this).val()+"]").each(function() {
					this.checked = true;
				});
			});
			
			var the_templates = $(\'div[id^="template_group_div_"]\');
		
			$("#template_groups").change(function() {
				the_templates.hide();
				var openDivs = $(this).val().toString()
				var ids = new Array();
				ids = openDivs.split(",");
								
				for(i=0;i<ids.length;i++)
				{
					$("#template_group_div_"+ids[i]).show();
				}
		
				return false;
			});
		');
        // Retrieve Valid Template Groups and Templates
        $this->db->from('template_groups tg, templates t');
        $this->db->select('tg.group_id, tg.group_name, t.template_id, t.template_name');
        $this->db->where('tg.group_id = t.group_id');
        $this->db->where('tg.site_id', $this->config->item('site_id'));
        if ($this->session->userdata['group_id'] != 1) {
            $this->db->where_in('t.group_id', array_keys($this->session->userdata['assigned_template_groups']));
        }
        $this->db->order_by('tg.group_order, t.group_id, t.template_name');
        $query = $this->db->get();
        if ($query->num_rows() == 0) {
            $vars['message'] = $this->lang->line('no_templates_available');
            $vars['show_template_manager'] = FALSE;
            return $this->load->view('design/template_preferences_manager', $vars);
        }
        // Create MultiSelect Lists
        $current_group = 0;
        $groups = array();
        $tmpl = array();
        $vars['templates'] = array();
        foreach ($query->result_array() as $i => $row) {
            if ($row['group_id'] != $current_group) {
                $groups[$row['group_id']] = form_prep($row['group_name']);
                if ($current_group != 0) {
                    $vars['templates']['template_group_div_' . $current_group]['select'] = form_multiselect('template_group_' . $row['group_id'] . '[]', $tmpl, '', "size='8' class='multiselect' style='width:45%'");
                    $vars['templates']['template_group_div_' . $current_group]['active'] = $current_group == $group_id ? TRUE : FALSE;
                    $tmpl = array();
                }
            }
            $tmpl[$row['template_id']] = form_prep($row['template_name']);
            $current_group = $row['group_id'];
        }
        $groups = form_multiselect('template_groups', $groups, $group_id, "id='template_groups' size='10' class='multiselect' style='width:160px'");
        $vars['templates']['template_group_div_' . $current_group]['select'] = form_multiselect('template_group_' . $row['group_id'] . '[]', $tmpl, '', "size='8' class='multiselect' style='width:45%'");
        $vars['templates']['template_group_div_' . $current_group]['active'] = $current_group == $group_id ? TRUE : FALSE;
        $vars['groups'] = $groups;
        if ($this->input->get_post('U')) {
            $vars['message'] = $this->lang->line('preferences_updated');
        }
        // Template Preference Headings
        $headings = array(array('template_type', $this->lang->line('type')), array('cache', $this->lang->line('cache_enable')), array('refresh', $this->lang->line('refresh_interval') . ' <small>(' . $this->lang->line('refresh_in_minutes') . ')</small>'));
        if ($this->session->userdata['group_id'] == 1) {
            $headings[] = array('allow_php', $this->lang->line('enable_php') . ' <span class="notice">*</span>');
            $headings[] = array('php_parse_location', $this->lang->line('parse_stage'));
        }
        if ($this->config->item('save_tmpl_files') == 'y' and $this->config->item('tmpl_file_basepath') != '') {
            $headings[] = array('save_template_file', $this->lang->line('save_template_file'));
        }
        $headings[] = array('hits', $this->lang->line('hit_counter'));
        $vars['headings'] = $headings;
        // Template Preference Options
        $vars['template_prefs'] = array();
        $template_type_options = array('null' => $this->lang->line('do_not_change'), 'css' => $this->lang->line('css_stylesheet'), 'js' => $this->lang->line('js'), 'feed' => $this->lang->line('rss'), 'static' => $this->lang->line('static'), 'webpage' => $this->lang->line('webpage'), 'xml' => $this->lang->line('xml'));
        $vars['template_prefs']['template_type'] = form_dropdown('template_type', $template_type_options, 'null', 'id="template_type"');
        $yes_no_options = array('null' => $this->lang->line('do_not_change'), 'y' => $this->lang->line('yes'), 'n' => $this->lang->line('no'));
        $vars['template_prefs']['cache'] = form_dropdown('cache', $yes_no_options, 'null', 'id="cache"');
        $vars['template_prefs']['refresh'] = form_input(array('name' => 'refresh', 'value' => '0', 'size' => 5));
        if ($this->session->userdata['group_id'] == 1) {
            $php_i_o_options = array('null' => $this->lang->line('do_not_change'), 'i' => $this->lang->line('input'), 'o' => $this->lang->line('output'));
            $vars['template_prefs']['allow_php'] = form_dropdown('allow_php', $yes_no_options, 'null', 'id="allow_php"');
            $vars['template_prefs']['php_parse_location'] = form_dropdown('php_parse_location', $php_i_o_options, 'null', 'id="php_parse_location"');
        }
        if ($this->config->item('save_tmpl_files') == 'y' and $this->config->item('tmpl_file_basepath') != '') {
            $vars['template_prefs']['save_template_file'] = form_dropdown('save_template_file', $yes_no_options, 'null', 'id="save_template_file"');
        }
        $vars['template_prefs']['hits'] = form_input(array('name' => 'hits', 'value' => '', 'size' => 5));
        // Template Access Restrictions
        $this->db->select('group_id, group_title');
        $this->db->where('site_id', $this->config->item('site_id'));
        $this->db->where('group_id !=', '1');
        $this->db->order_by('group_title');
        $query = $this->db->get('member_groups');
        $vars['template_access'] = array();
        foreach ($query->result() as $row) {
            $vars['template_access'][$row->group_id][] = $row->group_title;
            $radio_options = '';
            foreach ($yes_no_options as $key => $lang) {
                $radio_options .= '<label>' . form_radio('access_' . $row->group_id, $key, '', 'class="access_' . $key . '"') . NBS . $lang . '</label>' . NBS . NBS . NBS . NBS . NBS . NBS . NBS;
            }
            $vars['template_access'][$row->group_id][] = $radio_options;
        }
        $vars['template_access']['select_all'][] = $this->lang->line('select_all');
        $select_all_radios = '<label>' . form_radio('select_all', 'access_null', '', 'class="select_all"') . NBS . $this->lang->line('do_not_change') . '</label>' . NBS . NBS . NBS . NBS . NBS . NBS . NBS;
        $select_all_radios .= '<label>' . form_radio('select_all', 'access_y', '', 'class="select_all"') . NBS . $this->lang->line('yes') . '</label>' . NBS . NBS . NBS . NBS . NBS . NBS . NBS;
        $select_all_radios .= '<label>' . form_radio('select_all', 'access_n', '', 'class="select_all"') . NBS . $this->lang->line('no') . '</label>';
        $vars['template_access']['select_all'][] = $select_all_radios;
        $this->db->select('template_groups.group_name, templates.template_name, templates.template_id');
        $this->db->where('template_groups.group_id = ' . $this->db->dbprefix('templates.group_id'));
        $this->db->where('template_groups.site_id', $this->config->item('site_id'));
        $this->db->order_by('template_groups.group_name, templates.template_name');
        $query = $this->db->get(array('template_groups', 'templates'));
        $vars['no_auth_bounce_options']['null'] = $this->lang->line('do_not_change');
        foreach ($query->result() as $row) {
            $vars['no_auth_bounce_options'][$row->template_id] = $row->group_name . '/' . $row->template_name;
        }
        $vars['enable_http_auth_options'] = $yes_no_options;
        $this->cp->set_variable('cp_page_title', $this->lang->line('template_preferences_manager'));
        $this->cp->set_breadcrumb(BASE . AMP . 'C=design' . AMP . 'M=manager', $this->lang->line('template_manager'));
        $this->javascript->compile();
        $this->load->view('design/template_preferences_manager', $vars);
    }
Example #25
0
			<input type="radio" name="vwm_surveys_allowed_groups" value="NULL" <?php 
echo $allowed_groups === NULL ? 'checked="checked"' : NULL;
?>
 />
			None
		</label>
		<label>
			<input type="radio" name="vwm_surveys_allowed_groups" value="SELECT" <?php 
echo is_array($allowed_groups) ? 'checked="checked"' : NULL;
?>
 />
			Select
		</label>
		<div>
			<?php 
echo form_multiselect('vwm_surveys_select_allowed_groups[]', $member_groups, $allowed_groups);
?>
		</div>
	</fieldset>

	<fieldset>
		<legend>Pages (<?php 
echo count($pages);
?>
)</legend>
		<ol id="vwm_surveys_pages">
			<?php 
foreach ($pages as $page_number => $page) {
    ?>
				<li id="vwm_surveys_page_<?php 
    echo $page_number;
Example #26
0
								</div>
								<div class="form-group">
									<?php 
echo form_label('Content <span class="red">*</span>', 'content');
?>
									<?php 
echo form_textarea('content', set_value('content'), 'class="form-control" id="post-content" cols="30" rows="10"');
?>
								</div>
								<div class="form-group">

									<?php 
echo form_label('Tags <span class="red">*</span>', 'tag[]');
?>
									<?php 
echo form_multiselect('tag[]', $tags, set_value('tag'), 'class="form-control" id="tag-field"');
?>
								</div>
								<button type="submit" class="btn btn-primary">Create</button>
						</div><!--context-->
					</div><!--thread-->
			</div><!--content-->
			<div class="col-md-3" id="sidebar">
				<button type="submit" class="create-btn btn btn-primary btn-lg btn-block">
					<span class="glyphicon glyphicon-floppy-disk"></span>
					Update
				</button>
				<button onclick="window.history.back()" type="button" class="create-btn btn btn-warning btn-lg btn-block">
					<span class="glyphicon glyphicon-arrow-left"></span>
					Back
				</button>
Example #27
0
 function form_build_field($field, $html_type = NULL, $data = NULL, $extra = '')
 {
     $field_name = $field['field'];
     $field_type = $field['type'];
     $field_value = $field['value'];
     $extra = $extra . ' id="' . $field_name . '"';
     // Define the HTML type to use from DB field
     // Limited, as the DB types cannot be translated to HTML form types
     if (is_null($html_type)) {
         switch ($field_type) {
             case 'tinyint':
             case 'smallint':
                 // Checkbox (on / off)
                 if ($field['length'] == 1) {
                     $html_type = "checkbox";
                 } else {
                     $html_type = "input";
                 }
                 break;
             case 'float':
             case 'int':
             case 'char':
             case 'tinytext':
                 $html_type = "input";
                 break;
             case 'varchar':
             case 'text':
             case 'longtext':
                 if ($field_type == 'varchar' && $field['length'] < 255) {
                     $html_type = "input";
                 } elseif ($field_type == 'varchar' && $field['length'] < 3000) {
                     $html_type = "textarea";
                 } else {
                     $html_type = "html";
                 }
                 break;
             case 'enum':
                 $html_type = "radio";
                 break;
             case 'date':
             case 'datetime':
                 $html_type = "date";
                 break;
             default:
                 $html_type = "input";
         }
     }
     // No data provided
     if (!is_array($data)) {
         $data = array();
         // Try to get the ENUM possible values
         if ($field_type == 'enum') {
             foreach ($field['length'] as $enum) {
                 $data[$enum] = $enum;
             }
         }
     }
     switch ($html_type) {
         // Select
         // $data is supposed to be an array of keys => displayed labels
         case 'select':
             $extra .= ' class="select"';
             return form_dropdown($field_name, $data, $field_value, $extra);
             break;
         case 'multiselect':
             $extra .= ' class="select multiselect"';
             $selected = explode(',', $field_value);
             $field_name = $field_name . '[]';
             return form_multiselect($field_name, $data, $selected, $extra);
             break;
         case 'input':
             $extra .= ' class="inputtext"';
             return form_input($field_name, $field_value, $extra);
             break;
         case 'textarea':
             $extra .= ' class="textarea"';
             return form_textarea($field_name, $field_value, $extra);
             break;
             // Text Editing textarea (tinyMCE in this case)
         // Text Editing textarea (tinyMCE in this case)
         case 'html':
             $extra .= ' class="tinyTextarea"';
             return form_textarea($field_name, $field_value, $extra);
             break;
         case 'checkbox':
             $extra = ' class="checkbox"';
             $str = '';
             $print_label = TRUE;
             // We consider the checkbox only validate one data, which should be set at 1 or 0.
             if (empty($data)) {
                 $data = array(1 => '');
                 $print_label = FALSE;
             }
             foreach ($data as $value => $label) {
                 $id = 'c_' . uniqid();
                 $extra2 = $extra . ' id="' . $id . '"';
                 $checked = $field_value == $value ? TRUE : FALSE;
                 if ($print_label === TRUE) {
                     $str .= form_label($label, $id);
                 }
                 $str .= form_checkbox($field_name, $value, $checked, $extra2);
             }
             return $str;
             break;
         case 'radio':
             $extra = ' class="radio"';
             $str = '';
             $print_label = TRUE;
             // We consider the checkbox only validate one data, which should be set at 1 or 0.
             if (empty($data)) {
                 $data = array(1 => '');
                 $print_label = FALSE;
             }
             foreach ($data as $value => $label) {
                 $id = 'r_' . uniqid();
                 $extra2 = $extra . ' id="' . $id . '"';
                 $checked = $field_value == $value ? TRUE : FALSE;
                 if ($print_label === TRUE) {
                     $str .= form_label($label, $id);
                 }
                 $str .= form_radio($field_name, $value, $checked, $extra2);
             }
             return $str;
             break;
         case 'date':
             $extra .= ' class="inputtext date"';
             if ($field['type'] == 'datetime') {
                 $field_value = humanize_mdate($field_value, Settings::get('date_format') . ' %H:%i:%s');
             } else {
                 $field_value = humanize_mdate($field_value, Settings::get('date_format'));
             }
             return form_input($field_name, $field_value, $extra);
             break;
         default:
             $extra .= ' class="inputtext"';
             return form_input($field_name, $field_value, $extra);
     }
 }
Example #28
0
 function dropMultiselect_tpl($params = array())
 {
     if (!empty($params)) {
         $data = isset($params['data']) ? $params['data'] : false;
         $data_seleted = isset($params['data_seleted']) ? $params['data_seleted'] : array();
         $selected = isset($params['selected']) ? $params['selected'] : '';
         $value = isset($params['value']) ? $params['value'] : false;
         $text = isset($params['text']) ? $params['text'] : false;
         $name = isset($params['name']) ? $params['name'] : false;
         $name2 = isset($params['name2']) ? $params['name2'] : 'list';
         $class = isset($params['class']) ? $params['class'] : '';
         $event = isset($params['event']) ? $params['event'] : '';
         $prev = isset($params['prev']) ? $params['prev'] : '';
         $next = isset($params['next']) ? $params['next'] : '';
         $disabled = isset($params['disabled']) ? $params['disabled'] : '';
     }
     $name = $name == "" ? "selected" : $name;
     $count = 0;
     $options_selected = array();
     if ($data && $name && $value && $text) {
         if (!empty($data_seleted)) {
             foreach ($data_seleted as $option => $item) {
                 $option_selected = "";
                 if (is_array($text)) {
                     foreach ($text as $string) {
                         $option_selected .= $item[$string] . '-';
                     }
                     $options_selected[$item[$value]] = trim($option_selected, '-');
                 } else {
                     $options_selected[$item[$value]] = $item[$text];
                 }
             }
         }
         $options = array();
         foreach ($data as $option => $item) {
             $option_value = "";
             if (is_array($text)) {
                 if (!array_key_exists($item[$value], $options_selected)) {
                     foreach ($text as $string) {
                         $option_value .= $item[$string] . '-';
                     }
                     $options[$item[$value]] = trim($option_value, '-');
                 }
             } else {
                 if (!array_key_exists($item[$value], $options_selected)) {
                     $options[$item[$value]] = $item[$text];
                 }
             }
             $count++;
         }
         $multiple = form_multiselect($name2, $options_selected, $selected, "multiple='multiple' class='multiple_selected {$class}'  size='10'");
         $selected = "<span id='dualselected' class='dualselect'>" . form_multiselect($name, $options, $selected, "multiple='multiple' class='uniformselect' size='10'") . "<span class='ds_arrow'>\r\n                                    <button onclick='{$prev}' class='btn ds_prev'>\r\n                                        <i class='iconfa-chevron-left'>\r\n                                        </i>\r\n                                    </button>\r\n                                    <br>\r\n                                    <button onclick='{$next}' class='btn ds_next'>\r\n                                        <i class='iconfa-chevron-right'>\r\n                                        </i>\r\n                                    </button>\r\n                                </span>" . $multiple . "</span>";
         return $selected;
     }
     return false;
 }
					<h3 class="page-title">儀器預約系統<small>儀器與門禁管理</small></h3>
                    <!-- BEGIN EXAMPLE TABLE widget-->
                    <div class="widget">
                        <div class="widget-title">
                            <h4><i class="icon-reorder"></i>批次儀器設定</h4>
                        </div>
                        <div class="widget-body form">
							<form action="<?php 
echo site_url();
?>
/facility/admin/facility/update/batch" id="form_facility_config" class="form-horizontal" method="POST">
								<div class="control-group ">
						           <label class="control-label">選擇儀器</label>
						           <div class="controls">
								      <?php 
echo form_multiselect("facility_SN[]", $facility_ID_select_options, "", "class='chosen span12'");
?>
						           </div>
						        </div>
								<div class="control-group">
						           <label class="control-label">停機時間</label>
						           <div class="controls">
								      <input name="outage_start_date" type="text" value="<?php 
echo date("Y-m-d");
?>
" class="date-picker input-medium" />
									  <input name="outage_start_time" type="text" value="<?php 
echo date("H:i");
?>
" class="timepicker-24 input-medium" />
									  ~
Example #30
0
?>
</td>
				</tr>

				<tr class="ui-helper-reset">
					<th>Manager</th>
					<td><?php 
echo form_dropdown('user_manager', $users, $user->user_manager);
?>
</td>
				</tr>

				<tr class="ui-helper-reset">
					<th>Available Accounts</th>
					<td><?php 
echo form_multiselect('accounts[]', $accounts, unserialize(base64_decode($user->accounts)), 'size=10');
?>
</td>
				</tr>
			</tbody>
		</table>

		<p>
			<?php 
echo form_submit('submit_user', 'Update User');
?>
		</p>
		<?php 
echo form_hidden('update_user', true);
?>
		<?php