public function input($fieldKey, $fieldData) { $inputTaget = $this->CI->form->protection($fieldKey) . '-select-picasa'; $value = $fieldData->value ? $fieldData->value : ''; $photo = $this->CI->picasa->parkornCache($fieldData->value); // exit('call me here'); if ($photo && isset($photo->src)) { $img = img($this->CI->picasa->thumb($photo->src, 110), FALSE, 'width=110'); } else { $img = null; } // if( isset($fieldData->user) && $fieldData->user ){ // $script.= " user = '******';"; // } // if( isset($fieldData->album) && $fieldData->album ){ // $script.= "picasa.album = '".$fieldData->album."';"; // } $input = '<div class="pcs-imgs" name="' . $this->CI->form->protection($fieldKey) . '" ' . (isset($fieldData->user) && $fieldData->user ? 'user="******"' : null) . (isset($fieldData->album) && $fieldData->album ? 'albumid="' . $fieldData->album . '"' : null) . '>' . '<input type="text" class="uniform" style="display: none;" value=\'' . $value . '\' name="' . $this->CI->form->protection($fieldKey) . '">' . '<span class="img" name="select-img" style="-moz-user-select: none;" ' . ($photo && isset($photo->src) ? 'photoid=' . $photo->id : '') . '>' . ($value == '' ? 'Choose File' : $img) . '</span>' . '</div>'; $script = ''; $script .= "" . 'picasa.inputname = $("input[type=text][name=' . $this->CI->form->protection($fieldKey) . ']");'; if ($this->CI->template && $script) { $this->CI->template->add_js_ready($script); } return $input; }
function uploads($config) { $this->load->library('upload', $config); // підключаєм бібліотеку загрузки файлів unset($config); // чистим переміну if ($this->upload->do_upload()) { // функція загрузки файлів $upload_data = $this->upload->data(); // масив даних $add['title'] = $this->input->post('title'); $add['file_name'] = $upload_data['file_name']; // назва в бд $add['date'] = date("Y-m-d"); $this->db->insert('photos', $add); // запис в бд $config = array('image_library' => 'gd2', 'source_image' => $upload_data['full_path'], 'new_image' => APPPATH . '../uploads/img/photos/thumbs', 'create_thumb' => TRUE, 'maintain_ratio' => TRUE, 'width' => '80', 'heigth' => '80'); $this->load->library('image_lib', $config); $this->image_lib->resize(); $this->load->helper('html'); $data['img'] = img('uploads/img/photos/thumbs/' . $upload_data['raw_name'] . '_thumb' . $upload_data['file_ext']); $data['success'] = '<p class="text-success">Файл успішно завантажений</p>'; } else { $upload_error = $this->upload->display_errors('<p class="text-danger">', '</p>'); // вивід помилок $data['error'] = $upload_error; // передаєм помилку } return $data; }
function jqdatag() { $grid = $this->defgrid(); $param['grids'][] = $grid->deploy(); //Funciones que ejecutan los botones $bodyscript = $this->bodyscript($param['grids'][0]['gridname']); $readyLayout = $grid->readyLayout2(216, 135, $param['grids'][0]['gridname']); $WpAdic = "\n\t\t<tr><td><div class=\"anexos\">\n\t\t\t<table cellpadding='0' cellspacing='0'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td style='vertical-align:top;'><div class='botones'><a style='width:94px;text-align:left;vertical-align:top;' href='#' id='gmarcas'>" . img(array('src' => "images/tux1.png", 'height' => 15, 'alt' => 'Crear Marcas', 'title' => 'Crear Marcas', 'border' => '0')) . "+Marcas</a></div></td>\n\t\t\t\t\t<td style='vertical-align:top;'><div class='botones'><a style='width:94px;text-align:left;vertical-align:top;' href='#' id='gunidad'>" . img(array('src' => "images/unidad.gif", 'height' => 15, 'alt' => 'Crear Unidades', 'title' => 'Crear Unidades', 'border' => '0')) . "+Unidad</a></div></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td style='vertical-align:top;'><div class='botones'><a style='width:94px;text-align:left;vertical-align:top;' href='#' id='hinactivo'>" . img(array('src' => "images/basura.png", 'height' => 15, 'alt' => 'Mostrar/Ocultar Inactivos', 'title' => 'Mostrar/Ocultar Inactivos', 'border' => '0')) . "Inactivos</a></div></td>\n\t\t\t\t\t<td style='vertical-align:top;'><div class='botones'><a style='width:94px;text-align:left;vertical-align:top;' href='#' id='bbarras' >" . img(array('src' => "images/barcode.png", 'height' => 15, 'alt' => 'Barras Adicionales', 'title' => 'Barras Adicionales', 'border' => '0')) . "Barras</a></div></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td style='vertical-align:top;' colspan='2'><div class='botones'><a style='width:190px;text-align:left;vertical-align:top;' href='#' id='subica'>" . img(array('src' => "images/ojo.png", 'height' => 15, 'alt' => 'Ubicaciones', 'title' => 'Ubicaciones', 'border' => '0')) . "Ubicaciones</a></div></td>\n\t\t\t\t</tr>"; if ($this->datasis->traevalor('SUNDECOP') == 'S') { $WpAdic .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td style='vertical-align:top;'><div class='botones'><a style='width:94px;text-align:left;vertical-align:top;' href='#' id='sundecop'>" . img(array('src' => "images/sundecop.jpeg", 'height' => 15, 'alt' => 'Parametros SUNDECOP', 'title' => 'Parametros SUNDECOP', 'border' => '0')) . "SuNdeCoP</a></div></td>\n\t\t\t\t\t<td style='vertical-align:top;'><div class='botones'><a style='width:94px;text-align:left;vertical-align:top;' href='#' id='bpactivo'>" . img(array('src' => "images/lab.png", 'height' => 15, 'alt' => 'Crear Unidades', 'title' => 'Crear Unidades', 'border' => '0')) . "P.Activo</a></div></td>\n\t\t\t\t</tr>\n\t\t\t"; } $WpAdic .= "\n\t\t\t</table>\n\t\t\t</div>\n\t\t</td></tr>\n\n\t\t"; $grid->setWpAdicional($WpAdic); $WestPanel = $grid->deploywestp(); $adic = array(array('id' => 'fedita', 'title' => 'Agregar/Editar Registro'), array('id' => 'fborra', 'title' => 'Eliminar registro'), array('id' => 'fshow', 'title' => 'Varios')); $SouthPanel = $grid->SouthPanel($this->datasis->traevalor('TITULO1'), $adic); $link2 = site_url('inventario/sinv/recalcular'); $funciones = $this->funciones($param['grids'][0]['gridname']); //Panel Central y Sur $centerpanel = $grid->centerpanel($id = 'radicional', $param['grids'][0]['gridname']); $param['script'] = script('sinvmaes.js'); $param['WestPanel'] = $WestPanel; $param['funciones'] = $funciones; $param['readyLayout'] = $readyLayout; $param['centerpanel'] = $centerpanel; $param['SouthPanel'] = $SouthPanel; $param['listados'] = $this->datasis->listados('SINV', 'JQ'); $param['otros'] = $this->datasis->otros('SINV', 'JQ'); $param['temas'] = array('proteo', 'darkness', 'anexos'); $param['bodyscript'] = $bodyscript; $param['tabs'] = false; $param['encabeza'] = $this->titp; $this->load->view('jqgrid/crud2', $param); }
public function filter() { $string = '%' . $this->input->post('string') . '%'; $a = array(); if ($string) { $a = User::find('all', array('conditions' => array('nombre LIKE ? OR apellido LIKE ? OR usuario LIKE ?', $string, $string, $string))); } else { $a = User::find('all'); } $this->table->set_heading('Usuario', 'Nombre', 'Apellido', 'Teléfono', 'Celular', 'Email', 'Dirección', 'Acciones'); foreach ($a as $al) { $this->table->add_row($al->usuario, $al->nombre, $al->apellido, $al->telefono, $al->celular, $al->email, $al->direccion, anchor('usuarios/ver/' . $al->id, img('static/img/icon/doc_lines.png'), 'class="tipwe" title="Ver detalles de usuario"') . ' ' . anchor('usuarios/editar/' . $al->id, img('static/img/icon/pencil.png'), 'class="tipwe" title="Editar usuario"') . ' ' . anchor('usuarios/eliminar/' . $al->id, img('static/img/icon/trash.png'), 'class="tipwe eliminar" title="Eliminar usuario"')); } echo $this->table->generate(); $config['base_url'] = site_url('usuarios/index'); $config['total_rows'] = User::count(); $config['per_page'] = '10'; $config['num_links'] = '10'; $config['first_link'] = '← primero'; $config['last_link'] = 'último →'; $this->load->library('pagination', $config); echo '<div class="pagination">'; echo $this->pagination->create_links(); echo '</div>'; }
function testpayapl($mt, $type) { require 'cpaypal.php'; $requete = construit_url_paypal(); // Construit les options de base // La fonction urlencode permet d'encoder au format URL les espaces, slash, deux points, etc.) $requete = $requete . "&METHOD=SetExpressCheckout" . "&CANCELURL=" . urlencode(site_url('../achat/cancel')) . "&RETURNURL=" . urlencode(site_url('../achat/retour')) . "&AMT=" . $mt . "" . "&CURRENCYCODE=EUR" . "&DESC=" . urlencode($type) . "&LOCALECODE=FR" . "&HDRIMG=" . urlencode(img('logo.jpg', 'Logo du labo')); $ch = curl_init($requete); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // Retourne directement le transfert sous forme de chaîne de la valeur retournée par curl_exec() au lieu de l'afficher directement. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // On lance l'exécution de la requête URL et on récupère le résultat dans une variable $resultat_paypal = curl_exec($ch); // S'il y a une erreur, on affiche "Erreur", suivi du détail de l'erreur. if (!$resultat_paypal) { echo "<p>Erreur</p><p>" . curl_error($ch) . "</p>"; } else { $liste_param_paypal = recup_param_paypal($resultat_paypal); // Lance notre fonction qui dispatche le résultat obtenu en un array // Si la requête a été traitée avec succès if ($liste_param_paypal['ACK'] == 'Success') { // Redirige le visiteur sur le site de PayPal header("Location: https://www.paypal.com/webscr&cmd=_express-checkout&token=" . $liste_param_paypal['TOKEN']); exit; } else { echo "<p>Erreur de communication avec le serveur PayPal.<br />" . $liste_param_paypal['L_SHORTMESSAGE0'] . "<br />" . $liste_param_paypal['L_LONGMESSAGE0'] . "</p>"; } } // On ferme notre session cURL. curl_close($ch); }
/** * Grabs all new notifications and adds them to the sender's inform queue. * * This method gets called by dashboard's hooks file to display new * notifications on every pageload. * * @since 2.0.18 * @access public * * @param Gdn_Controller $Sender The object calling this method. */ public static function informNotifications($Sender) { $Session = Gdn::session(); if (!$Session->isValid()) { return; } $ActivityModel = new ActivityModel(); // Get five pending notifications. $Where = array('NotifyUserID' => Gdn::session()->UserID, 'Notified' => ActivityModel::SENT_PENDING); // If we're in the middle of a visit only get very recent notifications. $Where['DateUpdated >'] = Gdn_Format::toDateTime(strtotime('-5 minutes')); $Activities = $ActivityModel->getWhere($Where, 0, 5)->resultArray(); $ActivityIDs = array_column($Activities, 'ActivityID'); $ActivityModel->setNotified($ActivityIDs); $Sender->EventArguments['Activities'] =& $Activities; $Sender->fireEvent('InformNotifications'); foreach ($Activities as $Activity) { if ($Activity['Photo']) { $UserPhoto = anchor(img($Activity['Photo'], array('class' => 'ProfilePhotoMedium')), $Activity['Url'], 'Icon'); } else { $UserPhoto = ''; } $Excerpt = Gdn_Format::plainText($Activity['Story']); $ActivityClass = ' Activity-' . $Activity['ActivityType']; $Sender->informMessage($UserPhoto . Wrap($Activity['Headline'], 'div', array('class' => 'Title')) . Wrap($Excerpt, 'div', array('class' => 'Excerpt')), 'Dismissable AutoDismiss' . $ActivityClass . ($UserPhoto == '' ? '' : ' HasIcon')); } }
function dstat_index() { $img = img(); $html = "<H1>{APP_POSTFIX} {statistics}</H1><br>\n<div style='text-align:right;float:right'>" . imgtootltip("refresh-24.png", "{refresh}", "postfix_refresh_services()") . "</div>\n<div id='dstat_postfix_div'>\n{$img}\n</div>"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function product_listing_single($product) { $ci =& get_instance(); $ci->load->model('store_model'); $defaultImage = $ci->store_model->getProductImage($product->products_id); echo '<div class="col-md-3 col-sm-'; echo '<div class="product-listing-image">'; echo '<a href="' . base_url() . 'product/detail/' . $product->products_id . '">'; $prop = array('class' => 'img-responsive', 'src' => 'files/store/' . $defaultImage); echo img($prop); echo "</a>"; if ($product->products_title != '') { echo '<h2 class="product-listing-title">'; echo '<a href="' . base_url() . 'product/detail/' . $product->products_id . '">'; echo $product->products_title; echo '</a>'; echo "</h2>"; } if ($ci->config->item('show_price') && $product->products_price) { echo '<div class="product-listing-price">'; echo '$' . number_format($product->products_price, 2, '.', ','); echo '</div>'; } if ($product->products_desc != '') { echo "<p>"; echo $product->products_desc; echo "</p>"; } echo "<p>"; echo '<a class="btn btn-primary btn-outline btn-block" href="' . base_url() . 'product/detail/' . $product->products_id . '">View</a>'; echo "</p>"; echo '</div>'; echo '</div>'; }
public function filters($offset = 0) { $string = '%' . $this->input->post('concepto') . '%'; $ciclo = '%' . $this->input->post('ciclo') . '%'; $condiciones = ''; $valores = array(); if ($string != '%%') { $condiciones .= " concepto LIKE ?"; $valores['concepto'] = $string; } if ($ciclo != '%%') { $condiciones .= " ciclo_lectivo LIKE ?"; $valores['ciclo_lectivo'] = $ciclo; } $conditions = array_merge(array($condiciones), $valores); $config['base_url'] = site_url('conceptos/index'); $config['total_rows'] = Concept::count(array('conditions' => $conditions)); $config['per_page'] = '10'; $config['num_links'] = '10'; $config['first_link'] = '← primero'; $config['last_link'] = 'último →'; $this->load->library('pagination', $config); $conceptos = Concept::all(array('conditions' => $conditions, 'limit' => $config['per_page'], 'offset' => $offset)); $this->table->set_heading('Orden', 'Concepto', 'Pagos Parciales', 'Ciclo Lectivo', 'Acciones'); foreach ($conceptos as $concepto) { $this->table->add_row($concepto->id, $concepto->concepto, $concepto->pago_parcial ? 'Si' : 'No', $concepto->ciclo_lectivo, anchor('conceptos/ver/' . $concepto->id, img('static/img/icon/doc_lines.png'), 'class="tipwe" title="Ver detalles"') . ' ' . anchor('conceptos/editar/' . $concepto->id, img('static/img/icon/pencil.png'), 'class="tipwe" title="Editar"') . ' ' . anchor('conceptos/eliminar/' . $concepto->id, img('static/img/icon/trash.png'), 'class="tipwe eliminar" title="Eliminar"')); } echo $this->table->generate(); echo '<div class="pagination">'; echo $this->pagination->create_links(); echo '</div>'; }
function image_thumb_local($image_path, $height, $width, $crop = FALSE, $ratio = FALSE) { // Get the CodeIgniter super object $CI =& get_instance(); $ext = strchr($image_path, '.'); $file_name = substr(basename($image_path), 0, -strlen($ext)); // Path to image thumbnail $image_thumb = dirname($image_path) . '/' . $file_name . '_' . $height . '_' . $width . $ext; if (!file_exists($image_thumb)) { // LOAD LIBRARY $CI->load->library('image_lib'); // CONFIGURE IMAGE LIBRARY $config['image_library'] = 'gd2'; $config['source_image'] = $image_path; $config['new_image'] = $image_thumb; $config['maintain_ratio'] = $ratio; $config['height'] = $height; $config['width'] = $width; $CI->image_lib->initialize($config); if ($crop) { $CI->image_lib->crop(); } else { $CI->image_lib->resize(); } $CI->image_lib->clear(); } return '<img src="' . local_img_url() . $image_thumb . '" />'; return img($image_thumb); }
public function index() { $data = array(); $data['error'] = ''; $data['output'] = ''; if (isset($_FILES['userfile'])) { $this->upload->initialize(array('upload_path' => './assets/', 'allowed_types' => 'png|jpg|gif', 'max_size' => '5000', 'max_width' => '3000', 'max_height' => '3000')); if ($this->upload->do_upload()) { $data_upload = $this->upload->data(); $this->image_lib->initialize(array('image_library' => 'gd2', 'source_image' => './assets/' . $data_upload['file_name'], 'maintain_ratio' => false, 'create_thumb' => true, 'quality' => '20%', 'width' => 240, 'height' => 172)); if ($this->image_lib->resize()) { $output = '<h4>Thumb - hasil Resize</h4>'; $output .= img('./assets/' . $data_upload['raw_name'] . '_thumb' . $data_upload['file_ext']); $output .= '<h4 style="margin-top: 30px">Gambar Original</h4>'; $output .= img('./assets/' . $data_upload['file_name']); $data['output'] = $output; } else { $data['error'] = $this->image_lib->display_errors(); } } else { $data['error'] = $this->upload->display_errors(); } } $this->load->view('welcome_message', $data); }
function smarty_function_img($params, $template) { $CI =& get_instance(); $CI->load->helper('html'); $attr = array(); $src = get_default($params, 'src'); $class = get_default($params, 'class'); $alt = get_default($params, 'alt'); $title = get_default($params, 'title'); $width = get_default($params, 'width'); $height = get_default($params, 'height'); if ($src != '') { $attr['src'] = $src; } if ($class != '') { $attr['class'] = $class; } if ($alt != '') { $attr['alt'] = $alt; } if ($title != '') { $attr['title'] = $title; } if ($width != '') { $attr['width'] = $width; } if ($height != '') { $attr['height'] = $height; } return img($attr); }
public function filters() { $string = '%' . $this->input->post('provincia') . '%'; $c = $this->input->post('country_id'); if ($string != '%%' && $c > 0) { $provincias = State::find('all', array('conditions' => array('country_id = ? AND provincia LIKE ?', $c, $string))); } elseif ($string != '%%') { $provincias = State::find('all', array('conditions' => array('provincia LIKE ?', $string))); } elseif ($c != '0') { $provincias = State::find('all', array('conditions' => array('country_id = ?', $c))); } else { $provincias = State::find('all'); } $this->table->set_heading('Orden', 'País', 'Provincia', 'Acciones'); foreach ($provincias as $pro) { $this->table->add_row($pro->id, $pro->country->pais, $pro->provincia, anchor('provincias/editar/' . $pro->id, img('static/img/icon/pencil.png'), 'class="tipwe" title="Editar"') . ' ' . anchor('provincias/eliminar/' . $pro->id, img('static/img/icon/trash.png'), 'class="tipwe eliminar" title="Eliminar"')); } echo $this->table->generate(); $config['base_url'] = site_url('provincias/index'); $config['total_rows'] = State::count(); $config['per_page'] = '10'; $config['num_links'] = '10'; $config['first_link'] = '← primero'; $config['last_link'] = 'último →'; $this->load->library('pagination', $config); echo '<div class="pagination">'; echo $this->pagination->create_links(); echo '</div>'; }
function jqdatag() { $grid = $this->defgrid(); $param['grids'][] = $grid->deploy(); //Funciones que ejecutan los botones $bodyscript = $this->bodyscript($param['grids'][0]['gridname']); $WpAdic = "\n\t\t<tr><td><div class=\"anexos\">\n\t\t\t<table cellpadding='0' cellspacing='0'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td style='vertical-align:top;'><div class='botones'><a style='width:94px;text-align:left;vertical-align:top;' href='#' id='gtipo'>" . img(array('src' => "images/tux1.png", 'height' => 15, 'alt' => 'Tipos de Edificacion', 'title' => 'Tipo de Edificacion', 'border' => '0')) . " Tipos</a></div></td>\n\t\t\t\t\t<td style='vertical-align:top;'><div class='botones'><a style='width:94px;text-align:left;vertical-align:top;' href='#' id='gusos'>" . img(array('src' => "images/unidad.gif", 'height' => 15, 'alt' => 'Usos de las areas', 'title' => 'Usos de los locales', 'border' => '0')) . " Usos</a></div></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td style='vertical-align:top;' colspan='2'><div class='botones'><a style='width:190px;text-align:left;vertical-align:top;' href='#' id='gubica'>" . img(array('src' => "images/basura.png", 'height' => 15, 'alt' => 'Mostrar/Ocultar Inactivos', 'title' => 'Mostrar/Ocultar Inactivos', 'border' => '0')) . " Areas</a></div></td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t</div>\n\t\t</td></tr>\n\n\t\t"; $grid->setWpAdicional($WpAdic); //Botones Panel Izq //$grid->wbotonadd(array("id"=>"edocta", "img"=>"images/pdf_logo.gif", "alt" => "Formato PDF", "label"=>"Ejemplo")); $WestPanel = $grid->deploywestp(); $adic = array(array('id' => 'fedita', 'title' => 'Agregar/Editar Registro'), array('id' => 'fshow', 'title' => 'Mostrar Registro'), array('id' => 'fborra', 'title' => 'Eliminar Registro')); $SouthPanel = $grid->SouthPanel($this->datasis->traevalor('TITULO1'), $adic); $param['WestPanel'] = $WestPanel; //$param['EastPanel'] = $EastPanel; $param['SouthPanel'] = $SouthPanel; $param['listados'] = $this->datasis->listados('EDIF', 'JQ'); $param['otros'] = $this->datasis->otros('EDIF', 'JQ'); $param['temas'] = array('proteo', 'darkness', 'anexos1'); $param['bodyscript'] = $bodyscript; $param['tabs'] = false; $param['encabeza'] = $this->titp; $param['tamano'] = $this->datasis->getintramenu(substr($this->url, 0, -1)); $this->load->view('jqgrid/crud2', $param); }
function post_image($image, $date, $title = '') { $title = str_replace(array('"', '\''), '', $title); $image = $image != '' ? 'post/image/160/120/' . $image : 'assets/img/default-post.png'; $img_properties = array('src' => $image, 'alt' => $title, 'width' => '160', 'height' => '120', 'class' => 'float_left post-image'); return img($img_properties); }
public function index() { $offset = $this->general->get_offset(); $limit = $this->general->get_limit(); $total = $this->user_model->count_all(); $xdata['action'] = 'user/search' . get_query_string(); $xdata['action_delete'] = 'user/delete' . get_query_string(); $xdata['add_btn'] = anchor('user/add', '<span class="glyphicon glyphicon-plus"></span> Tambah', array('class' => 'btn btn-success btn-sm')); $xdata['delete_btn'] = '<button id="delete-btn" class="btn btn-danger btn-sm"><span class="glyphicon glyphicon-trash"></span> Delete Checked</button>'; $this->table->set_template(tbl_tmp()); $head_data = array('kode' => 'Kode', 'nama' => 'Fullname', 'level_nama' => 'Level', 'ip_login' => 'IP', 'user_agent' => 'User Agent', 'date_login' => 'Date', 'status_nama' => 'Status'); $heading[] = form_checkbox(array('id' => 'selectAll', 'value' => 1)); $heading[] = '#'; foreach ($head_data as $r => $value) { $heading[] = anchor('user' . get_query_string(array('order_column' => "{$r}", 'order_type' => $this->general->order_type($r))), "{$value} " . $this->general->order_icon("{$r}")); } $heading[] = 'Action'; $this->table->set_heading($heading); $result = $this->user_model->get()->result(); $i = 1 + $offset; foreach ($result as $r) { $this->table->add_row(array('data' => form_checkbox(array('name' => 'check[]', 'value' => $r->id)), 'width' => '10px'), $i++, anchor('user/edit/' . $r->id . get_query_string(), $r->kode), array('data' => img(array('src' => get_user_photo($r->photo), 'class' => 'img-circle img-table')) . ' ' . $r->nama, 'width' => '200'), $r->level_nama, $r->ip_login, $r->user_agent, $r->date_login, '<label class="label label-' . ($r->status_kode == 'ON' ? 'success' : 'danger') . '">' . $r->status_nama . '</label>', anchor('user/edit/' . $r->id . get_query_string(), 'Edit') . " | " . anchor('user/delete/' . $r->id . get_query_string(), 'Delete', array('onclick' => "return confirm('you sure')")) . " | " . anchor('user_event?user='******'Event')); } $xdata['table'] = $this->table->generate(); $xdata['total'] = page_total($offset, $limit, $total); $config = pag_tmp(); $config['base_url'] = "user" . get_query_string(null, 'offset'); $config['total_rows'] = $total; $config['per_page'] = $limit; $this->pagination->initialize($config); $xdata['pagination'] = $this->pagination->create_links(); $data['content'] = $this->load->view('user_list', $xdata, true); $this->load->view('template', $data); }
function index($offset = null) { $voters = $this->Boter->select_all(); $config['base_url'] = site_url('admin/voters/index'); $config['total_rows'] = count($voters); $config['per_page'] = HALALAN_PER_PAGE; $config['uri_segment'] = 4; $config['num_links'] = 5; $config['first_link'] = img('public/images/go-first.png'); $config['last_link'] = img('public/images/go-last.png'); $config['prev_link'] = img('public/images/go-previous.png'); $config['next_link'] = img('public/images/go-next.png'); $this->pagination->initialize($config); $data['links'] = $this->pagination->create_links(); if ($offset == null) { $offset = 0; } $limit = $config['per_page']; $data['offset'] = $offset; $data['limit'] = $limit; $data['total_rows'] = $config['total_rows']; $data['voters'] = $this->Boter->select_all_for_pagination($limit, $offset); $admin['username'] = $this->admin['username']; $admin['title'] = e('admin_voters_title'); $admin['body'] = $this->load->view('admin/voters', $data, TRUE); $this->load->view('admin', $admin); }
/** * Create widget * */ private function _createWidget() { $session = new Gamesession_delegate($this->gamesession->getId()); $session->load(); //TODO: Actual image generation $this->_widget = img(self::WIDGET_PATH_PREFIX . $session->hash); }
public function filters($offset = 0) { $string = '%' . $this->input->post('nivel') . '%'; $condiciones = ''; $valores = array(); if ($string != '%%') { $condiciones .= " nivel LIKE ?"; $valores['nivel'] = $string; } $conditions = array_merge(array($condiciones), $valores); $config['base_url'] = site_url('niveles/index'); $config['total_rows'] = Level::count(array('conditions' => $conditions)); $config['per_page'] = '10'; $config['num_links'] = '10'; $config['first_link'] = '← primero'; $config['last_link'] = 'último →'; $this->load->library('pagination', $config); $niveles = Level::all(array('conditions' => $conditions, 'limit' => $config['per_page'], 'offset' => $offset)); $this->table->set_heading('Orden', 'Nivel', 'Acciones'); foreach ($niveles as $nivel) { $this->table->add_row($nivel->id, $nivel->nivel, anchor('niveles/editar/' . $nivel->id, img('static/img/icon/pencil.png'), 'class="tipwe" title="Editar"') . ' ' . anchor('niveles/eliminar/' . $nivel->id, img('static/img/icon/trash.png'), 'class="tipwe eliminar" title="Eliminar"')); } echo $this->table->generate(); echo '<div class="pagination">'; echo $this->pagination->create_links(); echo '</div>'; }
function dstat_index() { $page = CurrentPageName(); $img = img(); $html = "<H1>{cpu_usage} & System</H1><br>\n<table style='width:100%'>\n<tr>\n\t<td valign='top'>\n\t" . RoundedLightWhite(imgtootltip("refresh-32.png", "{refresh}", "cpu_refresh_services()")) . "<br>\n\t" . RoundedLightWhite(imgtootltip('32-charts-plus.png', '{top_ressources}', "TopRessourcesCPUGraph()")) . "</td>\n<td valign='top'><div id='dstat_cpu_div'>\n{$img}\n</div>\n</td>\n</tr>\n</table>"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function removeButton($onClick, $gfx = '') { if ($gfx === '') { echo '<div class="removeButton" onclick="' . $onClick . ';"></div>'; } else { echo '<div class="removeButton" onclick="' . $onClick . ';">' . img($gfx) . '</div>'; } }
function smarty_function_img($params, $template) { $CI =& get_instance(); $CI->load->helper('parser'); $file = $params['file']; unset($params['file']); img($file, $params); }
function get_user_image($id, $class) { $path = 'assets/img/user/' . $id . '.jpg'; if (file_exists($path)) { return img(array('src' => $path, 'class' => $class, 'alt' => "User Image")); } else { return img(array('src' => 'assets/img/user/user.jpg', 'class' => $class, 'alt' => "User Image")); } }
function writeHomepageOption($Title, $Url, $iconName, $Current, $Description = '') { $iconPath = 'applications/dashboard/design/images/' . $iconName . '.png'; $cssClass = ''; if ($Current == $Url) { $cssClass = 'active'; } $cssClass .= ' Choice'; echo wrap('<div class="image-wrap">' . img($iconPath, ['alt' => $Title, 'class' => 'label-selector-image']) . '<div class="overlay">' . '<div class="buttons">' . anchor(t('Select'), $Url, 'btn btn-overlay', ['title' => $Description, 'rel' => $Url]) . '</div>' . '<div class="selected">' . dashboardSymbol('checkmark') . '</div>' . '</div></div>' . '<div class="title">' . t($Title) . '</div>', 'div', array('class' => $cssClass . ' label-selector-item')); }
function imgLazy($arg,$bool=false){ $path = $arg; if(is_array($arg)) $path = $arg['src']; $fullpath = $_SERVER['DOCUMENT_ROOT'].$path; if(file_exists($fullpath)) return img($arg,$bool); else return "<!-- no image found at ".$path." -->"; }
function jqdatag() { $grid = $this->defgrid(); $param['grids'][] = $grid->deploy(); $grid1 = $this->defgridit(); $param['grids'][] = $grid1->deploy(); $readyLayout = $grid->readyLayout2(212, 200, $param['grids'][0]['gridname'], $param['grids'][1]['gridname']); $bodyscript = $this->bodyscript($param['grids'][0]['gridname'], $param['grids'][1]['gridname']); $WpAdic = "\n\t\t<tr><td>\n\t\t\t<div class=\"anexos\">\n\n\t\t\t<table cellpadding='0' cellspacing='0' style='width:100%;'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td style='vertical-align:center;border:1px solid #AFAFAF;'><div class='tema1 botones'>" . img(array('src' => "assets/default/images/print.png", 'height' => 18, 'alt' => 'Imprimir', 'title' => 'Imprimir', 'border' => '0')) . "</div></td>\n\t\t\t\t\t<td style='vertical-align:top;text-align:center;'><div class='tema1 botones'><a style='width:60px;text-align:left;vertical-align:top;' border='0' href='#' id='imprimir'>Compra</a></div></td>\n\t\t\t\t\t<td style='vertical-align:top;text-align:center;'><div class='tema1 botones'><a class='tema1 botones' style='width:45px;text-align:left;vertical-align:top;' href='#' id='reteprin'>R.IVA</a></div></td>\n\t\t\t\t\t<td style='vertical-align:top;text-align:center;'><div class='tema1 botones'><a class='tema1 botones' style='width:45px;text-align:left;vertical-align:top;' href='#' id='reteislr'>ISLR</a></div></td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t</div>\n\t\t</td></tr>\n\t\t"; $grid->setWpAdicional($WpAdic); //Botones Panel Izq //$grid->wbotonadd(array('id'=>'cprecios','img'=>'images/precio.png' ,'alt' => 'Ajustar Precios' ,'label'=>'Cambiar Precios', )); $grid->wbotonadd(array('id' => 'bcmonto', 'img' => 'images/precio.png', 'alt' => 'Modificar la CxP', 'label' => 'Modificar la CxP')); if ($this->datasis->traevalor('MOTOS') == 'S') { $grid->wbotonadd(array('id' => 'vehiculo', 'img' => 'images/carro.png', 'alt' => 'Seriales Vehiculares', 'label' => 'Seriales Vehiculares')); } $grid->wbotonadd(array('id' => 'actualizar', 'img' => 'images/arrow_up.png', 'alt' => 'Actualizar', 'label' => 'Actualizar')); $grid->wbotonadd(array('id' => 'reversar', 'img' => 'images/arrow_down.png', 'alt' => 'Reversar', 'label' => 'Reversar')); $grid->wbotonadd(array('id' => 'recargos', 'img' => 'images/arrow_down.png', 'alt' => 'Reversar', 'label' => 'Recargos ')); /* ESCOJER FACTURA DESDE GASTOS O COLOCO UN ESTIMADO EN MONTO O % $grid->wbotonadd(array('id'=>'cpredeter', 'img'=>'images/arrow_down.png' ,'alt' => 'Reversar', 'label'=>'Rec. Predeterminado')); */ $WestPanel = $grid->deploywestp(); //Panel Central y Sur $centerpanel = $grid->centerpanel($id = 'radicional', $param['grids'][0]['gridname'], $param['grids'][1]['gridname']); //Panel de pie de forma $adic = array(array('id' => 'fcompra', 'title' => 'Compras'), array('id' => 'factuali', 'title' => 'Actualizar'), array('id' => 'fvehi', 'title' => 'Seriales Vehiculares'), array('id' => 'fborra', 'title' => 'Eliminar Registro'), array('id' => 'fcmonto', 'title' => 'Cambiar los montos que van a CxP'), array('id' => 'fshow', 'title' => 'Mostrar Compra'), array('id' => 'fcprecio', 'title' => 'Cambio de precios')); $SouthPanel = $grid->SouthPanel($this->datasis->traevalor('TITULO1'), $adic); $funciones = ' function ltransac(el, val, opts){ var link=\'<div><a href="#" onclick="tconsulta(\'+"\'"+el+"\'"+\');">\' +el+ \'</a></div>\'; return link; };'; $funciones .= '$("#cprecios").hide();' . "\n"; $funciones .= '$("#actualizar").hide();' . "\n"; $funciones .= '$("#reversar").hide();' . "\n"; $funciones .= '$("#bcmonto").hide();' . "\n"; $param['WestPanel'] = $WestPanel; //$param['EastPanel'] = $EastPanel; $param['readyLayout'] = $readyLayout; $param['SouthPanel'] = $SouthPanel; $param['listados'] = $this->datasis->listados('SCST', 'JQ'); $param['otros'] = $this->datasis->otros('SCST', 'JQ'); $param['centerpanel'] = $centerpanel; $param['funciones'] = $funciones; $param['temas'] = array('proteo', 'darkness', 'anexos'); $param['bodyscript'] = $bodyscript; $param['tabs'] = false; $param['encabeza'] = $this->titp; $param['tamano'] = $this->datasis->getintramenu(substr($this->url, 0, -1)); $this->load->view('jqgrid/crud2', $param); }
/** * Image link */ public function img() { $image_properties['src'] = $this->CI->config->item('base_url') . $this->CI->config->item('assets_folder') . '/img/' . $this->get_param('file'); $properties = array('alt', 'id', 'class', 'width', 'height', 'title', 'rel'); foreach ($properties as $prop) { if ($this->get_param($prop) != '') { $image_properties[$prop] = $this->get_param($prop); } } return img($image_properties); }
function createTable($arr) { $this->table->set_heading("Logo", anchor("/league/orderBy/id", "Code"), anchor("/league/orderBy/name", "Name"), anchor("/league/orderBy/wins", "Wins"), anchor("/league/orderBy/losses", "Losses"), "Ties", "Division", "Conference", "For", "Against", "Net"); foreach ($arr as $row) { $this->table->add_row(img(array('src' => '/assets/data/img/' . $row->TeamLogo)), $row->Code, $row->TeamName, $row->W, $row->L, $row->T, $row->Division, $row->Conference, $row->PF, $row->PA, $row->Net_Pts); } $parms = array('table_open' => '<table class="table shadow">'); $this->table->set_template($parms); //$this->data['thetable'] = $this->table->generate(); return $this->table->generate(); }
function gallery_image($image = '') { echo '<div class="col-md-3" col-sm-6">'; echo '<div class="gallery-detail-image">'; $prop = array('src' => 'files/' . $image->gallery_image_filename, 'class' => 'img-responsive'); echo '<a href="' . base_url() . 'files/' . $image->gallery_image_filename . '" data-toggle="lightbox" data-gallery="multiimages">'; echo img($prop); echo "</a>"; echo '</div>'; echo '</div>'; }
public function upload() { if (isset($_FILES['image'])) { $config['upload_path'] = './assets/uploads'; $config['allowed_types'] = 'gif|jpg|png|bmp'; $this->load->library('upload', $config); if ($this->upload->do_upload('image')) { $image_data = $this->upload->data(); echo img(array('src' => base_url("assets/uploads/{$image_data['file_name']}"), 'width' => 600, 'style' => 'margin-top:10px; padding:10px; background:#bbb')); } } }