示例#1
0
文件: cubes.php 项目: philum/cms
function plug_cubes($d)
{
    req('pop');
    $w = currentwidth();
    $r = $_SESSION['rqt'];
    $cols = 4;
    $c = $cols * 3;
    $n = count($r);
    $nl = ceil($n / $c);
    $l = $w / $c;
    $cats = array_keys_r($r, 1, 'k');
    $clr = cub_clr($cats);
    foreach ($r as $k => $v) {
        if ($v[11] > 1 && $v[3]) {
            $lx = $l * ($v[11] - 1);
            //$pub=minimg($v[3],"h").lka(htac($k),$v[2]);
            //$pub=make_thumb_d($v[3],round($lx).'/'.round($lx));//
            $pub = image('/imgc/' . $v[3], round($lx), round($lx));
            $pub = lka(htac($k) . '" title="' . $v[2], $pub);
            $ret .= divs(cub_sz($lx, $clr[$v[1]]), $pub);
        }
    }
    //for($ic=0;$ic<$c;$ic++){}
    //for($ib=0;$ib<$nl;$ib++){$i++;}
    return $ret;
}
示例#2
0
文件: channel.php 项目: philum/cms
function output_pages_from_cache($http, $otp)
{
    $npg = $_SESSION['prmb'][6];
    $page = $_SESSION['page'];
    $min = ($page - 1) * $npg;
    $max = $page * $npg;
    if (is_array($otp)) {
        foreach ($otp as $id => $nb) {
            if (is_numeric($id)) {
                $i++;
                if ($i >= $min && $i < $max) {
                    $mg = $http . '/imgc/' . first_img($nb[3]);
                    if (is_link($mg)) {
                        $ret .= btn('imgl', image($mg, '', 50));
                    }
                    $ret .= bal('h2', lka($http . '/' . $id, $nb[2]));
                    $ret .= btn('txtx', $nb[1]) . ' ';
                    if (rstr(27)) {
                        $ret .= btn('txtsmall', mkday($nb[0], 1)) . ' ' . pub_link($nb[9]) . ' ';
                    }
                    if (rstr(25)) {
                        $ret .= btn('txtsmall', art_length($nb[8]));
                    }
                    $ret .= br() . br();
                }
            }
        }
    }
    $n_pages = nb_page($i, $npg, $page);
    return $n_pages . $ret . $n_pages;
}
示例#3
0
function image($src, $width, $height, $format = 'png')
{
    $new_file_src = '/data/thumbs' . $src . $width . 'x' . $height . '.' . $format;
    $new_file = DIR . $new_file_src;
    if (is_file($new_file)) {
        return $new_file_src;
    }
    $file = DIR . $src;
    if (is_file($file)) {
        $new_file_path_parts = pathinfo($new_file);
        if (!is_dir($new_file_path_parts['dirname'])) {
            mkdir($new_file_path_parts['dirname'], 0777, true);
        }
        system('convert ' . $file . ' -resize ' . $width . 'x' . $height . '\\> ' . $new_file);
        //Первый кадр анимированного гифа
        if (!is_file($new_file)) {
            $check_anim = substr($new_file, 0, -(strlen($format) + 1)) . '-0.' . $format;
            if (is_file($check_anim)) {
                rename($check_anim, $new_file);
            } else {
                return image('/data/jnb.jpg', $width, $height);
            }
        }
        return $new_file_src;
    } else {
        return image('/data/jnb.jpg', $width, $height);
    }
}
示例#4
0
 function index()
 {
     $this->datasis->modulo_id($this->modulo, 1);
     $this->rapyd->load("datagrid", "dataform", "fields");
     $control = $this->uri->segment(4);
     $checkbox = '<input type="checkbox" name="genera[]" value="<#modulo#>" CHECKED>';
     $grid = new DataGrid('Seleccione los m&oacute;dulos que desea generar');
     $grid->db->select('modulo, descripcion');
     $grid->db->from('`reglascont`');
     $grid->db->groupby('modulo');
     $grid->db->orderby('modulo,regla');
     $grid->column("M&oacute;dulo", "modulo");
     $grid->column("Descripci&oacute;n", "descripcion");
     $grid->column('Generar', $checkbox, 'align="center"');
     $grid->build();
     $form = new DataForm('contabilidad/generar/procesar');
     $form->title('Rango de fecha para la Generaci&oacute;n');
     $form->fechai = new dateonlyField("Fecha Desde", "fechai", "d/m/Y");
     $form->fechaf = new dateonlyField("Fecha Hasta", "fechaf", "d/m/Y");
     $form->fechaf->size = $form->fechai->size = 10;
     $form->fechai->insertValue = $this->input->post('fechai') ? $this->input->post('fechai') : date("Ymd");
     $form->fechaf->insertValue = $this->input->post('fechaf') ? $this->input->post('fechaf') : date("Ymd");
     $form->tabla = new containerField('tabla', $grid->output);
     if ($control) {
         $form->control = new containerField('control', 'Contabilidad Generada');
     }
     //$form->submit("btn_submit","Generar Depurado");
     $form->build_form();
     $data['script'] = "<script type='text/javascript'>\n\t\tvar handlerFunc = function(t) {\n\t\t\tdocument.getElementById('preloader').style.display='none';\n\t\t\tnew Effect.Opacity('contenido', {duration:0.5, from:0.3, to:1.0});\n\t\t\talert(t.responseText);\n\t\t}\n\n\t\tvar errFunc = function(t) {\n\t\t\tdocument.getElementById('preloader').style.display='none';\n\t\t\tnew Effect.Opacity('contenido', {duration:0.5, from:0.3, to:1.0});\n\t\t\talert('Error ' + t.status + ' -- ' + t.statusText);\n\t\t}\n\n\t\tfunction generar() {\n\t\t\tnew Effect.toggle('preloader', 'appear');\n\t\t\tnew Effect.Opacity('contenido', {duration:0.5, from:1.0, to:0.3});\n\t\t\tnew Ajax.Request('" . site_url('contabilidad/generar/procesar') . "',{\n\t\t\t method: 'post',\n\t\t\t parameters : Form.serialize('df1'),\n\t\t\t onSuccess:handlerFunc,\n\t\t\t onFailure:errFunc});\n\t\t}\n\t\t</script>";
     $data['extras'] = "<div id='preloader' style='display: none;\tposition:absolute; left:40%; top:40%; font-family:Verdana, Arial, Helvetica, sans-serif;'>\n\t\t\t<center>" . image("loading4.gif") . "<br>" . image("loadingBarra.gif") . "<br>\n\t\t\t<b>Generando . . . </b>\n\t\t\t</center>\n\t\t</div>";
     $data['content'] = $form->output . "<input type=button value='Generar' onclick='generar()'>";
     $data["head"] = $this->rapyd->get_head() . script("prototype.js") . script("scriptaculous.js") . script("effects.js");
     $data['title'] = "<h1>Generar Contabilidad</h1>";
     $this->load->view('view_ventanas', $data);
 }
 /**
  * 显示文章列表
  */
 public function showlist()
 {
     global $G;
     $articlelist = array();
     $catid = intval($_GET['catid']);
     $where = "status=0";
     $where .= $catid ? " AND catid='{$catid}'" : '';
     $where .= $_GET['pic'] ? " AND pic<>''" : '';
     $pagesize = intval($_GET['pagesize']);
     $pagesize = $pagesize > 0 ? $pagesize : 20;
     $orderby = $_GET['orderby'];
     $orderby = in_array($orderby, array('id', 'time', 'viewnum', 'commentnum')) ? $orderby : 'id';
     $asc = $_GET['asc'] == 1 ? 'ASC' : 'DESC';
     $articlelist = $this->t('post_title')->where($where)->order($orderby, $asc)->page($G['page'], $pagesize)->select();
     if ($articlelist) {
         $newlist = array();
         foreach ($articlelist as $list) {
             $list['pic'] = image($list['pic']);
             $list['pubtime'] = @date('Y-m-d', $list['pubtime']);
             $newlist[] = $list;
         }
         $articlelist = $newlist;
     } else {
         $articlelist = array();
     }
     $this->showAppData($articlelist);
 }
示例#6
0
    function jqdatag()
    {
        $grid = $this->defgrid();
        $param['grids'][] = $grid->deploy();
        $bodyscript = $this->bodyscript($param['grids'][0]['gridname']);
        #Set url
        $grid->setUrlput(site_url($this->url . 'setdata/'));
        $WestPanel = '
		<div id="LeftPane" class="ui-layout-west ui-widget ui-widget-content">
			<div class="otros">
			<table id="west-grid">
			<tr><td>
				<td><div class="tema1 a1"><a style="width:190px" href="#" id="a1"><span class="ui-button-text">' . image('print.png', 'Formato PDF', array('title' => 'Formato PDF', 'border' => '0')) . ' &nbsp;&nbsp;Imprimir</span></a></div></td>
			</td></tr>
			</table>
			</div>
		</div> <!-- #LeftPane -->';
        $grid->wbotonadd(array('id' => 'a1', 'img' => 'assets/default/images/print.png', 'alt' => 'Formato PDF', 'label' => 'Imprimir'));
        $WestPanel = $grid->deploywestp();
        $adic = array(array('id' => 'fedita', 'title' => 'Agregar cambio forma de pago'), array('id' => 'fshow', 'title' => 'Mostrar registro'), array('id' => 'fborra', 'title' => 'Anula Factura'));
        $SouthPanel = $grid->SouthPanel($this->datasis->traevalor('TITULO1'), $adic);
        $param['WestPanel'] = $WestPanel;
        //$param['EastPanel']  = $EastPanel;
        $param['SouthPanel'] = $SouthPanel;
        $param['tema1'] = 'darkness';
        $param['bodyscript'] = $bodyscript;
        $param['tabs'] = false;
        $param['encabeza'] = $this->titp;
        $this->load->view('jqgrid/crud2', $param);
    }
示例#7
0
文件: umdico.php 项目: philum/cms
function udc_imz($f, $n = '2')
{
    list($w, $hb) = fwidth($f);
    $w = round($w / $n);
    $h = round($h / $n);
    return divs('width:' . $w . 'px;', image('/' . $f, $w, $h));
}
示例#8
0
 /**
  * 会员资料
  */
 public function indexAction()
 {
     $id = (int) $this->get('userid');
     $name = $this->get('username');
     if (empty($id) && empty($name)) {
         $this->msg(lang('m-spa-0'));
     }
     $data = $id ? $this->member->find($id) : $this->member->getOne('username=?', $name);
     if (empty($data)) {
         $this->msg(lang('m-spa-1', array('1' => $id ? '#' . $id : $name)));
     }
     $model = $this->membermodel[$data['modelid']];
     $data['nickname'] = $data['nickname'] ? $data['nickname'] : $data['username'];
     if ($model) {
         $table = $this->model($model['tablename']);
         $_data = $table->find($data['id']);
         $data = array_merge($data, $_data);
         //合并主表和附表
         $data = $this->getFieldData($model, $data);
     }
     $data['avatar'] = image($data['avatar']);
     if ($this->memberconfig['uc_use'] == 1 && function_exists('uc_api_mysql')) {
         $uc = uc_api_mysql('user', 'get_user', array('username' => $data['username']));
         if ($uc != 0) {
             $data['uid'] = $uc[0];
             $data['avatar'] = UC_API . '/avatar.php?uid=' . $data['uid'] . '&size=middle';
         }
     }
     unset($data['password']);
     $this->view->assign($data);
     $this->view->assign(array('meta_title' => lang('m-spa-2', array('1' => $data['nickname'])) . '-' . $this->site['SITE_NAME'], 'userid' => $data['id'], 'tablename' => $model['tablename'], 'modelname' => $model['modelname'], 'groupname' => $this->membergroup[$data['groupid']]['name'], 'page' => $this->get('page') ? $this->get('page') : 1));
     $this->view->display('member/space');
 }
 function textile($text, $lite = '')
 {
     if (get_magic_quotes_gpc() == 1) {
         $text = stripslashes($text);
     }
     $text = incomingEntities($text);
     $text = encodeEntities($text);
     $text = fixEntities($text);
     $text = cleanWhiteSpace($text);
     $text = getRefs($text);
     $text = noTextile($text);
     $text = image($text);
     $text = links($text);
     $text = span($text);
     $text = superscript($text);
     $text = footnoteRef($text);
     $text = code($text);
     $text = glyphs($text);
     $text = retrieve($text);
     if ($lite == '') {
         $text = lists($text);
         $text = table($text);
         $text = block($text);
     }
     /* clean up <notextile> */
     $text = preg_replace('/<\\/?notextile>/', "", $text);
     /* turn the temp char back to an ampersand entity */
     $text = str_replace("x%x%", "&amp;", $text);
     $text = str_replace("<br />", "<br />\n", $text);
     return trim($text);
 }
 public function uploadimage()
 {
     if ($_GET['from'] == 'swfupload') {
         $uid = intval($_GET['uid']);
         $username = trim($_GET['username']);
         $token = sha1($uid . $username . formhash());
         if (!$uid || !$username || $token != $_GET['token']) {
             $this->showAjaxError(-1, 'nologin');
         }
     } else {
         $uid = $GLOBALS['G']['uid'];
         if (!$uid) {
             $this->showAjaxError(-1, 'nologin');
         }
     }
     $upload = new UploadImage();
     if ($photo = $upload->saveImage()) {
         $photo['uid'] = $GLOBALS['G']['uid'];
         $photo['uptime'] = time();
         $photo['photoid'] = M('photo')->insert($photo, true);
         if ($_GET['from'] == 'umeditor') {
             $returns = array("state" => 'SUCCESS', "name" => $photo['name'], "url" => $photo['attachment'], "size" => $photo['filesize'], "type" => $photo['type']);
         } elseif ($_GET['from'] == 'redactor') {
             $img = image($photo['attachment']);
             exit('<img src="' . $img . '">');
         } else {
             $returns = $photo;
             $returns['url'] = C('ATTACHURL') . $photo['thumb'];
         }
         $this->showAjaxReturn($returns);
     }
 }
示例#11
0
function custom_menu_tree($menus = array())
{
    $html = '';
    // Build all application menus in a tree format
    foreach ($menus as $menu) {
        // Check if this menu has children
        $count_menu_children = count(get_value($menu, 'children'));
        // Build a single line menu
        $html .= '<li id="menu-item-' . get_value($menu, 'id_menu') . '" class="dd-item dd3-item" data-id="' . get_value($menu, 'id_menu') . '" order="' . get_value($menu, 'order_') . '">';
        $html .= '<div class="dd-handle dd3-handle"></div>';
        $html .= '<div class="dd3-content">';
        $class = get_value($menu, 'dtt_inative') != '' ? 'text-error' : '';
        $img = image(get_value($menu, 'url_img'));
        $label = get_value($menu, 'url_img') == '' && get_value($menu, 'label') == '' ? '[NO NAME]' : lang(get_value($menu, 'label'));
        $html .= '<a href="javascript:void(0)" class="menu-label ' . $class . '" data-toggle="modal" data-target="#modal-menu-' . get_value($menu, 'id_menu') . '">' . $img . ' ' . $label . '</a>';
        $html .= '<i class="text-success fa fa-fw fa-check-circle" style="display: none; margin-left: 5px"></i>';
        $html .= '<a href="javascript:void(0)" class="menu-delete pull-right hidden"><i class="fa fa-trash fa-fw"></i></a>';
        $html .= '</div>';
        // If current menu has children items, then build all again
        if ($count_menu_children > 0) {
            $html .= '<ol class="dd-list">' . custom_menu_tree(get_value($menu, 'children')) . '</ol>';
        }
        $html .= '</li>';
    }
    return $html;
}
function get_post_thumb_src($size = 'post-thumbnail', $default = false)
{
    global $post;
    if (function_exists('has_post_thumbnail') && has_post_thumbnail()) {
        $image_id = get_post_thumbnail_id($post->ID);
        $image_src = wp_get_attachment_image_src($image_id, $size);
        $image_src = apply_filters('wp_get_attachment_image_src', $image_src[0]);
        return $image_src;
    }
    $thumb_meta = get_post_meta($post->ID, '特色图片', true);
    if ($thumb_meta) {
        return $thumb_meta;
    }
    preg_match_all('/<img.+src=[\'\\"]([^\'\\"]+)[\'\\"].* \\/>/i', $post->post_content, $images);
    if (!empty($images)) {
        foreach ($images[1] as $image) {
            if (strpos($image, 'http') === 0) {
                $image_src = $image;
                break;
            } else {
                $image_src = false;
            }
        }
    }
    if (!$image_src) {
        $image_src = $default;
    }
    if (function_exists('image')) {
        return image($image_src);
    }
    return $image_src;
}
示例#13
0
 protected function parse_content($array)
 {
     if (is_array($array) and !empty($array)) {
         if (!empty($array['seo'])) {
             $url = _URL . "content/detail/{$array['seo']}";
         } else {
             $url = _URL . "content/detail/{$array['id']}/" . url_title($array['title'], "-", true);
         }
         $explode_title = explode(' ', $array['title']);
         $content = array();
         $content['id'] = $array['id'];
         $content['title'] = $array['title'];
         $content['subtitle'] = $array['subtitle'];
         $content['seo'] = $array['seo'];
         $content['created'] = mysql_date($array['created'], 'd/m/y', true);
         $content['user_id'] = $array['created_by'];
         $content['name'] = $array['name'];
         $content['image'] = $array['image'];
         $content['image_url'] = image("files/content/" . $array['image'], 'alt="' . $array['title'] . '"');
         $content['content'] = $array['content'];
         $content['meta_keyword'] = $array['meta_keyword'];
         $content['meta_description'] = $array['meta_description'];
         $content['hits'] = $array['hits'];
         $content['url'] = $url;
         return $content;
     }
 }
 public function edit()
 {
     $shopid = intval($_GET['shopid']);
     if ($this->checkFormSubmit()) {
         $shopnew = $_GET['shopnew'];
         if ($shopnew['shopname'] && $shopnew['province'] && $shopnew['city'] && $shopnew['address'] && $shopnew['description']) {
             if ($this->account['admincp']) {
                 $this->t('shop')->where(array('shopid' => $shopid))->update($shopnew);
             } else {
                 $this->t('shop')->where(array('uid' => $this->uid, 'shopid' => $shopid))->update($shopnew);
             }
             $links = array(array('text' => 'go_back', 'url' => '/?m=home&c=shop'), array('text' => 'reedit', 'url' => '/?m=home&c=shop&a=edit&shopid=' . $shopid));
             $this->showSuccess('modi_succeed', '', $links, '', true);
         } else {
             $this->showError('undefined_action');
         }
     } else {
         global $G, $lang;
         if ($this->account['admincp']) {
             $shop = $this->t('shop')->where(array('shopid' => $shopid))->selectOne();
         } else {
             $shop = $this->t('shop')->where(array('uid' => $this->uid, 'shopid' => $shopid))->selectOne();
         }
         $pic = image($shop['pic']);
         include template('shop_form');
     }
 }
示例#15
0
 public function run($options)
 {
     $attributes = array();
     if (is_numeric($options['width'])) {
         $attributes['width'] = $options['width'];
     }
     if (is_numeric($options['height'])) {
         $attributes['height'] = $options['height'];
     }
     $this->load->model('photos/photos_m');
     $p = new $this->photos_m();
     $photos = $p->limit($options['limit'])->order_by('updated_on', 'DESC')->get_all();
     $result['images'] = FALSE;
     if (sizeof($photos) > 0) {
         foreach ($photos as $key => $image) {
             $arr = explode('.', $image->filename);
             $thumb = $arr[0] . '_thumb.' . $arr[1];
             $img = image("photos/{$image->album_id}/{$thumb}", NULL, $attributes);
             $url = image_url("photos/{$image->album_id}/{$thumb}");
             $url = str_replace('_thumb', '', $url);
             $images[] = anchor($url, $img);
         }
         $result['images'] = $images;
     }
     return $result;
 }
示例#16
0
 function ver()
 {
     //$this->load->library('XLSReporte');
     $this->rapyd->load("datafilter2");
     $repo = $this->uri->segment(3);
     $esta = $this->uri->segment(4);
     $mSQL = "SELECT proteo FROM reportes WHERE nombre='{$repo}'";
     $mc = $this->datasis->dameval($mSQL);
     $nombre = strtolower($repo) . '.pdf';
     if (!empty($mc)) {
         $data["regresar"] = '<a href=' . site_url("/reportes/enlistar/{$esta}") . '>' . image('go-previous.png', 'Regresar', array('border' => 0)) . 'Regresar' . '</a>';
         $_formato = $this->input->post('salformat');
         if ($_formato or !empty($_formato)) {
             $_mclase = $_formato . 'Reporte';
         } else {
             $_mclase = 'PDFReporte';
         }
         $this->load->library($_mclase);
         $this->db->_escape_char = '';
         $this->db->_protect_identifiers = false;
         eval($mc);
     } else {
         echo 'Reporte ' . $repo . ' no definido para ProteoERP <br>';
         echo '<a href=' . site_url("/reportes/enlistar/{$esta}") . '>Regresar</a>';
     }
 }
示例#17
0
文件: ifr.php 项目: philum/cms
function ifrim($f, $ret)
{
    $dr = 'users/public/ifram/';
    mkdir_r($dr);
    write_file($dr . mkday('', 'ydmHis') . '.jpg', $ret);
    return image($f);
}
示例#18
0
文件: umvoc.php 项目: philum/cms
function ud_imz($f, $n = '2')
{
    list($w, $hb) = fwidth($f);
    $w = round($w / $n);
    $h = round($h / $n);
    return image('/' . $f, $w, $h);
}
示例#19
0
 function iconcaja($cajero, $fecha, $numero = '', $tipo = '', $caja, $reve = 0)
 {
     $cajero = trim($cajero);
     $fecha = trim($fecha);
     $numero = trim($numero);
     $caja = trim($caja);
     if (empty($caja)) {
         $caja = '99';
     }
     $atts = array('align' => 'LEFT', 'border' => '0');
     $fecha = str_replace('-', '', $fecha);
     $atRI = array('width' => '800', 'height' => '600', 'scrollbars' => 'yes', 'status' => 'yes', 'resizable' => 'yes', 'screenx' => '0', 'screeny' => '0');
     $CI =& get_instance();
     if (empty($numero)) {
         return image('caja_abierta.gif', "Cajero Abierto: {$cajero}", $atts) . '<h3>Abierto</h3><center>' . anchor("ventas/rcaj/precierre/{$caja}/{$cajero}/{$fecha}", 'Pre-cerrar cajero') . '</center>';
     } else {
         $reversar = $reve == 1 ? anchor('ventas/rcaj/reversar/' . $numero, 'Reversar') : '';
         if ($tipo == 'T') {
             //return image('caja_precerrada.gif',"Cajero Pre-Cerrado: ${cajero}",$atts).'<h3>'.anchor("ventas/rcaj/forcierre/${numero}/", 'Cerrar cajero').'</h3><center>'.anchor('formatos/ver/RECAJA/'.$numero, ' Ver cuadre de caja').br().$reversar.'</center>';
             return image('caja_precerrada.gif', "Cajero Pre-Cerrado: {$cajero}", $atts) . '<h3>' . anchor("ventas/rcaj/forcierre/{$numero}/", 'Cerrar cajero') . '</h3>';
         } else {
             return image('caja_cerrada.gif', "Cajero Cerrado: {$cajero}", $atts) . '<h3>Cerrado</h3><center>' . anchor('formatos/ver/RECAJA/' . $numero, ' Ver cuadre de caja') . br() . $reversar . '</center>';
         }
     }
 }
示例#20
0
function build_menu($menus = array())
{
    // Check if current level is parent
    $current_line = isset($menus[0]) ? $menus[0] : array();
    $root_level = get_value($current_line, 'id_menu_parent') <= 0 ? true : false;
    if (count($menus) > 0) {
        foreach ($menus as $menu) {
            // DEBUG:
            // print_r($menu);
            // Counting children menu
            $count_menu_children = count(get_value($menu, 'children'));
            // Build a link
            $link = tag_replace(get_value($menu, 'link'));
            $target = get_value($menu, 'target') != '' ? ' target="' . tag_replace(get_value($menu, 'target')) . '" ' : '';
            $label = lang(get_value($menu, 'label'));
            $img = image(get_value($menu, 'url_img'));
            // Build a single line menu
            if ($count_menu_children > 0) {
                $class = $root_level ? 'dropdown' : 'dropdown dropdown-submenu';
                $caret = $root_level ? '<span class="caret"></span>' : '';
                ?>
				<li class="<?php 
                echo $class;
                ?>
">
					<a href="<?php 
                echo $link;
                ?>
" <?php 
                echo $target;
                ?>
 class="dropdown-toggle" data-toggle="dropdown">
						<?php 
                echo $img . ' ' . $label . $caret;
                ?>
					</a>
					<ul class="dropdown-menu"><?php 
                build_menu(get_value($menu, 'children'));
                ?>
</ul>
				</li>
			<?php 
            } else {
                ?>
				<li><a href="<?php 
                echo $link;
                ?>
" <?php 
                echo $target;
                ?>
 ><?php 
                echo $img . ' ' . $label;
                ?>
</a></li>
			<?php 
            }
        }
    }
}
示例#21
0
    public function display($index)
    {
        $index = url_title($index);
        $module_name = $this->config->segments_url[0];
        $base_url = implode('/', in_array($index, $segments = array_offset_left($this->config->segments_url)) ? $this->_url_position == 'end' ? array_offset_right($segments) : array_offset_left($segments) : $segments);
        $tabs = array('panes' => array(), 'sections' => array());
        $i = 0;
        foreach ($this->_tabs as $tab) {
            if (isset($tab['url'])) {
                $tab['url'] = url_title($tab['url']);
                $tabs['sections'][] = array('active' => $tab['url'] == $index, 'url' => $tab['url'] == $this->_default_tab ? '' : $tab['url'], 'name' => $tab['name']);
                if ($tab['url'] == $index) {
                    $tabs['panes'][] = array('args' => $tab['args'], 'id' => $tab['url'], 'function' => $tab['function']);
                }
                $i++;
            } else {
                $languages = $this->db->select('code', 'name', 'flag')->from('nf_settings_languages')->order_by('`order`')->get();
                foreach ($languages as $lang) {
                    $code = $index;
                    if ($i == 0) {
                        if ($index != array_last($this->config->segments_url)) {
                            $index = $code = $lang['code'];
                        } else {
                            $code = NULL;
                        }
                    }
                    $tabs['sections'][] = array('active' => $lang['code'] == $code, 'url' => $i == 0 ? '' : $lang['code'], 'name' => '<img src="' . image('flags/' . $lang['flag']) . '" alt="" />' . $lang['name']);
                    if ($lang['code'] == $index) {
                        $tabs['panes'][] = array('args' => array_merge($tab['args'], array($index)), 'id' => $lang['code'], 'function' => $tab['function']);
                    }
                    $i++;
                }
            }
        }
        foreach ($tabs['sections'] as $section) {
            if ($is_good = $section['active']) {
                break;
            }
        }
        if (!isset($is_good) || !$is_good || array_last($this->config->segments_url) == $this->_default_tab) {
            throw new Exception(NeoFrag::UNFOUND);
        }
        $output = '	<div class="tabbable">
						<ul class="nav nav-tabs">';
        foreach ($tabs['sections'] as $section) {
            $output .= '	<li' . ($section['active'] ? ' class="active"' : '') . '><a href="' . url($module_name . '/' . trim($this->_url_position == 'end' ? $base_url . '/' . $section['url'] : $section['url'] . '/' . $base_url, '/') . '.html') . '">' . $section['name'] . '</a></li>';
        }
        $output .= '	</ul>
						<div class="tab-content">';
        $caller = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 2)[1]['object'];
        foreach ($tabs['panes'] as $pane) {
            $output .= '	<div class="tab-pane active" id="' . $pane['id'] . '">
								' . (string) $caller->method($pane['function'], $pane['args']) . '
							</div>';
        }
        $output .= '	</div>
					</div>';
        return $output;
    }
示例#22
0
文件: ifrm.php 项目: philum/cms
function ifrim($f, $d)
{
    $dr = 'users/public/ifrm/';
    mkdir_r($dr);
    $fb = $dr . strrchr_b($f, '/');
    write_file($fb, $d);
    return image('/' . $fb);
}
示例#23
0
 public function getLogoImage()
 {
     $html = '';
     if ($this->logo) {
         $html = image($this->logo, $this->name, array('class' => 'link-logo'));
     }
     return $html;
 }
示例#24
0
 function iconcaja($cajero, $audi)
 {
     if (empty($audi)) {
         return image('caja_abierta.gif', "Caja disponible");
     } else {
         return image('caja_precerrada.gif', "En auditoria");
     }
 }
示例#25
0
文件: draw.php 项目: philum/cms
function draw_save($d)
{
    $f = 'img/draw_temp.png';
    //$d.='=';
    //echo txarea('',$d,20,10);//(substr($d,22));
    write_file($f, base64_decode(substr($d, 22)));
    return image($f);
}
示例#26
0
 function actionTest()
 {
     $a = array('resize' => array(300, 200), 'rotate' => 45, 'border' => array(10, 'red'), 'rounded' => array(10, "tl tr"));
     $file = '1.jpg';
     $url = image($file, $a);
     $this->active = 'site.test';
     echo $this->render('test', array('url' => $url));
 }
示例#27
0
function displayPWchanger()
{
    global $smarty;
    $smarty->assign("logo", image(get_template_path("images/logo.png")));
    $smarty->assign("date", date("l, dS F Y H:i:s O"));
    $smarty->display(get_template_path('password.tpl'));
    exit;
}
示例#28
0
 function ver($repo, $esta = null)
 {
     $this->instalar();
     $this->rapyd->load('datafilter2');
     $dbrepo = $this->db->escape($repo);
     $mSQL = 'SELECT proteo FROM reportes WHERE nombre=' . $dbrepo;
     $mc = $this->datasis->dameval($mSQL);
     $nombre = strtolower($repo) . '.pdf';
     $_formato = $this->input->post('salformat');
     if (empty($mc)) {
         $mc = $this->_crearep($repo, 'proteo');
     } else {
         if ($this->db->char_set == 'latin1' && $this->config->item('charset') == 'UTF-8' && $_formato != 'PDF') {
             if (!$this->is_utf8($mc)) {
                 $mc = utf8_encode($mc);
             }
         }
     }
     if (!empty($mc)) {
         $sql = "UPDATE reportes SET instancias = instancias+1 WHERE nombre={$dbrepo}";
         $this->db->simple_query($sql);
         if (empty($esta)) {
             $esta = $this->datasis->dameval('SELECT modulo FROM intrarepo WHERE nombre=' . $this->db->escape($repo));
         }
         $data['regresar'] = '<a href=' . site_url('/reportes/enlistar/' . $esta) . '>' . image('go-previous.png', 'Regresar', array('border' => 0)) . 'Regresar' . '</a>';
         $data['regresar'] .= '<p style="font-size:0.6em;text-align:center;padding:0">..::' . $repo . '::..</p>';
         $fname = strtoupper($repo);
         switch ($_formato) {
             case 'XLS':
                 $_mclase = 'XLSReporte';
                 $fname .= '.xls';
                 break;
             case 'PDF':
                 $_mclase = 'PDFReporte';
                 $fname .= '.pdf';
                 break;
             case 'plano':
                 $_mclase = 'XLSXReporte';
                 $mc = str_replace('new PDFReporte(', 'new XLSXReporte(', $mc);
                 $fname .= '.xlsx';
                 break;
             case 'HTML':
                 $_mclase = 'HTMLReporte';
                 $fname .= '.html';
                 break;
             default:
                 $_mclase = 'PDFReporte';
                 $fname .= '.pdf';
         }
         $this->load->library($_mclase);
         $this->db->_escape_char = '';
         $this->db->_protect_identifiers = false;
         eval($mc);
     } else {
         echo 'Reporte ' . $repo . ' no definido para ProteoERP <br>';
         echo '<a href=' . site_url('/reportes/enlistar/' . $esta) . '>Regresar</a>';
     }
 }
示例#29
0
文件: imtx.php 项目: philum/cms
function plug_imtx($p, $o)
{
    $rid = 'plg' . randid();
    ses('out', '/plug/_data/imtx.png');
    $j = $rid . '_plug__2_imtx_imt*j_' . $w . '_' . $h . '_txtarec';
    $sj = 'SaveJ(\'' . $j . '\')';
    $ret .= txarea('txtarec', $p, 44, 14, atc('console') . atb('onkeyup', $sj) . atb('onclick', $sj));
    $ret .= lj('', $j, picto('reload')) . ' ';
    return $ret . divd($rid, image(root() . ses('out')));
}
示例#30
0
文件: gravatar.php 项目: philum/cms
function plug_gravatar($d, $id)
{
    //mail
    $h = grav_hash($d);
    $size = 48;
    $here = 'http://' . $_SERVER['HTTP_HOST'] . '/imgb/grav_homestar.jpg';
    $grav_url = 'http://www.gravatar.com/avatar/' . $h . '?d=' . $here . '&s=' . $size;
    $nm = grav_profile($h);
    return image($grav_url, '" title="' . $nm . '"', '');
}