Exemple #1
0
<?php

require "../config.php";
require "code_page.php";
require "process.php";
require "layout.php";
session_start();
if (!isset($_SESSION['login_user'])) {
    header('Location: ../login.php');
    exit;
}
$id = $_SESSION['login_user'];
reset_temp($_SESSION['login_user'], $pdo);
$sth = $pdo->prepare("SELECT * FROM students WHERE Student_ID = :id");
$sth->bindParam(':id', $id, PDO::PARAM_STR);
$sth->execute();
while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
    $name = $row['Name'];
    $pic_url = $row["pic_url"];
    $email = $row["email"];
    $faculty = $row["Faculty"];
}
?>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>AdminLTE 2 | Starter</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <?php 
include_css();
Exemple #2
0
<?php

require "config.php";
require "layout.php";
require "process.php";
session_start();
if (!isset($_SESSION['login_user'])) {
    header('Location: login.php');
    exit;
}
reset_temp($pdo);
$id = $_SESSION['login_user'];
$sth = $pdo->prepare("SELECT * FROM students WHERE Student_ID = :id");
$sth->bindParam(':id', $id, PDO::PARAM_STR);
$sth->execute();
while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
    $name = $row['Name'];
    $email = $row['email'];
    $phone = $row['phone'];
}
$sth = $pdo->prepare("SELECT Student_ID FROM students");
// ลอง คิวรี่ รหัสนิสิตทุกคนเข้าใส่ อาเรย์
$sth->execute();
while ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
    $all_id[] = $row['Student_ID'];
}
?>

<html>
<meta charset = "utf-8">
<head>