/** * Retorna os cursos formatados em lista * @param array $cursos * @param array $ordenada * @return string */ public function formata_cursos_lista($cursos = array(), $ordenada = array()) { $this->ci->load->helper('html'); if ($ordenada) { return ol($cursos); } return ul($cursos); }
/** * Return an ordened list * * @author Rafael Nexus * @param array $lista * @param string $extra * @return string */ function ol($lista, $extra = '') { if (empty($list) || is_null($list)) { return; } if (!is_array($list)) { $list = array($list); } $return = "<ol {$extra}>"; foreach ($list as $item) { $return .= is_array($item) ? '<li>' . ol($item) . '</li>' : "<li>{$item}</li>"; } return "{$return}</ul>"; }
function centinelas() { $this->load->helper('directory'); $this->load->library('table'); $tmpl = array('row_start' => '<tr valign="top">'); $this->table->set_template($tmpl); $map = directory_map('./system/logs/'); $lista = array(); foreach ($map as $file) { if ($file != 'index.html') { $lista[] = "<a href='javascript:void(0)' onclick=\"carga('{$file}')\" >{$file}</a> <a href='javascript:void(0)' onclick=\"carga1('{$file}')\" ><h1>Eliminar</h1></a>"; } } $copy = "<br><a href='javascript:void(0)' class='mininegro' onclick=\"\$.copy('copy this text')\" >Copiar texto</a>"; $this->table->add_row(ol($lista), '<b id="fnom">Seleccione un archivo de centinela</b><div id="log" class="marco1" style="width: 550px; min-height: 400px" ></div>'); $link = site_url('supervisor/prueba/vercentinela'); $link1 = site_url('supervisor/prueba/eliminar'); $data['script'] = "<script>\n\t\t function carga(arch){\n\t\t link='{$link}'+'/'+arch;\n\t\t //alert(link);\n\t\t \$.clipboard(arch);\n\t\t \$('#fnom').text(arch);\n\t\t \$('#log').load(link);\n\t\t };\n\t\t function carga1(arch){\n\t\t link='{$link1}'+'/'+arch;\n\t\t //alert(link1);\n\t\t \$.clipboard(arch);\n\t\t \$('#fnom').text(arch);\n\t\t \$('#log').load(link1);\n\t\t };\n\t\t</script>"; $data['content'] = $this->table->generate(); $data['title'] = "<h1>Centinelas</h1>"; $data["head"] = script("jquery.pack.js") . script('plugins/jquery.clipboard.pack.js') . $this->rapyd->get_head() . style('marcos.css') . style('estilos.css'); $this->load->view('view_ventanas', $data); }
<?php echo ol($stages);
<li class="header">THE NAVIGATION</li> <li><?php echo anchor('/', '<i class="fa fa-home"></i> <span>Home</span>'); ?> </li> <?php echo $this->sso->menu; ?> </ul> </section> </aside> <div class="content-wrapper"> <section class="content-header"> <?php echo heading($content_header, 1); echo ol($breadcrumb, 'class="breadcrumb"'); ?> </section> <section class="content"> <?php echo $body; ?> </section> </div> <footer class="main-footer"> <div class="row"> <div class="col-sm-6"> <!-- <strong>Copyright © <?php echo date('Y'); ?> </strong> All rights reserved.-->
<?php if (count($deploy_log)): ?> <table border="0" cellspacing="0" cellpadding="0" style="margin:10px 0"> <tr> <?php foreach ($deploy_log as $log_item): ?> <td valign="top"> <?=heading($this->localize->set_human_time($log_item->deploy_timestamp,TRUE,TRUE),3)?> <?=ol(unserialize($log_item->deploy_data))?> </td> <?php endforeach ?> </tr> </table> <?php else: ?> <p><?=lang('dh:log_is_empty')?></p> <?php endif; ?> <p> <?='<a href="'.BASE.AMP.'C=addons_modules'.AMP.'M=show_module_cp'.AMP.'module=deployment_hooks'.AMP.'method=log">'.lang('dh:full_deployment_log').'</a>';?> <?='<a href="'.BASE.AMP.'C=addons_modules'.AMP.'M=show_module_cp'.AMP.'module=deployment_hooks">'.lang('dh:menu_home').'</a>';?> </p>
<li class="header">THE NAVIGATION</li> <li><?php echo anchor('/', '<i class="fa fa-home"></i> <span>Home</span>'); ?> </li> <?php //echo $this->sso->menu ?> </ul> </section> </aside> <div class="content-wrapper"> <section class="content-header"> <?php echo heading('Application Configuration', 1); echo ol(array(), 'class="breadcrumb"'); ?> </section> <section class="content"> <div class="row"> <div class="col-sm-12"> <div class="box box-info"> <?php echo form_open($action, 'class="form-horizontal"', $key); ?> <div class="box-header"> <?php echo heading('<i class="fa fa-pencil"></i> Form', 3, 'class="box-title"'); ?> </div> <div class="box-body">
echo heading('NCDI-Calculator', 2); ?> Met deze applicatie kun je de NCDI-percentielen en taalleeftijden laten berekenen. <ul> <li>De applicatie verwacht als input een <em>.csv</em>-bestand, gescheiden door ofwel komma's (,) of puntkomma's (;).</li> <li>Zo'n bestand kun je laten uitvoeren door een spreadsheetprogramma als Microsoft Excel of LibreOffice (kies <em>Opslaan als...</em>).</li> <li>De applicatie verwacht de volgende kolommen als invoer: <?php echo ol(array('proefpersoon', 'geboortedatum', 'datum invullen', 'geslacht (M/F)', 'totaalscore begrip', 'totaalscore productie', 'totaalscore woordvormen', 'totaalscore zinnen')); ?> </li> <li>De uitvoer van deze applicatie is een <em>.csv</em>-bestand, dat je weer kunt inlezen met een spreadsheetprogramma.</li> <li>De applicatie geeft de volgende kolommen als uitvoer: <?php echo ol(array('proefpersoon', 'leeftijd in maanden', 'leeftijd in maanden en dagen (m;d)', 'percentielscore begrip', 'taalleeftijd begrip', 'percentielscore productie', 'taalleeftijd productie', 'percentielscore woordvormen', 'taalleeftijd woordvormen', 'percentielscore zinnen', 'taalleeftijd zinnen')); ?> </li> </ul> <?php echo $this->session->flashdata('message'); ?> <?php echo form_open_multipart($action, array('class' => 'pure-form pure-form-aligned')); ?> <?php echo form_fieldset($page_title); ?> <div class="pure-control-group"> <?php
/** * Processes Any Embedded Templates in String * * If any {embed=} tags are found, it processes those templates and does a replacement. * * @param string * @return void */ public function process_sub_templates($template) { // Match all {embed=bla/bla} tags $matches = array(); if (!preg_match_all("/(" . LD . "embed\\s*=)(.*?)" . RD . "/s", $template, $matches)) { return; } // Loop until we have parsed all sub-templates // For each embedded tag we encounter we'll run the template parsing // function - AND - through the beauty of recursive functions we // will also call THIS function as well, allowing us to parse // infinitely nested sub-templates in one giant loop o' love $this->log_item(" - Processing Sub Templates (Depth: " . ($this->depth + 1) . ") - "); $i = 0; $this->depth++; $this->log_item("List of Embeds: " . str_replace(array('"', "'"), '', trim(implode(',', $matches[2])))); // re-match the full tag of each if necessary before we start processing // necessary evil in case template globals are used inside the embed tag, // doing this within the processing loop will result in leaving unparsed // embed tags e.g. {embed="foo/bar" var="{global_var}/{custom_field}"} $temp = $template; foreach ($matches[2] as $key => $val) { if (strpos($val, LD) !== FALSE) { $matches[0][$key] = ee()->functions->full_tag($matches[0][$key], $temp); $matches[2][$key] = substr(str_replace($matches[1][$key], '', $matches[0][$key]), 0, -1); $temp = str_replace($matches[0][$key], '', $temp); } } foreach ($matches[2] as $key => $val) { $parts = preg_split("/\\s+/", $val, 2); $this->embed_vars = isset($parts[1]) ? ee()->functions->assign_parameters($parts[1]) : array(); if ($this->embed_vars === FALSE) { $this->embed_vars = array(); } $val = trim_slashes(strip_quotes($parts[0])); if (strpos($val, '/') === FALSE) { continue; } $ex = explode("/", trim($val)); if (count($ex) != 2) { continue; } // Determine Site $site_id = ee()->config->item('site_id'); if (stristr($ex[0], ':')) { $name = substr($ex[0], 0, strpos($ex[0], ':')); if (ee()->config->item('multiple_sites_enabled') == 'y' && !IS_CORE) { if (count($this->sites) == 0) { // This should really be cached somewhere ee()->db->select('site_id, site_name'); $sites_query = ee()->db->get('sites'); foreach ($sites_query->result_array() as $row) { $this->sites[$row['site_id']] = $row['site_name']; } } $site_id = array_search($name, $this->sites); if (empty($site_id)) { $site_id = ee()->config->item('site_id'); } } $ex[0] = str_replace($name . ':', '', $ex[0]); } // Loop Prevention /* ------------------------------------------- /* Hidden Configuration Variable /* - template_loop_prevention => 'n' Whether or not loop prevention is enabled - y/n /* -------------------------------------------*/ $this->attempted_fetch[] = $ex['0'] . '/' . $ex['1']; // Tell user if a template has been recursively loaded if (substr_count($this->templates_sofar, '|' . $site_id . ':' . $ex['0'] . '/' . $ex['1'] . '|') > 1 && ee()->config->item('template_loop_prevention') != 'n') { // Set 503 status code, mainly so caching proxies do not cache this ee()->output->set_status_header(503, 'Service Temporarily Unavailable'); // Tell user which template was loaded recursively and in what order // so they can easily fix the error if (ee()->config->item('debug') >= 1) { ee()->load->helper(array('html_helper', 'language_helper')); $message = '<p>' . sprintf(lang('template_loop'), $ex['0'] . '/' . $ex['1']) . '</p>' . '<p>' . lang('template_load_order') . ':</p>' . ol($this->attempted_fetch); ee()->output->show_message(array('heading' => 'Error', 'content' => $message), FALSE); } else { exit; } } // Process Subtemplate $this->log_item("Processing Sub Template: " . $ex[0] . "/" . $ex[1]); $this->fetch_and_parse($ex[0], $ex[1], TRUE, $site_id); $this->final_template = str_replace($matches[0][$key], $this->template, $this->final_template); $this->embed_type = ''; // Here we go again! Wheeeeeee..... $this->process_sub_templates($this->template); // pull the subtemplate tracker back a level to the parent template $this->templates_sofar = substr($this->templates_sofar, 0, -strlen('|' . $site_id . ':' . $ex[0] . '/' . $ex[1] . '|')); } $this->depth--; if ($this->depth == 0) { $this->templates_sofar = ''; } }
/** * Processes Any Embedded Templates in String * * If any {embed=} tags are found, it processes those templates and does a replacement. * * @param string $parent_template Template string to search for embeds in * @return string Parent template with all embeds expanded */ public function process_sub_templates($parent_template) { // Match all {embed=bla/bla} tags $matches = array(); if (!preg_match_all("/(" . LD . "embed\\s*=)(.*?)" . RD . "/s", $parent_template, $matches)) { return $parent_template; } // Loop until we have parsed all sub-templates // For each embedded tag we encounter we'll run the template parsing // function - AND - through the beauty of recursive functions we // will also call THIS function as well, allowing us to parse // infinitely nested sub-templates in one giant loop o' love $this->log_item(" - Processing Sub Templates (Depth: " . ($this->depth + 1) . ") - "); $i = 0; $this->depth++; $this->log_item("List of Embeds: " . str_replace(array('"', "'"), '', trim(implode(',', $matches[2])))); // re-match the full tag of each if necessary before we start processing // necessary evil in case template globals are used inside the embed tag, // doing this within the processing loop will result in leaving unparsed // embed tags e.g. {embed="foo/bar" var="{global_var}/{custom_field}"} $temp = $parent_template; foreach ($matches[2] as $key => $val) { if (strpos($val, LD) !== FALSE) { $matches[0][$key] = ee()->functions->full_tag($matches[0][$key], $temp); $matches[2][$key] = substr(str_replace($matches[1][$key], '', $matches[0][$key]), 0, -1); $temp = str_replace($matches[0][$key], '', $temp); } } foreach ($matches[2] as $key => $val) { $parts = preg_split("/\\s+/", $val, 2); $this->embed_vars = isset($parts[1]) ? ee()->functions->assign_parameters($parts[1]) : array(); if ($this->embed_vars === FALSE) { $this->embed_vars = array(); } // Extract the information we need to fetch the subtemplate $fetch_data = $this->_get_fetch_data($parts[0]); if (!isset($fetch_data)) { continue; } list($template_group, $template_name, $site_id) = $fetch_data; // Loop Prevention /* ------------------------------------------- /* Hidden Configuration Variable /* - template_loop_prevention => 'n' Whether or not loop prevention is enabled - y/n /* -------------------------------------------*/ $this->attempted_fetch[] = $template_group . '/' . $template_name; // Tell user if a template has been recursively loaded if (substr_count($this->templates_sofar, '|' . $site_id . ':' . $template_group . '/' . $template_name . '|') > 1 && ee()->config->item('template_loop_prevention') != 'n') { // Set 503 status code, mainly so caching proxies do not cache this ee()->output->set_status_header(503, 'Service Temporarily Unavailable'); // Tell user which template was loaded recursively and in what order // so they can easily fix the error if (ee()->config->item('debug') >= 1) { ee()->load->helper(array('html_helper', 'language_helper')); $message = '<p>' . sprintf(lang('template_loop'), $template_group . '/' . $template_name) . '</p>' . '<p>' . lang('template_load_order') . ':</p>' . ol($this->attempted_fetch); ee()->output->show_message(array('heading' => 'Error', 'content' => $message), FALSE); } // Show nothing if debug is off exit; } // Backup current layout vars, they don't apply to this embed $layout_vars_bak = $this->layout_vars; $layout_conditionals = $this->layout_conditionals; $this->layout_vars = array(); $this->layout_conditionals = array(); // Process Subtemplate $this->log_item("Processing Sub Template: " . $template_group . "/" . $template_name); $this->fetch_and_parse($template_group, $template_name, TRUE, $site_id); $layout = $this->_find_layout(); $full_subtemplate = $this->process_layout_template($this->template, $layout); $this->embed_type = ''; // Nesnestedted embeds. Here we go again! Wheeeeeee..... $full_subtemplate = $this->process_sub_templates($full_subtemplate); // Insert it back into the parent template $parent_template = str_replace($matches[0][$key], $full_subtemplate, $parent_template); // pull the subtemplate tracker back a level to the parent template $this->templates_sofar = substr($this->templates_sofar, 0, -strlen('|' . $site_id . ':' . $template_group . '/' . $template_name . '|')); // Restore layout vars. Technically we don't need these but a third // party may want them to behave correctly. $this->layout_vars = $layout_vars_bak; $this->layout_conditionals = $layout_conditionals; } $this->depth--; if ($this->depth == 0) { $this->templates_sofar = ''; } return $parent_template; }
$this->table->set_template($cp_table_template); $this->table->set_heading( array( 'data' => lang('dh:time'), 'style' => 'width:150px' ), array( 'data' => lang('ip_address'), 'style' => 'width:100px' ), lang('dh:log') ); foreach ($deployment_posts as $post) { $this->table->add_row( $this->localize->set_human_time($post->deploy_timestamp,TRUE,TRUE), $post->deploy_ip, ol(unserialize($post->deploy_data)) ); } echo $this->table->generate(); echo $pagination; } ?>
public function detalle() { $id_receta = $this->ajax_post('id_receta'); $cantidades = ''; $sqlData = array('buscar' => false, 'offset' => false, 'limit' => false, 'aplicar_limit' => false, 'unique' => $id_receta); $id_compras_articulo = array(); $insumos_sin_costo = array(); $recetario = $this->db_model->get_data_unique($sqlData); $costo_porcion = 0; foreach ($recetario as $key => $value) { $id_nutricion_receta = $value['id_nutricion_receta']; $receta = $value['receta']; $id_sucursal = $value['id_sucursal']; $clave_corta = $value['clave_corta']; $id_nutricion_familia = $value['id_nutricion_familia']; $familia = $value['familia']; $porciones = $value['porciones']; $preparacion = $value['preparacion']; $id_usuario = $value['id_usuario']; $timestamp = $value['timestamp']; $edit_id_usuario = $value['edit_id_usuario']; $edit_timestamp = $value['edit_timestamp']; if ($value['id_compras_articulo']) { $id_compras_articulo[] = $value['id_compras_articulo']; if (!$value['costo_x_um']) { $insumos_sin_costo[] = $value['articulo']; } else { $costo_porcion = $costo_porcion + $value['porciones_articulo'] * $value['costo_x_um']; } $input = form_input($this->att_addon('articulo_' . $value['id_compras_articulo'], $value['porciones_articulo'])); $cantidades .= "<p id='articulo_" . $value['id_compras_articulo'] . "'>\r\n\t\t\t\t\t\t\t\t\t<label>" . $value['articulo'] . "</label>\r\n\t\t\t\t\t " . add_on_tpl($input, $value['um']) . "\r\n\t\t\t\t\t </p>"; } } if (!empty($insumos_sin_costo)) { $lista_insumos_sin_costo = ol($insumos_sin_costo, array('class' => 'list-ordered')); $msg_insumos_sin_costo = $this->lang_item("msg_insumos_sin_costo", false) . br(1) . $lista_insumos_sin_costo; $msg_insumos_sin_costo = alertas_tpl('', $msg_insumos_sin_costo, false, '20%'); } else { $msg_insumos_sin_costo = ''; } $costo_porcion = $costo_porcion > 0 ? $costo_porcion / $porciones : 0; $sqlData = array('buscar' => 0, 'offset' => 0, 'limit' => 0); $dropdown_sucursales = array('data' => $this->sucursales->db_get_data($sqlData), 'value' => 'id_sucursal', 'text' => array('cv_sucursal', 'sucursal'), 'name' => "lts_sucursales_update", 'class' => "requerido", 'selected' => $id_sucursal); $sucursales = dropdown_tpl($dropdown_sucursales); $seccion = $this->modulo . '/' . $this->seccion . '/' . $this->seccion . '_editar'; $familias = array('data' => $this->familias->db_get_data(array()), 'value' => 'id_nutricion_familia', 'text' => array('clave_corta', 'familia'), 'name' => "lts_familias_insert", 'class' => "requerido", 'selected' => $id_nutricion_familia); $list_familias = dropdown_tpl($familias); $insumos = array('data' => $insumos = $this->db_model->get_insumos(), 'value' => 'id_compras_articulo', 'text' => array('clave_corta', 'articulo'), 'name' => "lts_insumos_update", 'class' => "requerido ", 'selected' => $id_compras_articulo); $list_insumos = multi_dropdown_tpl($insumos); $btn_save = form_button(array('class' => 'btn btn-primary', 'name' => 'update_receta', 'onclick' => 'actualizar()', 'content' => $this->lang_item("btn_guardar"))); /*$buttonTPL = array( 'text' => $this->lang_item("btn_xlsx"), 'iconsweets' => 'iconsweets-excel', 'href' => base_url($this->path.'export_rexlsx?filtro='.base64_encode($id_receta)) );*/ $tab_3['filtro'] = isset($id_receta) && $id_receta != "" ? sprintf($this->lang_item("msg_query_search", false), array(), $id_receta) : ""; //$tab_3['export'] = button_tpl($buttonTPL); $tab_3['id_receta'] = $id_nutricion_receta; $tab_3['lbl_receta'] = $this->lang_item('lbl_receta'); $tab_3['lbl_clave_corta'] = $this->lang_item('lbl_clave_corta'); $tab_3['lbl_porciones'] = $this->lang_item('lbl_porciones'); $tab_3['lbl_preparacion'] = $this->lang_item('lbl_preparacion'); $tab_3['lbl_familia'] = $this->lang_item('lbl_familia'); $tab_3['lbl_asignar_insumos'] = $this->lang_item('lbl_asignar_insumos'); $tab_3['lbl_editar_porciones'] = $this->lang_item('lbl_editar_porciones'); $tab_3['select_insumos'] = $this->lang_item('select_insumos'); $tab_3['lbl_presentacion_insumo'] = $this->lang_item('lbl_presentacion_insumo'); $tab_3['lbl_costo_x_porcion'] = $this->lang_item('lbl_costo_x_porcion'); $tab_3['value_receta'] = $receta; $tab_3['value_clave_corta'] = $clave_corta; $tab_3['value_costo_x_porcion'] = $costo_porcion; $tab_3['msg_insumos_sin_costo'] = $msg_insumos_sin_costo; $tab_3['value_porciones'] = $porciones; $tab_3['value_preparacion'] = $preparacion; $tab_3['multiselect_insumos'] = $list_insumos; $tab_3['cantidades_insumos'] = $cantidades; $tab_3['select_familias'] = $list_familias; $tab_3['button_save'] = $btn_save; $tab_3['lbl_sucursal'] = $this->lang_item('lbl_sucursal'); $tab_3['dropdown_sucursal'] = $sucursales; $this->load_database('global_system'); $this->load->model('users_model'); $usuario_registro = $this->users_model->search_user_for_id($id_usuario); $usuario_name = text_format_tpl($usuario_registro[0]['name'], "u"); $tab_3['value_usuarios_registro'] = $usuario_name; if ($edit_id_usuario) { $usuario_registro = $this->users_model->search_user_for_id($edit_id_usuario); $usuario_name = text_format_tpl($usuario_registro[0]['name'], "u"); $tab_3['value_ultima_modificacion'] = sprintf($this->lang_item('val_ultima_modificacion', false), $this->timestamp_complete($edit_timestamp), $usuario_name); } else { $usuario_name = ''; $tab_3['value_ultima_modificacion'] = $this->lang_item('lbl_sin_modificacion', false); } $tab_3['value_timestamp'] = $timestamp; $tab_3['lbl_ultima_modificacion'] = $this->lang_item('lbl_ultima_modificacion', false); $tab_3['lbl_fecha_registro'] = $this->lang_item('lbl_fecha_registro', false); $tab_3['lbl_usuario_registro'] = $this->lang_item('lbl_usuario_registro', false); if ($this->ajax_post(false)) { echo json_encode($this->load_view_unique($seccion, $tab_3, true)); } else { return $this->load_view_unique($seccion, $tab_3, true); } }