本文整理汇总了PHP中img函数的典型用法代码示例。如果您正苦于以下问题:PHP img函数的具体用法?PHP img怎么用?PHP img使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了img函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: input
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 = '".$fieldData->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="' . $fieldData->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;
}
示例2: uploads
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;
}
示例3: jqdatag
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);
}
示例4: filter
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>';
}
示例5: testpayapl
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);
}
示例6: informNotifications
/**
* 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'));
}
}
示例7: dstat_index
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);
}
示例8: product_listing_single
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>';
}
示例9: filters
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>';
}
示例10: image_thumb_local
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);
}
示例11: index
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);
}
示例12: smarty_function_img
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);
}
示例13: filters
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>';
}
示例14: jqdatag
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);
}
示例15: post_image
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);
}