function addToQueue($session_code, $track) { global $connection; $query = "INSERT INTO Tracks (session_code,spotify_uri,artist,album,title,image,length) VALUES ('" . strtoupper($session_code) . "','" . mysqli_real_escape_string($connection, $track->getURI()) . "','" . mysqli_real_escape_string($connection, $track->getArtistAsString()) . "','" . mysqli_real_escape_string($connection, $track->getAlbum()) . "','" . mysqli_real_escape_string($connection, $track->getTitle()) . "','" . mysqli_real_escape_string($connection, getImage($track->getURI())) . "'," . (int) $track->getLength() . ")"; mysqli_query($connection, $query); return true; }
function doImage($source, $width, $height, $timestamp = true, $name) { $origImage = getImage($source, $width, $height); if (is_null($origImage)) { die("Rendering Error"); } $image = resize($origImage, $width, $height); $thumb = resize($origImage, 100, 75); if ($timestamp) { $image = addTimeStamp($image); } $compression = 75; $filepath = "screenshots/"; $filename = $filepath . $name . "_" . time() . ".jpg"; $filename_thumb = $filepath . $name . "_" . time() . "_thumb.jpg"; //main image imagejpeg($image, $filename, $compression); chmod($filename, 0600); imagedestroy($image); //thumb image imagejpeg($thumb, $filename_thumb, $compression); chmod($filename_thumb, 0600); imagedestroy($thumb); echo "OK"; }
function getPhotos($category, $posts) { $is_highlights = !is_array($posts); $data = !$is_highlights ? $posts : []; $url = 'http://' . $_SERVER['SERVER_NAME'] . '/' . 'cms/wp-json/posts?filter[posts_per_page]=-1&filter[order]=desc&filter[orderby]=post_date' . ($is_highlights ? '&filter[category_name]=destaque' : null); $response = \Httpful\Request::get($url)->send(); $catId = get_cat_ID($category); foreach ($response->body as $key => $post) { $image_src = getImage($post->content); $attachment_id = pn_get_attachment_id_from_url($image_src); $image_large_src = wp_get_attachment_image_src($attachment_id, 'large'); if (!$is_highlights && !isHighgligthCategory($catId, $post->terms->category)) { if ($image_src) { array_push($data, array('id' => $post->ID, 'title' => $post->title, 'image_src' => getImage($post->content), 'image_large_src' => $image_large_src[0])); } } else { if ($is_highlights && isHighgligthCategory($catId, $post->terms->category)) { if ($image_src) { array_push($data, array('id' => $post->ID, 'title' => $post->title, 'image_src' => getImage($post->content), 'image_large_src' => $image_large_src[0])); } } } } return $data; }
function printResultWithX($result) { $rowNum = $result->num_rows; echo '<h1>' . $rowNum . ' cookbooks were found:</h1>'; while ($rowNum > 0) { echo '<div class="recipe-preview-row">'; for ($i = 0; $i < 3; $i++) { if ($row = $result->fetch_assoc()) { if (isVisible($row["cookbook_id"])) { $path = getImage($row["cookbook_id"]); echo '<a href="view-cookbook.php?cookbook_id=' . $row["cookbook_id"] . '"> <div class="recipe-preview-row-icon"> <img class="thumbnail" src="' . $path . '"> <p>' . $row["cb_title"] . '</p> </div> </a> <a href="delete.php?cookbook_id=' . $row["cookbook_id"] . '" onclick="return confirm(\'Are you sure you want to delete ' . $row["cb_title"] . '\');"> <img class="x" src="images/x.png"></a>'; } } $rowNum = $rowNum - 1; } echo '</div>'; } }
public function __construct($params = null) { parent::__construct(); if (isset($params['utility'])) { $this->utility = $params['utility']; } else { $this->utility = new Utility(); } if (isset($params['url'])) { $this->url = $params['url']; } else { $this->url = new Url(); } if (isset($params['image'])) { $this->image = $params['image']; } else { $this->image = getImage(); } if (isset($params['user'])) { $this->user = $params['user']; } else { $this->user = new User(); } if (isset($params['config'])) { $this->config = $params['config']; } }
/** * getFlag() * * @param string $flag * @param string $type * @return string Either the flag or default flag if none exists */ function getFlag($flag, $type = 'url') { $image = getImage('/flags/' . strtolower($flag)); if ($image) { return $image[$type]; } else { return IMAGE_PATH . '/flags/0.gif'; } }
function _moduleContent(&$smarty, $module_name) { include_once "libs/paloSantoGrid.class.php"; include_once "libs/paloSantoForm.class.php"; include_once "libs/paloSantoOrganization.class.php"; //folder path for custom templates $local_templates_dir = getWebDirModule($module_name); //conexion resource $pDB = new paloDB($arrConf['elastix_dsn']["elastix"]); global $arrCredentials; $action = getAction(); $content = ""; switch ($action) { case "new_user": $content = viewFormUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials); break; case "view": $content = viewFormUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials); break; case "edit": $content = viewFormUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials); break; case "save_new": $content = saveNewUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials); break; case "save_edit": $content = saveEditUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials); break; case "delete": $content = deleteUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials); break; case "getGroups": $content = getGroups($pDB, $arrCredentials); break; case "getImage": $content = getImage($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials); break; case "reloadAasterisk": $content = reloadAasterisk($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials); break; case "reconstruct_mailbox": $content = reconstruct_mailbox($pDB, $arrConf, $arrCredentials); break; /*case "changes_email_quota": $content = changes_email_quota($smarty, $module_name, $pDB, $arrConf, $arrCredentials); break;*/ /*case "changes_email_quota": $content = changes_email_quota($smarty, $module_name, $pDB, $arrConf, $arrCredentials); break;*/ default: // report $content = reportUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials); break; } return $content; }
function getImage($conn) { $sql = "SELECT FLOOR(MAX(img.ID) * RAND()) AS ID\n FROM IMAGENS img\n INNER JOIN SITES s ON img.SITE_ID = s.ID\n WHERE s.TIPO <> 'VID' AND s.ORIENTACAO = 'STR'"; $stmt = $conn->query($sql); $row = $stmt->fetch(PDO::FETCH_ASSOC); $sql = "SELECT i.CAMINHO_IMAGEM AS IMG, s.TIPO AS TIPO\n FROM IMAGENS i\n INNER JOIN SITES s ON i.SITE_ID = s.ID\n WHERE i.ID = " . $row["ID"]; $stmt = $conn->query($sql); $row = $stmt->fetch(PDO::FETCH_ASSOC); if (empty($row) || empty($row["IMG"])) { $row = getImage($conn); } return $row; }
function displayDealerHand($state, $upcard, $dealerHand, $dealerScore) { $html = ''; if (State::isActive($state)) { $html .= getImage($upcard); } else { $html .= getImage($upCard); $cards = $dealerHand->getCards(); foreach ($cards as $card) { $html .= getImage($card); } $html .= '<br><br>'; $html .= 'The dealer has: ' . $dealerScore; } return $html; }
function jsonItemData($classe = 0, $start = 0, $count = 10) { $add = ""; if ($classe != 0) { $add = "WHERE `Require_Job`='{$classe}'"; } $query = "SELECT * FROM `iteminfo` {$add} ORDER BY `ID` LIMIT {$start}, {$count};"; $data = queryDB($query); if ($data != null) { for ($i = 0; $i < $count; $i++) { $data[$i]['Icon'] = getImage($data[$i]['Icon']); } header('Content-type: application/json; charset=utf8'); echo json_encode($data); } }
function createNotification($ids, $msgType) { //Set initial vars $conn = $GLOBALS['conn']; $curr = utf8_encode("£"); $path = $_SERVER['HTTP_HOST'] . "/ProjectDing"; $num_orders = count(array_unique($ids)); $order_ids = implode($ids, ","); $orders_total = 0; $other_items_qty = -1; $s = null; //Execute query $sql = "SELECT * from pding_transactions WHERE order_id IN({$order_ids}) ORDER BY subtotal ASC"; $result = mysqli_query($conn, $sql); //Incremental vars while ($row = mysqli_fetch_assoc($result)) { //Sum the subtotals $orders_total += $row['subtotal']; //Increment additional items qty $other_items_qty++; //(Lazy) - setting main item vars each time because last row will be most expensive $main_item_name = $row['product_name']; $main_item_qty = $row['quantity']; $main_item_sku = $row['product_code']; } //More vars if ($other_items_qty > 1) { $s = "s"; } $main_item_image = getImage($main_item_sku); //Possible notification types $msgs = array(0 => array("desc" => "One order for one item only", "title" => $num_orders . " new web order for " . $curr . $orders_total, "body" => "New order received for " . $main_item_qty . "x " . $main_item_name . ". Click to view order details.", "action" => $path . "/view_order.php?ids=" . $order_ids, "image" => $main_item_image), 1 => array("desc" => "One order for multiple items", "title" => $num_orders . " new web order for " . $curr . $orders_total, "body" => "New order received for " . $main_item_qty . "x " . $main_item_name . " and " . $other_items_qty . " other item{$s}. Click to view order details.", "action" => $path . "/view_order.php?ids=" . $order_ids, "image" => $main_item_image), 2 => array("desc" => "Multiple orders", "title" => $num_orders . " new web orders received totalling " . $curr . $orders_total, "body" => "Click here to view the details of these orders.", "action" => $path . "/view_order.php?ids=" . $order_ids, "image" => $main_item_image)); $notification = $msgs[$msgType]; echo "<pre>"; print_r($notification); echo "</pre>"; //Insert notification into table $sql = "INSERT INTO pding_notifications VALUES ('', '" . mysqli_real_escape_string($conn, $notification['title']) . "', '" . mysqli_real_escape_string($conn, $notification['body']) . "', '" . mysqli_real_escape_string($conn, $notification['action']) . "', '" . mysqli_real_escape_string($conn, $notification['image']) . "', NOW())"; echo $sql; mysqli_query($conn, $sql); //Mark transactions as "sent" foreach ($ids as $id) { $sql = "UPDATE pding_transactions SET notification_queued=1 WHERE order_id = {$id}"; mysqli_query($conn, $sql); } }
function doImage($source, $width, $height, $timestamp = true) { $image = getImage($source, $width, $height); if (is_null($image)) { die("Rendering Error"); } //no cache header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past header('Content-Type: image/jpeg'); $image = resize($image, $width, $height); if ($timestamp) { $image = addTimeStamp($image); } imagejpeg($image); imagedestroy($image); }
function draw($result, $numitems, $width = 100, $align = 'center') { global $g_options, $game, $realgame, $db; $numpages = ceil($numitems / $this->numperpage); ?> <div class="subblock" style="width:<?php echo $width; ?> %;text-align:<?php echo $align; ?> ;"> <table class="data-table"> <tr class="data-table-head"> <?php $totalwidth = 0; if ($this->showranking) { $totalwidth += 5; echo "<td style=\"width:5%;text-align=:right;\" class=\"fSmall\">Rank</td>\n"; } foreach ($this->columns as $col) { $totalwidth += $col->width; echo "<td style=\"width:{$col->width}%;text-align:{$col->align};\" class=\"fSmall\">"; if ($col->sort != 'no') { echo getSortArrow($this->sort, $this->sortorder, $col->name, $col->title, $this->var_sort, $this->var_sortorder, $this->sorthash, $this->ajax); } else { echo $col->title; } echo "</td>\n"; } ?> </tr> <?php if ($totalwidth != 100) { error("Warning: Column widths do not add to 100%! (={$totalwidth}%)", false); } $rank = ($this->page - 1) * $this->numperpage + 1; while ($rowdata = $db->fetch_array($result)) { echo "<tr>\n"; $i = 0; if ($this->showranking) { $c = $i % 2 + 1; $i++; echo "<td style=\"text-align:right;\" class=\"bg{$c}\">{$rank}</td>\n"; } foreach ($this->columns as $col) { $c = $i % 2 + 1; $class = ""; $cellbody = ''; $colval = $rowdata[$col->name]; if ($col->align != 'left') { $colalign = " style=\"text-align:{$col->align};\""; } else { $colalign = ""; } $class = "bg{$c}"; if ($col->icon || $col->flag) { $cellbody = ' '; } if ($col->link) { if (strpos($col->link, 'javascript:') === false) { $link = str_ireplace('%k', urlencode($rowdata[$this->keycol]), $col->link); $cellbody .= "<a href=\"" . $g_options['scripturl'] . "?{$link}\">"; } else { $col->link = str_replace('\\\\', '', $col->link); $link = str_ireplace('%k', $rowdata[$this->keycol], $col->link); $cellbody .= "<a href=\"{$link}\">"; } } if ($col->icon) { $image = getImage("/{$col->icon}"); if ($image) { $cellbody .= '<img src="' . $image['url'] . "\" class=\"tableicon\" alt=\"{$col->icon}\" />"; } } elseif ($col->flag) { #$link = ereg_replace("%f", $col->link); if ($g_options['countrydata'] == 1) { if ($rowdata['flag'] == '') { $rowdata['flag'] = '0'; $alt_text = 'No Country'; } else { $alt_text = ucfirst(strtolower($rowdata['country'])); } $cellbody .= '<img src="' . getFlag($rowdata['flag']) . "\" class=\"tableicon\" alt=\"{$alt_text}\" title=\"{$alt_text}\" />"; } else { $col->flag = 'player'; $cellbody .= '<img src="' . IMAGE_PATH . "/{$col->flag}.gif\" class=\"tableicon\" alt=\"{$col->icon}.gif\" />"; } } switch ($col->type) { case 'timestamp': $cellbody = timestamp_to_str($colval); break; case 'roleimg': $image = getImage("/games/{$game}/roles/" . strtolower($colval)); // check if image exists for game -- otherwise check realgame if ($image) { $cellbody .= '<img src="' . $image['url'] . '" alt="' . $col->fname[$colval] . '" title="' . $col->fname[$colval] . '" /> '; } elseif ($image = getImage("/games/{$realgame}/roles/" . strtolower($colval))) { $cellbody .= '<img src="' . $image['url'] . '" alt="' . $col->fname[$colval] . '" title="' . $col->fname[$colval] . '" /> '; } if ($col->fname[$colval] != '') { $cellbody .= '<b>' . $col->fname[$colval] . '</b>'; } else { $cellbody .= '<b>' . ucwords(preg_replace('/_/', ' ', $colval)) . '</b>'; } break; case 'weaponimg': // Check if game has the image -- if not, failback to real game. If not, no image. $image = getImage("/games/{$realgame}/weapons/" . strtolower($colval)); if ($image) { $cellbody .= '<img src="' . $image['url'] . '" ' . $image['size'] . ' alt="' . $col->fname[$colval] . '" title="' . $col->fname[$colval] . '" />'; } elseif ($image = getImage("/games/{$realgame}/weapons/" . strtolower($colval))) { $cellbody .= '<img src="' . $image['url'] . '" ' . $image['size'] . ' alt="' . $col->fname[$colval] . '" title="' . $col->fname[$colval] . '" />'; } else { $cellbody .= '<b>' . ($col->fname[$colval] != '' ? $col->fname[$colval] : ucwords(preg_replace('/_/', ' ', $colval))) . '</b>'; } break; case 'bargraph': $cellbody .= '<img src="' . IMAGE_PATH . '/bar'; if ($colval > 40) { $cellbody .= '6'; } elseif ($colval > 30) { $cellbody .= '5'; } elseif ($colval > 20) { $cellbody .= '4'; } elseif ($colval > 10) { $cellbody .= '3'; } elseif ($colval > 5) { $cellbody .= '2'; } else { $cellbody .= '1'; } $cellbody .= '.gif" style="width:'; if ($colval < 1) { $cellbody .= '1'; } elseif ($colval > 100) { $cellbody .= '100'; } else { $cellbody .= sprintf("%d", $colval + 0.5); } $cellbody .= "%;\" class=\"bargraph\" alt=\"{$colval}%\" />"; break; case 'heatmap': $heatmap = getImage("/games/{$game}/heatmaps/{$colval}-kill"); $heatmapthumb = getImage("/games/{$game}/heatmaps/{$colval}-kill-thumb"); if ($heatmap) { $cellbody .= "<span style=\"text-align: center;\"><a href=\"" . $heatmap['url'] . "\" rel=\"boxed\"><img width=\"20\" height=\"16\" src=\"" . $heatmapthumb['url'] . "\" /></a></span>"; } else { $cellbody .= " "; } break; default: if ($this->showranking && $rank == 1 && $i == 1) { $cellbody .= '<b>'; } if (is_numeric($colval) && $colval >= 1000) { $colval = number_format($colval); } $colval = nl2br(htmlspecialchars($colval, ENT_COMPAT)); if ($col->embedlink == 'yes') { $colval = preg_replace(array('/%A%([^ %]+)%/', '/%\\/A%/'), array("<a href=\"\$1\">", '</a>'), $colval); } $cellbody .= $colval; if ($this->showranking && $rank == 1 && $i == 1) { $cellbody .= '</b>'; } break; } if ($col->link) { $cellbody .= '</a>'; } if ($col->append) { $cellbody .= $col->append; } if ($col->skill_change) { if ($rowdata['last_skill_change'] == '') { $rowdata['last_skill_change'] = 0; } if ($rowdata['last_skill_change'] == 0) { $cellbody .= " <img src=\"" . IMAGE_PATH . "/t1.gif\" alt=\"" . $rowdata['last_skill_change'] . " Points\" />"; } elseif ($rowdata['last_skill_change'] > 0) { $cellbody .= " <img src=\"" . IMAGE_PATH . "/t0.gif\" alt=\"" . $rowdata['last_skill_change'] . " Points\" />"; } elseif ($rowdata['last_skill_change'] < 0) { $cellbody .= " <img src=\"" . IMAGE_PATH . "/t2.gif\" alt=\"" . $rowdata['last_skill_change'] . " Points\" />"; } } echo "<td{$colalign} class=\"{$class}\">" . $cellbody . "</td>\n"; $i++; } echo "</tr>\n\n"; $rank++; } ?> </table> </div><br /><br /> <?php if ($numpages > 1) { ?> <div class="subblock" style="text-align:right;"> <span style="text-align:right;"> <?php echo 'Page: '; $start = $this->page - intval($this->maxpagenumbers / 2); if ($start < 1) { $start = 1; } $end = $numpages; if ($end > $this->maxpagenumbers + $start - 1) { $end = $this->maxpagenumbers + $start - 1; } if ($end - $start + 1 < $this->maxpagenumbers) { $start = $end - $this->maxpagenumbers + 1; } if ($start < 1) { $start = 1; } if ($start > 1) { if ($start > 2) { $this->_echoPageNumber(1, "First page", "", " ..."); } else { $this->_echoPageNumber(1, 1); } } for ($i = $start; $i <= $end; $i++) { if ($i == $this->page) { echo "<b>{$i}</b> "; } else { $this->_echoPageNumber($i, $i); } if ($i == $end && $i < $numpages) { if ($i < $numpages - 1) { $this->_echoPageNumber($numpages, "Last page", "... "); } else { $this->_echoPageNumber($numpages, 10); } } } ?> </span> </div><br /><br /> <?php } }
function parseFolder($path) { $covers = array('Folder.jpg', 'folder.jpg', 'Folder.png', 'folder.png', 'Cover.jpg', 'cover.jpg', 'Cover.png', 'cover.png'); // default cover files foreach ($covers as $file) { getImage($path . $file); } // all (other) files foreach (glob($path . '*') as $file) { if (is_file($file)) { getImage($file); } } }
function draw($result, $numitems, $width = 100, $align = "center") { global $g_options, $game; $numpages = ceil($numitems / $this->numperpage); ?> <table width="<?php echo $width; ?> %" align="<?php echo $align; ?> " border="0" cellspacing="0" cellpadding="0" bgcolor="<?php echo $g_options["table_border"]; ?> "> <tr> <td><table width="100%" border="0" cellspacing="1" cellpadding="4"> <tr valign="bottom" bgcolor="<?php echo $g_options["table_head_bgcolor"]; ?> "> <?php $totalwidth = 0; if ($this->showranking) { $totalwidth += 5; echo "<td width=\"5%\" align=\"right\">" . "<font color=\"" . $g_options["table_head_text"] . "\">" . $g_options["font_small"] . l("Rank") . "</font>" . $g_options["fontend_small"] . "</td>\n"; } foreach ($this->columns as $col) { $totalwidth += $col->width; echo "<td width=\"" . $col->width . "%\" align=\"{$col->align}\">"; if ($col->translate) { $col->title = l($col->title); } if ($col->sort != "no") { echo getSortArrow($this->sort, $this->sortorder, $col->name, $col->title, $this->var_sort, $this->var_sortorder, $this->sorthash); } else { echo $g_options["font_small"]; echo "<font color=\"" . $g_options["table_head_text"] . "\">"; echo $col->title; echo "</font>"; echo $g_options["fontend_small"]; } echo "</td>\n"; } ?> </tr> <?php if ($totalwidth != 100) { error("Warning: Column widths do not add to 100%! (={$totalwidth}%)", false); } $rank = ($this->page - 1) * $this->numperpage + 1; while ($rowdata = mysql_fetch_assoc($result)) { echo "<tr>\n"; $i = 0; if ($this->showranking) { $c = $i % 2 + 1; $i++; echo "<td align=\"right\" bgcolor=\"" . $g_options["table_bgcolor{$c}"] . "\">" . $g_options["font_normal"] . "{$rank}." . $g_options["fontend_normal"] . "</td>\n"; } foreach ($this->columns as $col) { $c = $i % 2 + 1; $cellbody = ""; $colval = $rowdata[$col->name]; if ($col->align != "left") { $colalign = " align=\"{$col->align}\""; } else { $colalign = ""; } $bgcolor = $g_options["table_bgcolor{$c}"]; if ($col->icon) { $cellbody = " "; } // this needs to be changed. // remove table class and do it for every table manually // this way to do not have those if masages if ($col->name == "skill") { // check if we have a top or flop if (empty($rowdata['oldSkill'])) { $rowdata['oldSkill'] = $rowdata['skill']; } if ($rowdata['skill'] > $rowdata['oldSkill']) { $cellbody .= "<img src=\"" . $g_options["imgdir"] . "/skill_up.gif\" width='16' height='16' hspace='4' " . "border='0' align=\"middle\" alt=\"{$col->icon}.gif\">"; } elseif ($rowdata['skill'] < $rowdata['oldSkill']) { $cellbody .= "<img src=\"" . $g_options["imgdir"] . "/skill_down.gif\" width='16' height='16' hspace='4' " . "border='0' align=\"middle\" alt=\"{$col->icon}.gif\">"; } else { $cellbody .= "<img src=\"" . $g_options["imgdir"] . "/skill_stay.gif\" width='16' height='16' hspace='4' " . "border='0' align=\"middle\" alt=\"{$col->icon}.gif\">"; } } if ($col->link) { $link = ereg_replace("%k", urlencode($rowdata[$this->keycol]), $col->link); $cellbody .= "<a href=\"index.php?{$link}\">"; } if ($col->icon) { $pic = $col->icon . ".gif"; if ($col->icon == "player") { if (isset($rowdata['active']) && $rowdata['active'] == "0") { $pic = "player_inactive.gif"; } } $cellbody .= "<img src='" . $g_options["imgdir"] . $pic . "' width='16' height='16' hspace='4' " . "border='0' align=\"middle\" alt=\"{$col->icon}\">"; } switch ($col->type) { case "weaponimg": $colval = strtolower(ereg_replace("[ \r\n\t]*", "", $colval)); $bgcolor = $g_options["table_wpnbgcolor"]; $image = getImage("/weapons/{$game}/{$colval}"); // check if image exists if ($image) { $cellbody .= "<img src=\"" . $image["url"] . "\" " . $image["size"] . " border='0' title='" . $rowdata['name'] . "' alt=\"" . $rowdata['name'] . "\">"; } else { $cellbody .= $g_options["font_small"]; $cellbody .= "<font color=\"#FFFFFF\" class=\"weapon\"><b>"; $cellbody .= strToUpper($colval); $cellbody .= "</b></font>"; $cellbody .= $g_options["fontend_small"]; } break; case "bargraph": $cellbody .= "<img src=\"" . $g_options["imgdir"] . "/bar"; if ($colval > 40) { $cellbody .= "6"; } elseif ($colval > 30) { $cellbody .= "5"; } elseif ($colval > 20) { $cellbody .= "4"; } elseif ($colval > 10) { $cellbody .= "3"; } elseif ($colval > 5) { $cellbody .= "2"; } else { $cellbody .= "1"; } $cellbody .= ".gif\" width=\""; if ($colval < 1) { $cellbody .= "1%"; } elseif ($colval > 100) { $cellbody .= "100%"; } else { $cellbody .= sprintf("%d%%", $colval + 0.5); } $cellbody .= "\" height=10 border='0' alt=\"{$colval}%\">"; break; case 'roleimg': $cellbody .= $colval; $rowdata['rolecode'] = str_replace('#', '', $rowdata['rolecode']); if (file_exists($g_options["imgdir"] . '/roles/' . $game . '/' . $rowdata['rolecode'] . '.png')) { $cellbody .= '<img src="' . $g_options["imgdir"] . '/roles/' . $game . '/' . $rowdata['rolecode'] . '.png" hspace="10" border="0" align="middle" alt="' . $rowdata['rolecode'] . '">'; } break; default: if ($this->showranking && $rank == 1 && $i == 1) { $cellbody .= "<b>"; } #$colval = nl2br(htmlentities($colval, ENT_COMPAT, "UTF-8")); $colval = nl2br(ereg_replace(" ", " ", htmlspecialchars($colval))); if ($col->embedlink == "yes") { $colval = ereg_replace("%A%([^ %]+)%", "<a href=\"\\1\">", $colval); $colval = ereg_replace("%/A%", "</a>", $colval); } $cellbody .= $colval; if ($this->showranking && $rank == 1 && $i == 1) { $cellbody .= "</b>"; } break; } if (!empty($col->link)) { $cellbody .= "</a>"; } if (!empty($col->append)) { $cellbody .= $col->append; } echo "<td{$colalign} bgcolor=\"{$bgcolor}\">" . $g_options["font_normal"] . $cellbody . $g_options["fontend_normal"] . "</td>\n"; $i++; } echo "</tr>\n\n"; $rank++; } ?> </table></td> </tr> </table> <?php if ($numpages > 1) { ?> <p> <table width="<?php echo $width; ?> %" align="<?php echo $align; ?> " border="0" cellspacing="0" cellpadding="0"> <tr valign="top"> <td width="100%" align="right"><?php echo $g_options["font_normal"]; echo "Page: "; $start = $this->page - intval($this->maxpagenumbers / 2); if ($start < 1) { $start = 1; } $end = $numpages; if ($end > $this->maxpagenumbers + $start - 1) { $end = $this->maxpagenumbers + $start - 1; } if ($end - $start + 1 < $this->maxpagenumbers) { $start = $end - $this->maxpagenumbers + 1; } if ($start < 1) { $start = 1; } if ($start > 1) { if ($start > 2) { $this->_echoPageNumber(1, "First page", "", " ..."); } else { $this->_echoPageNumber(1, 1); } } for ($i = $start; $i <= $end; $i++) { if ($i == $this->page) { echo "<b>{$i}</b> "; } else { $this->_echoPageNumber($i, $i); } if ($i == $end && $i < $numpages) { if ($i < $numpages - 1) { $this->_echoPageNumber($numpages, "Last page", "... "); } else { $this->_echoPageNumber($numpages, 10); } } } echo $g_options["fontend_normal"]; ?> </td> </tr> </table><p> <?php } }
<img id="logo" title="ITST J.F.Kennedy" src="imgs/logo.jpg"> <button id="btnCopyright" title="Copyright" > <svg viewBox="0 0 49 49" fill="none" stroke="black"> <circle cx="24" cy="24" r="21.24" stroke-width="5.52"/> <circle cx="24" cy="24" r="10.2" stroke-width="5.52" /> <rect x="30" y="21" fill="#FFFFFF" width="8" height="7" stroke="white" stroke-width="0.5"/> </svg> </button> </nav> </header> <div class="container"> <div class="row"> <div class="col-lg-6"> <section id="sectionInfoDoc"> <?php echo $GLOBALS['risposta']; ?> </section> </div> <div class="col-lg-6"> <section id="sectionImgDoc" > <?php echo getImage($idDocumento); ?> </section> </div> </div> </div> </body> </html>
<?php require_once 'library/utility.php'; require_once 'library/database.php'; global $database; $id = array_get($_GET, 'id'); $width = array_get($_GET, 'width', ''); $height = array_get($_GET, 'height', ''); $format = $width . "x" . $height; // Validate the parameters $formats = array("480x"); if (!is_scalar($id) || !is_scalar($width) || !is_scalar($height)) { die; } if (!in_array($format, $formats)) { die; } $commentFile = $database->getCommentFileByID($id); if (!$commentFile) { die; } $picture = getCommentUploadImagePath($commentFile['uploadfile']); $cached_picture = getCommentUploadImagePath($commentFile['uploadfile'], $width, $height); if (file_exists($cached_picture)) { $image = $cached_picture; } elseif (!file_exists($picture)) { $image = getDefaultImagePath(); } else { $image = getImage($picture, $cached_picture, $width, $height); } serveImage($image);
<li> <div class="g-plus" data-action="share"></div> </li> <?php } ?> <?php if (nc_osc_show_pintrest_share()) { ?> <li> <a href="https://www.pinterest.com/pin/create/button/ ?url=<?php echo getUrl(); ?> &media=<?php echo getImage(); ?> &description=<?php echo osc_esc_html(meta_title()); ?> t" data-pin-do="buttonPin" data-pin-config="above"> <img src="//assets.pinterest.com/images/pidgets/pin_it_button.png" /> </a> </li> <?php } ?> </ul>
<?php require_once './config.php'; $page = new AdminPage(); $tvRage = new TvRage(['Settings' => $page->settings]); $rage = ['id' => '', 'description' => '', 'releasetitle' => '', 'genre' => '', 'rageid' => '', 'country' => '', 'imgdata' => '']; switch (isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view') { case 'submit': if ($_POST["id"] == '') { $tvRage->add($_POST["rageid"], $_POST["releasetitle"], $_POST["description"], $_POST["genre"], $_POST['country'], getImage()); } else { $tvRage->update($_POST["id"], $_POST["rageid"], $_POST["releasetitle"], $_POST["description"], $_POST["genre"], $_POST['country'], getImage()); } if (isset($_POST['from']) && !empty($_POST['from'])) { header("Location:" . $_POST['from']); exit; } header("Location:" . WWW_TOP . "/rage-list.php"); break; case 'view': default: if (isset($_GET["id"])) { $page->title = "Tv Rage Edit"; $rage = $tvRage->getByID($_GET["id"]); } break; } $page->smarty->assign('rage', $rage); $page->title = "Add/Edit TV Rage Show Data"; $page->content = $page->smarty->fetch('rage-edit.tpl'); $page->render();
?> "> <div class="icon"> <i class="fa fa-female"></i> </div> </div> <div class="bottom"> <span>Woman</span> </div> </div> </div> <div class="col-sm-4"> <div class="item text-center"> <div class="top"> <img src="<?php getImage('configuration/teen.jpg'); ?> "> <div class="icon"> <i class="fa fa-child"></i> </div> </div> <div class="bottom"> <span>Teenager</span> </div> </div> </div> </div> </div> </div> </div>
<div class="clear"></div> </div> <div class="row"> <div class="colauto"> <?php echo form_checkbox(array('name' => 'freeCD', 'id' => 'freeCD', 'value' => '1')); ?> </div> <label for='freeCD'>I would like a free CD</label> <div class="clear"></div> </div> <div class="row right" style="height:45px;margin-top:20px;"> <div style="float:left;text-align: left;" id='enqformmsg'></div> <img id='enqprocessbtn' style="display:none;" src="<?php echo getImage('ajax-loader.gif'); ?> " /> <?php echo form_submit(array('class' => 'btn', 'id' => 'enqbtn', 'value' => 'Send !')); ?> <div class="clear"></div> </div> <?php echo form_close(); ?> </div> <div class="clear"></div> </div> <!-- End of content_body --> ?>
<? require_once($_SERVER["DOCUMENT_ROOT"]."/constants.php"); require_once($_SERVER["DOCUMENT_ROOT"]."/../Common/database/db.php"); require_once($_SERVER["DOCUMENT_ROOT"]."/../Common/miscellaneous/images.php"); $params = array(":id" => substr($_SERVER["PATH_INFO"], strpos($_SERVER["PATH_INFO"], "/ID=") + 4)); $sql = "SELECT br_id, br_imagen FROM rrhh.rbr_banners WHERE br_id = :id"; $stmt = DBExecSql($conn, $sql, $params); $row = DBGetQuery($stmt); $img = IMAGES_BANNERS_PATH.$row["BR_ID"]."/".$row["BR_IMAGEN"]; getImage($img, 40, 40, 40); ?>
/** * Humanize Device * * Process the $device array to add/modify elements. * * @param array $device * @return none */ function humanize_device(&$device) { global $config; // Set the HTML class and Tab color for the device based on status if ($device['status'] == '0') { $device['html_row_class'] = "error"; $device['html_tab_colour'] = "#cc0000"; } else { $device['html_row_class'] = ""; /// This one looks too bright and out of place - adama #$device['html_tab_colour'] = "#194BBF"; /// This one matches the logo. changes are not finished, lets see if we can add colour elsewhere. - adama $device['html_tab_colour'] = "#194B7F"; // F*****g dull gay colour, but at least there's a semicolon now - tom // Your mum's a semicolon - adama } if ($device['ignore'] == '1') { $device['html_row_class'] = "warning"; $device['html_tab_colour'] = "#aaaaaa"; if ($device['status'] == '1') { $device['html_row_class'] = ""; $device['html_tab_colour'] = "#009900"; // Why green for ignore? Confusing! } } if ($device['disabled'] == '1') { $device['html_row_class'] = "warning"; $device['html_tab_colour'] = "#aaaaaa"; } $device['icon'] = getImage($device); // Set the name we print for the OS $device['os_text'] = $config['os'][$device['os']]['text']; // Mark this device as being humanized $device['humanized_device'] = TRUE; }
$failedfilename = './images/' . $partcode . '.FAILED.' . $ext; file_put_contents($failedfilename, $im); } } else { // use the cached version, is fresh enough and it's not empty $im = file_get_contents('./images/' . $orimagename); } } else { // We don't have a cached image $im = getImage($libraryUrl); // Cache image locally under two filenames - OR name and Exertis Micro-P Oracle partcode if ($source != 'mp') { file_put_contents('./images/' . $orimagename, $im); $ext = pathinfo('./images/' . $orimagename, PATHINFO_EXTENSION); } else { $ext = 'jpg'; } file_put_contents('./images/' . $partcode . '.' . $ext, $im); } } else { // grab default image from cache if possible, otherwise pull from Icom server $imagefilename = 'product_default.gif'; if (file_exists('./images/' . $imagefilename)) { $im = file_get_contents('./images/' . $imagefilename); } else { $im = getImage('http://www.exertismicro-p.co.uk/ImagesPortal/UK/Catalogue/' . $imagefilename); file_put_contents('./images/' . $imagefilename, $im); } } header("Content-type: image/jpeg"); echo $im;
} elseif ($service['service_status'] == '1') { $serviceLabel = "label-warning"; $serviceLabelOld = 'availability-map-oldview-box-warn'; $serviceState = "warn"; $service_warn_count++; } else { $serviceLabel = "label-danger"; $serviceLabelOld = 'availability-map-oldview-box-down'; $serviceState = "down"; $service_down_count++; } } } if ($config['webui']['availability_map_compact'] == 0) { if ($directpage == "yes") { $deviceIcon = getImage($service); $temp_output[] = ' <a href="' . generate_url(array('page' => 'device', 'tab' => 'services', 'device' => $service['device_id'])) . '" title="' . $service['hostname'] . " - " . $service['service_type'] . " - " . $service['service_desc'] . '"> <div class="service-availability ' . $serviceState . '" style="width:' . $config['webui']['availability_map_direct_tile_size'] . 'px;"> <span class="service-name-label label ' . $serviceLabel . ' label-font-border">' . $service["service_type"] . '</span> <span class="availability-label label ' . $serviceLabel . ' label-font-border">' . $serviceState . '</span> <span class="device-icon">' . $deviceIcon . '</span><br> <span class="small">' . shorthost(ip_to_sysname($service, $service['hostname'])) . '</span> </div> </a>'; } else { $temp_output[] = ' <a href="' . generate_url(array('page' => 'device', 'tab' => 'services', 'device' => $service['device_id'])) . '" title="' . $service['hostname'] . " - " . $service['service_type'] . " - " . $service['service_desc'] . '"> <span class="label ' . $serviceLabel . ' widget-availability label-font-border">' . $service['service_type'] . ' - ' . $serviceState . '</span> </a>'; }
<div class="contacts-colls-l"> <?php if (empty($record['user_facebook_id'])) { ?> <div class="clear" style="margin-bottom:20px;"> <a href="<?php echo base_url('facebook-connect'); ?> " class="btn facebook-btn"><span class="fa fa-facebook"></span> | Connect with Facebook</a> </div> <?php } ?> <div class="clear"> <img src="<?php echo base_url(getImage($record['user_profile_picture'])); ?> " alt="<?php echo stripslashes($record['user_fullname']); ?> " style="width:250px;"/> </div> <div class="clear"> <form action="<?php echo base_url('user/changeProfilePicture'); ?> " method="post" enctype="multipart/form-data" class="img-upload-form"> <input type="hidden" name="next" value="<?php echo current_url(); ?>
?> </div> <div class="col-item-md"> <ul class="list-has-bg-item"> <?php $k = 0; ?> <?php for ($i = ceil(count($arrNoti) / 5); $i < count($arrNoti); $i++) { ?> <li> <a href="<?php echo PIUrl::createUrl('/home/notiDetail', array("alias" => $arrNoti[$i]->alias)); ?> "><img src="<?php echo getImage($arrNoti[$i]->image, 555, 255); ?> " alt="img" width="550" height="253"></a> <div class="content-detail"> <h4><a href="<?php echo PIUrl::createUrl('/home/notiDetail', array("alias" => $arrNoti[$i]->alias)); ?> "><?php echo $arrNoti[$i]->name; ?> </a></h4> <p class="date-post"><?php echo "Đăng ngày " . date("d/m/Y", $arrNoti[$i]->created); ?> </p> </div>
<?php if (!empty($you_may_like_records)) { ?> <div class="h-liked"> <div class="h-liked-lbl">You May Also Like</div> <div class="h-liked-row"> <?php foreach ($you_may_like_records as $ykey => $yvalue) { $post_title = stripslashes($yvalue['post_title']); $post_primary_image = base_url(getImage($yvalue['post_primary_image'])); $post_url = getTripUrl($yvalue['post_url_key']); $post_total_cost = get_currency_symbol($yvalue['post_currency']) . $yvalue['post_total_cost']; ?> <!-- // --> <div class="h-liked-item"> <div class="h-liked-item-i"> <div class="h-liked-item-l"> <a href="<?php echo $post_url; ?> "><img alt="<?php echo $post_title; ?> " src="<?php echo $post_primary_image; ?> "></a> </div> <div class="h-liked-item-c"> <div class="h-liked-item-cb">
</ul> </div> </div> <div id="side"> <div id="statsIsland"> <div id="sectionHeader2"> <p>Live Radio Stats</p> </div> <div id = smallHeader> <h3>Current Radio Show</h3> </div> <div id="currentDJ"> <div id="image"> <img src="<?php getImage(); ?> " alt="<?php getName(); ?> " height="100" width="100"> </div> <div id=showInfo> <b><?php getName(); ?> </b> <ul> <li><a href="<?php getFacebook(); ?>
$query_permitted_device = generate_query_permitted(array('device'), array('device_table' => 'devices')); $results = dbFetchRows("SELECT * FROM `devices`\n WHERE (`hostname` LIKE '%{$queryString}%' OR `location` LIKE '%{$queryString}%') {$query_permitted_device}\n ORDER BY `hostname` LIMIT 8"); if (count($results)) { $found = 1; echo '<li class="nav-header">Devices found: ' . count($results) . '</li>' . PHP_EOL; foreach ($results as $result) { echo '<li class="divider" style="margin: 0px;"></li>' . PHP_EOL; echo '<li style="margin: 0px;">' . PHP_EOL . ' <a href="' . generate_device_url($result) . '">' . PHP_EOL; humanize_device($result); $name = $result['hostname']; if (strlen($name) > 35) { $name = substr($name, 0, 35) . "..."; } $num_ports = dbFetchCell("SELECT COUNT(*) FROM `ports` WHERE device_id = ?", array($result['device_id'])); echo ' <dl style="border-left: 10px solid ' . $result['html_tab_colour'] . '; " class="dl-horizontal dl-search"> <dt style="padding-left: 10px; text-align: center;">' . getImage($result) . '</dt> <dd> <strong>' . highlight_search(htmlentities($name)) . ' <small>' . htmlentities($result['hardware']) . ' | ' . htmlentities($config['os'][$result['os']]['text']) . ' ' . htmlentities($result['version']) . ' <br /> ' . highlight_search(htmlentities($result['location'], 0, 'UTF-8')) . ' | ' . $num_ports . ' ports</small> </strong> </dd> </dl> </a> </li>' . PHP_EOL; } } /// SEARCH PORTS $query_permitted_port = generate_query_permitted(array('port')); $results = dbFetchRows("SELECT * FROM `ports`\n LEFT JOIN `devices` ON `ports`.`device_id` = `devices`.`device_id`\n WHERE (`ifAlias` LIKE '%{$queryString}%' OR `ifDescr` LIKE '%{$queryString}%') {$query_permitted_port}\n ORDER BY `ifDescr` LIMIT 8;"); if (count($results)) {