Esempio n. 1
0
 private function cache_docs($root = 1, $mode = 'file')
 {
     $this->config->load('translations_a', false);
     $langs = $this->config->item('lang');
     $articles = $this->config->item('articles');
     $result = $this->db->query("SELECT\r\n\t\tsheets.redirect,\r\n\t\tsheets.parent,\r\n\t\tsheets.id,\r\n\t\tsheets.header,\r\n\t\tsheets1.header as topheader\r\n\t\tFROM\r\n\t\tsheets sheets1\r\n\t\tRIGHT OUTER JOIN sheets ON (sheets1.id = sheets.parent)\r\n\t\twhere sheets.active\r\n\t\tORDER BY\r\n\t\tsheets.parent DESC,\r\n\t\tsheets.pageorder", array($root));
     if ($result->num_rows()) {
         $this->load->helper('html');
         foreach ($langs as $lang => $langname) {
             $input = array();
             foreach ($result->result() as $row) {
                 $link = strlen($row->redirect) ? $row->redirect : '/page/docs/' . $row->id;
                 $groupname = isset($articles[$row->parent]) && strlen($articles[$row->parent][$lang]) ? $articles[$row->parent][$lang] : $row->topheader;
                 $itemname = isset($articles[$row->id]) && strlen($articles[$row->id][$lang]) ? $articles[$row->id][$lang] : $row->header;
                 $grouplink = '<a href="#"><i class="icon-tags"></i>&nbsp;&nbsp;' . $groupname . "</a>";
                 $itemlink = '<a href="' . $link . '"><i class="icon-tag"></i>&nbsp;&nbsp;' . $itemname . "</a>";
                 if (!isset($input[$grouplink])) {
                     $input[$grouplink] = array();
                 }
                 array_push($input[$grouplink], $itemlink);
             }
             foreach ($input as $key => $val) {
                 $list = $input[$key];
                 break;
             }
             //if($mode === 'file') {
             write_file('application/views/cache/menus/docs_' . $lang . '.php', ul($list, array('class' => 'dropdown-menu')));
             //} else {
             //	print '<link href="http://api.korzhevdp.com/css/frontend.css" rel="stylesheet" media="screen" type="text/css">'.ul($list, array('class' => 'dropdown-menu'))."<hr>";
             //}
         }
     }
 }
Esempio n. 2
0
 /**
  * database function.
  * 
  * @access public
  * @return void
  */
 public function database()
 {
     $this->output->enable_profiler(true);
     $this->load->database();
     $this->load->dbutil();
     $this->load->dbforge();
     $data['title'] = $this->system_model->get('app_name');
     $data['breadcrumbs'] = array(array('data' => anchor('/', $this->system_model->get('app_name')), 'mode' => 'unavailable'), array('data' => anchor('install', ucfirst(lang('install'))), 'mode' => 'unavailable'), array('data' => anchor('install/database', ucfirst(lang('install') . ' ' . lang('database'))), 'mode' => 'current'));
     $html = heading(ucfirst(lang('install')) . ' ' . lang('database'), 1);
     $current = $this->migration->current();
     if (is_null($current)) {
         $html .= div($this->migration->error_string(), 'alert-box error');
     } else {
         $html .= div('Klubb database version: ' . $current, 'alert-box success');
     }
     $tables = $this->db->list_tables();
     foreach ($tables as $table) {
         $fields = $this->db->list_fields($table);
         array_unshift($fields, strong('Fält:'));
         $fields = ul($fields, array('class' => 'inline-list'));
         $html .= div(heading('Tabell: ' . $table, 4) . $fields, 'radius panel');
     }
     $data['html'] = $html;
     $this->system_model->view('template', $data);
 }
Esempio n. 3
0
 public function get_skillset_requirements_formatted()
 {
     $this->_CI->load->helper('html');
     $lis = explode("\n", $this->skills_needed);
     $lis = array_map('trim', $lis);
     return ul($lis, array('class' => 'ul'));
 }
Esempio n. 4
0
 function menu()
 {
     $pertenece = $this->session->userdata['panel'];
     //echo '--->'.$pertenece;
     if ($pertenece === FALSE) {
         $pertenece = 0;
     }
     $attr = array('name' => '_mp');
     $areglo = arr_menu();
     $amenu = '';
     $menu = array();
     foreach ($areglo as $data) {
         $link = site_url("/bienvenido/index/{$data['modulo']}");
         if ($data['modulo'] == $pertenece) {
             $attr['class'] = 'current';
         } else {
             $attr['class'] = '';
         }
         $attr['title'] = $data['mensaje'];
         $menu[] = anchor("/bienvenido/index/{$data['modulo']}", $data['titulo'], $attr);
         $amenu .= "<div id='sc{$data['modulo']}' class='tabcontent'>{$data['mensaje']}</div>\n";
     }
     if ($this->session->userdata('logged_in')) {
         $link = site_url("/bienvenido/cese");
         $menu[] = "<a href='{$link}' title='Cerrar Sessi&oacute;n'>Salir</a>";
         $amenu .= "<div id='salir_s' class='tabcontent'  >Cerrar Session</div>\n";
     }
     $data['menu'] = ul($menu);
     $data['amenu'] = '';
     //$amenu;
     return $this->layout->load->view($this->common . 'menu', $data, true);
 }
Esempio n. 5
0
 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[] = anchor("supervisor/mantenimiento/borracentinela/{$file}", 'X') . " <a href='javascript:void(0)' onclick=\"carga('{$file}')\" >{$file}</a>";
         }
     }
     $copy = "<br><a href='javascript:void(0)' class='mininegro'  onclick=\"copiar()\" >Copiar texto</a>";
     $tadata = array('name' => 'sql', 'id' => 'log', 'rows' => '20', 'cols' => '60');
     $form = form_open('ejecutasql/filteredgrid/process') . form_textarea($tadata) . '<br>' . form_submit('mysubmit', 'Ejecutar como SQL') . form_close();
     $this->table->add_row(ul($lista), '<b id="fnom">Seleccione un archivo de centinela</b><br>' . $form);
     $link = site_url('supervisor/mantenimiento/vercentinela');
     $data['script'] = "<script>\n\t\t  function carga(arch){\n\t\t    link='{$link}'+'/'+arch;\n\t\t    //alert(link);\n\t\t    \$('#fnom').text(arch);\n\t\t    \$('#log').load(link);\n\t\t  };\n\t\t  function copiar(){\n\t\t    \$('#log').copy();\n\t\t  };\n\t\t</script>";
     $data['content'] = $this->table->generate();
     $data['title'] = " Centinelas ";
     //script('plugins/jquery.clipboard.pack.js')
     $data["head"] = script("jquery.pack.js") . script('plugins/jquery.copy.min.js') . $this->rapyd->get_head() . style('marcos.css') . style('estilos.css');
     $this->load->view('view_ventanas', $data);
 }
Esempio n. 6
0
 function update_images() {
     // Take in ajax of {id:description}
     // and update for those images accordingly
     if(!$this->input->is_ajax_request()) {
         echo "Do not access this page directly";
         return;
     }
     $out = array();
     if($data = json_decode($this->input->post('images'),true)){
         $imgs = array(); 
         foreach($data as $k=>$v) {
             if($v['delete'])
                 $out[] = $this->delete($k);
             else
                 $imgs[] = array("iid"=>$k,
                                 "description"=>$v['description'],
                                 "title"=>$v['title']
                             );
         }
      //  var_dump($imgs);
         $this->db->update_batch('images',$imgs,"iid");
         $out[] = "Updated ".$this->db->affected_rows(). " images";
         
     } else {
         echo "An error occurred, nothing was updated";
     }
     echo ul($out);
 }
Esempio n. 7
0
 /** Convert value to HTML parseable format
  * @param mixed $value
  * @return string
  */
 public static function to_html(\System\Template\Renderer $ren, $value)
 {
     if (is_object($value) && method_exists($value, 'to_html')) {
         return $value->to_html($ren);
     }
     if (is_array($value)) {
         $content = array();
         foreach ($value as $val) {
             $content[] = li(self::to_html($ren, $val));
         }
         return ul('plain inline', $content);
     }
     if ($value instanceof \DateTime) {
         return $ren->format_date($value, 'human');
     }
     if (gettype($value) == 'boolean') {
         return span($value = $value ? 'yes' : 'no', $ren->trans($value));
     }
     if (gettype($value) == 'float') {
         return number_format($value, 5);
     }
     if (gettype($value) == 'string') {
         return htmlspecialchars_decode($value);
     }
     return $value;
 }
Esempio n. 8
0
function get_category_ul($attr = array())
{
    $category_array = array();
    foreach (get_instance()->mongo_db->category->find()->sort(array('order' => 1)) as $category) {
        $category_array[] = anchor('category/' . $category['slug'], $category['title']);
    }
    return ul($category_array, $attr);
}
 /**
  * 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);
 }
    public function set_sections()
    {
        $this->EE->load->model('template_model');
        $this->EE->load->helper(array('html', 'url'));
        $this->EE->lang->loadfile('design');
        $this->EE->lang->loadfile('template_menu');
        $query = $this->EE->template_model->get_templates(NULL, array('templates.group_id'));
        $sections = array();
        $groups = array();
        foreach ($query->result() as $row) {
            $groups[$row->group_name] = $row->group_id;
            $sections[$row->group_name][] = anchor(BASE . AMP . 'C=design' . AMP . 'M=edit_template' . AMP . 'id=' . $row->template_id, $row->template_name, array('data-href' => site_url($row->group_name . '/' . $row->template_name)));
        }
        $search_form = form_open('C=design' . AMP . 'M=manager');
        $search_form .= form_input(array('type' => 'search', 'name' => 'template_keywords', 'value' => '', 'maxlength' => '80', 'class' => 'input', 'autosave' => 'ee_template_search', 'results' => '10', 'placeholder' => 'Search Template', 'style' => 'width:140px'));
        $search_form .= form_close();
        $this->sections[''] = ul(array($search_form, anchor(BASE . AMP . 'C=design' . AMP . 'M=new_template_group', '+ ' . $this->EE->lang->line('nav_create_group')), anchor(BASE . AMP . 'C=design' . AMP . 'M=manager', $this->EE->lang->line('manager')), anchor(BASE . AMP . 'C=design' . AMP . 'M=global_variables', $this->EE->lang->line('global_vars')), anchor(BASE . AMP . 'C=design' . AMP . 'M=snippets', $this->EE->lang->line('nav_snippets')), anchor(BASE . AMP . 'C=design' . AMP . 'M=sync_templates', $this->EE->lang->line('nav_sync_templates')), anchor(BASE . AMP . 'C=design' . AMP . 'M=global_template_preferences', $this->EE->lang->line('global_prefs')), anchor(BASE . AMP . 'C=design' . AMP . 'M=template_preferences_manager', $this->EE->lang->line('prefs_manager')), anchor('javascript:void(0);', $this->EE->lang->line('view_rendered'), array('id' => 'template_menu_mode')))) . '<div class="clear"></div>';
        foreach ($sections as $key => $value) {
            array_push($value, anchor(BASE . AMP . 'C=design' . AMP . 'M=new_template' . AMP . 'group_id=' . $groups[$key], '<span class="notice">+</span>', array('class' => 'add')));
            $this->sections[anchor(BASE . AMP . 'C=design' . AMP . 'M=edit_template_group' . AMP . 'group_id=' . $groups[$key], $key) . NBS . anchor(BASE . AMP . 'C=design' . AMP . 'M=template_group_delete_confirm' . AMP . 'group_id=' . $groups[$key], '<span class="notice">-</span>')] = ul($value);
        }
        $this->EE->cp->add_to_head('<style type="text/css">#template_menu_acc{padding:10px !important;}#template_menu_acc .accessorySection{padding:0 5px;}#template_menu_acc .accessorySectionFirst{float:none;border:none;border:0;margin-bottom:10px;line-height:20px;}#template_menu_acc .accessorySectionFirst li{float:left;margin-right:14px;}#template_menu_acc .accessorySectionFirst h5{display:none;}#template_menu_acc li a{display:block;padding:0 0 3px;}#template_menu_acc li{padding:0 !important;}#template_menu_acc h5{font-size:12px !important;margin-bottom:4px !important;}#template_menu_acc .accessorySection h5 a{color:white !important;}</style>');
        $this->EE->javascript->output('$("#template_menu_acc .accessorySection:first").addClass("accessorySectionFirst");');
        $this->EE->javascript->output('
		$("#template_menu_mode").click(function(){
			if ( ! $(this).hasClass("mode")) {
				$(this).addClass("mode");
				$(this).html("' . $this->EE->lang->line('edit_templates') . '");
				$("#template_menu_acc .accessorySection:not(.accessorySectionFirst) li a:not(.add)").each(function(){
					var href = $(this).attr("data-href");
					$(this).attr("data-href", $(this).attr("href")).attr("href", href);
				});
			} else {
				$(this).removeClass("mode");
				$(this).html("' . $this->EE->lang->line('view_rendered') . '");
				$("#template_menu_acc .accessorySection:not(.accessorySectionFirst) li a:not(.add)").each(function(){
					var href = $(this).attr("data-href");
					$(this).attr("data-href", $(this).attr("href")).attr("href", href);
				});
			}
		});');
        if ($this->always_open) {
            $this->EE->javascript->output('
				$(".template_menu_acc").parent().siblings().removeClass("current");
				$("#accessoriesDiv .accessory").hide();
				$(".template_menu_acc").parent().addClass("current");
				$("#template_menu_acc").show().attr("templateMenuHeight", 0);
				$("#template_menu_acc .accessorySection:not(.accessorySectionFirst)").each(function(){
					if ($(this).outerHeight() > Number($("#template_menu_acc").attr("templateMenuHeight"))) {
						$("#template_menu_acc").attr("templateMenuHeight", $(this).outerHeight());
					}
				});
				$("#template_menu_acc .accessorySection:not(.accessorySectionFirst)").height(Number($("#template_menu_acc").attr("templateMenuHeight")));
			');
        }
    }
Esempio n. 11
0
 /**
  * index function.
  * 
  * @access public
  * @return void
  */
 public function index()
 {
     $this->output->enable_profiler(false);
     $this->benchmark->mark('auth_start');
     if (!$this->auth->loggedin()) {
         redirect('user/login');
     }
     $uid = intval($this->auth->userid());
     $this->benchmark->mark('auth_end');
     $user = $this->user_model->get_user($uid);
     $greeting = '';
     if (isset($user['firstname'])) {
         $greeting = ' ' . $user['firstname'];
         $data['firstname'] = $user['firstname'];
     } else {
         $greeting = ' ' . $user['username'];
         $data['firstname'] = $user['firstname'];
     }
     $data['title'] = $this->system_model->get('app_name');
     $data['stylesheets'] = array('buttons_purple');
     $data['partial'] = 'home';
     $data['org_name'] = $this->system_model->get('org_name');
     $data['app_name'] = $this->system_model->get('app_name');
     $data['members'] = $this->member_model->count_members();
     $data['users'] = $this->user_model->count_users();
     $memberdata = heading(ucfirst(lang('members')), 5);
     $ofeachtype = array();
     $this->benchmark->mark('members_process_start');
     foreach ($this->member_model->get_types() as $type) {
         $count = $this->member_model->count_members_type($type['id']);
         array_push($ofeachtype, $count . ' ' . strtolower($type['plural']));
     }
     $data['membertypes'] = $ofeachtype;
     $memberdata .= p(ucfirst($data['org_name']) . ' har totalt ' . anchor('members', $data['members'] . ' ' . lang('members')) . ' varav:');
     $memberdata .= ul($data['membertypes'], array('class' => 'disc'));
     $memberdata .= button_group(array(button_anchor('members', ucfirst(lang('administer')) . ' ' . lang('members'), 'radius'), button_anchor('member/register', ucfirst(lang('register_member')), 'radius')), 'radius');
     $this->benchmark->mark('members_process_end');
     $userdata = heading(ucfirst(lang('users')), 5);
     $this->benchmark->mark('users_process_start');
     $userdata .= p(ucfirst($data['app_name']) . ' har totalt ' . anchor('admin/users', $data['users'] . ' ' . lang('users')) . '.');
     $active = $this->user_model->get_active();
     $ausers = array();
     foreach ($active as $aid) {
         $auser = $this->user_model->get_user($aid);
         array_push($ausers, $auser['firstname'] . ' ' . $auser['lastname']);
     }
     $data['loggedon'] = $ausers;
     $userdata .= heading(ucfirst(lang('currently_logged_on')) . ':', 6) . ul($ausers, array('class' => 'disc'));
     $userdata .= button_group(array(button_anchor('admin/users', ucfirst(lang('administer')) . ' ' . lang('users'), 'radius'), button_anchor('user/create', ucfirst(lang('create_user')), 'radius')), 'radius');
     $this->benchmark->mark('users_process_end');
     $content = heading(ucfirst(lang('welcome')) . $greeting . '!', 1);
     $content .= row(columns($memberdata, 6) . columns($userdata, 6));
     $html = $content;
     $data['html'] = $html;
     $this->system_model->view('template', $data);
 }
 function button_group($data = array(), $class = '')
 {
     $class = $class != '' ? $class . ' ' : $class;
     if (!function_exists('ul')) {
         // The HTML Helper ul function is required, make the user load the helper.
         return "This Helper requires the html helper to be loaded!";
     }
     $bg = ul($data, array('class' => $class . 'button-group'));
     return $bg;
 }
Esempio n. 13
0
 function menu()
 {
     $thtml = '<b>Seleccione m&eacute;todo para generar los habladores</b>';
     $html[] = anchor('inventario/etiqueta_sinv/num_compra', 'Por n&uacute;mero compra') . ': generar habladores con todos los productos pertenecientes a una compra';
     $html[] = anchor('inventario/etiqueta_sinv/lee_barras', 'Por c&oacute;digo de barras') . ': permite generar habladores por productos seleccionados';
     $html[] = anchor('inventario/etiqueta_sinv/filteredgrid', 'Por filtro de productos') . ': permite generar los habladores filtrandolos por cacter&iacute;sticas comunes';
     $data['title'] = '<h1>Men&uacute; de Habladores</h1>';
     $data['content'] = $thtml . ul($html) . '<p style="font-size:0.5em;text-align:center">Formato: <b>' . $this->formato . '</b></p>';
     $this->load->view('view_ventanas', $data);
 }
Esempio n. 14
0
 function index()
 {
     $this->datasis->modulo_id('923', 1);
     $list[] = anchor('sincro/notifica/sms', 'Mensajes SMS');
     $list[] = anchor('sincro/notifica/email', 'E-Mail');
     $attributes = array('class' => 'boldlist', 'id' => 'mylist');
     $out = ul($list, $attributes);
     $data['content'] = $out;
     $data['title'] = '<h1>Env&iacute;os de mensajes</h1>';
     $data['head'] = '';
     $this->load->view('view_ventanas', $data);
 }
Esempio n. 15
0
 function index()
 {
     $list = array();
     $list[] = anchor('doc/modulos', 'Modulos documentados');
     $list[] = anchor('doc/tablas', 'Tablas documentadas');
     $attributes = array('class' => 'boldlist', 'id' => 'mylist');
     $out = ul($list, $attributes);
     $data['content'] = $out;
     $data["head"] = script("jquery.pack.js") . script("jquery.treeview.pack.js") . $this->rapyd->get_head() . style('jquery.treeview.css');
     $data['title'] = '<h1>Documentaci&oacute;n</h1>';
     $this->load->view('view_ventanas', $data);
 }
Esempio n. 16
0
 static function draw($r)
 {
     foreach ($r as $k => $v) {
         if ($v['txt']) {
             $ret .= li($k . ') ' . stripslashes_b($v['txt']));
         }
         if ($v['r']) {
             $ret .= ul(self::draw($v['r']));
         }
     }
     return ul($ret);
 }
Esempio n. 17
0
 function index()
 {
     $list = array();
     $list[] = anchor('supervisor/prueba/bprefac', 'Borrar PreFacturas menores o iguales al d&iacute;a de ayer');
     $list[] = anchor('supervisor/prueba/bmodbus', 'Vaciar la tabla ModBus');
     $list[] = anchor('supervisor/prueba/centinelas', 'Centinelas');
     $attributes = array('class' => 'boldlist', 'id' => 'mylist');
     $out = ul($list, $attributes);
     $data['content'] = $out;
     $data["head"] = script("jquery.pack.js") . script("jquery.treeview.pack.js") . $this->rapyd->get_head() . style('jquery.treeview.css');
     $data['title'] = '<h1>prueba</h1>';
     $this->load->view('view_ventanas', $data);
 }
Esempio n. 18
0
function trick_names_ul($tricks)
{
    if (count($tricks) > 0) {
        $content = '';
        foreach ($tricks as $trick) {
            $content .= li(trick_link($trick['name']));
        }
        $content = ul($content);
    } else {
        $content = 'you have no tricks';
    }
    return $content;
}
Esempio n. 19
0
/**
 * Return an unordened list
 *
 * @author Rafael Nexus
 * @param array $list
 * @param string $extra
 * @return string
 */
function ul($list, $extra = '')
{
    if (empty($list) || is_null($list)) {
        return;
    }
    if (!is_array($list)) {
        $list = array($list);
    }
    $return = "<ul {$extra}>";
    foreach ($list as $item) {
        $return .= is_array($item) ? '<li>' . ul($item) . '</li>' : "<li>{$item}</li>";
    }
    return "{$return}</ul>";
}
Esempio n. 20
0
function tag_ids_checkbox_ul($tags, $tag_defaults = array())
{
    if (count($tags) > 0) {
        $content = '';
        foreach ($tags as $tag) {
            $default = count($tag_defaults) > 0 ? in_array($tag['tag_id'], $tag_defaults) : false;
            $content .= li(checkbox_array('tag_ids', $tag['tag_id'], $default) . ' --- ' . tag_link($tag['name']));
        }
        $content = ul($content);
        return $content;
    } else {
        return false;
    }
}
Esempio n. 21
0
 public function index()
 {
     $resultSet = $this->em->getRepository($this->ModelName)->findBy(array(), array('Id' => 'DESC'));
     $trips = array();
     foreach ($resultSet as $trip) {
         $deleteUrl = $this->getActionAnchor('trips/delete/' . $trip->getId(), '<span class="red-text icon-Delete-File"></span> Delete', $this->lang->line('tooltip_delete_trip'), 'left');
         $editUrl = $this->getActionAnchor('trips/detail/' . $trip->getId(), '<span class="blue-text icon-Pen-2"></span> Edit', $this->lang->line('tooltip_edit_trip'), 'right');
         $actionLink = anchor('#', '<i class="material-icons">more_vert</i>', array('data-constrainwidth' => 'false', 'class' => 'dropdown-button tp-icon', 'data-activates' => 'item-actions'));
         $actionUl = ul(array($deleteUrl, $editUrl), array('id' => 'item-actions', 'class' => 'dropdown-content'));
         $trips[] = array($actionLink . $actionUl, $trip->getDateStart()->format('m/d/Y'), $trip->getDateEnd()->format('m/d/Y'), stripslashes($trip->getName()) . '<p class="help-block">' . stripslashes($trip->getDescription()) . '</p>', '');
     }
     $this->data['trips'] = $trips;
     $this->setTitle(ucwords($this->lang->line('Title_TripList')));
     $this->renderView();
 }
Esempio n. 22
0
 /**
  * rights_get function.
  * 
  * @access public
  * @return void
  */
 public function rights_get()
 {
     if (!$this->auth->loggedin()) {
         redirect('user/login');
     }
     $uid = intval($this->auth->userid());
     $role_id = $this->get('role');
     if (!$role_id) {
         show_error('Invalid request.', 500);
     } else {
         $role_rights = $this->rights_model->get_for_role($role_id);
         $rights_html = ul(array(form_label(form_checkbox(array('name' => 'use_system', 'id' => 'use_system', 'value' => $role_id, 'checked' => $role_rights['use_system'] ? true : false)) . nbs() . ucfirst(lang('use_system')), 'use_system'), form_label(form_checkbox(array('name' => 'add_members', 'id' => 'add_members', 'value' => $role_id, 'checked' => $role_rights['add_members'] ? true : false)) . nbs() . ucfirst(lang('add_members')), 'add_members'), form_label(form_checkbox(array('name' => 'add_users', 'id' => 'add_users', 'value' => $role_id, 'checked' => $role_rights['add_users'] ? true : false)) . nbs() . ucfirst(lang('add_users')), 'add_users')), array('class' => 'no-bullet'));
         $this->output->set_output($rights_html);
     }
 }
Esempio n. 23
0
 function crear()
 {
     $this->rapyd->load("datagrid", "dataform");
     $link = anchor('', '+');
     $add = 'Descripci&oacute;n' . form_input('descrip', '') . ' Cantidad' . form_input('cant', '');
     $img1 = image('list_plus.png', 'agregar', array('id' => 'aactlist'));
     $img2 = image('list_plus.png', 'agregar', array('id' => 'apaslist'));
     $img3 = image('list_plus.png', 'agregar', array('id' => 'acaplist'));
     $list = array($img1 . '<b>ACTIVOS</b><ul id="actlist"></ul>', $img2 . '<b>PASIVOS</b><ul id="paslist"></ul>', $img3 . '<b>CAPITAL</b><ul id="caplist"></ul>');
     $attributes = array('id' => 'lbalances');
     $data['script'] = "<script type='text/javascript'>\n\t\tfunction agregar(){\n\t\t\t\$('#actlist').append('<strong>Hello</strong>');\n\t\t}\n\n\t\t\$(document).ready(function(){\n\t\t\t\$('#aactlist').click(function () { \$('#actlist').append('<li>Descripci&oacute;n<input type=\"text\" name=\"descrip\" value=\"\"  /> Cantidad<input type=\"text\" name=\"cant\" value=\"\"  /></li>'); });\n\t\t\t\$('#apaslist').click(function () { \$('#paslist').append('<li>Descripci&oacute;n<input type=\"text\" name=\"descrip\" value=\"\"  /> Cantidad<input type=\"text\" name=\"cant\" value=\"\"  /></li>'); });\n\t\t\t\$('#acaplist').click(function () { \$('#caplist').append('<li>Descripci&oacute;n<input type=\"text\" name=\"descrip\" value=\"\"  /> Cantidad<input type=\"text\" name=\"cant\" value=\"\"  /></li>'); });\n\t\t});\n\t\t</script>";
     $data['extras'] = "";
     $data['content'] = form_open('email/send') . ul($list, $attributes) . form_close();
     $data["head"] = script("jquery.pack.js") . $this->rapyd->get_head();
     $data['title'] = 'Estados Finacieros';
     $this->load->view('view_ventanas', $data);
 }
function messages()
{
    $CI =& get_instance();
    $CI->load->library('messages');
    $messages = $CI->messages->get_all();
    $output = array();
    if (count($messages['info']) > 0) {
        $output[] = alert(ul(array_values($messages['info']), array('class' => 'unstyled')), 'alert alert-info');
    }
    if (count($messages['error']) > 0) {
        $output[] = alert(ul(array_values($messages['error']), array('class' => 'unstyled')), 'alert alert-error');
    }
    if (count($messages['success']) > 0) {
        $output[] = alert(ul(array_values($messages['success']), array('class' => 'unstyled')), 'alert alert-success');
    }
    return join("\n", $output);
}
Esempio n. 25
0
 function sub_category_list($category_id = 0)
 {
     $ci =& get_instance();
     $ci->load->helper('html');
     $ci->load->module('core');
     if ($category_id > 0) {
         $categories = get_sub_categories($category_id);
         if (count($categories) > 0) {
             foreach ($categories as $row) {
                 $row['fetch_pages'] = unserialize($row['fetch_pages']);
                 $total_pages = $ci->core->_get_category_pages($row, 0, 0, TRUE);
                 $result[] = '<a href="' . site_url($row['path_url']) . '">' . $row['name'] . ' (' . $total_pages . ')</a>';
             }
             return ul($result);
         } else {
             return FALSE;
         }
     } else {
         return FALSE;
     }
 }
Esempio n. 26
0
 /** 
  * Sends out reminders for callers. 
  */
 public function callers()
 {
     if (!$this->input->is_cli_request()) {
         echo "This script can only be accessed via the command line" . PHP_EOL;
         return;
     }
     $users = $this->userModel->get_all_callers();
     foreach ($users as $user) {
         reset_language(user_language($user));
         $this->email->clear();
         $this->email->from(FROM_EMAIL, FROM_EMAIL_NAME);
         $this->email->to(in_development() ? TO_EMAIL_OVERRIDE : $user->email);
         $this->email->subject(lang('rem_subject'));
         $call_messages = array();
         $experiments = $this->callerModel->get_experiments_by_caller($user->id);
         foreach ($experiments as $experiment) {
             if ($experiment->archived != 1) {
                 $count = count($this->participantModel->find_participants($experiment));
                 if ($count > 0) {
                     array_push($call_messages, sprintf(lang('rem_exp_call'), $experiment->name, $count));
                 }
             }
         }
         if ($call_messages) {
             $message = sprintf(lang('mail_heading'), $user->username);
             $message .= br(2);
             $message .= lang('rem_body');
             $message .= br(1);
             $message .= ul($call_messages);
             $message .= lang('mail_ending');
             $message .= br(2);
             $message .= lang('mail_disclaimer');
             $this->email->message($message);
             $this->email->send();
             // DEBUG: echo $this->email->print_debugger();
         }
     }
 }
Esempio n. 27
0
 function calendar($y = FALSE, $m = FALSE)
 {
     if (!$this->connected) {
         $this->layout = "layouts/public";
     }
     $this->load->library('calendar');
     $e = new Event();
     $y = $y ? $y : date('Y');
     $m = $m ? $m : date('m');
     $events = $e->select('DAY(start) AS day,events.id,title,description,cost')->where('MONTH(start)', $m)->where('YEAR(start)', $y)->include_related('category', array('color'))->get_iterated();
     $this->load->helper('text');
     $ul = array();
     foreach ($events as $e) {
         $ul[$e->day][] = '<span class="label" style="background:' . $e->category_color . ';">' . anchor('events/show/' . $e->id, ellipsize($e->title, 20, 1, '..'), 'id="' . $e->id . '" class="tip" data-toggle="modal" data-original-title="' . $e->title . '"') . '</span>';
     }
     $data = array();
     foreach ($ul as $day => $event) {
         $data[$day] = ul($event, array('class' => 'unstyled sortable'));
     }
     $this->data['calendar'] = $this->calendar->generate($y, $m, $data);
     $c = new Category();
     $this->data['categories'] = $c->get_iterated();
 }
Esempio n. 28
0
    public function test_Ul()
    {
        $expect = <<<EOH
<ul>
  <li>foo</li>
  <li>bar</li>
</ul>

EOH;
        $expect = ltrim($expect);
        $list = array('foo', 'bar');
        $this->assertEquals(ltrim($expect), ul($list));
        $expect = <<<EOH
<ul class="test">
  <li>foo</li>
  <li>bar</li>
</ul>

EOH;
        $expect = ltrim($expect);
        $this->assertEquals($expect, ul($list, 'class="test"'));
        $this->assertEquals($expect, ul($list, array('class' => 'test')));
    }
Esempio n. 29
0
 /** Score page */
 public function sc($test_code, $token = NULL)
 {
     $test = $this->get_test_or_die($test_code);
     $data['page_title'] = $test->name . ' - ' . lang('scores');
     $data = $this->set_test_data($data, $test);
     $data = $this->set_token_data($data, $token);
     if ($data['valid_token'] && substr($test->code, 0, 4) === 'ncdi') {
         // Calculate the scores
         $testinvite = $data['testinvite'];
         $scores = create_ncdi_score_array($test, $testinvite);
         $data['ncdi_table'] = create_ncdi_table($scores);
         // Find any existing previous scores for this participant
         $participant = $this->participantModel->get_participant_by_id($data['participant_id']);
         $prev_testinvites = $this->testInviteModel->get_previous_testinvites($participant, $testinvite);
         $data['has_prev_results'] = FALSE;
         // Add some comments on the results
         $comments = $this->add_comments_to_score($scores, $participant);
         $data['ncdi_text'] = ul($comments);
         // Loop over the scores and add them to the page (without comments)
         $prev_tables = array();
         $prev_descs = array();
         foreach ($prev_testinvites as $prev_testinvite) {
             $scores = create_ncdi_score_array($test, $prev_testinvite);
             $date = output_date($prev_testinvite->datecompleted);
             $gender = gender_child($participant->gender);
             $age = age_in_months($participant, $prev_testinvite->datecompleted);
             $data['has_prev_results'] = TRUE;
             array_push($prev_tables, create_ncdi_table($scores));
             array_push($prev_descs, sprintf('Resultaten van %s. Uw %s was toen <strong>%s maanden</strong> oud.', $date, $gender, $age));
         }
         $data['ncdi_prev_tables'] = $prev_tables;
         $data['ncdi_prev_descs'] = $prev_descs;
     }
     $this->load->view($this->view_code($test, 'header'), $data);
     $this->load->view($this->view_code($test, 'scores'), $data);
     $this->load->view('templates/footer');
 }
Esempio n. 30
-3
 /**
  * index function.
  * 
  * @access public
  * @return void
  */
 public function index()
 {
     $this->output->enable_profiler(false);
     if (!$this->auth->loggedin()) {
         redirect('user/login');
     }
     $data['title'] = $this->system_model->get('app_name');
     $html = row(columns(heading(ucfirst(lang('about')) . ' ' . $this->system_model->get('app_name'), 1), 12));
     $uptime_array = explode(" ", exec("cat /proc/uptime"));
     $seconds = round($uptime_array[0], 0);
     $minutes = $seconds / 60;
     $hours = $minutes / 60;
     $days = floor($hours / 24);
     $hours = sprintf('%02d', floor($hours - $days * 24));
     $minutes = sprintf('%02d', floor($minutes - $days * 24 * 60 - $hours * 60));
     if ($days == 0) {
         $uptime = $hours . ":" . $minutes;
     } elseif ($days == 1) {
         $uptime = $days . " " . lang('day') . ", " . $hours . ":" . $minutes;
     } else {
         $uptime = $days . " " . lang('days') . ", " . $hours . ":" . $minutes;
     }
     $infolist = ul(array(heading('Applikation', 5) . ul(array(strong('Klubb-' . lang('version') . ': ') . KLUBB_VERSION, strong('CodeIgniter-' . lang('version') . ': ') . CI_VERSION, strong(ucfirst(lang('database')) . ': ') . $this->db->platform() . ', ' . lang('version') . ': ' . $this->db->version(), strong(ucfirst(lang('environment') . ': ')) . lang(ENVIRONMENT))), heading('Server', 5) . ul(array(strong('Namn: ') . php_uname('n'), strong('System: ') . php_uname('s') . ' ' . php_uname('r') . ' ' . php_uname('v') . ' ' . php_uname('m'), strong('Upptid: ') . $uptime, strong('PHP-version: ') . phpversion(), strong('PHP-moduler: ') . implode(', ', get_loaded_extensions())))), array('class' => 'no-bullet'));
     $html .= row(columns($infolist));
     $data['breadcrumbs'] = array(array('data' => anchor('/', $this->system_model->get('app_name')), 'mode' => 'unavailable'), array('data' => anchor('about', ucfirst(lang('about') . ' ' . $data['title'])), 'mode' => 'current'));
     $data['html'] = $html;
     $this->system_model->view('template', $data);
 }