function form_open($action = '', $attributes = '', $hidden = array()) { $CI =& get_instance(); $charset = strtolower($CI->config->item('charset')); if ($attributes == '') { $attributes = 'method="post" accept-charset="' . $charset . '"'; } else { if (is_string($attributes)) { if (strpos('accept-charset=', $attributes) === FALSE) { $attributes .= ' accept-charset="' . $charset . '"'; } } elseif (is_object($attributes) or is_array($attributes)) { $attributes = (array) $attributes; if (!in_array('accept-charset', $attributes)) { $attributes['accept-charset'] = $charset; } } } $action = strpos($action, '://') === FALSE ? $CI->config->site_url($action) : $action; $form = '<form action="' . $action . '"'; $form .= _attributes_to_string($attributes, TRUE); $form .= '>'; if (is_array($hidden) and count($hidden) > 0) { $form .= form_hidden($hidden); } return $form; }
function print_input_file_upload($input) { $html = ''; $data = array('name' => $input['name'], 'id' => isset($input['id']) ? $input['id'] : $input['name'], 'tabindex' => isset($input['tabindex']) ? $input['tabindex'] : '', 'value' => $input['value']); $html .= form_upload($data) . form_hidden($input['name'], $input['value']); return $html; }
public function initialize($cajero = NULL) { $CI =& get_instance(); $CI->load->helper(array('form', 'bancofield')); $existeObjeto = $cajero != NULL ? 1 : 0; $this->id = form_hidden('id', $existeObjeto ? $cajero->id : $CI->input->post('id')); $this->banco_id = BancoField('banco_id', $existeObjeto ? $cajero->banco_id : $CI->input->post('banco_id')); $this->nombre = form_input('nombre', $existeObjeto ? $cajero->nombre : $CI->input->post('nombre')); $this->horario = form_input('horario', $existeObjeto ? $cajero->horario : $CI->input->post('horario')); $this->direccion = form_input('direccion', $existeObjeto ? $cajero->direccion : $CI->input->post('direccion')); $this->latitud = form_input('latitud', $existeObjeto ? $cajero->latitud : $CI->input->post('latitud')); $this->longitud = form_input('longitud', $existeObjeto ? $cajero->longitud : $CI->input->post('longitud')); $this->banred = form_checkbox('banred', '1', $existeObjeto ? $cajero->banred : $CI->input->post('banred')); $this->pacificard = form_checkbox('pacificard', '1', $existeObjeto ? $cajero->pacificard : $CI->input->post('pacificard')); $this->american_express = form_checkbox('american_express', '1', $existeObjeto ? $cajero->american_express : $CI->input->post('american_express')); $this->bankard = form_checkbox('bankard', '1', $existeObjeto ? $cajero->bankard : $CI->input->post('bankard')); $this->nexo = form_checkbox('nexo', '1', $existeObjeto ? $cajero->nexo : $CI->input->post('nexo')); $this->visa_debito = form_checkbox('visa_debito', '1', $existeObjeto ? $cajero->visa_debito : $CI->input->post('visa_debito')); $this->visa = form_checkbox('visa', '1', $existeObjeto ? $cajero->visa : $CI->input->post('visa')); $this->plus = form_checkbox('plus', '1', $existeObjeto ? $cajero->plus : $CI->input->post('plus')); $this->mastercard = form_checkbox('mastercard', '1', $existeObjeto ? $cajero->mastercard : $CI->input->post('mastercard')); $this->cirrus = form_checkbox('cirrus', '1', $existeObjeto ? $cajero->cirrus : $CI->input->post('cirrus')); $this->maestro = form_checkbox('maestro', '1', $existeObjeto ? $cajero->maestro : $CI->input->post('maestro')); $this->diners = form_checkbox('diners', '1', $existeObjeto ? $cajero->diners : $CI->input->post('diners')); $this->estado = form_dropdown('estado', array('AC' => 'Activo', 'IN' => 'Inactivo'), $existeObjeto ? $cajero->estado : $CI->input->post('estado')); }
public function editar() { if (!($this->dados['infos'] = $this->curso_model->listar($this->id))) { redirect('../cursos/listar'); } $dadosCurso = $this->dados['infos'][0]; $form = form_open('#', array('class' => 'niceform')); $form .= '<table class="cadForm">'; $form .= '<tr>'; $form .= '<td>'; $form .= form_label('Nome:', '', array('for' => 'email')); $form .= form_input('curso_nome', $dadosCurso['curso_nome'], array('size' => 30)); $form .= form_hidden('curso_id', $dadosCurso['curso_id']); $form .= form_hidden('lixeira', $dadosCurso['lixeira']); $form .= '</td>'; $form .= '<td>'; $form .= form_label('Quantidade de aulas:', '', array('for' => 'email')); $form .= form_input('curso_qtd_aulas', $dadosCurso['curso_qtd_aulas'], array('size' => 20)); $form .= '</td>'; $form .= '</tr>'; $form .= '<tr>'; $form .= '<td></td>'; $form .= '<td>'; $form .= form_submit('cadastrar', 'Enviar', 'id="submit"'); $form .= '</td>'; $form .= '</tr>'; $form .= '</table>'; $form .= form_close(); $form .= '<span class="obs">Todos os campos são obrigatórios.</span>'; $this->dados['form'] = $form; $this->load->view('editar', $this->dados); }
public function index() { $table = ee('CP/Table', array('sortable' => FALSE, 'reorder' => TRUE)); $rows = array(); $data = array(); // Default HTML buttons simply have a member ID of 0 $buttons = ee('Model')->get("HTMLButton")->filter('member_id', 0)->order('tag_order', 'asc')->all(); foreach ($buttons as $button) { $name = strpos($button->classname, 'html-') !== 0 ? $button->tag_name : ''; $preview = array('toolbar_items' => array($button->classname => array('href' => ee('CP/URL')->make('settings/buttons/edit/' . $button->id), 'title' => $button->tag_name, 'content' => $name . form_hidden('order[]', $button->id)))); $toolbar = array('toolbar_items' => array('edit' => array('href' => ee('CP/URL')->make('settings/buttons/edit/' . $button->id), 'title' => strtolower(lang('edit'))))); $columns = array('preview' => $preview, 'tag_name' => $button->tag_name, 'accesskey' => $button->accesskey, $toolbar, array('name' => 'selection[]', 'value' => $button->id, 'data' => array('confirm' => lang('html_button') . ': <b>' . htmlentities($button->tag_name, ENT_QUOTES, 'UTF-8') . '</b>'))); $attrs = array(); if (ee()->session->flashdata('button_id') == $button->id) { $attrs = array('class' => 'selected'); } $rows[] = array('attrs' => $attrs, 'columns' => $columns); } $table->setColumns(array('preview' => array('type' => Table::COL_TOOLBAR), 'tag_name', 'accesskey', 'manage' => array('type' => Table::COL_TOOLBAR), array('type' => Table::COL_CHECKBOX))); $table->setNoResultsText('no_search_results'); $table->setData($rows); $data['table'] = $table->viewData($this->base_url); $data['new'] = ee('CP/URL')->make('settings/buttons/create'); $data['form_url'] = ee('CP/URL')->make('settings/buttons/delete'); $data['table']['action_content'] = $this->predefined(); ee()->javascript->set_global('lang.remove_confirm', lang('html_buttons') . ': <b>### ' . lang('html_buttons') . '</b>'); ee()->cp->add_js_script(array('file' => array('cp/confirm_remove', 'cp/members/html_button_reorder', 'cp/sort_helper'), 'plugin' => array('ee_table_reorder'))); $reorder_ajax_fail = ee('CP/Alert')->makeBanner('reorder-ajax-fail')->asIssue()->canClose()->withTitle(lang('html_button_ajax_reorder_fail'))->addToBody(lang('html_button_ajax_reorder_fail_desc')); ee()->javascript->set_global('html_buttons.reorder_url', ee('CP/URL')->make('settings/buttons/order/')->compile()); ee()->javascript->set_global('alert.reorder_ajax_fail', $reorder_ajax_fail->render()); ee()->view->base_url = $this->base_url; ee()->view->ajax_validate = TRUE; ee()->view->cp_page_title = lang('html_buttons'); ee()->cp->render('account/buttons', $data); }
function menu_child($parent, $level = 1) { $query = $this->CI->db->get_where('menu_detail', array('menu_parent' => $parent))->result(); if (!empty($query)) { foreach ($query as $row) { echo form_hidden('menuid[]', $row->id); ?> <tr> <td><?php echo $row->menu_name; ?> </td> <td><?php if ($row->menu_type == "link") { echo $row->menu_link; } else { echo site_url() . '/' . $row->menu_link; } ?> </td> <td><?php echo form_input(array('value' => $row->menu_order, 'name' => 'menuorder[]', 'class' => 'form-control input-sm', 'style' => 'width:50px;')); ?> </td> <td> <?php echo anchor('adminmenu/deletedetail/' . $row->id, 'Delete', array('class' => 'btn btn-sm btn-danger')); ?> </td> </tr> <?php $this->menu_child($row->id, $level + 1); } } }
/** * Output form input * * @param array * @param array * @return string */ public function form_output($params) { $count = isset($params['custom']['limit']) ? $params['custom']['limit'] : 1; $this->CI->load->config('files/files'); $value = !empty($params['value']) ? explode('|', $params['value']) : null; $out = ''; if ($value and count($value) > 0) { $out .= '<ul class="list-group">'; foreach ($value as $file) { $out .= '<li class="list-group-item">'; $out .= '<span class="image_remove" data-file="' . $file . '">X</span> <a class="image_link" href="' . site_url('files/large/' . $file) . '" target="_break"> <img src="' . site_url('files/thumb/' . $file) . '" height="100" /> </a><br />'; $out .= '</li>'; } $out .= '</ul>'; $out .= form_hidden($params['form_slug'], $params['value']); } else { $out .= form_hidden($params['form_slug'], null); } $options['name'] = $params['form_slug'] . '_file[]'; $options['multiple'] = 'multiple'; $out .= form_upload($options); //} return $out; }
function generateConfirm($edit) { $dataInvalid = $this->isDataInvalid($edit); if ($this->formbuilder) { $this->formbuilder->bulk_set_answers($_POST[$this->event->formkey()]); $dataInvalid .= $this->formbuilder->answers_invalid(); } if ($dataInvalid) { error_exit($dataInvalid . '<br>Please use your back button to return to the form, fix these errors, and try again.'); } $output = para('Please confirm that this data is correct and click the submit button to proceed to the payment information page.'); $output .= form_hidden('edit[step]', 'submit'); $fields = array('Registration Status' => 'payment', 'Notes' => 'notes'); $rows = array(); foreach ($fields as $display => $column) { array_push($rows, array($display, form_hidden("edit[{$column}]", $edit[$column]) . check_form($edit[$column]))); } $output .= form_group('Registration details', "<div class='pairtable'>" . table(null, $rows) . '</div>'); if ($this->formbuilder) { $form = $this->formbuilder->render_viewable(); $form .= $this->formbuilder->render_hidden(); $output .= form_group('Registration answers', $form); } $output .= para(form_submit('submit')); return form($output); }
function display_field($data) { $this->_field_includes(); $this->EE->lang->loadfile('category_field'); $group_id = $this->get_settings_prop('category_field_category_group_id'); $display_type = $this->get_settings_prop('category_field_display_type'); $hide_filter = $this->get_settings_prop('category_field_hide_filter', 'n'); $hide_edit = $this->get_settings_prop('category_field_hide_edit', 'n'); // If no group id select, exit and return message if ($group_id == '') { return lang('no_group_id'); } $this->EE->cp->add_to_foot(' <script> $(document).ready(function() { $("#sub_hold_field_' . $this->field_id . '").categoryField({ fieldId : ' . $this->field_id . ', categoryGroupId : ' . $group_id . ', editText : "' . lang('edit') . '", themesFolder : "' . URL_THIRD_THEMES . '../cp_themes/", displayType : ' . $display_type . ', hideEdit : "' . $hide_edit . '", fieldName : "' . $this->field_name . '" }); }); </script>'); $html = form_hidden($this->field_name); if ($hide_filter != 'y') { $html .= '<input type="text" value="" id="cat_filter_group_' . $group_id . '" class="filter_input" placeholder="' . lang('filter_input_placeholder') . '"/>'; } return $html; }
function comments($comments, $object_id, $object, $usernames, $format, $return = 'agilan/index') { $string = ""; $string .= "<ol class='comments'>"; if (isset($comments[$object_id]) && count($comments[$object_id]) > 0) { foreach ($comments[$object_id] as $kk => $ll) { $CID = $ll->user_id; $CU = $usernames[$ll->user_id]; $stamp = mysql_to_unix($ll->created); $string .= "<li><b>" . $CU . ":</b> <small>" . $ll->comment . "<br/>" . mdate($format, $stamp) . "</small></li>"; } } else { $string .= nbs(); } $string .= "<li class='last'>"; $string .= form_open('comments/index'); $input = array('name' => 'comment', 'id' => 'comment', 'size' => 35); $string .= form_input($input); $string .= form_hidden('object', $object); $string .= form_hidden('object_id', $object_id); $string .= form_hidden('return_url', $return); $string .= form_submit('add comment', 'comment'); $string .= form_close(); $string .= "</li>"; $string .= "</ol>"; echo $string; }
function form_open($action = '', $attributes = '', $hidden = array()) { $_ci = & get_instance(); $_ci->load->library('form_validation'); if ($attributes == '') { $attributes = 'method="post"'; } $action = ( strpos($action, '://') === FALSE) ? $_ci->config->site_url($action) : $action; $form = '<form action="' . $action . '"'; $form .= _attributes_to_string($attributes, TRUE); $form .= '>'; if ($_ci->form_validation->has_nonce()) { $value = set_value('nonce'); if ($value == '') { $value = $_ci->form_validation->create_nonce(); } $hidden['nonce'] = set_value('nonce', $value); } if (is_array($hidden) && count($hidden) > 0) { $form .= form_hidden($hidden); } return $form; }
/** * Output form input * * @param array * @param array * @return string */ public function form_output($params) { $this->CI->load->config('files/files'); // Get the file if ($params['value']) { $current_file = $this->CI->db->where('id', $params['value'])->limit(1)->get('files')->row(); } else { $current_file = null; } $out = ''; if ($current_file) { $out .= '<div class="file_info"><span href="#" class="file_remove">X</span><a href="' . base_url('files/download/' . $current_file->id) . '">' . $current_file->name . '</a></div>'; } // Output the actual used value if ($params['value']) { $out .= form_hidden($params['form_slug'], $params['value']); } else { $out .= form_hidden($params['form_slug'], 'dummy'); } $options['name'] = $params['form_slug']; $options['name'] = $params['form_slug'] . '_file'; $this->CI->type->add_js('file', 'filefield.js'); $this->CI->type->add_css('file', 'filefield.css'); return $out .= form_upload($options); }
function form_open($action = '', $attributes = array(), $hidden = array()) { $CI =& get_instance(); $action = strpos($action, '://') === FALSE ? BASE . AMP . $action : $action; $form = '<form action="' . $action . '"'; if (is_array($attributes)) { if (!isset($attributes['method'])) { $form .= ' method="post"'; } foreach ($attributes as $key => $val) { $form .= ' ' . $key . '="' . $val . '"'; } } else { $form .= ' method="post" ' . $attributes; } $form .= ">\n"; if ($CI->config->item('secure_forms') == 'y') { if (!is_array($hidden)) { $hidden = array(); } $hidden['XID'] = XID_SECURE_HASH; } if (is_array($hidden) and count($hidden > 0)) { $form .= form_hidden($hidden) . "\n"; } return $form; }
function form_open($action = '', $attributes = array(), $hidden = array()) { $CI =& get_instance(); if (strpos($action, '://') === FALSE && strpos($action, BASE) !== 0) { $action = BASE . AMP . $action; } $action = ee()->uri->reformat($action); $form = '<form action="' . $action . '"'; if (is_array($attributes)) { if (!isset($attributes['method'])) { $form .= ' method="post"'; } foreach ($attributes as $key => $val) { $form .= ' ' . $key . '="' . $val . '"'; } } else { $form .= ' method="post" ' . $attributes; } $form .= ">\n"; if (!bool_config_item('disable_csrf_protection')) { if (!is_array($hidden)) { $hidden = array(); } $hidden['csrf_token'] = CSRF_TOKEN; } if (is_array($hidden) and count($hidden > 0)) { $form .= form_hidden($hidden) . "\n"; } return $form; }
/** * Output form input * * @param array * @param array * @return string */ public function form_output($params) { $this->CI->load->config('files/files'); // Get the file $this->CI->db->limit(1); $this->CI->db->where('id', $params['value']); $db_obj = $this->CI->db->get('files'); $out = ''; if ($db_obj->num_rows() != 0) { // Div for the PyroCMS admin /*if( $this->CI->uri->segment(1) == 'admin' ): $out .= '<div style="float: left;">'; endif;*/ $out .= $this->_output_thumb($db_obj->row(), true) . br(); } else { $out .= ''; } // Output the actual used value if (is_numeric($params['value'])) { $out .= form_hidden($params['form_slug'], $params['value']); } else { $out .= form_hidden($params['form_slug'], 'dummy'); } $options['name'] = $params['form_slug']; $options['name'] = $params['form_slug'] . '_file'; //if( $this->CI->uri->segment(1) == 'admin' ): $out .= '</div>'; endif; return $out .= form_upload($options); }
/** * build (only) the field (widhout labels or borders) * * @access public * @return void */ function build() { $output = ""; if (!isset($this->cols)) { $this->cols = 42; } if (!isset($this->rows)) { $this->rows = 15; } $this->_getValue(); switch ($this->status) { case "disabled": case "show": if (!isset($this->value)) { $output = RAPYD_FIELD_SYMBOL_NULL; } elseif ($this->value == "") { $output = ""; } else { $output = '<span style="font-size:9px; width: 100%; height:100px; overflow: auto">' . nl2br(htmlspecialchars($this->value)) . '</span>'; //I know I know.. } break; case "create": case "modify": $attributes = array('name' => $this->name, 'id' => $this->name, 'cols' => $this->cols, 'rows' => $this->rows, 'onclick' => $this->onclick, 'onchange' => $this->onchange, 'class' => $this->css_class, 'style' => $this->style); $output = form_textarea($attributes, $this->value) . $this->extra_output; break; case "hidden": $output = form_hidden($this->name, $this->value); break; default: } $this->output = $output; }
/** * 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; }
/** * Form Declaration * * Creates the opening portion of the form. * * Modified to accomodate HTTPS actions * * @param string the URI segments of the form destination * @param array a key/value pair of attributes * @param array a key/value pair hidden data */ function form_open($action = '', $attributes = '', $hidden = array()) { $CI =& get_instance(); if ($attributes == '') { $attributes = 'method="post"'; } // If an action is not a full URL then turn it into one if ($action && strpos($action, '://') === FALSE) { $action = if_secure_site_url($action); } // If no action is provided then set to the current url $action or $action = if_secure_site_url($CI->uri->uri_string()); $form = '<form action="' . $action . '"'; $form .= _attributes_to_string($attributes, TRUE); $form .= '>'; // Add CSRF field if enabled, but leave it out for GET requests and requests to external websites if ($CI->config->item('csrf_protection') === TRUE and !(strpos($action, if_secure_base_url()) === FALSE or strpos($form, 'method="get"'))) { $hidden[$CI->security->get_csrf_token_name()] = $CI->security->get_csrf_hash(); } // Add MY CSRF token if MY CSRF library is loaded if ($CI->load->is_loaded('tokens') and !(strpos($action, if_secure_base_url()) === FALSE or strpos($form, 'method="get"'))) { $hidden[$CI->tokens->name] = $CI->tokens->token(); } if (is_array($hidden) and count($hidden) > 0) { $form .= sprintf("<div style=\"display:none\">%s</div>", form_hidden($hidden)); } return $form; }
public function principal() { if (!isset($_SESSION['login'])) { die("Sesion terminada. <a href='" . base_url() . "'>Registrarse e ingresar.</a> "); } $arrmes = array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"); $mes = date("m", time()); $ano = date("Y", time()); $dia = date("d", time()); $ver = ""; $fecha = $dia . " DE " . strtoupper($arrmes[$mes - 1]) . " DE " . $ano; $fecha_std = $dia . "/" . $mes . "/" . $ano; $fecha_red = $dia . $mes . $ano; $nombreusuario = $this->session->userdata('nomper'); $codusu = $this->session->userdata('codusu'); $rolusu = $this->session->userdata('rolusu'); $filter = new stdClass(); $filter->rol = $rolusu; $filter->order_by = array("m.MENU_Orden" => "asc"); $menu = get_menu($filter); /*Accesos*/ $data['fecha'] = $fecha; $data['menu'] = $menu; $filter = new stdClass(); $filter->order_by = array("ACCESOP_Codigo" => "desc"); $data['accesos'] = $this->acceso_model->listar($filter); $data['header'] = get_header(); $data['oculto'] = form_hidden(array("serie" => "", "numero" => "", "codot" => "")); $this->load->view("seguridad/principal", $data); }
public function editar($acta = 0, $curso = 0) { $filter = new stdClass(); $filter->acta = $acta; $filter->order_by = array("f.PERSC_ApellidoPaterno" => "asc", "f.PERSC_ApellidoMaterno" => "asc", "f.PERSC_Nombre" => "asc"); $actaprofesores = $this->actaprofesor_model->listar($filter); $flgDetalle = 0; $item = 1; $lista = array(); if (count($actaprofesores) > 0) { foreach ($actaprofesores as $indice => $value) { $lista[$indice] = new stdClass(); $lista[$indice]->nombres = $value->PERSC_Nombre; $lista[$indice]->paterno = $value->PERSC_ApellidoPaterno; $lista[$indice]->materno = $value->PERSC_ApellidoMaterno; $lista[$indice]->codigo = $value->ACTAPROFP_Codigo; $lista[$indice]->profesor = $value->codprofesor; $lista[$indice]->hingreso = $value->ACTAPROFC_Hingreso; $lista[$indice]->hsalida = $value->ACTAPROFC_Hsalida; $lista[$indice]->observacion = $value->ACTAPROFC_Observacion; $lista[$indice]->curso = $value->PROD_Nombre; } $flgDetalle = 1; } $data['titulo'] = "Asistencia de profesores"; $data['form_open'] = form_open('', array("name" => "frmPersona", "id" => "frmPersona", "onsubmit" => "return valida_guiain();")); $data['form_close'] = form_close(); $data['lista'] = $lista; $data['flgDetalle'] = $flgDetalle; $data['oculto'] = form_hidden(array("curso" => $curso, "acta" => $acta, "flgDetalle" => $flgDetalle)); $this->load->view("ventas/actaprofesor_nuevo", $data); }
function build() { $output = ""; $this->_getValue(); switch ($this->status) { case "disabled": case "show": if (!isset($this->value)) { $output = RAPYD_FIELD_SYMBOL_NULL; } elseif ($this->value == "") { $output = ""; } else { $output = $this->value; } break; case "create": case "modify": $onchange = ""; $onclick = ""; if ($this->onchange != "") { $onchange = ' onchange="' . $this->onchange . '"'; } if ($this->onclick != "") { $onclick = ' onclick="' . $this->onclick . '"'; } $id = ' id="' . $this->name . '"'; $output = form_checkbox($this->name, $this->true_value, $this->checked, $id . $onchange . $onclick) . $this->extra_output; break; case "hidden": $output = form_hidden($this->name, $this->value); break; default: } $this->output = $output; }
public function novasenha($reset_senha = '') { $usuario = $this->usuarios->getBy('reset_senha', $reset_senha); $dados['codigo'] = form_hidden('codigo', $reset_senha); $dados['id_oculto'] = form_hidden('id', $usuario->id); $this->load->view('novasenha_view', $dados); }
public function receber() { //Regras da Validação $this->form_validation->set_rules('nome', 'NOME', 'required'); $this->form_validation->set_rules('tipo', 'TIPO DE USUARIO', 'required'); $this->form_validation->set_rules('cpf', 'CPF', 'required|valid_cpf'); $this->form_validation->set_rules('email', 'EMAIL', 'required'); $this->form_validation->set_rules('contato', 'CONTATO', 'required'); // A função matches verifica se os campos são iguais $this->form_validation->set_rules('senha', 'SENHA', 'required|matches[senha2]'); $this->form_validation->set_rules('senha2', 'CONFIRMAR', 'required'); if ($this->form_validation->run() == FALSE) { //se não houver cpf ou senha retornara com msg de erro $this->load->model('Usuarios'); $dados['tipo'] = $this->Usuarios->gettabela('tbltipousuario'); $dados['tipouser'] = $this->input->post('tipo'); if (isset($_POST['id'])) { $id = $this->input->post('id'); $dados['id_oculto'] = form_hidden('id', $id); } $this->load->view('admin/cadastro_usuario', $dados); } else { //Se existir um id faça a atualização de cadastro if (isset($_POST['id'])) { $id = $this->input->post('id'); $data['nome'] = $this->input->post('nome'); $data['tipoid'] = $this->input->post('tipo'); $data['cpf'] = $this->input->post('cpf'); $data['matricula'] = $this->input->post('matricula'); $data['email'] = $this->input->post('email'); $data['contato'] = $this->input->post('contato'); $data['senha'] = $this->input->post('senha'); /* Carrega o modelo */ $this->load->model('Usuarios'); /* Chama a função inserir do modelo */ if ($this->Usuarios->atualiza($id, $data)) { setMensagem('admin/usuario', 'Cadastro atualizado com sucesso!'); } else { setMensagem('admin/usuario', 'Ocorreu um Erro', TRUE); } } else { $data['nome'] = $this->input->post('nome'); $data['tipoid'] = $this->input->post('tipo'); $data['cpf'] = $this->input->post('cpf'); $data['matricula'] = $this->input->post('matricula'); $data['email'] = $this->input->post('email'); $data['contato'] = $this->input->post('contato'); $data['senha'] = $this->input->post('senha'); /* Carrega o modelo */ $this->load->model('Usuarios'); /* Chama a função inserir do modelo */ if ($this->Usuarios->cadastro($data)) { setMensagem('admin/usuario', 'Cadastro realizado com sucesso!'); } else { setMensagem('admin/usuario', 'Ocorreu um Erro', TRUE); } } } }
function html_9d96364ed1d79895affe5b2e3d246085($Cache, $Pile, $doublons = array(), $Numrows = array(), $SP = 0) { if (isset($Pile[0]["doublons"]) and is_array($Pile[0]["doublons"])) { $doublons = nettoyer_env_doublons($Pile[0]["doublons"]); } $connect = ''; $page = '<div class="formulaire_spip formulaire_ecrire_auteur ajax" id="formulaire_ecrire_auteur' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'id', null), true)) . '"> <br class=\'bugajaxie\' /> ' . (($t1 = strval(interdire_scripts(table_valeur(@$Pile[0], (string) 'message_ok', null)))) !== '' ? '<p class="reponse_formulaire reponse_formulaire_ok">' . $t1 . '</p>' : '') . ' ' . (($t1 = strval(interdire_scripts(table_valeur(@$Pile[0], (string) 'message_erreur', null)))) !== '' ? '<p class="reponse_formulaire reponse_formulaire_erreur">' . $t1 . '</p>' : '') . ' ' . (($t1 = strval(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'editable', null), true)))) !== '' ? $t1 . (' <form method=\'post\' action=\'' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'action', null), true)) . '#formulaire_ecrire_auteur' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'id', null), true)) . '\' enctype=\'multipart/form-data\'> ' . '<div>' . form_hidden(interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'action', null), true))) . '<input name=\'formulaire_action\' type=\'hidden\' value=\'' . @$Pile[0]['form'] . '\' />' . '<input name=\'formulaire_action_args\' type=\'hidden\' value=\'' . @$Pile[0]['formulaire_args'] . '\' />' . (!empty($Pile[0]['_hidden']) ? @$Pile[0]['_hidden'] : '') . '</div> ' . (($t2 = strval(interdire_scripts(table_valeur(table_valeur(@$Pile[0], (string) 'erreurs', null), 'previsu') ? ' ' : ''))) !== '' ? $t2 . (' <fieldset class="previsu"> <legend>' . _T('public|spip|ecrire:previsualisation') . '</legend> <ul> <li><strong>' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'sujet_message_auteur', null), true)) . '</strong> - <em>' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'email_message_auteur', null), true)) . '</em></li> <li>' . interdire_scripts(nl2br(entites_html(table_valeur(@$Pile[0], (string) 'texte_message_auteur', null), true))) . '</li> </ul> <p class="boutons"><input type="submit" class="submit" name="confirmer" value="' . _T('public|spip|ecrire:form_prop_confirmer_envoi') . '" /></p> </fieldset> ') : '') . ' <fieldset> <legend>' . _T('public|spip|ecrire:envoyer_message') . '</legend> <ul class="editer-groupe"> <li class=\'editer saisie_email_message_auteur obligatoire' . (($t2 = strval(interdire_scripts(table_valeur(table_valeur(@$Pile[0], (string) 'erreurs', null), 'email_message_auteur') ? ' ' : ''))) !== '' ? ' ' . $t2 . 'erreur' : '') . '\'> <label for="email_message_auteur' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'id', null), true)) . '">' . _T('public|spip|ecrire:entree_adresse_email') . ' ' . _T('public|spip|ecrire:info_obligatoire_02') . '</label> ' . (($t2 = strval(interdire_scripts(table_valeur(table_valeur(@$Pile[0], (string) 'erreurs', null), 'email_message_auteur')))) !== '' ? '<span class="erreur_message">' . $t2 . '</span>' : '') . ' <input' . (($t2 = strval('' ? 'required="required" type="email" class="text email"' : 'type="text" class="text"')) !== '' ? ' ' . $t2 : '') . ' name="email_message_auteur" id="email_message_auteur' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'id', null), true)) . '" value="' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'email_message_auteur', null), true)) . '" size="30" /> </li> <li class=\'editer saisie_sujet_message_auteur obligatoire' . (($t2 = strval(interdire_scripts(table_valeur(table_valeur(@$Pile[0], (string) 'erreurs', null), 'sujet_message_auteur') ? ' ' : ''))) !== '' ? ' ' . $t2 . 'erreur' : '') . '\'> <label for="sujet_message_auteur' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'id', null), true)) . '">' . _T('public|spip|ecrire:form_prop_sujet') . ' ' . _T('public|spip|ecrire:info_obligatoire_02') . '</label> ' . (($t2 = strval(interdire_scripts(table_valeur(table_valeur(@$Pile[0], (string) 'erreurs', null), 'sujet_message_auteur')))) !== '' ? '<span class="erreur_message">' . $t2 . '</span>' : '') . ' <input type="text" class="text" name="sujet_message_auteur" id="sujet_message_auteur' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'id', null), true)) . '" value="' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'sujet_message_auteur', null), true)) . '" size="30"' . ' /> </li> <li class=\'editer saisie_texte_message_auteur obligatoire' . (($t2 = strval(interdire_scripts(table_valeur(table_valeur(@$Pile[0], (string) 'erreurs', null), 'texte_message_auteur') ? ' ' : ''))) !== '' ? ' ' . $t2 . 'erreur' : '') . '\'> <label for="texte_message_auteur' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'id', null), true)) . '">' . _T('public|spip|ecrire:info_texte_message') . ' ' . _T('public|spip|ecrire:info_obligatoire_02') . '</label> ' . (($t2 = strval(interdire_scripts(table_valeur(table_valeur(@$Pile[0], (string) 'erreurs', null), 'texte_message_auteur')))) !== '' ? '<span class="erreur_message">' . $t2 . '</span>' : '') . ' <textarea name="texte_message_auteur" id="texte_message_auteur' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'id', null), true)) . '" rows="10" cols="60">' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'texte_message_auteur', null), true)) . '</textarea> </li> </ul> </fieldset> <p style="display: none;"> <label for="nobot">' . _T('public|spip|ecrire:antispam_champ_vide') . '</label> <input type="text" class="text" name="nobot" id="nobot" value="' . interdire_scripts(entites_html(table_valeur(@$Pile[0], (string) 'nobot', null), true)) . '" size="10" /> </p> <p class="boutons"><input type="submit" class="submit" name="valide" value="' . _T('public|spip|ecrire:form_prop_envoyer') . '" /></p> </form> ') : '') . ' </div> '; return analyse_resultat_skel('html_9d96364ed1d79895affe5b2e3d246085', $Cache, $page, 'squelettes-dist/formulaires/ecrire_auteur.html'); }
function get_settings_form($message = null) { $function = $this->type . '_settings'; $form = $function($message); $form .= form_hidden('op', 'save'); $form .= form_submit("Save configuration"); return form($form); }
/** * Display Field * * @access public * @param string saved data input * @param array input params from tag * @param array attribute params from tag * @return string display output */ public function display_field($data = '', $params = array(), $attr = array()) { $output = form_hidden($this->field_name, $this->parse_specials(trim($data) !== '' ? $data : (isset($this->settings['default_data']) ? $this->settings['default_data'] : ''))); if (!empty($attr)) { $output = preg_replace("/[\\/]?>\$/ms", $this->stringify_attributes($attr) . ' />', $output); } return $output; }
/** * Create the form elements to map matrix fields * * @param string $field_name * @param string $field_label * @param string $field_type * @param string $data * @return void * @author Andrew Weaver */ function display_configuration($field_name, $field_label, $field_type, $data) { $config = array(); $config["label"] = form_label($field_label) . BR . anchor("http://brandnewbox.co.uk/support/details/datagrab_and_matrix_fields", "Matrix notes", 'class="help"'); // Get list of matrix columns and map column id to label $this->EE->db->select("col_id, col_label,col_type"); $query = $this->EE->db->get("exp_matrix_cols"); $matrix_columns = array(); $matrix_column_types = array(); foreach ($query->result_array() as $row) { $matrix_columns[$row["col_id"]] = $row["col_label"]; $matrix_column_types[$row["col_id"]] = $row["col_type"]; } $cells = form_hidden($field_name, "1"); // Loop over all columns foreach ($data["field_settings"][$field_name]["col_ids"] as $col_id) { // Get current settings if this is a saved import if (isset($data["default_settings"]["cf"][$field_name . "_columns"])) { $default_cells = $data["default_settings"]["cf"][$field_name . "_columns"]; } else { $default_cells = array(); } // Build configuration interface $cells .= "<p>" . $matrix_columns[$col_id] . NBS . ":" . NBS; $cells .= form_dropdown($field_name . "_columns[" . $col_id . "]", $data["data_fields"], isset($default_cells[$col_id]) ? $default_cells[$col_id] : ''); if ($matrix_column_types[$col_id] == "file") { $cells .= NBS . NBS . "Upload folder: " . NBS; // Get upload folders if (!isset($folders)) { $this->EE->db->select("id, name"); $this->EE->db->from("exp_upload_prefs"); $this->EE->db->order_by("id"); $query = $this->EE->db->get(); $folders = array(); foreach ($query->result_array() as $row) { $folders[$row["id"]] = $row["name"]; } } $cells .= form_dropdown($field_name . "_extra1[" . $col_id . "]", $folders, isset($data["default_settings"]["cf"][$field_name . "_extra1"][$col_id]) ? $data["default_settings"]["cf"][$field_name . "_extra1"][$col_id] : ''); $cells .= NBS . NBS . "Fetch?: " . NBS; $cells .= form_dropdown($field_name . "_extra2[" . $col_id . "]", array("No", "Yes"), isset($data["default_settings"]["cf"][$field_name . "_extra2"][$col_id]) ? $data["default_settings"]["cf"][$field_name . "_extra2"][$col_id] : ''); } $cells .= "</p>"; } // Pulldown menu to determin what to do for updates $column_options = array(); $column_options["-1"] = "Delete all existing rows"; $column_options["0"] = "Keep existing rows and append new"; $sub_options = array(); foreach ($data["field_settings"][$field_name]["col_ids"] as $col_id) { $sub_options[$col_id] = $matrix_columns[$col_id]; } $column_options["Update the row if this column matches:"] = $sub_options; $cells .= "<p>" . "Action to take when an entry is updated: " . form_dropdown($field_name . "_unique", $column_options, isset($data["default_settings"]["cf"][$field_name . "_unique"]) ? $data["default_settings"]["cf"][$field_name . "_unique"] : '') . "</p>"; // return config interface $config["value"] = $cells; return $config; }
public function products_list() { ci()->load->model('admin/categories_model'); ci()->page_title(lang('products_list'), lang('products_list')); $options = array('order_by' => 'product_order', 'direction' => 'ASC', 'limit' => 10, 'offset' => '0', 'iTotalRecords' => '0', 'iTotalDisplayRecords' => '0'); $col_map = array('product_order', 'product_id', 'product_title', 'cat_id', 'regular_price'); $categories = ci()->categories_model->get_sorted_cats_select(); /* Ordering */ // if (1==1 or ($order_by = ci()->input->get('iSortCol_0')) !== FALSE) if (($order_by = ci()->input->get('iSortCol_0')) !== FALSE) { if (isset($col_map[$order_by])) { $options['order_by'] = $col_map[$order_by]; $options['dir'] = ci()->input->get('sSortDir_0'); if ($col_map[$order_by] == 'cat_id') { $options['join']['table'] = 'categories c'; $options['join']['cond'] = ' products.cat_id=c.cat_id'; $options['join']['type'] = 'left'; $options['order_by'] = 'cat_name'; } } $options['limit'] = ci()->input->get_post('perpage') ? (int) ci()->input->get_post('perpage') : 10; $options['offset'] = (int) ci()->input->get_post('iDisplayStart'); $vars['sEcho'] = (int) ci()->input->get_post('sEcho'); $get = ci()->input->get_post('keyword'); if ($gr = ci()->input->get_post('cat_id')) { $options['where']['products.cat_id'] = $gr; } if (!ci()->input->get_post('exact_match')) { $options['custom'] = "(product_title like '%{$get}%' or product_description like '%{$get}%' or product_ingredients like '%{$get}%')"; } else { $options['custom'] = "(product_title = '{$get}' or product_description = '{$get}' or product_ingredients = '{$get}')"; } $ajax = TRUE; } $vars['default_sort'] = array(0, 'asc'); $vars['non_sortable_columns'] = array(5, 6, 7); $vars['perpage_select_options'] = array('10' => '10 ' . lang('results'), '25' => '25 ' . lang('results'), '50' => '50 ' . lang('results'), '75' => '75 ' . lang('results'), '100' => '100 ' . lang('results'), '150' => '150 ' . lang('results')); $vars['aaData'] = array(); $products = ci()->_model->get($options); $options['count'] = TRUE; $vars['iTotalRecords'] = $vars['iTotalDisplayRecords'] = ci()->_model->get($options); $vars['perpage'] = $options['limit']; $c = 0; foreach ($products as $v) { $vars['aaData'][] = array('<span class="ui-icon ui-icon-arrowthick-2-n-s" trid="s_' . $v['product_id'] . '_' . $v['product_order'] . '"></span>' . form_hidden("product_order[{$v['product_id']}]", $v['product_order']), $v['product_id'], "<a href='{$this->_view_base}edit_product?product_id={$v['product_id']}'> {$v['product_title']} </a>", @$categories[$v['cat_id']], $v['regular_price'], '<a href="' . $this->_view_base . 'edit_product?product_id=' . $v['product_id'] . '">' . lang('edit') . '</a>', '<a href="' . $this->_view_base . 'remove_product?product_id=' . $v['product_id'] . '" class="delete">' . lang('delete') . '</a>', form_checkbox('bulk[]', $v['product_id'], '', 'class="bulk"')); } $vars['categories'] = ci()->categories_model->get_sorted_cats_select(); if (!@$ajax) { $js = $this->_datatables_js($this->_view_base . 'products_list', $vars['non_sortable_columns'], $vars['default_sort'], $options['limit']); $vars['js'] = $js; $vars['data'] = $products; } else { ci()->output->send_ajax_response($vars); } ci()->javascript->output(ci()->load->view($this->_view_base . 'javascript/products.js', '', true)); ci()->javascript->compile(); ci()->load->view($this->_view_base . 'products', $vars); }
/** * 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; }
/** * Create the form elements to map matrix fields * * @param string $field_name * @param string $field_label * @param string $field_type * @param string $data * @return void * @author Andrew Weaver */ function display_configuration($field_name, $field_label, $field_type, $data) { $config = array(); $config["label"] = form_label($field_label) . BR . anchor("http://brandnewbox.co.uk/support/details/datagrab_and_matrix_fields", "(βeta notes)", 'class="help"'); $this->EE->db->select("col_id, col_label"); $query = $this->EE->db->get("exp_matrix_cols"); $matrix_columns = array(); foreach ($query->result_array() as $row) { $matrix_columns[$row["col_id"]] = $row["col_label"]; } $cells = form_hidden($field_name, "1"); foreach ($data["field_settings"][$field_name]["col_ids"] as $col_id) { if (isset($data["default_settings"]["cf"][$field_name . "_columns"])) { $default_cells = $data["default_settings"]["cf"][$field_name . "_columns"]; } else { $default_cells = array(); } $cells .= "<p>" . $matrix_columns[$col_id] . NBS . ":" . NBS . form_dropdown($field_name . "_columns[" . $col_id . "]", $data["data_fields"], isset($default_cells[$col_id]) ? $default_cells[$col_id] : '') . "</p>"; } $column_options = array(); $column_options["-1"] = "Delete all existing rows"; $column_options["0"] = "Keep existing rows and append new"; $sub_options = array(); foreach ($data["field_settings"][$field_name]["col_ids"] as $col_id) { $sub_options[$col_id] = $matrix_columns[$col_id]; } $column_options["Update the row if this column matches:"] = $sub_options; $cells .= "<p>" . "Action to take when an entry is updated: " . form_dropdown($field_name . "_unique", $column_options, isset($data["default_settings"]["cf"][$field_name . "_unique"]) ? $data["default_settings"]["cf"][$field_name . "_unique"] : '') . "</p>"; $config["value"] = $cells; return $config; }