private function loadSpiele() { $spieltag = new Spieltag($this->spieltag); $uid = $_SESSION['session']->getUserId(); $now = new DateTime('now'); $this->tpl->assign('ende', $spieltag->getTippFrist()); if ($spieltag->getTippFrist() <= $now) { $this->tpl->assign('abgelaufen', true); } else { $this->tpl->assign('abgelaufen', false); } $arr = array(); foreach ($spieltag as $spiel) { /* @var $spiel Spiel */ $arr[$spiel->getId()] = array(); $arr[$spiel->getId()]['spiel'] = $spiel; try { $tipp = new DbTipp($uid, $spiel->getId()); $arr[$spiel->getId()]['tipp'] = $tipp; } catch (TippExistiertNichtException $e) { $arr[$spiel->getId()]['tipp'] = false; } } return $arr; }
public function getData($url_path = '/teams', $extra = NULL, $template_file = NULL, $useCache = true) { $wn_current = ltrim(date('W'), '0'); $wn_previous = ltrim(date('W', strtotime('-7 days')), '0'); $wn_next = ltrim(date('W', strtotime('+7 days')), '0'); $extra = str_replace(array('weeknummer=C', 'weeknummer=P', 'weeknummer=N'), array('weeknummer=' . $wn_current, 'weeknummer=' . $wn_previous, 'weeknummer=' . $wn_next), $extra); $pluginFolder = dirname(__FILE__); if (!isset($template_file) || $template_file == 'template') { $template_file = basename($url_path); if (strpos($extra, 'slider=1') > -1) { // logica voor de slider: 'slider=1' $template_file = $template_file . '_slider'; } } RainTPL::configure('base_url', NULL); RainTPL::configure('tpl_dir', $pluginFolder . '/templates/'); RainTPL::configure('cache_dir', $pluginFolder . '/cache/'); RainTPL::configure('path_replace', false); $tpl = new RainTPL(); // standaard 15 minuten cache $cache_key = sanitize_file_name($url_path . '_' . $extra); if ($useCache && ($cache = $tpl->cache($template_file, $expire_time = 900, $cache_id = $cache_key))) { return $cache; } else { $list = $this->doRequest($url_path, $extra); $tpl->assign('logo', strpos($extra, 'logo=1') > -1); $tpl->assign('thuisonly', strpos($extra, 'thuisonly=1') > -1); $tpl->assign('uitonly', strpos($extra, 'uitonly=1') > -1); if (isset($list) && strpos($extra, 'thuis=1') > -1) { // logica voor thuisclub eerst in overzichten als 'thuis=1' in $extra zit if (strpos($extra, 'uitonly=1') === false) { $thuis = array_filter($list, function ($row) { $length = strlen($this->clubName); return isset($row->ThuisClub) && substr($row->ThuisClub, 0, $length) === $this->clubName; }); if (count($thuis) > 0) { $tpl->assign('thuis', $thuis); } } if (strpos($extra, 'thuisonly=1') === false) { $uit = array_filter($list, function ($row) { $length = strlen($this->clubName); return isset($row->ThuisClub) && substr($row->UitClub, 0, $length) === $this->clubName; }); if (count($uit) > 0) { $tpl->assign('uit', $uit); } } } else { $tpl->assign('data', $list); } return $tpl->draw($template_file, $return_string = true); } }
/** * @static * @param RainTPL $tpl Das zuzuweisende Template * @param $title string Der Titel der Seite */ public static function AssignVars(RainTPL &$tpl, $title = '') { $tpl->assign('login', $_SESSION['session']->getLogin()); $tpl->assign('title', $title === '' ? TIPPSPIEL_CONF_TITLE : $title . ' | ' . TIPPSPIEL_CONF_TITLE); if ($_SESSION['session']->getErrno() !== 0) { $tpl->assign('permlogin_error', true); $tpl->assign('permlogin_msg', $_SESSION['session']->getError()); } else { $tpl->assign('permlogin_error', false); } }
/** * Generiert die Ausgabe nach der im Konstruktor vorgegebenen Regeln * @return string|null String, wenn $display im Konstruktor auf false gesetzt wurde, ansonsten null * und das Template wird direkt ausgegeben */ public function generate() { $spieltagArray = $this->loadFromDatabase(); $this->tpl->assign('spieltage', $spieltagArray); if ($this->display) { StartUp::AssignVars($this->tpl, 'Nächste Tippfristen'); $this->tpl->draw('naechste_fristen', false); } else { return $this->tpl->draw('naechste_fristen', true); } return null; }
public function action_default() { if (isset($_SESSION['user']) == false) { return '<div class="error notice">Sie haben keinen Zugriff</div>'; } $query = $GLOBALS['pdo']->prepare("SELECT * FROM users WHERE userID=:user"); $query->bindValue('user', $_SESSION['user']->id); $query->execute(); $data = $query->fetch(); $tmp = new RainTPL(); $tmp->assign('username', $data['username']); $tmp->assign('email', $data['email']); $tmp->assign('name', $data['name']); return $tmp->draw('profil', true); }
/** * Mostramos el template. */ public function __destruct() { if (is_object($this->template) && !Request::is_ajax() && !Error::$has_error) { DEBUG || $this->template->assign('execution', get_readable_file_size(memory_get_peak_usage() - START_MEMORY)); $this->template->show(); } }
public function loadView($fileName, $data = array(), $return_string = false) { require_once CORE_DIR . '/rain.tpl.class.php'; raintpl::configure("base_url", null); raintpl::configure("tpl_dir", APP_DIR . "/views/"); raintpl::configure("cache_dir", APP_DIR . "/cache/"); $tpl = new RainTPL(); foreach ($data as $key => $val) { $tpl->assign($key, $val); } $tpl->assign("baseURL", baseURL()); if ($return_string) { $html = $tpl->draw($fileName, true); return $html; } else { $tpl->draw($fileName, false); } }
public static function index() { //Get Products Information $data = ProductDataSource::getProductData(); //Initalize Rain TPL templating $view = new RainTPL(); //Assign data to info variable $view->assign('info', $data); //Draw out HTML $view->draw('index'); }
/** * Configuración de la cache del sitio. */ public function action_finalizacion() { // Cargo la vista. $vista = View::factory('finalizacion'); // Seteo el paso como terminado. if ($_SESSION['step'] < 6) { $_SESSION['step'] = 6; } // Seteo el menu. $this->template->assign('steps', $this->steps(6)); // Seteo la vista. $this->template->assign('contenido', $vista->parse()); }
private function generateNaechstenSpieltag() { $db = Database::getDbObject(); $query = "SELECT `spieltag` FROM `spieltage` WHERE `datum` >= CURDATE() LIMIT 1;"; $stmt = $db->prepare($query); $stmt->execute(); $stmt->store_result(); if ($stmt->num_rows > 0) { $id = 0; $stmt->bind_result($id); $stmt->fetch(); $spieltag = new Spieltag($id); $st = array(); foreach ($spieltag as $v) { $st[] = $v; } $this->raintpl->assign('naechsterSpieltag', true); $this->raintpl->assign('naechsteSpiele', $st); $this->raintpl->assign('spieltagNaechst', $id); } else { $this->raintpl->assign('naechsterSpieltag', false); } }
<?php define('IN_GB', TRUE); include "includes/gb.class.php"; include "includes/config.php"; include "language/{$default_language}"; include "includes/rain.tpl.class.php"; include "includes/sanitize.php"; raintpl::configure("base_url", null); raintpl::configure("tpl_dir", "themes/{$theme}/"); raintpl::configure("cache_dir", "cache/"); //initialize a Rain TPL object $tpl = new RainTPL(); $tpl->assign("theme", $theme); $tpl->assign("title", $title); $tpl->assign("headingtitletxt", $headingtitletxt); $tpl->assign("addentrytxt", $addentrytxt); $tpl->assign("viewguestbooktxt", $viewguestbooktxt); $tpl->assign("newpostfirsttxt", $newpostfirsttxt); $tpl->assign("newpostlasttxt", $newpostlasttxt); $tpl->assign("searchlabeltxt", $searchlabeltxt); $tpl->assign("searchbuttontxt", $searchbuttontxt); $tpl->assign("currentyear", date("Y")); $tpl->assign("goback", $goback); $search = sanitize_html_string($_POST['search_term']); $pageNum = sanitize_int($_GET['page'], 0, 9000); // Set Search Variables if ($search == "") { $search = sanitize_html_string($_GET['search_term']); } if ($pageNum == "") {
} } else { exit; } $check_name_ndl = ''; if ($pha_nhom_duoc_ly_id != 0) { $check_name_ndl = new db_query('SELECT phg_name FROM pharma_group WHERE phg_id = "' . $pha_nhom_duoc_ly_id . '" LIMIT 1'); $check_name_ndl = mysqli_fetch_assoc($check_name_ndl->result); $check_name_ndl = $check_name_ndl['phg_name']; } #Phần hiển thị $rainTpl = new RainTPL(); $rainTpl->assign('load_header', $load_header); $rainTpl->assign('module_name', $module_name); $rainTpl->assign('error_msg', print_error_msg($bg_errorMsg)); $html_page = ''; $form = new form(); $html_page .= $form->form_open(); $html_page .= $form->textnote('Các trường có dấu (<span class="form-asterick">*</span>) là bắt buộc nhập'); /** * something here */ $html_page .= $form->text(array('label' => 'Tên thuốc', 'name' => 'pha_name', 'id' => 'pha_name', 'value' => $pha_name, 'require' => 1, 'errorMsg' => 'Bạn chưa nhập tên thuốc', 'placeholder' => 'tên thuốc', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->text(array('label' => 'Tiêu đề thuốc', 'name' => 'pha_title', 'id' => 'pha_title', 'value' => $pha_title, 'require' => 1, 'errorMsg' => 'Bạn chưa nhập tiêu đề thuốc', 'placeholder' => 'tiêu đề thuốc', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->textarea(array('label' => 'Mô tả', 'name' => 'pha_description', 'id' => 'pha_description', 'value' => $pha_description, 'require' => 0, 'placeholder' => 'Mô tả thuốc', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->textarea(array('label' => 'Nội dung', 'name' => 'pha_content', 'id' => 'pha_content', 'value' => $pha_content, 'require' => 0, 'placeholder' => 'Nội dung thuốc', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->text(array('label' => 'Mã đăng ký', 'name' => 'pha_so_dang_ky', 'id' => 'pha_so_dang_ky', 'value' => $pha_so_dang_ky, 'require' => 1, 'placeholder' => 'Mã đăng ký', 'isdatepicker' => 0, 'helpblock' => '')); $html_page .= $form->text(array('label' => 'Dạng bào chế', 'name' => 'pha_dang_bao_che', 'id' => 'pha_dang_bao_che', 'value' => $pha_dang_bao_che, 'require' => 1, 'placeholder' => 'Dạng bào chế', 'isdatepicker' => 0, 'helpblock' => ''));
$image = 'sup_image'; } $db_bill_debit = new db_query('SELECT * FROM ' . $tabel . ' ' . $left_join . ' WHERE ' . $id_column . ' AND ' . $status . ' = 0'); $number_bill = mysqli_num_rows($db_bill_debit->result); while ($data_bill_debit = mysqli_fetch_assoc($db_bill_debit->result)) { $name = $data_bill_debit[$name_key]; $total_debit += $data_bill_debit[$totalmoney]; if ($data_bill_debit[$image] == '') { $avatar = $avatars; } else { $avatar = '<img src="' . get_picture_path($data_bill_debit[$image]) . '"/>'; } } $total_money = '<span class="total_money" data-total_money="' . $total_debit . '">' . number_format($total_debit) . '</span>'; $rainTpl = new RainTPL(); add_more_css('pay_debit.css', $load_header); $rainTpl->assign('load_header', $load_header); $rainTpl->assign('name_object', $name_object); $rainTpl->assign('name', $name); $rainTpl->assign('id', $id); $rainTpl->assign('record_id', $record_id); $rainTpl->assign('type', $type); $rainTpl->assign('avatar', $avatar); $rainTpl->assign('number_bill', $number_bill); $rainTpl->assign('total_debit', $total_debit); $rainTpl->assign('total_money', $total_money); $rainTpl->assign('footer_control', $footer_control); $rainTpl->assign('link_custom_script', '<script type="text/javascript" src="script_debit.js"></script>'); $rainTpl->draw('content_pay_debit');
// Test wether an update should be done if ($config->version !== Config::$versions[count(Config::$versions) - 1]) { require_once INC_DIR . 'update.php'; update($config->version, Config::$versions[count(Config::$versions) - 1]); header('location: index.php'); exit; } // Load Rain TPL require_once INC_DIR . 'rain.tpl.class.php'; require_once INC_DIR . 'rewriting.class.php'; RainTPL::$tpl_dir = RELATIVE_TPL_DIR . $config->template; RainTPL::$base_url = $config->base_url; RewriteEngine::$rewrite_base = RainTPL::$base_url; RainTPL::$rewriteEngine = new RewriteEngine(); $tpl = new RainTPL(); $tpl->assign('start_generation_time', microtime(true), RainTPL::RAINTPL_IGNORE_SANITIZE); $tpl->assign('config', $config); // CSRF protection require_once INC_DIR . 'csrf.php'; // Sharing options require_once INC_DIR . 'share.php'; // Manage users require_once INC_DIR . 'users.php'; if (log_user_in() === false) { $error = array(); $error['type'] = 'error'; $error['title'] = 'Login error'; $error['content'] = '<p>The provided username or password is incorrect.</p>'; $tpl->assign('error', $error, RainTPL::RAINTPL_IGNORE_SANITIZE); } $tpl->assign('user', isset($_SESSION['user']) ? $_SESSION['user'] : false, RainTPL::RAINTPL_HTML_SANITIZE);
function showDailyRSS() { // Cache system $query = $_SERVER["QUERY_STRING"]; $cache = new CachedPage($GLOBALS['config']['PAGECACHE'], page_url($_SERVER), startsWith($query, 'do=dailyrss') && !isLoggedIn()); $cached = $cache->cachedVersion(); if (!empty($cached)) { echo $cached; exit; } // If cached was not found (or not usable), then read the database and build the response: // Read links from database (and filter private links if used it not logged in). $LINKSDB = new LinkDB($GLOBALS['config']['DATASTORE'], isLoggedIn(), $GLOBALS['config']['HIDE_PUBLIC_LINKS'], $GLOBALS['redirector']); /* Some Shaarlies may have very few links, so we need to look back in time (rsort()) until we have enough days ($nb_of_days). */ $linkdates = array(); foreach ($LINKSDB as $linkdate => $value) { $linkdates[] = $linkdate; } rsort($linkdates); $nb_of_days = 7; // We take 7 days. $today = Date('Ymd'); $days = array(); foreach ($linkdates as $linkdate) { $day = substr($linkdate, 0, 8); // Extract day (without time) if (strcmp($day, $today) < 0) { if (empty($days[$day])) { $days[$day] = array(); } $days[$day][] = $linkdate; } if (count($days) > $nb_of_days) { break; // Have we collected enough days? } } // Build the RSS feed. header('Content-Type: application/rss+xml; charset=utf-8'); $pageaddr = escape(index_url($_SERVER)); echo '<?xml version="1.0" encoding="UTF-8"?><rss version="2.0">'; echo '<channel>'; echo '<title>Daily - ' . $GLOBALS['title'] . '</title>'; echo '<link>' . $pageaddr . '</link>'; echo '<description>Daily shared links</description>'; echo '<language>en-en</language>'; echo '<copyright>' . $pageaddr . '</copyright>' . PHP_EOL; // For each day. foreach ($days as $day => $linkdates) { $daydate = linkdate2timestamp($day . '_000000'); // Full text date $rfc822date = linkdate2rfc822($day . '_000000'); $absurl = escape(index_url($_SERVER) . '?do=daily&day=' . $day); // Absolute URL of the corresponding "Daily" page. // Build the HTML body of this RSS entry. $html = ''; $href = ''; $links = array(); // We pre-format some fields for proper output. foreach ($linkdates as $linkdate) { $l = $LINKSDB[$linkdate]; $l['formatedDescription'] = format_description($l['description'], $GLOBALS['redirector']); $l['thumbnail'] = thumbnail($l['url']); $l['timestamp'] = linkdate2timestamp($l['linkdate']); if (startsWith($l['url'], '?')) { $l['url'] = index_url($_SERVER) . $l['url']; // make permalink URL absolute } $links[$linkdate] = $l; } // Then build the HTML for this day: $tpl = new RainTPL(); $tpl->assign('title', $GLOBALS['title']); $tpl->assign('daydate', $daydate); $tpl->assign('absurl', $absurl); $tpl->assign('links', $links); $tpl->assign('rfc822date', escape($rfc822date)); $html = $tpl->draw('dailyrss', $return_string = true); echo $html . PHP_EOL; } echo '</channel></rss><!-- Cached version of ' . escape(page_url($_SERVER)) . ' -->'; $cache->cache(ob_get_contents()); ob_end_flush(); exit; }
session_start(); include "includes/gb.class.php"; include "includes/config.php"; include "language/{$default_language}"; include "includes/rain.tpl.class.php"; include "includes/csrf.class.php"; raintpl::configure("base_url", null); raintpl::configure("tpl_dir", "themes/{$theme}/"); raintpl::configure("cache_dir", "cache/"); // Generate Token Id and Valid $csrf = new csrf(); $token_id = $csrf->get_token_id(); $token_value = $csrf->get_token($token_id); //initialize a Rain TPL object $tpl = new RainTPL(); $tpl->assign("theme", $theme); $tpl->assign("title", $title); $tpl->assign("headingtitletxt", $headingtitletxt); $tpl->assign("addentrytxt", $addentrytxt); $tpl->assign("viewguestbooktxt", $viewguestbooktxt); $tpl->assign("newpostfirsttxt", $newpostfirsttxt); $tpl->assign("newpostlasttxt", $newpostlasttxt); $tpl->assign("searchlabeltxt", $searchlabeltxt); $tpl->assign("searchbuttontxt", $searchbuttontxt); $tpl->assign("yournametxt", $yournametxt); $tpl->assign("youremailtxt", $youremailtxt); $tpl->assign("yourMessagetxt", $yourMessagetxt); $tpl->assign("yourCountrytxt", $yourCountrytxt); $tpl->assign("submitbutton", $submitbutton); $tpl->assign("image_verify", $image_verify); $tpl->assign("currentyear", date("Y"));
closedir($dhandle); ksort($comments); // Sort comments by date, oldest first. $messages = array_merge($messages, $comments); } $CIPHERDATA = json_encode($messages); // If the paste was meant to be read only once, delete it. if (property_exists($paste->meta, 'burnafterreading') && $paste->meta->burnafterreading) { deletePaste($pasteid); } return array($CIPHERDATA, '', ''); } $CIPHERDATA = ''; $ERRORMESSAGE = ''; $STATUS = ''; if (!empty($_GET['deletetoken']) && !empty($_GET['pasteid'])) { list($CIPHERDATA, $ERRORMESSAGE, $STATUS) = processPasteDelete($_GET['pasteid'], $_GET['deletetoken']); } else { if (!empty($_SERVER['QUERY_STRING'])) { list($CIPHERDATA, $ERRORMESSAGE, $STATUS) = processPasteFetch($_SERVER['QUERY_STRING']); } } require_once "lib/rain.tpl.class.php"; header('Content-Type: text/html; charset=utf-8'); $page = new RainTPL(); $page->assign('CIPHERDATA', htmlspecialchars($CIPHERDATA, ENT_NOQUOTES)); // We escape it here because ENT_NOQUOTES can't be used in RainTPL templates. $page->assign('VERSION', $VERSION); $page->assign('ERRORMESSAGE', $ERRORMESSAGE); $page->assign('STATUS', $STATUS); $page->draw('page');
<?php } } ?> </ul> </li> <?php } } ?> </ul> <?php $left_column = ob_get_contents(); ob_clean(); $footer_control = '<div class="total_money"><label>Tổng tiền :</label> <span id="total-money" style="font-size: 16px;color: red;font-weight: bold"> </span></div>'; $rainTpl = new RainTPL(); add_more_css('custom.css', $load_header); $rainTpl->assign('load_header', $load_header); $rainTpl->assign('module_name', $module_name); $rainTpl->assign('error_msg', print_error_msg($bg_errorMsg)); $rainTpl->assign('left_control', $left_control); $rainTpl->assign('right_control', $right_control); $rainTpl->assign('top_control', $top_control); $rainTpl->assign('footer_control', $footer_control); $rainTpl->assign('left_column', $left_column); $rainTpl->assign('right_column', $right_column); $custom_script = file_get_contents('script.html'); $rainTpl->assign('custom_script', $custom_script); $rainTpl->draw('fullwidth_2column_report_transfer');
echo $value1["id"]; ?> "><img src='<?php echo WEB_PATH; ?> templates/images/delete.gif' ALT='<?php echo _('Delete'); ?> ' border='0'></a><?php } ?> </td> </tr> <?php $counter1++; } } ?> </table> </center> <?php } $RainTPL_include_obj = new RainTPL(); $RainTPL_include_obj->assign($var); $RainTPL_directory_template_temp = $RainTPL_include_obj->tpl_dir; $this->tpl_dir = $GLOBALS['RainTPL_tpl_dir'] = $RainTPL_include_obj->tpl_dir . "/" . dirname("global_footer"); $RainTPL_include_obj->draw("global_footer"); $this->tpl_dir = $GLOBALS['RainTPL_tpl_dir'] = $RainTPL_directory_template_temp; ?> <!--/ template_manager -->
<?php $action = getValue('action', 'str', 'POST', ''); switch ($action) { case 'get_section': $id_map = getValue('id_map', 'int', 'POST', 0); $db_query = new db_query('SELECT sec_id,sec_name,sec_desc FROM sections LEFT JOIN anatomy_map ON ana_sec_id = sec_id WHERE ana_id = ' . $id_map); $list_section = mysqli_fetch_assoc($db_query->result); unset($db_query); $list_section['link_detail'] = generate_section_detail($list_section); //query các bộ phận con $db_query = new db_query('SELECT sec_id,sec_name FROM sections WHERE sec_parent_id = ' . $list_section['sec_id']); $list_section['sec_child'] = array(); $cdi_sec_id = array($sec_data['sec_id']); while ($row = mysqli_fetch_assoc($db_query->result)) { $row['link_detail'] = generate_section_detail($row); $list_section['sec_child'][] = $row; } unset($db_query); //assign to template $rainTpl = new RainTPL(); $rainTpl->assign('list_section', $list_section); ob_clean(); echo $rainTpl->draw('cat_section_list', 1); break; }
<?php require_once 'inc_security.php'; #some config #Phần hiển thị $rainTpl = new RainTPL(); $rainTpl->assign('load_header', $load_header); $rainTpl->assign('module_name', $module_name); #Bắt đầu với datagrid $list = new dataGrid($id_field, 30); #something config for list dataGrid /** * $list->add('')...etc * */ $list->add('dic_key', 'Nội dung', 'string', 1, 0); $list->add('dic_translate_en', 'Bản dịch', 'string'); $list->add('', 'Edit', 'edit'); $list->add('', 'Delete', 'delete'); $db_count = new db_count('SELECT count(*) as count FROM ' . $bg_table . ' WHERE 1 ' . $list->sqlSearch() . ' '); $total = $db_count->total; unset($db_count); $db_listing = new db_query('SELECT * FROM ' . $bg_table . ' WHERE 1 ' . $list->sqlSearch() . ' ORDER BY ' . $list->sqlSort() . ' ' . $id_field . ' DESC ' . $list->limit($total)); $total_row = mysqli_num_rows($db_listing->result);
</h4> </div> <div class="modal-body"> <div class="form-group"> Descripción: <input class="form-control" type="text" name="descripcion" placeholder="Cuenta principal" autocomplete="off" required=""/> </div> <div class="form-group"> <a target="_blank" href="http://es.wikipedia.org/wiki/International_Bank_Account_Number">IBAN</a>: <input class="form-control" type="text" name="iban" maxlength="34" placeholder="ES12345678901234567890123456" autocomplete="off"/> </div> <div class="form-group"> <a target="_blank" href="http://es.wikipedia.org/wiki/Society_for_Worldwide_Interbank_Financial_Telecommunication">SWIFT</a> o BIC: <input class="form-control" type="text" name="swift" maxlength="11" autocomplete="off"/> </div> </div> <div class="modal-footer"> <button class="btn btn-sm btn-primary" type="submit"> <span class="glyphicon glyphicon-floppy-disk"></span> Guardar </button> </div> </div> </div> </div> </form> <?php $tpl = new RainTPL(); $tpl_dir_temp = self::$tpl_dir; $tpl->assign($this->var); $tpl->draw(dirname("footer") . (substr("footer", -1, 1) != "/" ? "/" : "") . basename("footer"));
include PROJECTPATH . "inc/libs/vitabytes/mailing.inc.php"; /* * Including models and controllers */ include PROJECTPATH . "inc/categories.inc.php"; include PROJECTPATH . "inc/shopobjects.inc.php"; include PROJECTPATH . "inc/session.inc.php"; include PROJECTPATH . "inc/cart.inc.php"; include PROJECTPATH . "inc/user.inc.php"; include PROJECTPATH . "inc/order.inc.php"; include PROJECTPATH . "inc/payment.inc.php"; foreach ($_POST as &$value) { if (!is_array($value)) { $value = strip_tags(htmlspecialchars($value)); } } foreach ($_GET as &$value) { $value = strip_tags(htmlspecialchars($value)); } /* * Setting up the menu */ if (unserialize(stripslashes($_COOKIE['menu'])) == NULL) { setcookie('menu', serialize(CategoriesCtl::GetCategories(CATEGORIES_ID)), time() + 7600); } $cart = CartCtl::Get(SessionCtl::GetSession()); $tpl->assign("menu", unserialize(stripslashes($_COOKIE['menu']))); $tpl->assign("cart", $cart); $tpl->assign("username", $_COOKIE['username']); $tpl->assign("sitename", SITE_NAME); $tpl->assign("request_uri", "http://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]);
$db_insert = new db_execute($sql_district); unset($db_insert); } } } #Phần hiển thị $rainTpl = new RainTPL(); $rainTpl->assign('load_header', $load_header); $rainTpl->assign('module_name', $module_name); $rainTpl->assign('error_msg', print_error_msg($bg_errorMsg)); $html_page = ''; $form = new form(); $html_page .= $form->form_open(); $html_page .= $form->textnote('Các trường có dấu (<span class="form-asterick">*</span>) là bắt buộc nhập'); $html_page .= $form->text(array('label' => 'Tỉnh - thành phố', 'name' => 'cit_name', 'id' => 'cit_name', 'require' => 1, 'errorMsg' => 'Bạn chưa nhập tên tỉnh - thành phố')); $html_page .= $form->form_group_custom('Quận - huyện - thị xã'); $row_template = new RainTPL(); $row_template->assign('input_name', 'array_district[]'); $row_template->assign('input_value', ''); $row_template->assign('add_btn_label', 'Thêm giá trị'); $row_template->assign('remove_btn_label', 'Loại bỏ'); $row_template->assign('row_list'); $html_page .= $row_template->draw('row_insert', 1); $html_page .= $form->form_group_custom('close'); $html_page .= $form->checkbox(array('label' => 'Trực thuộc TW', 'name' => 'cit_tw', 'id' => 'cit_tw', 'value' => 1, 'currentValue' => 0)); $html_page .= $form->select(array('label' => 'Phí ship cố định', 'name' => 'cit_static_fee', 'id' => 'cit_static_fee', 'option' => $array_ship_level)); $html_page .= $form->form_redirect(); $html_page .= $form->form_action(array('label' => array('Thêm mới', 'Nhập lại'), 'type' => array('submit', 'reset'))); $html_page .= $form->form_close(); $rainTpl->assign('html_page', $html_page); $rainTpl->draw('add');
} else { $selected_check = ''; } $array_option_desk .= '<option value="' . $row['sed_id'] . '" ' . $selected_check . '>' . $row['age_name'] . ' - ' . $row['sed_name'] . '</option>'; } unset($db_query); // lay danh sach kho hang $db_query_store = new db_query('SELECT *FROM categories_multi WHERE cat_type = "stores"'); while ($row_store = mysqli_fetch_assoc($db_query_store->result)) { if ($con_default_store == $row_store['cat_id']) { $check_store = 'selected="selected"'; } else { $check_store = ''; } $array_store .= '<option value="' . $row_store['cat_id'] . '" ' . $check_store . '>' . $row_store['cat_name'] . '</option>'; } unset($db_query_store); $rainTpl = new RainTPL(); add_more_css('custom.css', $load_header); $rainTpl->assign('load_header', $load_header); $rainTpl->assign('module_name', $module_name); $rainTpl->assign('error_msg', print_error_msg($bg_errorMsg)); $rainTpl->assign('array_option_desk', $array_option_desk); $rainTpl->assign('array_store', $array_store); $rainTpl->assign('con_restaurant_address', $con_restaurant_address); $rainTpl->assign('con_restaurant_phone', $con_restaurant_phone); $rainTpl->assign('con_restaurant_name', $con_restaurant_name); $rainTpl->assign('con_restaurant_image', $con_restaurant_image); $custom_script = file_get_contents('script.html'); $rainTpl->assign('custom_script', $custom_script); $rainTpl->draw('modal_setup');
$content_column .= '<div class="section-content">'; $content_column .= $list->showHeader(1); $content_column .= $list->start_tr(1, $bill_id, 'class="menu-normal record-item" data-record_id="' . $bill_id . '"'); $content_column .= '<td class="center">' . format_codenumber($bill_id, 6, '') . '</td>'; $content_column .= '<td class="center">' . date('d/m/Y h:i', $ngay_no) . '</td>'; $content_column .= '<td class="text-right">' . number_format($so_no) . '</td>'; $content_column .= '<td class="text-right">' . number_format($thanhtoan) . '</td>'; $content_column .= $list->end_tr(); $content_column .= $list->showFooter(); $content_column .= '</div>'; $custom_script = '<script> var windowHeight = windowHeight || $(window).height(); var wrapperHeight = windowHeight; var wrapperContent = $(\'#wrapper-full\'); wrapperContent.height(wrapperHeight); var sectionContent_class = $(\'.section-content\'); sectionContent_class.height(wrapperHeight - 10); var table_scoll = $(\'.table-listing-bound\'); table_scoll.height(wrapperHeight - 10); table_scoll.enscroll({ showOnHover: true, minScrollbarLength: 28, addPaddingToPane : false }); </script>'; $rainTpl = new RainTPL(); $rainTpl->assign('load_header', $load_header); $rainTpl->assign('content_column', $content_column); $rainTpl->assign('footer_control', $footer_control); $rainTpl->assign('custom_script', $custom_script); $rainTpl->draw('mindow_iframe_1column');
$_SESSION['currentUser'] = serialize($myUser); } } if (!$myUser && isset($_COOKIE[$conf->get('COOKIE_NAME')])) { $users = User::getAllUsers(); foreach ($users as $user) { if ($user->getCookie() == $_COOKIE[$conf->get('COOKIE_NAME')]) { $myUser = $user; $myUser->loadRight(); } } } //Instanciation du template $tpl = new RainTPL(); //Definition des dossiers de template raintpl::configure("base_url", null); raintpl::configure("tpl_dir", './templates/' . $conf->get('DEFAULT_THEME') . '/'); raintpl::configure("cache_dir", "./cache/tmp/"); $view = ''; $rank = new Rank(); if ($myUser != false && $myUser->getRank() != false) { $rank = $rank->getById($myUser->getRank()); } $tpl->assign('myUser', $myUser); $tpl->assign('userManager', $userManager); $tpl->assign('configurationManager', $conf); $tpl->assign('error', $error); $tpl->assign('notice', $message); $tpl->assign('_', $_); $tpl->assign('action', ''); $tpl->assign('rank', $rank);
<?php $frame_src = getValue('href', 'str', 'POST', '', 3); $frame_src = url_add_params($frame_src, array('frame_source_request' => 'iframe')); $module_name = getValue('modal_name', 'str', 'POST', 3); $module_rightname = getValue('modal_rightname', 'str', 'POST', 3); $rainTpl = new RainTPL(); $rainTpl->assign('frame_src', $frame_src); $rainTpl->assign('module_name', $module_name); $rainTpl->assign('module_rightname', $module_rightname); $rainTpl->draw('modal_template');
public function action_default() { if (Modul::hasAccess('system') == false) { return '<div class="notice error">Sie haben keinen Zugriff</div>'; } $query = $GLOBALS['pdo']->prepare("SELECT count(vmID) AS `vms`, SUM(IF(status=1,1,0)) AS `vms_on` FROM vm"); $query->execute(); $data = $query->fetch(); $query = $GLOBALS['pdo']->prepare("SELECT imageID FROM images"); $query->execute(); $images = $query->rowCount(); $tmp = new RainTPL(); $tmp->assign('vms', $data['vms']); $tmp->assign('vms_on', $data['vms_on']); $tmp->assign('images', $images); $ram = Server::getRamSettings(); if ($ram) { $ram_usage = FileSystem::formatFileSize($ram['used']) . ' / ' . FileSystem::formatFileSize($ram['all']); } else { $ram_usage = 'linux only'; } $tmp->assign('ram_usage', $ram_usage); $cpu = Server::getCPUusage(); if ($cpu) { $cpu_usage = implode(" ", array_values($cpu)); } else { $cpu_usage = 'linux only'; } $tmp->assign('cpu_usage', $cpu_usage); $free = disk_free_space('/'); $all = disk_total_space('/'); $tmp->assign('free', FileSystem::formatFileSize($all - $free)); $tmp->assign('all', FileSystem::formatFileSize($all)); $qemu_ram = Server::getQemuRamTemp(); if ($qemu_ram !== false) { $tmp->assign('ram_qemu', FileSystem::formatFileSize($qemu_ram)); } else { $tmp->assign('ram_qemu', 'linux only'); } $roles = ''; $query = $GLOBALS['pdo']->prepare("SELECT * FROM roles"); $query->execute(); while ($ds = $query->fetch()) { $roles .= '<option value="' . $ds['roleID'] . '">' . $ds['name'] . '</option>'; } $roles = str_replace('value="' . $GLOBALS['config']['default_role'] . '"', 'value="' . $GLOBALS['config']['default_role'] . '" selected="selected"', $roles); $tmp->assign('roles', $roles); foreach ($GLOBALS['config'] as $key => $value) { $tmp->assign($key, $value); } return $tmp->draw('system', true); }
public function action_default() { $tmp2 = new RainTPL(); $query = $GLOBALS['pdo']->prepare("SELECT * FROM vm WHERE owner = :owner"); $query->bindValue(":owner", $_SESSION['user']->id, PDO::PARAM_INT); $query->execute(); if ($query->rowCount() > 0) { $vms = array(); while ($ds = $query->fetch()) { if ($ds['lastrun'] != '0000-00-00') { $lastrun = date("d.m.Y H:i", strtotime($ds['lastrun'])); } else { $lastrun = '---'; } if ($ds['status'] == QemuMonitor::RUNNING) { $buttons = '<a href="index.php?site=myvm&action=stop&vmID=' . $ds['vmID'] . '" class="button red small center"><span class="icon" data-icon="Q"></span>Stop</a>'; $buttons .= '<a href="screenshot.php?vmID=' . $ds['vmID'] . '" class="button small center"><span class="icon" data-icon="0"></span>Screenshot</a>'; if ($ds['password']) { $buttons .= '<a href="vnc.php?vmID=' . $ds['vmID'] . '" class="button small center grey"><span class="icon" data-icon="0"></span>VNC</a>'; $buttons .= '<a href="index.php?site=vnc&vmID=' . $ds['vmID'] . '" class="button small center grey"><span class="icon" data-icon="0"></span>Web-VNC</a>'; } else { $buttons .= '<a href="#' . $ds['vmID'] . '" disabled="disabled" class="button small center grey vm_disabled"><span class="icon" data-icon="0"></span>VNC</a>'; } } else { $buttons = '<a href="index.php?site=myvm&action=start&vmID=' . $ds['vmID'] . '" class="button green small center"><span class="icon" data-icon=" "></span>Start</a>'; $buttons .= '<a class="button small center grey"><span class="icon" data-icon="G"></span>Edit</a>'; } $vm = array(); $vm['lastrun'] = $lastrun; $vm['buttons'] = $buttons; $vm['name'] = $ds['name']; $vm['ram'] = FileSystem::formatFileSize($ds['ram'] * 1024 * 1024, 0); $vms[] = $vm; } $tmp2->assign('vms', $vms); return $tmp2->draw('myvm_table', true); } else { return "Du hast noch keine VM. Du musst warten bis dir eine zugeteilt wird von den Admins."; } }