public function delete() { $this->check_current_user(); if ($this->input->server('REQUEST_METHOD') === 'POST') { $data = $this->input->post($this->data['controller']); $this->check_akses_page($this->data['controller'], 'delete', $this->data['controller']); if (empty($data['id'])) { $this->session->set_flashdata('alert', array('type' => 'warning', 'message' => 'Tidak ada data pejabat pembuat komitmen yang dipilih')); redirect(base_url($this->data['controller'])); } $this->db->trans_begin(); $this->db->delete($this->pejabat->table, array('id' => $data['id'])); if ($this->db->trans_status() === FALSE) { $this->db->trans_rollback(); $this->session->set_flashdata('alert', array('type' => 'error', 'message' => 'Data pejabat pembuat komitmen gagal dihapus')); } else { $this->db->trans_commit(); $this->session->set_flashdata('alert', array('type' => 'success', 'message' => 'Data pejabat pembuat komitmen telah dihapus')); if (!empty($data['photo'])) { unlink(uploads_url($this->data['controller'] . '/' . $data['photo'])); } } redirect(base_url($this->data['controller'])); } }
?> <?php echo foundation_form_input('name', array('default_value' => isset($room->name) ? $room->name : null)); ?> <?php echo foundation_form_input('rate', array('default_value' => isset($room->rate) ? $room->rate : null)); ?> <?php echo foundation_form_input('description', array('as' => 'text', 'default_value' => isset($room->description) ? $room->description : null)); ?> <?php if (isset($room->image)) { ?> <label>Current Featured Image</label> <img src="<?php echo uploads_url($room->image); ?> " /> <label>Upload New Featured Image <input type="file" name="image" /></label> <?php } else { ?> <label>Upload Featured Image <input type="file" name="image" /></label> <?php } ?> <?php echo form_submit(array('class' => 'button'), 'Submit'); ?>
<div class="copy-left"> <p>Copyright © 2015.</p> <a href="#page-home" class="btn btn-totop btn-totop-hide"><i class="fa fa-angle-up"></i></a> </div> </div> <div class="col-md-6 col-sm-6 col-xs-12"> <ul class="social-links"> <li><a href=""><i class="fa fa-twitter"></i></a></li> <li><a href=""><i class="fa fa-facebook"></i></a></li> <li><a href=""><i class="fa fa-instagram"></i></a></li> <li><a href=""><i class="fa fa-google-plus"></i></a></li> <li><a href=""><i class="fa fa-dribbble"></i></a></li> <li><a href=""><i class="fa fa-linkedin"></i></a></li> <li><a href=""><i class="fa fa-github"></i></a></li> </ul> </div> </div> </div> </div> end:footer --> </section> <!-- end:content-wrapper --> <input type="text" id="poster_path" type="hidden" value="<?php echo uploads_url() . 'events/posters/' . $event_details->poster; ?> " />
foreach ($images as $k => $image) { ?> <tbody> <tr> <td><?php echo $k + 1; ?> </td> <td><?php echo ucfirst($image->type); ?> </td> <td> <?php echo anchor(uploads_url() . "default/" . $image->path, img(array("src" => uploads_url() . "default/" . $image->path, "border" => "0", "height" => "80", "width" => "180", "alt" => $image->type . " default image")), array('data-toggle' => 'lightbox')); ?> <td> <?php if ($image->status) { ?> <?php echo anchor('disable-default-image/' . $image->id, 'Disable'); ?> <?php } else { ?> <?php echo anchor('enable-default-image/' . $image->id, 'Enable'); ?> <?php
</ul> </div> <div class="panel-body"> <?php if (!empty($vendor_images)) { ?> <?php foreach ($vendor_images as $vimg) { ?> <div class="col-md-4"> <p><b>Category : <?php echo $vimg->name; ?> </b></p> <img src="<?php echo uploads_url() . 'vendors/images/' . $vimg->path; ?> " width="300" height="160" /> </div> <?php } ?> <?php } else { ?> <b>No Image uploaded !</b> <?php } ?> </div> </div>
public static function get_uploaded_files_markup($results = array()) { $url = uploads_url(); ob_start(); if (!empty($results)) { ?> <ul id="selectable" class=""><?php $num = 0; foreach ($results as $id => $filename) { //$img = $results[$num]; $thumbsize = GlobalsRevSlider::IMAGE_SIZE_THUMBNAIL; $mediumsize = GlobalsRevSlider::IMAGE_SIZE_MEDIUM; $largesize = GlobalsRevSlider::IMAGE_SIZE_LARGE; $filerealname = substr($filename, 0, strrpos($filename, '.')); $fileext = substr($filename, strrpos($filename, '.'), strlen($filename) - strlen($filerealname)); $thumbimg = $img = "{$filerealname}-{$thumbsize}x{$thumbsize}{$fileext}"; $mediumimg = "{$filerealname}-{$mediumsize}x{$mediumsize}{$fileext}"; $largeimg = "{$filerealname}-{$largesize}x{$largesize}{$fileext}"; if (++$num % 4 === 1) { ?> <li data-image="<?php echo $filename; ?> " data-large="<?php echo $largeimg; ?> " data-medium="<?php echo $mediumimg; ?> " data-thumb="<?php echo $thumbimg; ?> " class="last"><a href="#"><img alt="<?php echo $img; ?> " src="<?php echo $url . $img; ?> " /></a></li><?php } else { ?> <li data-image="<?php echo $filename; ?> " data-large="<?php echo $largeimg; ?> " data-medium="<?php echo $mediumimg; ?> " data-thumb="<?php echo $thumbimg; ?> "><a href="#"><img alt="<?php echo $img; ?> " src="<?php echo $url . $img; ?> " /></a></li><?php } } ?> </ul><?php } $content = ob_get_contents(); ob_end_clean(); return $content; }
<dt>Rate</dt> <dd><?php echo $room->rate; ?> </dd> <dt>Description</dt> <dd><?php echo $room->description; ?> </dd> <dt>Image</dt> <dd> <img src='<?php echo uploads_url("{$room->image}"); ?> ' /> </dd> </dl> <div class="actions"> <a href="<?php echo site_url('admin/edit_room/' . $room->id); ?> " class="button">Edit</a> <a href="<?php echo site_url('admin/delete_room/' . $room->id); ?> " class="button">Delete</a> </div>
<img src="<?php echo uploads_url() . $selected_image->file_name; ?> " alt="Yet another banana picture" class="img-responsive banana"> <div class="comments"> <p class="text-center"> <a class="btn btn-default" href="<?php echo uploads_url() . $selected_image->file_name; ?> " title="Full size picture"><span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span> Open full size</a> </p> <?php if ($selected_image->description) { ?> <h3>Description: </h3> <div class="panel panel-default"> <div class="panel-body"> <?php echo $selected_image->description; ?> </div> <div class="panel-footer"> <span class="glyphicon glyphicon-user" aria-hidden="true"></span> Uploader <span class="glyphicon glyphicon-time" aria-hidden="true"></span> <?php echo $selected_image->timestamp; ?> </div>
function get_image_real_size($image) { $filepath = uploads_url() . $image; if (file_exists($filepath)) { return list($width, $height) = getimagesize($filepath); } return false; }
function wp_get_attachment_image_src($attach_id, $size = 'thumbnail', $args = array()) { $wpdb = rev_db_class::rev_db_instance(); $tablename = $wpdb->prefix . GlobalsRevSlider::TABLE_ATTACHMENT_IMAGES; $filename = $wpdb->get_var("SELECT file_name FROM {$tablename} WHERE ID={$attach_id}"); if (!empty($filename)) { $filerealname = substr($filename, 0, strrpos($filename, '.')); $fileext = substr($filename, strrpos($filename, '.'), strlen($filename) - strlen($filerealname)); $newfilename = $filerealname; if (gettype($size) == 'string') { switch ($size) { case "thumbnail": $px = GlobalsRevSlider::IMAGE_SIZE_THUMBNAIL; $newfilename .= "-{$px}x{$px}"; break; case "medium": $px = GlobalsRevSlider::IMAGE_SIZE_MEDIUM; $newfilename .= "-{$px}x{$px}"; break; case "large": $px = GlobalsRevSlider::IMAGE_SIZE_LARGE; $newfilename .= "-{$px}x{$px}"; break; default: break; } $newfilename .= $fileext; $imagesize = get_image_real_size($newfilename); return array(uploads_url($newfilename), $imagesize[0], $imagesize[1]); // return array(rev_media_url($newfilename),$imagesize[0],$imagesize[1]); } } return false; }
public function upload_photo($config = array()) { $config = array('upload_path' => uploads_url($this->data['controller']), 'file_name' => strtotime(date('Y-m-d H:i')), 'allowed_types' => 'gif|jpg|jpeg|png', 'max_size' => '500KB', 'max_width' => '3000', 'max_height' => '3000'); return $this->load->library('upload', $config); }
<section class="content"> <h1 class="page-title">Rooms & Rates</h1> <?php foreach ($rooms as $room) { ?> <article class="room"> <img src="<?php echo uploads_url($room['image']); ?> " class="featured-image" /> <div class="info"> <h1 class="number_name" > <span class="number">Room <?php echo $room['number']; ?> </span> <span><?php echo $room['name']; ?> </span> </h1> <div class="rate"><?php echo money_format('%=i.2n/night', $room['rate']); ?> </div>
</div> </div> <div class="form-group"> <label class="col-md-3 col-xs-12 control-label">Logo</label> <div class="col-md-6 col-xs-12"> <?php if ($details->logo != '') { ?> <img src="<?php echo uploads_url() . 'vendors/logos/' . $details->logo; ?> " width="300" height="160" /> <?php } else { ?> <b>No logo added</b> <?php } ?> </div> </div> </div> </div>
public function get_avatar($user) { if (!empty($user)) { $user_folder = uploads_url($user); $avatar_png = $user_folder . 'avatar.png'; $avatar_jpg = $user_folder . 'avatar.jpg'; $avatar_jpeg = $user_folder . 'avatar.jpeg'; if (file_exists($avatar_png)) { return $avatar_png; } elseif (file_exists($avatar_jpg)) { return $avatar_jpg; } elseif (file_exists($avatar_jpeg)) { return $avatar_jpeg; } else { return uploads_url($user) . 'avatar.jpg'; } } else { return uploads_url() . 'avatar.jpg'; } }
public static function get_uploaded_files_markup($results = array()) { $lan_iso = Context::getcontext()->language->iso_code; include_once _PS_ROOT_DIR_ . '/modules/revsliderprestashop/views/config/config.php'; // include_once(_PS_ROOT_DIR_.'/modules/revsliderprestashop/views/lang/'.$lan_iso.'.php'); include_once _PS_ROOT_DIR_ . '/modules/revsliderprestashop/views/include/utils.php'; $upload_dir = __PS_BASE_URI__ . 'modules/revsliderprestashop/uploads/'; $current_path = _PS_ROOT_DIR_ . '/modules/revsliderprestashop/uploads/'; $url = uploads_url(); ob_start(); if (!empty($results)) { ?> <div id="divImageList" > <ul id="selectable" class=""> <?php $num = 0; foreach ($results as $id => $filename) { //$img = $results[$num]; $thumbsize = GlobalsRevSlider::IMAGE_SIZE_THUMBNAIL; $mediumsize = GlobalsRevSlider::IMAGE_SIZE_MEDIUM; $largesize = GlobalsRevSlider::IMAGE_SIZE_LARGE; $filerealname = substr($filename, 0, strrpos($filename, '.')); $fileext = substr($filename, strrpos($filename, '.'), strlen($filename) - strlen($filerealname)); $thumbimg = $img = "{$filerealname}-{$thumbsize}x{$thumbsize}{$fileext}"; $mediumimg = "{$filerealname}-{$mediumsize}x{$mediumsize}{$fileext}"; $largeimg = "{$filerealname}-{$largesize}x{$largesize}{$fileext}"; $file_path = $file_path = $current_path . $largeimg; $date = filemtime($file_path); $size = filesize($file_path); // $file_ext = substr(strrchr($file, '.'), 1); $file_infos = pathinfo($file_path); $file_ext = $file_infos['extension']; // $sorted[$k] = array('file' => $file, 'date' => $date, 'size' => $size, 'extension' => $file_ext); $extension_lower = fix_strtolower($file_ext); $is_img = true; list($img_width, $img_height, $img_type, $attr) = getimagesize($file_path); // if (++$num % 4 === 1): ?> <li data-image="<?php echo $filename; ?> " data-large="<?php echo $upload_dir . $img; ?> " data-medium="<?php echo $upload_dir . $img; ?> " data-thumb="<?php echo $upload_dir . $img; ?> " class="ff-item-type-2 file"> <figure data-type="img" data-name="1117858_1577750_graph-1024x1024.png"> <a data-function="apply" data-field_id="" data-file="<?php echo $upload_dir . $img; ?> " class="link" href="javascript:void('')"> <div class="img-precontainer"> <div class="img-container"> <span></span> <img alt="<?php echo $img; ?> " src="<?php echo $upload_dir . $img; ?> " class="original " > </div> </div> <div class="img-precontainer-mini original-thumb"> <div class="filetype png hide">png</div> <div class="img-container-mini"> <span></span> <img src="<?php echo $upload_dir . $img; ?> " class=" " alt="<?php echo $img; ?> thumbnails"> </div> </div> </a> <div class="box"> <h4 class="ellipsis"> <a data-function="apply" data-field_id="" data-file="<?php echo $img; ?> " class="link" href="javascript:void('')"> <?php echo $img; ?> </a></h4> </div> <?php $date = filemtime($current_path . $img); ?> <input type="hidden" class="date" value="<?php echo $date; ?> "/> <input type="hidden" class="size" value="<?php echo $size; ?> "/> <input type="hidden" class="extension" value="<?php echo $extension_lower; ?> "/> <input type="hidden" class="name" value=""/> <div class="file-date"><?php echo date(lang_Date_type, $date); ?> </div> <div class="file-size"><?php echo makeSize($size); ?> </div> <div class='img-dimension'><?php if ($is_img) { echo $img_width . "x" . $img_height; } ?> </div> <div class='file-extension'><?php echo Tools::safeOutput($extension_lower); ?> </div>
?> </p></div> <div class="col s1"><p id="pontuacao_producao_<?php echo $producao['id_producao']; ?> " class="truncate"><?php echo $producao['pontuacao_producao']; ?> </p></div> <div class="col s1"> <p id="documento_producao_<?php echo $producao['id_producao']; ?> " class="truncate"> <?php echo isset($producao['documento_producao']) ? '<a target="_blank" href="' . uploads_url() . '/' . $producao['documento_producao'] . '">Comprovante</a>' : 'Pendente'; ?> </p> </div> </div> <div class="collapsible-body col s12 blue lighten-5"> <form id="<?php echo $formid; ?> " class="editProducao"> <div class="input-field col s12" style="margin-top: 3em;"> <input id="nome_producao" name="nome_producao" type="text" value="<?php echo $producao['nome_producao']; ?> " class="autoupdate-producao validate"> <label for="nome_producao">Alias</label>
public function process($url, $width = null, $height = null, $crop = null, $single = true, $upscale = false) { if (!$url || !$width && !$height) { return false; } $upload_dir = UniteFunctionsWPRev::getUrlUploads(); $upload_url = uploads_url(); $http_prefix = "http://"; $https_prefix = "https://"; if (!strncmp($url, $https_prefix, strlen($https_prefix))) { $upload_url = str_replace($http_prefix, $https_prefix, $upload_url); } elseif (!strncmp($url, $http_prefix, strlen($http_prefix))) { $upload_url = str_replace($https_prefix, $http_prefix, $upload_url); } if (false === strpos($url, $upload_url)) { return false; } $rel_path = str_replace($upload_url, '', $url); $img_path = $upload_dir . $rel_path; if (!file_exists($img_path) or !getimagesize($img_path)) { return false; } $info = pathinfo($img_path); $ext = $info['extension']; list($orig_w, $orig_h) = getimagesize($img_path); $dims = image_resize_dimensions($orig_w, $orig_h, $width, $height, $crop); $dst_w = $dims[4]; $dst_h = $dims[5]; if (!$dims && (null === $height && $orig_w == $width xor null === $width && $orig_h == $height xor $height == $orig_h && $width == $orig_w)) { $img_url = $url; $dst_w = $orig_w; $dst_h = $orig_h; } else { $suffix = "{$dst_w}x{$dst_h}"; $dst_rel_path = str_replace('.' . $ext, '', $rel_path); $destfilename = "{$upload_dir}{$dst_rel_path}-{$suffix}.{$ext}"; if (!$dims || true == $crop && false == $upscale && ($dst_w < $width || $dst_h < $height)) { return false; } elseif (file_exists($destfilename) && getimagesize($destfilename)) { $img_url = "{$upload_url}{$dst_rel_path}-{$suffix}.{$ext}"; } else { $editor = wp_get_image_editor($img_path); if (is_wp_error($editor) || is_wp_error($editor->resize($width, $height, $crop))) { return false; } $resized_file = $editor->save(); if (!is_wp_error($resized_file)) { $resized_rel_path = str_replace($upload_dir, '', $resized_file['path']); $img_url = $upload_url . $resized_rel_path; } else { return false; } } } if (true === $upscale) { remove_filter('image_resize_dimensions', array($this, 'aq_upscale')); } if ($single) { $image = $img_url; } else { $image = array(0 => $img_url, 1 => $dst_w, 2 => $dst_h); } return $image; }
include_once 'config/config.php'; $iso = ''; if (!defined('ABSPATH')) { define('ABSPATH', dirname(__FILE__)); } $up_media_url = _MODULE_DIR_ . "revsliderprestashop/views/"; $plugins_url = _MODULE_DIR_ . "revsliderprestashop/"; /* $views_urls = admin_url('?view=dialog'); $upload_urls = admin_url('?view=upload');*/ $views_urls = controller_upload_url('&view=dialog'); $upload_urls = controller_upload_url('&view=upload'); $ajax_calls_url = $up_media_url . "ajax_calls.php"; $hash = Tools::encrypt(GlobalsRevSlider::MODULE_NAME); $tablename = _DB_PREFIX_ . 'revslider_attachment_images'; $url = uploads_url(); // $db_results = Db::getInstance()->executeS("SELECT * FROM {$tablename}"); $results = array(); // foreach($db_results as $dres){ // $results[$dres['ID']] = $dres['file_name']; // } $results = UniteBaseAdminClassRev::get_uploaded_files_result(); $_SESSION["verify"] = "RESPONSIVEfilemanager"; if (isset($_POST['submit'])) { include $upload_urls; } else { include 'include/utils.php'; if (isset($_GET['fldr']) && !empty($_GET['fldr']) && preg_match('/\\.{1,2}[\\/|\\\\]/', urldecode($_GET['fldr'])) === 0) { $subdir = urldecode(trim($_GET['fldr'], '/') . '/'); } else { $subdir = '';
public static function import_media($file_url) { $folder = uploads_url(); $file_urls = explode('#', $file_url); $randnum = rand(00, 9999999); $filename = basename($file_urls[1]); $filename = "{$randnum}_{$filename}"; if ($fp = fopen($file_url, "r")) { fclose($fp); return self::import_media_img($file_url, $folder, $filename); } return false; }
<img src="<?php echo uploads_url() . 'vendors/logos/' . $details->logo; ?> " width="300" height="160" /> </div> </div> <span class="help-block"></span> </div> <div class="form-group"> <label class="col-md-3 col-xs-12 control-label">Featured Image</label> <div class="col-md-6 col-xs-12"> <img src="<?php echo uploads_url() . 'vendors/images/' . $details->featured_img; ?> " width="300" height="160" /> </div> </div> <span class="help-block"></span> </div> <!-- <div class="form-group"> <label class="col-md-3 col-xs-12 control-label">Checkbox</label> <div class="col-md-6 col-xs-12"> <label class="check"><input type="checkbox" class="icheckbox" checked="checked"/> Checkbox title</label>
echo site_url('dang-xuat'); ?> ">Thoát</a></li> <li><a href="<?php echo site_url('tai-khoan'); ?> ">Tài Khoản</a></li> </ul> </li> <li class="float-right avatar-icon"> <a href="<?php echo site_url('tai-khoan'); ?> "> <img src="<?php echo uploads_url() . 'user/' . $this->session->userdata(LABEL_LOGIN)['avatar']; ?> "> </a> </li> <?php } ?> <li class="drop-down-menu float-right"> <a href="javascript:void(0)" class="click-dropdown">Đăng Tin</a> <ul> <li class="href-none-after"><a href="<?php echo site_url('buon-ban'); ?> ">Phương Tiện Học Tập</a></li> <li class="href-none-after"><a href="<?php
margin-bottom: 10px; } </style> <!-- Home start --> <section id="home" class="home-parallax" style="margin-top:4%;"> <div class="row"> <div class="col-md-12"> <h2 class="vendor-title"><?php echo ucfirst($details->catering_name); ?> </h2> <img src="<?php echo uploads_url(); ?> vendors/images/<?php echo $details->featured_img; ?> " width=100% class = "img-responsive" data-captioner-start-closed = "false" role="caption" data-captioner-type="animated" title="<?php echo ucfirst($details->name); ?> " alt="
} ?> </div> <div class="event-wrap events-ind clearfix"> <?php foreach ($events_home_data as $k => $event) { ?> <?php if (!$event->sponsored) { ?> <div class="col-md-4"> <img src="<?php echo uploads_url() . 'events/thumbs/' . $event->thumb; ?> "> <div style="text-align:center"> <h4><?php echo anchor($event->eventSlug, $event->eventName); ?> </h4> <h6><?php echo $event->venue; ?> , <?php echo $event->cityname; ?> </h6> <h6><?php