public static function index($html, $title, $arr = null) { $valores = ['Title' => $title, 'container' => dinamic("frontend/views/indexViews/" . $html, $arr)]; $templad = loadPage("frontend/assets/templad/default.html"); $mostrar = remplas($valores, $templad); return $mostrar; }
$values .= format(rand_name($_POST["name"], $id), 1); $values .= format($_POST["url"], 1); $values .= format('0', 0); // insertObject($field,$value) $res = $tbl->insertObject($field, $values); if ($res) { //var_dump($res); echo "OK"; } } ?> <div id="center-column"> <div class="top-bar"> <h1>Tin tức</h1> <div class="breadcrumbs"><a href="<?php echo loadPage('news'); ?> ">Tin tức</a> / <a href="#">Thêm</a></div> </div><br /> <div class="table"> <img src="img/bg-th-left.gif" width="8" height="7" alt="" class="left" /> <img src="img/bg-th-right.gif" width="7" height="7" alt="" class="right" /> <form method="post" enctype="multipart/form-data"> <table class="listing form" cellpadding="0" cellspacing="0"> <tr> <th class="full" colspan="4">NỘI DUNG</th> </tr> <tr class="bg" style="display:none">
// search if (isset($_POST["search"])) { // loadPaging(&$start,&$nume,$limit=20,$where='',$order='order by id desc') $res = $tbl->loadPaging($start, $nume, $limit, 'where name like' . formatCompare($_POST["key"], 0)); } else { // loadPaging(&$start,&$nume,$limit=20,$where='',$order='order by id desc') $res = $tbl->loadPaging($start, $nume, $limit); } /*$sql=("select * from pages where lang = ".$a." "); $res=mysql_query($sql);*/ if ($res) { while ($row = mysql_fetch_array($res)) { ?> <tr> <td class="first style1"><a href="<?php echo loadPage('editsupport&id=' . $row['id']); ?> "><?php echo $row['name']; ?> </a></td> <td align="center" class="last"><input type="checkbox" name="del[]" value="<?php echo $row['id']; ?> " id="del[]" /></td> </tr> <?php } } ?> <tr class="bg">
// get fields $field = 'id,name,address,image,ordering'; // upload file $file = "logo"; // uploadFile($file,$auto=1,$dir='uploads/images/'); $logo = uploadFile($file, 0, '../uploads/'); // format($str,$isComma=1) $values = $tbl->getLastId() + 1 . ","; $values .= format($_POST["name"]); $values .= format($_POST["url"]); $values .= format(str_replace('../', '', $logo)); $values .= format($_POST["vitri"], 0); // insert $res = $tbl->insertObject($field, $values); if ($res) { header('location: ' . loadPage('addlinkweb')); } } ?> <div id="center-column"> <div class="top-bar"> <h1>Liên kết website</h1> <div class="breadcrumbs"><a href="#">Content</a> / <a href="#">Thêm</a></div> </div><br /> <div class="table"> <img src="img/bg-th-left.gif" width="8" height="7" alt="" class="left" /> <img src="img/bg-th-right.gif" width="7" height="7" alt="" class="right" /> <form method="post" enctype="multipart/form-data">
// get values $ms = format($_POST["ms"], 0); $solanchon = format($_POST["solanchon"], 0); $image = format(str_replace('../', '', $image), 0); $values = array($ms, $image, $solanchon); // insertObject($field,$value) if ($_POST['tmpms'] == $_POST['ms']) { $res = $tbl->updateObject($field, $values, 'id=' . $id); if ($res) { header('location: ' . loadPage('poll')); } } else { if ($num_kt == 0) { $res = $tbl->updateObject($field, $values, 'id=' . $id); if ($res) { header('location: ' . loadPage('poll')); } } } } $res = $tbl->loadOne('id=' . $id); if ($res) { $row = mysql_fetch_array($res); ?> <div id="center-column"> <div class="top-bar"> <h1>Bình chọn</h1> <div class="breadcrumbs"><a href="#">Sửa</a></div> </div><br />
function index() { loadPage('sort.php'); }
$id = $_GET["id"]; } $tbl = new table('combi'); if (isset($_POST["done"])) { // get field /*$filea = $_FILES["image"]["name"]; if($filea=='') $image = '../'.$_POST['tmpimage']; else $image = uploadFile('image',0,'../uploads/');*/ $field = array('name', 'details', 'ordering', 'alias'); $values = array(format($_POST["name"], 0), format($_POST["details"], 0), format($_POST["ordering"], 0), format(rand_name($_POST["name"], $id), 0)); // insertObject($field,$value) $res = $tbl->updateObject($field, $values, 'id=' . $id); if ($res) { header('location: ' . loadPage('combi')); } } $res = $tbl->loadOne('id=' . $id); if ($res) { $row = mysql_fetch_array($res); ?> <div id="center-column"> <div class="top-bar"> <h1>Mua hàng trên web Nhật</h1> <div class="breadcrumbs"><a href="#">Sửa</a></div> </div><br /> <div class="table">
<ul class="nav"> <li><a href="<?php echo loadPage('category_adv'); ?> ">Danh mục </a></li> <li><a href="<?php echo loadPage('advertise'); ?> ">Danh sách </a></li> </ul> <h3>Thành viên</h3> <ul class="nav"> <li><a href="<?php echo loadPage('member'); ?> ">Thành viên</a></li> </ul> <h3>Administrator</h3> <ul class="nav"> <li><a href="<?php echo loadPage('admin'); ?> ">Người dùng</a></li> <li><a href="<?php echo loadPage('password'); ?> ">Đổi mật khẩu</a></li> <li><a href="source/logout.php" class="last">Thoát (Logout)</a></li> </ul> </div>
<?php DEFINED('DS') or DEFINE('DS', DIRECTORY_SEPARATOR); // Константа разделителя директорий include_once '..' . DS . 'config' . DS . 'config.php'; // Инициализация настроек include_once '..' . DS . 'config' . DS . 'db.php'; // Инициализация базы данных include_once '..' . DS . 'library' . DS . 'mainFunctions.php'; // Основные функции // получаем имена вызываемых контроллера и экшина $controller = filter_input(INPUT_GET, 'controller'); $action = filter_input(INPUT_GET, 'action'); // определяем вызываемый контроллер $controllerName = $controller ? ucfirst($controller) : 'Index'; // определяем вызываемую функцию $actionName = $action ? $action : 'index'; loadPage($smarty, $controllerName, $actionName);
header('location: ' . loadPage('baiviet')); } } else { echo "Lỗi trùng tên. Vui lòng nhập tên khác."; } } $res = $tbl->loadOne('id=' . $id); if ($res) { $row = mysql_fetch_array($res); $thumb_img = get_thumb('uploads/category/', $row['image']); ?> <div id="center-column"> <div class="top-bar"> <h1>Bài viết</h1> <div class="breadcrumbs"><a href="<?php echo loadPage('baiviet'); ?> ">Bài viết</a> / <a href="#">Sửa</a></div> </div><br /> <div class="table"> <img src="img/bg-th-left.gif" width="8" height="7" alt="" class="left" /> <img src="img/bg-th-right.gif" width="7" height="7" alt="" class="right" /> <form method="post" enctype="multipart/form-data"> <table class="listing form" cellpadding="0" cellspacing="0"> <tr> <th class="full" colspan="3">NỘI DUNG</th> </tr> <tr>
?> <tr> <td class="first style1"> <a href="<?php echo loadPage('editbaiviet&id=' . $row['id']); ?> "> <?php echo $row['name']; ?> </a> </td> <td> <a href="<?php echo loadPage('editbaiviet&id=' . $row['id']); ?> "> <img src="../<?php echo $thumb_img; ?> " height="50" align="absmiddle" /> </a> </td> <td> <span class="first style1"> <?php if ($row['catid'] != 0) { $tbl_cat = new table('category_bv'); $res_cat = $tbl_cat->loadOne('id=' . $row['catid']); $row_cat = mysql_fetch_array($res_cat);
$nume = 0; if ($_POST["search"]) { // loadPaging(&$start,&$nume,$limit=20,$where='',$order='order by id desc'); // formatCompare($str,$pos=0); $res = $tbl->loadPaging($start, $nume, $limit, 'where ms like' . formatCompare($_POST["key"], 0)); } else { // loadPaging(&$start,&$nume,$limit=20,$where='',$order='order by id desc'); $res = $tbl->loadPaging($start, $nume, $limit); } if ($res) { while ($row = mysql_fetch_array($res)) { ?> <tr> <td class="first style1"><a href="<?php echo loadPage('editpoll&id=' . $row['id']); ?> "><?php echo $row['ms']; ?> </a></td> <td><img src="../<?php echo $row['image']; ?> " width="50"/></td> <td align="center" class="last"><input type="checkbox" name="del[]" value="<?php echo $row['id']; ?> " id="del[]" /></td> </tr> <?php
#!/usr/bin/php <?php function loadPage($url) { $filepath = sys_get_temp_dir() . '/' . basename($url); if (!file_exists($filepath)) { copy('compress.zlib://' . $url, $filepath, stream_context_create(['http' => ['header' => 'Accept-Encoding: gzip']])); } $page = new DOMDocument(); $page->preserveWhiteSpace = false; @$page->loadHTMLFile($filepath, LIBXML_COMPACT | LIBXML_NOBLANKS); return $page; } $page = loadPage('http://www.w3.org/html/wg/drafts/html/master/index.html'); $filters = []; foreach ($page->getElementById('attributes-1')->getElementsByTagName('tr') as $tr) { if (strpos($tr->textContent, 'URL') === false) { continue; } $th = $tr->getElementsByTagName('th')->item(0); foreach (preg_split('/[;\\s]+/', $th->textContent, -1, PREG_SPLIT_NO_EMPTY) as $attrName) { // We manually ignore itemprop because it accepts plain text as well as URLs. // We also ignore itemid because it actually accepts any URIs, not just URLs if ($attrName === 'itemprop' || $attrName === 'itemid') { continue; } $filters[$attrName] = '#url'; } } ksort($filters); $len = max(array_map('strlen', array_keys($filters)));
$values .= format($_POST['name_nn'], 1); $values .= format($_POST['address_nn'], 1); $values .= format($_POST['phone_nn'], 1); $values .= format($_POST['email_nn'], 1); $values .= format($_POST['name_bank'], 1); $values .= format($_POST['chuthe'], 1); $values .= format($_POST['num_acc'], 1); $values .= format($now, 1); $values .= format(isCheck(isset($_POST["block"])), 0); if (isEmpty($_POST["username"]) == 1) { echo "Username invalid!"; } else { // insertObject($field,$value) $res = $tbl->insertObject($field, $values); if ($res) { header('location: ' . loadPage('member')); } } } ?> <div id="center-column"> <div class="top-bar"> <h1>Thành viên</h1> <div class="breadcrumbs"><a href="#">Content</a> / <a href="#">Thêm</a></div> </div><br /> <div class="table"> <img src="img/bg-th-left.gif" width="8" height="7" alt="" class="left" /> <img src="img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
<td class="first" width="96"><strong>Date</strong></td> <?php // get current date and time $now = getdate(); // turn it into strings $currentDate = $now["mday"] . "-" . $now["mon"] . "-" . $now["year"]; // result: "It is now 12:37:47 on 30.10.2006" (example) ?> <td colspan="2" class="last"><?php echo "{$currentDate}"; ?> </td> </tr> <tr class="bg"> <td class="first"> </td> <td colspan="2" class="last"><a href="<?php echo loadPage('contact'); ?> ">Go back</a></td> </tr> <tr class="bg"> <td class="first"> </td> <td colspan="2" class="last"> </td> </tr> </table> </form> <p> </p> </div> </div> <?php }
<?php $tbl = new table('orders'); echo $tbl->getTotal(); ?> </td> </tr> <tr> <td class="first style1">Tổng số thành viên</td> <td> <?php $tbl = new table('user'); echo $tbl->getTotal(); ?> </td> </tr> <tr class="bg"> <td class="first style2"><a href="<?php echo loadPage('ip'); ?> ">IP truy cập</a></td> <td> <?php $tbl = new table('ipaddress'); echo $tbl->getTotal(); ?> </td> </tr> </table> </form> </div> </div>
// search if (isset($_POST["search"])) { // loadPaging(&$start,&$nume,$limit=20,$where='',$order='order by id desc') $res = $tbl->loadPaging($start, $nume, $limit, 'where name like' . formatCompare($_POST["key"], 0)); } else { // loadPaging(&$start,&$nume,$limit=20,$where='',$order='order by id desc') $res = $tbl->loadPaging($start, $nume, $limit); } /*$sql=("select * from pages where lang = ".$a." "); $res=mysql_query($sql);*/ if ($res) { while ($row = mysql_fetch_array($res)) { ?> <tr> <td class="first style1"><a href="<?php echo loadPage('editseo&id=' . $row['id']); ?> "><?php echo $row['name']; ?> </a></td> <td align="center" class="last"><input type="checkbox" name="del[]" value="<?php echo $row['id']; ?> " id="del[]" <?php if ($perid != 0) { echo 'disabled="disabled"'; } ?> /></td> </tr>
$id = $_GET["id"]; } $tbl = new table('support'); if (isset($_POST["done"])) { // updateObject($field=array(),$value=array(),$where) $field = array('loai', 'name', 'nickname', 'details', 'image', 'ordering', 'phone'); $filename = $_FILES['image']['name']; if ($filename == '') { $image = '../' . $_POST["tmpImage"]; } else { $image = uploadFile('image', 0, '../Images/Support/'); } $values = array(format($_POST["loai"], 0), format($_POST["name"], 0), format($_POST["nickname"], 0), format($_POST["details"], 0), format(str_replace('../', '', $image), 0), format($_POST["ordering"], 0), format($_POST["phone"], 0)); $res = $tbl->updateObject($field, $values, 'id=' . $id); if ($res) { header('location: ' . loadPage('support')); } } $res = $tbl->loadOne('id=' . $id); if ($res) { $row = mysql_fetch_array($res); ?> <div id="center-column"> <div class="top-bar"> <h1>Support</h1> <div class="breadcrumbs"><a href="#">Content</a> / <a href="#">Edit</a></div> </div><br /> <div class="table">
if ($res) { header('location: ' . loadPage('category3')); } } else { echo "Lỗi trùng tên. Vui lòng nhập tên khác."; } } $res = $tbl->loadOne('id=' . $id); if ($res) { $row = mysql_fetch_array($res); ?> <div id="center-column"> <div class="top-bar"> <h1>Danh mục 3</h1> <div class="breadcrumbs"><a href="<?php echo loadPage('category3'); ?> ">Danh mục 3</a> / <a href="#">Sửa</a></div> </div><br /> <div class="table"> <img src="../c/img/bg-th-left.gif" width="8" height="7" alt="" class="left" /> <img src="../c/img/bg-th-right.gif" width="7" height="7" alt="" class="right" /> <form method="post"> <table class="listing form" cellpadding="0" cellspacing="0"> <tr> <th class="full" colspan="2">NỘI DUNG</th> </tr> <tr> <td class="first" width="75"><strong>Id </strong></td> <td width="536" class="last">#<?php echo $id;
<?php $tbl = new table('permission'); if (isset($_POST["done"])) { // get field $field = 'id,name'; // get values // format($str,$isComma=1) $values = format($tbl->getLastId() + 1, 1); $values .= format($_POST["name"], 0); // insertObject($field,$value) $res = $tbl->insertObject($field, $values); if ($res) { header('location: ' . loadPage('permission')); } } ?> <div id="center-column"> <div class="top-bar"> <h1>Permission</h1> <div class="breadcrumbs"><a href="#">Content</a> / <a href="#">Thêm</a></div> </div><br /> <div class="table"> <img src="img/bg-th-left.gif" width="8" height="7" alt="" class="left" /> <img src="img/bg-th-right.gif" width="7" height="7" alt="" class="right" /> <form method="post" enctype="multipart/form-data"> <table class="listing form" cellpadding="0" cellspacing="0"> <tr>
echo loadPage('editimg&id=' . $row['id']); ?> "><?php echo $row['name']; ?> </a> </td> <td><a href="<?php echo loadPage('editimg&id=' . $row['id']); ?> "><img src="../<?php echo $thumb_img; ?> " height="50" /></a></td> <td><a href="<?php echo loadPage('editimg&id=' . $row['id']); ?> "><?php echo $row_pro['name']; ?> </a></td> <td align="center" class="last"><input type="checkbox" name="del[]" value="<?php echo $row['id']; ?> " id="del[]" /></td> </tr> <?php } } ?> <tr class="bg">
$nume = 0; if (isset($_POST["search"])) { // loadPaging(&$start,&$nume,$limit=20,$where='',$order='order by id desc') // formatCompare($str,$pos=0) $res = $tbl->loadPaging($start, $nume, $limit, 'where name like ' . formatCompare($_POST["key"], 0)); } else { // loadPaging(&$start,&$nume,$limit=20,$where='',$order='order by id desc') $res = $tbl->loadPaging($start, $nume, $limit); } if ($res) { while ($row = mysql_fetch_array($res)) { ?> <tr> <td class="first style1"><a href="<?php echo loadPage('editPermission&id=' . $row['id']); ?> "><?php echo $row['name']; ?> </a></td> <td class="last"><input type="checkbox" name="del[]" value="<?php echo $row['id']; ?> " id="del[]" /></td> </tr> <?php } } ?> <tr class="bg">
} $nume = 0; if ($_POST["search"]) { // loadPaging(&$start,&$nume,$limit=20,$where='',$order='order by id desc'); // formatCompare($str,$pos=0); $res = $tbl->loadPaging($start, $nume, $limit, 'where nuocngoai=1 and name like' . formatCompare($_POST["key"], 0)); } else { // loadPaging(&$start,&$nume,$limit=20,$where='',$order='order by id desc'); $res = $tbl->loadPaging($start, $nume, $limit, 'where nuocngoai=1'); } if ($res) { while ($row = mysql_fetch_array($res)) { ?> <tr> <td class="first style1"><a href="<?php echo loadPage('editProducts&id=' . $row['id']); ?> "><?php echo $row['name']; ?> </a></td> <td> <?php if ($row['catid1'] != '' && $row['catid1'] != 0) { $tbl_cat1 = new table('category1'); $res_cat1 = $tbl_cat1->loadOne('id=' . $row['catid1']); if ($res_cat1) { $row_cat1 = mysql_fetch_array($res_cat1); echo $row_cat1['name']; } }
<?php /** * Help page */ require_once "lib/functions.php"; require_once "lib/ui.php"; /* Load page */ loadPage(); /* Login user */ if (!isAuthenticated()) { login(); } else { loadContent(); }
$values .= format(convert($_POST["name"]), 0); // insertObject($field,$value) $res = $tbl->insertObject($field, $values); if ($res) { echo "OK"; } } else { echo "Lỗi trùng tên. Vui lòng nhập tên khác."; } } ?> <div id="center-column"> <div class="top-bar"> <h1>Chuyên mục riêng</h1> <div class="breadcrumbs"><a href="<?php echo loadPage('chuyenmuc'); ?> ">Chuyên mục riêng</a> / <a href="#">Thêm</a></div> </div><br /> <div class="table"> <img src="img/bg-th-left.gif" width="8" height="7" alt="" class="left" /> <img src="img/bg-th-right.gif" width="7" height="7" alt="" class="right" /> <form method="post" enctype="multipart/form-data"> <table class="listing form" cellpadding="0" cellspacing="0"> <tr> <th class="full" colspan="2">NỘI DUNG</th> </tr> <tr>
} if ($res) { while ($row = mysql_fetch_array($res)) { $thumb_img = get_thumb('uploads/nsx/', $row['image']); ?> <tr> <td class="first style1"><a href="<?php echo loadPage('editchuyenmuc&id=' . $row['id']); ?> "><?php echo $row['name']; ?> </a></td> <td><a href="<?php echo loadPage('editchuyenmuc&id=' . $row['id']); ?> "><img src="../<?php echo $thumb_img; ?> " height="30" align="absmiddle" /></a></td> <td align="center"><input type="text" value="<?php echo $row['ordering']; ?> " onkeyup="update_order('ajax/ajax_order.php',<?php echo $row['id']; ?> ,this.value,'chuyenmuc')" class="txt_order"/></td> <td align="center" class="last"><input type="checkbox" name="del[]" value="<?php echo $row['id']; ?>
// mysql_backup($host,$db,$user,$pass,$output,$structure_only) $backup = new mysql_backup($db_host, $db_name, $db_user, $db_pass, $output, $structure_only); $backup->backup(); // ---------------- end backup ------------------------------------ // field $field = 'id,name,date,file'; // format($str,$isComma=1) // values $values = format($tbl->getLastId() + 1, 1); $values .= format($_POST["name"], 1); $values .= format($_POST["date"], 1); $values .= format($output, 0); // insertObject($field,$value) $res = $tbl->insertObject($field, $values); if ($res) { header('location: ' . loadPage('backup')); } } ?> <div id="center-column"> <div class="top-bar"> <h1>Backup</h1> <div class="breadcrumbs"><a href="#">Content</a> / <a href="#">Thêm</a></div> </div><br /> <div class="table"> <img src="img/bg-th-left.gif" width="8" height="7" alt="" class="left" /> <img src="img/bg-th-right.gif" width="7" height="7" alt="" class="right" /> <form method="post" enctype="multipart/form-data"> <table class="listing form" cellpadding="0" cellspacing="0"> <tr>
} $nume = 0; // search if (isset($_POST["search"])) { // loadPaging(&$start,&$nume,$limit=20,$where='',$order='order by id desc') $res = $tbl->loadPaging($start, $nume, $limit, 'where title like' . formatCompare($_POST["key"], 0)); } else { // loadPaging(&$start,&$nume,$limit=20,$where='',$order='order by id desc') $res = $tbl->loadPaging($start, $nume, $limit); } if ($res) { while ($row = mysql_fetch_array($res)) { ?> <tr> <td><span class="first style1"><a href="<?php echo loadPage('viewContact&id=' . $row['id']); ?> "><?php echo $row['name']; ?> </a></span></td> <td><?php echo $row['date']; ?> </td> <td align="center" class="last"><input type="checkbox" name="del[]" value="<?php echo $row['id']; ?> " id="del[]" /></td> </tr> <?php
// formatCompare($str,$pos=0) $res = $tbl->loadPaging($start, $nume, $limit, 'where name like ' . formatCompare($_POST["key"], 0)); } else { // loadPaging(&$start,&$nume,$limit=20,$where='',$order='order by id desc') $res = $tbl->loadPaging($start, $nume, $limit); } /*$sql=("select * from categoryadvertise where lang = ".$a." "); $res=mysql_query($sql);*/ if ($res) { while ($row = mysql_fetch_array($res)) { ?> <tr> <td class="first style1"> <a href="<?php echo loadPage('editcategory_adv&id=' . $row['id']); ?> "><?php echo $row['name']; ?> </a> </td> <td align="center" class="last"> <input type="checkbox" name="del[]" value="<?php echo $row['id']; ?> " id="del[]" <?php if ($perid != 0 || $row['id'] == '8' || $row['id'] == '9') { echo 'disabled="disabled"'; }
if ($res) { while ($row = mysql_fetch_array($res)) { ?> <tr> <td class="first style1"> <a href="<?php echo loadPage('editAdvertise&id=' . $row['id']); ?> "><?php echo $row['name']; ?> </a> </td> <td> <a href="<?php echo loadPage('editAdvertise&id=' . $row['id']); ?> "> <div> <?php $start1 = strlen($row['image']) - 3; if (substr($row['image'], $start1, 3) == 'swf') { ?> <embed wmode="transparent" src="../<?php echo $row['image']; ?> " quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" height="50"></embed> <?php } else { ?> <img border="0" alt="" src="../<?php