function login($link, $user_id) { $_SESSION['auth'] = 'ok'; $_SESSION['user_id'] = $user_id; $user_info = getUserById($link, $user_id); $_SESSION['user'] = $user_info['user']; $_SESSION['role'] = $user_info['role']; header('LOCATION: ./index.php'); }
function checkIsAuth() { global $db; if (!isset($_SESSION['userid'])) { header('Location: /'); exit; } else { //Теперь при вызове этой функции для закрытия части сайта //мы можем сразу забрать данные о пользователе. В userspace продолжение getUserById($_SESSION['userid']); } }
function extractLogins($prefix) { $prefixLen = strlen($prefix); foreach ($_POST as $key => $value) { $index = strpos($key, $prefix); if ($index !== false) { $userId = substr($key, $prefixLen); $oneLogin = getUserById($userId); $loginList[] = $oneLogin; } } return $loginList; }
function sendConfirmationEmail($userID) { global $smarty; $user = getUserById($userID); $hash = getUserActivation($userID); $to = $user["email"]; $subject = 'Please confirm your registration in Fastmarket'; $smarty->assign('user', $user["name"]); $smarty->assign('hash', $hash); $message = $smarty->fetch('emails/confirmationEmail.tpl'); $headers = "From: noreply@fastmarket.fe.up.pt\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; mail($to, $subject, $message, $headers); }
function sendProductPriceChange($userId, $productId) { global $smarty; $user = getUserById($userId); $userName = "******"; $link = "http://fastmarket.com"; $to = "*****@*****.**"; $productName = "Ferrari 548"; $subject = 'Product changed price'; $smarty->assign('user', $userName); $smarty->assign('link', $link); $smarty->assign('productName', $productName); $message = $smarty->fetch('emails/productPriceChange.tpl'); $headers = "From: noreply@fastmarket.fe.up.pt\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; mail($to, $subject, $message, $headers); }
function page_admincontrol() { global $admin_lang; // // get the coutnt of all pages // $sitedata_result = db_result("SELECT page_id FROM " . DB_PREFIX . "pages_content"); $page_count = mysql_num_rows($sitedata_result); // // get the count of all registered users // $users_result = db_result("SELECT user_id FROM " . DB_PREFIX . "users"); $users_count = mysql_num_rows($users_result); // // get the size of all tables with the prefix DB_PREFIX // $table_infos_result = db_result("SHOW TABLE STATUS"); $data_size = 0; while ($table_infos = mysql_fetch_object($table_infos_result)) { if (substr($table_infos->Name, 0, strlen(DB_PREFIX)) == DB_PREFIX) { $data_size += $table_infos->Data_length + $table_infos->Index_length; } } $out = "<h3>AdminControl</h3><hr />\r\n\t<table>\r\n\t\t<tr><td>" . $admin_lang['online since'] . "</td><td>#DATUM</td></tr>\r\n\t\t<tr><td>" . $admin_lang['registered users'] . "</td><td>" . $users_count . "</td></tr>\r\n\t\t<tr><td>" . $admin_lang['created pages'] . "</td><td>" . $page_count . "</td></tr>\r\n\t\t<tr><td>" . $admin_lang['database size'] . "</td><td>" . kbormb($data_size) . "</td></tr>\r\n\t</table>\r\n\t\r\n\t<h3>Aktuelle Besucher</h3><hr />\r\n\t<table>\r\n\t\t<tr>\r\n\t\t\t<td>" . $admin_lang['name'] . "</td>\r\n\t\t\t<td>" . $admin_lang['page'] . "</td>\r\n\t\t\t<td>" . $admin_lang['last action'] . "</td>\r\n\t\t\t<td>" . $admin_lang['language'] . "</td>\r\n\t\t\t<td>" . $admin_lang['ip'] . "</td>\r\n\t\t\t<td>" . $admin_lang['host'] . "</td>\r\n\t\t</tr>"; //output all visitors surfing on the site $users_online_result = db_result("SELECT userid, page, lastaction, lang, ip, host FROM " . DB_PREFIX . "online"); while ($users_online = mysql_fetch_object($users_online_result)) { if ($users_online->userid == 0) { $username = $admin_lang['not registered']; } else { $username = getUserById($users_online->userid); } // // FIXME: gethostbyaddr needes to much time if there are many users online // $out .= "\t\t\t<tr>\r\n\t\t\t<td>" . $username . "</td>\r\n\t\t\t<td><a href=\"index.php?page=" . $users_online->page . "\">" . $users_online->page . "</a></td>\r\n\t\t\t<td>" . date("d.m.Y H:i:s", $users_online->lastaction) . "</td>\r\n\t\t\t<td>" . $admin_lang[$users_online->lang] . "</td>\r\n\t\t\t<td>" . $users_online->ip . "</td>\r\n\t\t\t<td>" . $users_online->host . "</td>\r\n\t\t</tr>\r\n"; } $out .= "</table>"; return $out; }
<?php require_once __DIR__ . '/app/models/user.php'; //require_once __DIR__ . '/app/models/post.php'; require_once __DIR__ . '/libs/storage.php'; require_once __DIR__ . '/libs/viev.php'; $user = getUserById(isset($_GET['id']) ? $_GET['id'] : ''); if (!$user) { header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not found'); exit('Post not found!'); } //var_dump($post); ?> <!Doctype html> <html> <head> <meta charset="utf-8"> <title><?php echo $user['login']; ?> </title> </head> <body> <p>Имя пользователя: <?php echo $user['login']; ?> </p> <p><?php echo $post['login']; ?>
<?php header('Content-Type: application/json'); include "../../include/dbcon.inc.php"; include "../../include/functions.php"; include "../../include/pm_functions.inc.php"; include "../../include/push_functions.inc.php"; $user_id = getUserIdFromToken($con, @$_POST["token"]); $dog_id = $con->real_escape_string($_POST["dog_id"]); $symptoms = $con->real_escape_string($_POST["symptoms"]); $place_id = $con->real_escape_string($_POST["place_id"]); $duedate = $con->real_escape_string($_POST["duedate"]); $volume = $con->real_escape_string($_POST["volume"]); $user = getUserById($user_id, $con); $dog = getDogById($dog_id, $con); $bloodtype = getBloodTypeById($dog["dog_bloodtype_id"], $con); $bloodstores = getBloodStoreByBloodTypeId($dog["dog_bloodtype_id"], $con); $result = 0; if (sizeof($bloodstores) > 0) { //Found Blood In Hospital Blood Store //create bloodstore_id string $bloodstore_ids = array(); foreach ($bloodstores as $key => $bloodstore) { array_push($bloodstore_ids, $bloodstore["bloodstore_id"]); } $bloodstore_id = implode(",", $bloodstore_ids); $con->query("INSERT INTO `request`(`request_id`, `from_user_id`, `for_dog_id`, `symptoms`, `place_id`," . " `duedate`, `request_type`, `bloodstore_id`, `created_time`, `amount_volume`) " . "VALUES (null,'{$user_id}','{$dog_id}','{$symptoms}','{$place_id}','{$duedate}',1,'{$bloodstore_id}',now(),'{$volume}')"); //save to db (request_type = 1) $senthospital_id = array(); //store sent hospital id $message = "การขอรับเลือดของ" . $dog["dog_name"] . " เมื่อ " . date("j") . " " . $thai_month_short_arr[date("n")] . " " . (date("Y") + 543) . " " . "พบเลือดกรุ๊ป " . $bloodtype["bloodtype_name"] . " ที่โรงพยาบาลดังนี้";
<div class="score-tabs"> <div class="col-md-2"></div> <div class="col-md-8"><ul class="gamepoint"> <li><a href="game-point-leader-board">All Time </a></li> <li><a href="game-point-weekly-leader-board">This Week</a></li> <li><a href="game-point-daily-leader-board">Today </a></li> </ul></div> <div class="clearfix"></div> <div class="highscore"> <div class="row"> <div class="col-md-12"> <h3>Today Leaderboard</h3> </div> <?php if (isset($_SESSION['user_loged_id'])) { $user_information = getUserById($_SESSION['user_loged_id']); $u_info = mysql_fetch_array($user_information); $current_user = countDailyUserDailyPointByUserId($_SESSION['user_loged_id']); if ($current_user > 0) { $user_current_score = mysql_fetch_array($current_user); } $utilize = countUtilizeUserPointByUserId($_SESSION['user_loged_id']); $utilize_point = mysql_fetch_array($utilize); ?> <?php if ($user_current_score['user_id'] > 0) { ?> <div class="bdr-bot-red"> <div class="col-md-1 nopad-right"> <img src="user_images/<?php echo $u_info['photo'];
<?php session_start(); include "dbconnection.php"; if (isset($_SESSION['user_loged_id'])) { $session_id = $_SESSION['user_loged_id']; $user_detail = getUserById($_SESSION['user_loged_id']); $user = mysql_fetch_array($user_detail); } else { header("location:maverick-game-user-login"); } ?> <!DOCTYPE HTML> <html> <head> <title>Purchase Coins | Maverick Game</title> <meta name="description" content="" /> <meta name="keywords" content="" /> <link rel="shortcut icon" href="favicon.png" type="image/x-icon"/> <link href='http://fonts.googleapis.com/css?family=PT+Sans:400,700' rel='stylesheet' type='text/css' /> <link href='http://fonts.googleapis.com/css?family=Didact+Gothic' rel='stylesheet' type='text/css'> <link rel="stylesheet" type="text/css" href="assets/css/style.css"/> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="assets/js/jquery.min.js" type="text/javascript"></script> <script src="assets/js/bootstrap.min.js"></script> <script src="assets/js/script.js"></script> <!--[if lt IE 9]> <script src="http://css3-mediaqueries-js.googlecode.com/files/css3-mediaqueries.js"></script> <script src="/assets/js/respond.min.js"></script> <![endif]-->
</a> <ul class="dropdown-menu"> <li class="header">You have <?php echo $total_game_comment['game_comment_id']; ?> Game Comments Notification</li> <li> <!-- inner menu: contains the actual data --> <ul class="menu"> <?php $games_notification = getAllNotificationGames($last_game['game_comment_id']); if ($games_notification) { while ($game_notification = mysql_fetch_array($games_notification)) { $games_users = getUserById($game_notification['user_id']); $game_user = mysql_fetch_array($games_users); ?> <li><!-- start message --> <a href="#"> <div class="pull-left"> <?php if ($rhyme_user['userimages'] != '') { ?> <img src="../userimages/<?php echo $game_user['userimages']; ?> " class="img-circle" alt="User Image"/> <?php
?> </div> </div> <?php } } ?> <?php $get_reply = getReplyByThreadByReply($thread_id); if ($get_reply > 0) { while ($reply_get = mysql_fetch_array($get_reply)) { $thread_user = getUserById($reply_get['user_id']); $userthread = mysql_fetch_array($thread_user); ?> <div class="col-md-12 postdtl"> <div class="col-md-3 post-display"> <?php if ($userthread['user_name'] != "") { ?> <h3> <?php echo $userthread['user_name']; ?> </h3> <?php } else { ?>
?> <input type="hidden" name="imgName" id="imgName" value="<?php if (isset($imgname)) { echo $imgname; } ?> " /> </form> <?php if (isset($_REQUEST['update'])) { $imgNames = $_POST['imgNames']; $user_crop_image = $imgNames; $user_crop_image = explode("/", $imgNames); $profile_img_query = mysql_query("UPDATE glogin_users SET photo='{$user_crop_image['1']}' WHERE id='{$session_id}'"); unset($_SESSION['loged_user_image']); $users = getUserById($session_id); $user = mysql_fetch_array($users); $_SESSION['loged_user_image'] = $user['photo']; //echo "<strong style='background-color:green'; color:#fff; font-size:12px; padding:3px 5px'>Your Profile Picture has been Update Sucessfully</strong>"; echo "<script type='text/javascript'>\n\t\t\t\t\t\ttop.location.href = 'user-profile.php';\n\t\t\t\t\t\t</script>"; } ?> </div> </div> </div> </div> </div> </div> </div>
function updateUser($userId, $name, $email, $password, $privilegeId) { $sql = "UPDATE users " . "SET name = ?, email = ?, password = ?, privilege_id=? " . "WHERE id = ?"; $sqlVars = array($name, $email, $password, $privilegeId, $userId); return getUserById($userId) ? query($sql, $sqlVars) : false; }
<?php session_start(); if (isset($_POST['submit'])) { include "dbconnection.php"; $puzzle_id = mysql_real_escape_string($_POST['puzzle_id']); $rhymes = getPuzzleById($puzzle_id); $rhyme = mysql_fetch_array($rhymes); $rhyme_seo = $rhyme['seo_puzzle']; if (isset($_SESSION['user_id'])) { $users = getUserById($_SESSION['user_id']); $user = mysql_fetch_array($users); $comments = mysql_real_escape_string($_POST['comments']); addPuzzleComments($puzzle_id, $comments, $_SESSION['user_id']); $base_url = "http://thefunkids.com/admin"; $subject = "Comments on Rhymes for Moderation"; $from = "*****@*****.**"; $to = "*****@*****.**"; $mail_body = "Dear All,<br/><br/> A comment has been posted on our website TheFunKids.com and is pending approval. Kindly review and <br /><br /> moderate whether the comment should be posted or not.<br /><br /><br/>Login Url:<a href=" . $base_url . ">" . $base_url . "</a><br/><br/><strong>User Name:</strong>admin@thefunkids.com<br><strong>Password:</strong>admin123<br/></br>Regards & Love<br/><br/>The Fun Kids Team"; $body = wordwrap($mail_body, 2000); //$body_user = wordwrap($mail_body_user,70); $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $headers .= "From: " . $from . "\r\n"; $headers .= 'Bcc:amohsin@golive.com.pk,saher@golive.com.pk' . "\r\n"; //------------------------Thanks You Email------------------------------------------------------------------- mail($to, $subject, $mail_body, $headers); header("location:kid-puzzle-{$rhyme_seo}&comment#puzzles"); } elseif (isset($_SESSION['FBID'])) { $user_facebook_id = getUserByFaceBookId($_SESSION['FBID']); if ($user_facebook_id) {
function sendUserToMail($userId) { //1. получить пользователя по $id_user - пиши. $user = getUserById($userId); //строка записи из таблицы users //2. получить адрес пользователя. $address = getUserFullAddress($user['id_address']); /*header("Content-Type: text/html;charset=utf-8"); echo '<pre>'; print_r($user); print_r($address); die;*/ //пиши все остальное. $msg = "Ф.И.О: {$user['fio']}\n Email: {$user['email']}\n Телефон: {$user['phone']}\n Статус: {$user['name_status']}\n Адрес: {$address['fullAddress']}, кв. {$address['kv']}\n Логин: {$user['login']}\n Пароль: {$user['password']}"; $subject = ''; $to = '*****@*****.**'; //почта получателя $send = sendMail("Name", $to, 'example.ru', 'info@example.ru/', $subject, $msg); return $send; }
function createUserPlace(PDO $db, $user_id, $restaurant_id) { require_once __DIR__ . '/../account/account.php'; $response = getUserById($db, $user_id); if ($response->getType() != Response::SUCCESS) { return new ErrorResponse("User does not exist."); } $query = ' INSERT INTO user_places( user_id, restaurant_id ) VALUES( :user_id, :restaurant_id )'; try { $statement = $db->prepare($query); $statement->bindValue(':user_id', $user_id, PDO::PARAM_INT); $statement->bindValue(':restaurant_id', $restaurant_id, PDO::PARAM_INT); $statement->execute(); if ($statement->rowCount() >= 1) { return new SuccessResponse("User place created.", $response->getData()); } return new ErrorResponse('User place could not be registered.'); } catch (PDOException $ex) { return new ExceptionResponse('PDOException was caught.', $ex); } }
function editUser($data) { $user_info = getUserById($data['userId']); $sql = "UPDATE " . e50; $implode = array(); if (isset($data['username'])) { if ($user_info['username'] != $data['username']) { $implode[] = " username = '******'username'] . "'"; insertUserLog($data['userId'], 1, $user_info['username'], $data['username']); } } if (isset($data['email'])) { if ($user_info['email'] != $data['email']) { $implode[] = " email = '" . $data['email'] . "'"; insertUserLog($data['userId'], 2, $user_info['email'], $data['email']); } } if (isset($data['password'])) { if ($user_info['password'] != $data['password']) { $implode[] = " password = '******'password'] . "'"; insertUserLog($data['userId'], 3, $user_info['password'], $data['password']); } } if (isset($data['group_id'])) { if ($user_info['group_id'] != $data['user_group']) { $implode[] = " group_id = '" . $data['user_group'] . "'"; insertUserLog($data['userId'], 4, $user_info['group_id'], $data['user_group']); } } if (isset($data['status'])) { if ($user_info['status'] != $data['status']) { $implode[] = " status = '" . $data['status'] . "'"; insertUserLog($data['userId'], 5, $user_info['status'], $data['status']); } } if ($implode) { $sql .= " SET " . implode(" , ", $implode); } $sql .= " WHERE id='" . $data['userId'] . "'"; $query = mysql_query($sql); if ($query) { return true; } return false; }
<td style="background:#f4f4f4; width:54%;"><span class="tabletd"> <a href="mom-forum-thread-<?php echo $thread['thread_seo']; ?> "> <?php $string = strip_tags($thread['thread_message']); if (strlen($string) > 100) { // truncate string $stringCut = substr($string, 0, 100); // make sure it ends in a word so assassinate doesn't become ass... $string = substr($stringCut, 0, strrpos($stringCut, ' ')) . '...'; } echo $string; if ($thread['user_id'] > 0) { $user_detail = getUserById($thread['user_id']); $user = mysql_fetch_array($user_detail); echo "<br> by "; ?> <span style='color: #688031'><?php echo $user['name']; ?> <br></span> <?php echo date("d-m-y", strtotime($thread['createdAt'])); } ?> </a> </span></td> <td class="text-center" style="background:#efefef; width:8%;"><sprean class="tabletd"> <?php
session_start(); if (isset($_REQUEST['post_id'])) { include "dbconnection.php"; $post_id = $_GET['post_id']; $reply_type = $_GET['reply_type']; if ($reply_type == 'quote') { $reply_type = "quick reply"; } else { $reply_type = "reply"; } $thread_user_id = $_GET['thread_user_id']; $post_status = $_GET['post_status']; $thread_post_user = getUserById($thread_user_id); $thread_user = mysql_fetch_array($thread_post_user); $post_user = $_GET['post_user_id']; $post_user = getUserById($post_user); $user_post = mysql_fetch_array($post_user); approveThreadPosts($post_id, $post_status); $subject = "Quick reply to thread"; $from = "*****@*****.**"; $to = $thread_user['email']; $mail_body = "Hi " . $thread_user['name'] . "<br/><br/>" . $user_post['name'] . ",<br/><br/> has post a" . $reply_type . " to thread has been posted on your thread on TheFunKids.com<br /><br /></br>Regards & Love<br/><br/>The Fun Kids Team"; $body = wordwrap($mail_body, 2000); //$body_user = wordwrap($mail_body_user,70); $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $headers .= "From: " . $from . "\r\n"; $headers .= 'Bcc:raheelaslam@golive.com.pk,amohsin@golive.com.pk,saher@golive.com.pk' . "\r\n"; //------------------------Thanks You Email------------------------------------------------------------------- mail($to, $subject, $mail_body, $headers); header("location:mom-forum-posts.php");
$_POST = array_map('strip_tags', $_POST); $commentDate = getdate(); $errors = []; $msg = "error"; if (isset($_POST['submit'])) { // Récupère les données de l'article à sauvegarder $commentToEdit['id_article'] = $_POST['id_article']; $commentToEdit['author_comment'] = $_POST['author_comment']; $commentToEdit['content_comment'] = $_POST['content_comment']; $commentToEdit['emailauthor_comment'] = $_POST['emailauthor_comment']; $commentToEdit['gresponse'] = $_POST['g-recaptcha-response']; if (isset($commentToEdit['date_comment'])) { $commentDate = array_reverse(array_values($commentToEdit['date_comment'])); } // sauvegarde d'un article $errors = validComment($commentToEdit); //verifiyIdentity() if (empty($errors)) { $commentToEdit['date_article'] = implode("-", $commentDate); saveComment($commentToEdit); $msg = "ok"; } header('Location: index.php?id=' . $commentToEdit['id_article'] . "&msg={$msg}"); exit; } else { if (isset($_GET['id']) && isset($_SESSION['id_user'])) { moderateComment($_GET['id'], getUserById($_SESSION['id_user'])); } } header('Location: index.php'); exit;
<input name="" type="submit" value="submit" class="search-btn"> </form> </div> </div> </div> <?php if (isset($_SESSION['user_loged_id'])) { $user_profile_pics = getUserById($_SESSION['user_loged_id']); $user_profile_pic = mysql_fetch_array($user_profile_pics); ?> <div class="col-md-4"> <?php $user_coins = getCoinsByUserId($_SESSION['user_loged_id']); $user_coins = getCoinsByUserId($_SESSION['user_loged_id']); $user_coin = mysql_fetch_array($user_coins); if ($user_coin['total_coins'] > 0) { ?> ?> <div class="col-sm-6 col-md-5 col-xs-5 nopad"> <div class="coins"> <p><?php echo $user_coin['total_coins']; ?>
<div class="recent-discussions"> <h2>Recent Discussions</h2> <ul> <?php $recent_posts = getRecentThreadPost(); if ($recent_posts > 0) { while ($recent_post = mysql_fetch_array($recent_posts)) { $recent_post_users = getUserById($recent_post['user_id']); $recent_post_user = mysql_fetch_array($recent_post_users); ?> <li> <div class="picture main-column-picture"> <div class="post-count"><span class="sprite count"> <?php $post = countPostByUserId($recent_post_user['id']); $totalpost = mysql_fetch_array($post); echo $totalpost[0]; ?> </span></div> <div class="discuss-name"><a class="topic" href="game-forum-post-<?php echo $recent_post['thread_seo']; ?> "><?php echo $recent_post['thread_name']; ?> </a><br> <span class="date"><?php echo date("d-m-y", strtotime($recent_post['createdAt'])); ?> by </span> <a class="author" href="game-forum-post-<?php
<?php session_start(); include "dbconnection.php"; if (isset($_SESSION['user_loged_id'])) { $user_payements = getUserById($_SESSION['user_loged_id']); $user_payement = mysql_fetch_array($user_payements); if (isset($_REQUEST['package_id'])) { $package_id = $_REQUEST['package_id']; $user_id = $_SESSION['user_loged_id']; $rand = strtoupper(substr(uniqid(sha1(time())), 0, 6)); $unique = $rand; addNewOrders($user_id, $package_id, $unique); $view = "select * from maverick_packages where package_id={$package_id}"; $show = mysql_query($view); $row = mysql_fetch_array($show); if (date('d') == 31 || date('m') == 1 && date('d') > 28) { $date = strtotime('last day of next month'); } else { $date = strtotime('+1 months'); } } else { header("location:purchase-coins"); } } else { header("location:maverick-game-user-login"); } ?> <!DOCTYPE HTML> <html> <head>
<?php // controller for admin delete page... // must be logged in to view... requireLogin(); // data supporting page... include DATA . 'users.php'; // variable for page logic... $id = $_GET['id']; // page logic... if (!empty($_POST)) { if ($_POST['deleteConf'] == 'Yes') { deleteUser($id); session_destroy(); header('Location: ?page=deleteSuccess'); } elseif ($_POST['deleteConf'] == 'No') { header('Location: ?page=admin'); } } // variable... $user = getUserById($id); // views... include VIEWS . 'header.php'; include VIEWS . 'contentAdminDelete.php'; include VIEWS . 'footer.php';
</td> <td><?php echo substr($tache[2], 0, 10) . "..."; ?> </td> <td><?php echo $tache[3]; ?> </td> <td><?php echo $tache[4]; ?> </td> <td><?php if ($tache[5] != '1000') { echo getUserById($tache[5]); } else { echo 'Public'; } ?> </td> <td> <input type="button" value="Terminer" onclick="terminerTache(<?php echo $tache[0]; ?> )"> <!-- <input type="image" src="images/icn_trash.png" title="Trash" onclick="deleteTache(<?php //echo $tache[0]; ?> )"> -->
<a href="index.php?controller=product&action=new"> Thêm sản phẩm mới </a> <table class="my-table"> <tr><th>STT</th><th>Minh họa</th><th>Tên</th><th>Giá</th> <th>Lượt xem</th> <th>Người tạo</th> <th>Xem </th> <th>Chỉnh sửa</th> <th>Xóa</th> </tr> <?php $products = getProducts(); while ($p = mysql_fetch_array($products)) { echo "<tr><td>{$p['id']}</td>"; echo "<td><img src='{$p['img']}' width=50 height = 50 /></td>"; echo "<td class ='align-left'>{$p['name']}</td>"; echo "<td>{$p['price']}</td>"; echo "<td>{$p['view']}</td>"; $u = getUserById($p['user_id']); echo "<td>{$u['fullname']}</td>"; echo "<td><a href='index.php?controller=product" . "&action=view&id={$p['id']}'>Xem</a></td>"; echo "<td><a href='index.php?controller=product" . "&action=edit&id={$p['id']}'>Sửa</a></td>"; echo "<td><a href='index.php?controller=product" . "&action=delete&id={$p['id']}'>Xóa</a></td></tr>"; } ?> </table> <?php include "view/theme/footer.php";
<?php require_once '../include.php'; checkLogined(); $rows = getAllProv(); if (!$rows) { alertMes("没有相应省份,请先添加省份!!", "addProv.php"); } $rows_city = getAllCity(); if (!$rows_city) { alertMes("没有相应城市,请先添加城市!!", "addCity.php"); } $id = $_REQUEST['id']; $userInfo = getUserById($id); //print_r($userInfo); ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>-.-</title> <link href="./styles/global.css" rel="stylesheet" type="text/css" media="all" /> <script type="text/javascript" charset="utf-8" src="../plugins/kindeditor/kindeditor.js"></script> <script type="text/javascript" charset="utf-8" src="../plugins/kindeditor/lang/zh_CN.js"></script> <script type="text/javascript" src="./scripts/jquery-1.6.4.js"></script> <script> KindEditor.ready(function(K) { window.editor = K.create('#editor_id'); }); $(document).ready(function(){
<div class="col-lg-6 bor-right"> <h2>Player</h2> </div> <div class="col-lg-4 text-center"> <h2>Score</h2> </div> </div> </div> <?php $i = 0; $game_id = 1; $sore_games = getGameScoreByScoreId($game_id); if ($sore_games > 0) { while ($score_game = mysql_fetch_array($sore_games)) { $i++; $games_scores_user = getUserById($score_game['user_id']); $game_score_user = mysql_fetch_array($games_scores_user); ?> <div class="score-row"> <div class="row"> <div class="col-lg-2 bor-right-red text-center"> <h2> <?php echo $i; ?> </h2> </div> <div class="col-lg-6 bor-right-red"> <?php if (isset($game_score_user['photo']) != "") { ?>
<form method="post" action="dopostgamecomments.php"> <input type="hidden" name="game_id" value="<?php echo $game_id; ?> "/> <textarea name="comments" cols="" rows=""></textarea> <a href="#games"><input type="submit" name="submit" value="POST A COMMENT" class="btn-coment sign-in"></a> </form> <div class="discus"> <?php $rhyme_comment = getApproveGameComment($game_id); if ($rhyme_comment > 0) { while ($rhymecomment = mysql_fetch_array($rhyme_comment)) { $user_id = $rhymecomment['user_id']; $user_comment = getUserById($user_id); while ($user = mysql_fetch_array($user_comment)) { ?> <div class="action"> <h4> <?php echo $user['name']; ?> </h4> <br/> <?php if ($user['userimages'] != '') { ?> <img src="userimages/<?php echo $user['userimages']; ?>