IMG-LOGO
×

Hướng dẫn cài đặt môi trường

[Bài Viết] Hướng dẫn cài composer [Bài Viết] Hướng dẫn tạo dự án Laravel đầu tay. [Bài Viết] Hướng dẫn cấu hình cơ sở dữ liệu và bật chức năng auth có sẵn trong Laravel [Bài Viết] Hướng dẫn cài theme Acacha AdminLTE cho Laravel [Bài Viết] Hướng dẫn tắt debug khi upload dự án laravel lên HOST [Video] Hướng dẫn cài đặt môi trường + tạo dự án + Tìm hiểu Route qua ví dụ - Lập trình Laravel [Video] Hướng dẫn cài đặt dự án Laravel + Cài đặt chức năng Auth (login + register) trong Laravel

Tìm hiểu Route & View & Controller

[Video] Tìm hiểu Route trong Laravel + Học lập trình laravel qua ví dụ Hello World, ax+b=0, Hiển thị danh sách sinh viên [Video] Tìm hiểu Route qua ví dụ quản lý sinh viên - Laravel [Video] Hướng dẫn tìm hiểu Route - Controller - View trong Laravel qua ví dụ [Video] Lập trình Laravel - Truyền dữ liệu từ Controller qua View - Ví dụ Hello World trong Laravel Phần 1 [Video] Lập trình Laravel - Truyền dữ liệu từ Controller qua View - Ví dụ Tính giai thừa trong Laravel Phần 2 [Video] Lập trình Laravel - Truyền dữ liệu từ Controller qua View - Ví dụ hiển thị danh sách sinh viên trong Laravel Phần 3

GET/POST trong Laravel

[Video] Tìm hiểu GET/POST trong Laravel qua ví dụ nhập thông tin người dùng - Lập trình Laravel [Video] Quản lý sinh viên bằng Laravel - Lập trình Laravel

Layout - Blade

[Video] Tìm hiểu Route - Blade (nhung css/js/photos) - cú pháp Blade - Xử lý GET/POST trong Laravel [Video] Hướng dẫn tìm hiểu layout trong Laravel - qua ví dụ tạo website tin tức - Lập Trình Laravel

Kết nối CSDL - Laravel

[Video] Hướng dẫn tìm hiểu view, migration, seeder, db - laravel - Qua ví dụ quản lý sinh viên [Video] Học Laravel qua ví dụ thêm & hiển thị tài khoản người dung - DB::Insert - DB::get - Paginate - Khoá Học Laravel [Video] - Chương trình quản lý điểm danh Aptech - Lập trình Laravel - Lập trình PHP/Laravel [Video] Bài tập quản lý sách bằng Laravel - Full Source Code quản lý sách - Lập trình Laravel [Video] - Tạo 1 POS bán hàng cho siêu thị - Supper Market - Lập trình Laravel [Video] Hướng dẫn tim hiểu Pagination + model qua ví dụ quản lý sinh viên - Lập trình Laravel

Phân quyền - Chức năng nâng cao

[Video] - Tìm hiểu Auth trong Laravel [Video] Phân Quyền-Hướng dẫn viết chức năng phân quyền người dùng theo role Lâp Trình PHP/Laravel [Video] API Resful Laravel - Hướng dẫn tạo API Resful bằng PHP/Laravel - Khóa học lập trình PHP/Laravel

Thực Chiến: Web bán hàng

[Video] Hướng dẫn tạo dự án super market - phần 1 - Laravel [Video] Hướng dẫn tạo dự án super market - phần 2- laravel [Video] Tạo giở hàng - học lập trình laravel qua project- Phần 3 - laravel




Trang Chủ Học Laravel Examination & Test - Lập trình PHP/Laravel

Examination & Test - Lập trình PHP/Laravel

by GokiSoft.com - 15:45 29/06/2020 10,091 Lượt Xem

Đề tài: Sử dụng PHP hoặc PHP/Laravel

- Tạo dự án quản lý sinh viên 

- Tạo website bán hàng

Bình luận



Chia sẻ từ lớp học

Thành Lâm [T1907A]

Ngày viết: 15:08 03/07/2020

Phan Bạch Tùng Dương [T1907A]

Ngày viết: 13:42 03/07/2020



 <?php 
// session_start();
require_once('database.php');

 ?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="">
  <meta name="author" content="">
  <title>HomePage</title>
<!-- Latest compiled and minified CSS -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">

	<!-- jQuery library -->
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

	<!-- Popper JS -->
	<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>

	<!-- Latest compiled JavaScript -->
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
	<style type="text/css">
		body{
			margin-top: 100px;
		}

    body {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: url("https://cdn.pixabay.com/photo/2017/08/30/01/05/milky-way-2695569_960_720.jpg");
  background-size: cover;
  opacity: 0.9;
}
		a.btn.btn-danger {
		    margin-left: 15px;
		}
		p.btn.btn-success {
		    margin-top: 16px;
		}
		span.btn.btn-primary {
	    margin-left: 15px;
	}
	</style>
</head>

<body>

  <!-- Navigation -->
  <nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
    <div class="container">
      <a class="navbar-brand" href="#">Shop PP</a>
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse" id="navbarResponsive">
        <ul class="navbar-nav ml-auto">
          <li class="nav-item active">
            <a class="nav-link" href="index.php">Home
              <span class="sr-only">(current)</span>
            </a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="#">About</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="admin.php">Admin</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="contact.php">Contact</a>
          </li>
        </ul>
      </div>
    </div>
  </nav>

  <!-- Page Content -->
  <div class="container">

    <div class="row">

      <div class="col-lg-3">

        <h1 class="my-4" style="font-family: serif;color: white">Category</h1>
        <div class="list-group">
          <a href="#" class="list-group-item" style="text-decoration: none;color: black">Smart phone</a>
          <a href="#" class="list-group-item" style="text-decoration: none;color: black">Smart TV </a>
          <a href="#" class="list-group-item" style="text-decoration: none;color: black">Laptop</a>
          <a href="#" class="list-group-item" style="text-decoration: none;color: black">...</a>
        </div>

      </div>
      <!-- /.col-lg-3 -->

      <div class="col-lg-9">

        <div id="carouselExampleIndicators" class="carousel slide my-4" data-ride="carousel">
          <ol class="carousel-indicators">
            <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
            <li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
            <li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
          </ol>
          <div class="carousel-inner" role="listbox">
            <div class="carousel-item active">
              <img class="d-block img-fluid" src="https://cf.shopee.vn/file/978a1c7f14be325d32d8fed73fefbe73_xxhdpi" alt="First slide">
            </div>
            <div class="carousel-item">
              <img class="d-block img-fluid" src="https://cf.shopee.vn/file/d57f406bfe304ed39a41271127c0a5d7_xxhdpi" alt="Second slide">
            </div>
            <div class="carousel-item">
              <img class="d-block img-fluid" src="https://cf.shopee.vn/file/ea16ac9fe9cce72078a243c5becd0964_xxhdpi"alt="Third slide">
            </div>
          </div>
          <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
            <span class="carousel-control-prev-icon" aria-hidden="true"></span>
            <span class="sr-only">Previous</span>
          </a>
          <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
            <span class="carousel-control-next-icon" aria-hidden="true"></span>
            <span class="sr-only">Next</span>
          </a>
        </div>

        <div class="row">
		<?php 
			$sql = 'select * from product ';
			$productList = executeResult($sql);
			foreach ($productList as $prd) {
				echo '<div class="col-lg-4 col-md-6 mb-4">
        		<div class="card h-100">
        			<a href="#"><img class="card-img-top" src='.$prd['link'].' alt=""></a>
        			<div class="card-body">

        				<h4 class="card-title">
        					<a href="#" name="nameproduct1">'.$prd['nameproduct'].'</a>
                  <span class="btn btn-primary">New</span>
        				</h4>
        				<h5 name = "price1">'.$prd['price'].'₫</h5>
        				<p class="card-text" name = "title1">'.$prd['title'].'</p>
                <button class="btn btn-danger" onclick=\'window.open("productdetails.php?id='. $prd['id'].'","_self")\'>Detail</button>
                <p class="btn btn-success">Trả góp: '.$prd['installment'].'%</p>
        			</div>
        			<div class="card-footer">
        				<small class="text-muted">&#9733; &#9733; &#9733; &#9733; &#9734;</small>        		  				
        			</div>
        		</div>
        	</div>';
			}
		 ?>

        <!-- /.row -->

      </div>
      <!-- /.col-lg-9 -->

    </div>
    <!-- /.row -->

  </div>
  <!-- /.container -->

 

  <!-- Bootstrap core JavaScript -->
<!--   <script type="text/javascript">
		function ViewProduct(id) {
			console.log(id)
			$.post('GetIdProduct.php', {
				'id': id
			}, function(data) {
				alert(id)
				window.open('productdetails.php');
			})
		}
	</script> -->

  <!-- Footer -->
  <footer class="py-5 bg-dark">
    <div class="container">
      <p class="m-0 text-center text-white">Copyright &copy; Your PP</p>
    </div>
    <!-- /.container -->
  </footer>
</body>

  <script src="vendor/jquery/jquery.min.js"></script>
  <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

</html>



<?php
require_once ('database.php');

$_nameproduct = $_link = $_price = $_installment = $_title ='';

if (!empty($_POST)) {
	$_id = '';

	if (isset($_POST['nameproduct'])) {
		$_nameproduct = $_POST['nameproduct'];
	}
	if (isset($_POST['link'])) {
		$_link = $_POST['link'];
	}
	if (isset($_POST['price'])) {
		$_price	 = $_POST['price'];
	}

	if (isset($_POST['installment'])) {
		$_installment = $_POST['installment'];
	}

	if (isset($_POST['title'])) {
		$_title = $_POST['title'];
	}

	if (isset($_POST['id'])) {
		$_id = $_POST['id'];
	}

	$_nameproduct = str_replace('\'', '\\\'', $_nameproduct);
	$_price      = str_replace('\'', '\\\'', $_price);
	$_link  = str_replace('\'', '\\\'', $_link);
	$_installment       = str_replace('\'', '\\\'', $_installment);
	$_title       = str_replace('\'', '\\\'', $_title);


	if ($_id != '') {
		//update
		$sql = "update product set nameproduct = '$_nameproduct', link = '$_link', price = '$_price' , installment = '$_installment',title = '$_title' where id = " .$_id;
	} else {
		//insert
		$sql = "insert into product(nameproduct, link, price,installment,title) value ('$_nameproduct
		', '$_link', '$_price','$_installment','$_title')";
	}
	execute($sql);

	header('Location: admin.php');
	die();
}

$id = '';
if (isset($_GET['id'])) {
	$id          = $_GET['id'];
	$sql         = 'select * from product where id = '.$id;
	$productList = executeResult($sql);
	if ($productList != null && count($productList) > 0) {
		$prd        = $productList[0];
		$_nameproduct = $prd['nameproduct'];
		$_link      = $prd['link'];
		$_price  = $prd['price'];
		$_installment  = $prd['installment'];
		$_title  = $prd['title'];
	} else {
		$id = '';
	}
}
?>

<!DOCTYPE html>
<html>
<head>
	<title>Registation Form * Form Tutorial</title>
	<!-- Latest compiled and minified CSS -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">

	<!-- jQuery library -->
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

	<!-- Popper JS -->
	<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>

	<!-- Latest compiled JavaScript -->
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
</head>
<body>
	<div class="container">
		<div class="panel panel-primary">
			<div class="panel-heading">
				<h2 class="text-center">Thêm Sản Phẩm</h2>
			</div>
			<div class="panel-body">
				<form method="post">
					<div class="form-group">
					  <label for="usr">Tên Sản Phẩm:</label>
					  <input type="number" name="id" value="<?=$id?>" style="display: none;">
					  <input required="true" type="text" class="form-control" id="usr" name="nameproduct" value="<?=$_nameproduct?>">
					</div>
					<div class="form-group">
					  <label for="birthday">Link Sản Phẩm:</label>
					  <input type="text" class="form-control" id="link" name="link" value="<?=$_link?>">
					</div>
					<div class="form-group">
					  <label for="address">Giá Sản Phẩm:</label>
					  <input type="text" class="form-control" id="price" name="price" value="<?=$_price?>">
					</div>
					<div class="form-group">
					  <label for="address">Phần Trăm Trả Góp:</label>
					  <input type="number" class="form-control" id="installment" name="installment" value="<?=$_installment?>">
					</div>
					<div class="form-group">
					  <label for="address">Tiêu đề:</label>
					  <input type="text" class="form-control" id="title" name="title" value="<?=$_title?>">
					</div>
					<button class="btn btn-success">Lưu</button>
				</form>
			</div>
		</div>
	</div>
</body>
</html>



<?php
require_once ('database.php');
?>
<!DOCTYPE html>
<html>
<head>
	<title>Admin Product</title>
	<!-- Latest compiled and minified CSS -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">

	<!-- jQuery library -->
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

	<!-- Popper JS -->
	<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>

	<!-- Latest compiled JavaScript -->
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
</head>
<body>
	<div class="container">
		<div class="panel panel-primary">
			<div class="panel-heading" style="color: red; text-align: center; font-size: 30px;">
				Quản lý thông tin sản phẩm
				<form method="get">
					<input type="text" name="search" class="form-control" style="margin-top: 15px; margin-bottom: 15px;" placeholder="Tìm kiếm theo tên sản phẩm">
				</form>
			</div>
			<div class="panel-body">
				<table class="table table-bordered">
					<thead>
						<tr>
							<th>STT</th>
							<th>Tên sản phẩm</th>
							<th>Link sản phẩm</th>
							<th>Giá sản phẩm </th>
							<th>Phần trăm trả góp</th>
							<th>Tiêu đề</th>
							<th width="60px"></th>
							<th width="60px"></th>
						</tr>
					</thead>
					<tbody>
<?php
if (isset($_GET['search']) && $_GET['search'] != '') {
	$sql = 'select * from product where nameproduct like "%'.$_GET['search'].'%"';
} else {
	$sql = 'select * from product';
}

$productList = executeResult($sql);

$index = 1;
foreach ($productList as $pro) {
	echo '<tr>
			<td>'.($index++).'</td>
			<td><img style = "width:300px;height:300px;"   src ="'.$pro['link'].'"/></td>
			<td>'.$pro['nameproduct'].'</td>		
			<td>'.$pro['price'].'</td>
			<td>'.$pro['installment'].'</td>
			<td>'.$pro['title'].'</td>
			<td><button class="btn btn-warning" onclick=\'window.open("AddProduct.php?id='.$pro['id'].'","_self")\'>Edit</button></td>
			<td><button class="btn btn-danger" onclick="deleteProduct('.$pro['id'].')">Delete</button></td>
		</tr>';
}
?>
					</tbody>
				</table>
				<div class="panel panel-primary">
			<div class="panel-heading" style="color: pink; text-align: center; font-size: 30px;">
				Quản lý phản hồi người dùng
				<form method="get">
					<input type="text" name="s" class="form-control" style="margin-top: 15px; margin-bottom: 15px;" placeholder="Tìm kiếm theo tên sản phẩm">
				</form>
			</div>
			<div class="panel-body">
				<table class="table table-bordered">
					<thead>
						<tr>
							<th>STT</th>
							<th>Tên sản phẩm</th>
							<th>Phản hồi người dùng sản phẩm</th>						
							<th width="60px"></th>
						</tr>
					</thead>
					<tbody>
<?php
if (isset($_GET['s']) && $_GET['s'] != '') {
	$sql = 'select * from contact where contactname like "%'.$_GET['s'].'%"';
} else {
	$sql = 'select * from contact';
}

$productList = executeResult($sql);

$index = 1;
foreach ($productList as $pro) {
	echo '<tr>
			<td>'.($index++).'</td>
			<td>'.$pro['contactname'].'</td>		
			<td>'.$pro['contact'].'</td>
			<td><button class="btn btn-danger" onclick="deleteProduct('.$pro['id'].')">Delete</button></td>
		</tr>';
}
?>
					</tbody>
				</table>
				<button class="btn btn-success" onclick="window.open('AddProduct.php', '_self')">Add Product</button>
								<a class="btn btn-dark" href="index.php">Back to home</a>
			</div>
		</div>
	</div>

	<script type="text/javascript">
		function deleteProduct(id) {
			option = confirm('Bạn có muốn xoá sản phẩm này không?')
			if(!option) {
				return;
			}

			console.log(id)
			$.post('delete_product.php', {
				'id': id
			}, function(data) {
				alert(data)
				location.reload()
			})
		}
	</script>
</body>
</html>



<?php 
	define('HOST', 'localhost');
	define('DATABASE', 'shopmanage');
	define('USERNAME', 'root');
	define('PASSWORD', '');
 ?>



<?php
require_once('database.php');
$_contact= $_nameproduct = '';
if (isset($_POST['contact'])) {
		$_contact = $_POST['contact'];
	}
if (isset($_POST['nameproduct'])) {
		$_nameproduct = $_POST['nameproduct'];
	}
$_contact = str_replace('\'', '\\\'', $_contact);
if ($_contact != '' && $_nameproduct != '') {
	$sql = "insert into contact(nameproduct, contact) values ('$_nameproduct
		', '$_contact')";
		execute($sql);
		header('Location:thanks.php');
die();
}
// execute($sql);
// die();
?>
<!DOCTYPE html>
<html>
<head>
	<title>Contact Product</title>
	<!-- Latest compiled and minified CSS -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">

	<!-- jQuery library -->
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

	<!-- Popper JS -->
	<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>

	<!-- Latest compiled JavaScript -->
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
	<style type="text/css">
		body{
			margin-top: 100px;
		}
		footer.py-5.bg-dark {
			margin-top: 250px;
		}
	</style>
</head>
<body>
	<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
		<div class="container">
			<a class="navbar-brand" href="#">Shop PP</a>
			<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
				<span class="navbar-toggler-icon"></span>
			</button>
			<div class="collapse navbar-collapse" id="navbarResponsive">
				<ul class="navbar-nav ml-auto">
					<li class="nav-item ">
						<a class="nav-link" href="index.php">Home							
						</a>
					</li>
					<li class="nav-item">
						<a class="nav-link" href="#">About</a>
					</li>
					<li class="nav-item">
						<a class="nav-link" href="admin.php">Admin</a>
					</li>
					<li class="nav-item active">
						<a class="nav-link" href="contact.php">Contact</a>
						<span class="sr-only">(current)</span>
					</li>
				</ul>
			</div>
		</div>
	</nav>
	<div class="container">
		<div class="panel panel-primary">
			<div class="panel-heading">
				<h2 class="text-center">Đánh Giá</h2>
			</div>
			<div class="panel-body">
				<form method="post">
					<div class="form-group">
						<label for="nameproduct"> Tên sản phẩm:</label>
						<input type="text" class="form-control" id="nameproduct" name="nameproduct">
					</div>																			
					<div class="form-group">
						<label for="contact">Đánh giá:</label>
						<input type="text" class="form-control" id="contact" name="contact">
					</div>
					<button class="btn btn-success">Gửi</button>
				</form>
			</div>
		</div>
	</div>
	<!-- Footer -->
	<footer class="py-5 bg-dark" style="margin-top: 470px;">
		<div class="container">
			<p class="m-0 text-center text-white">Copyright &copy; Your PP</p>
		</div>
		<!-- /.container -->
	</footer>
</body>
</html>



<?php
require_once ('config.php');

/**
 * insert, update, delete -> su dung function
 */
function execute($sql) {
	//create connection toi database
	$conn = mysqli_connect(HOST, USERNAME, PASSWORD, DATABASE);

	//query
	mysqli_query($conn, $sql);

	//dong connection
	mysqli_close($conn);
}

/**
 * su dung cho lenh select => tra ve ket qua
 */
function executeResult($sql) {
	//create connection toi database
	$conn = mysqli_connect(HOST, USERNAME, PASSWORD, DATABASE);

	//query
	$resultset = mysqli_query($conn, $sql);
	$list      = [];
	while ($row = mysqli_fetch_array($resultset, 1)) {
		$list[] = $row;
	}

	//dong connection
	mysqli_close($conn);

	return $list;
}


function getOneProduct($id) {
	//create connection toi database
	$conn = mysqli_connect(HOST, USERNAME, PASSWORD, DATABASE);
	$sql_select_one = "SELECT * FROM product WHERE id = $id LIMIT 1";
	$result_one = mysqli_query($conn, $sql_select_one);
	$product = mysqli_fetch_assoc($result_one);

	return $product;
}
function checkUserLogin($username, $password) {
	//create connection toi database
	$conn = mysqli_connect(HOST, USERNAME, PASSWORD, DATABASE);
	//tạo câu truy vấn
	$sql_select_one = "SELECT * FROM users WHERE `username` = '$username' AND `password` = '$password' LIMIT 1";
	//thực thi truy vấn
	$result_one = mysqli_query($conn, $sql_select_one);

	$user = mysqli_fetch_assoc($result_one);

	return $user;
}



<?php
if (isset($_POST['id'])) {
	$id = $_POST['id'];

	require_once ('database.php');
	$sql = 'delete from product where id = '.$id;
	execute($sql);

	echo 'Đã xóa.';
}



<?php 
session_start();
require_once('database.php');
// require_once('GetIdProduct.php');
$id  = $sql  = $view = '';
if (!empty($_GET)) {
	if (isset($_GET['id'])) {
		$id = $_GET['id'];
	}
}

$product[] = array();
$sql = "SELECT * FROM `product` where id =" . $id;
$product = executeResult($sql);

foreach ($product as $pro) {
					$view.='<div class="card mt-4" style="margin-bottom:70px;width:650px;">
					<img class="card-img-top img-fluid" src='.$pro['link'].' alt="">
					<div class="card-body">
					<h3 class="card-title">'.$pro['nameproduct'].'</h3>
					<h4>'.$pro['price'].'₫</h4>
					<h2>Trả góp: '.$pro['installment'].'%</h2>
					<p class="card-text">'.$pro['title'].'</p>
					<span class="text-warning">&#9733; &#9733; &#9733; &#9733; &#9734;</span>
					4.0 stars
					</div>
					</div>';
				}
?>


<!DOCTYPE html>
<html lang="en">

<head>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
	<meta name="description" content="">
	<meta name="author" content="">

	<title>Details</title>

	<!-- Bootstrap core CSS -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
	<!-- Custom styles for this template -->
	<style type="text/css">
		body{
			padding-top: 56px;
		}
	</style>
</head>

<body>
	<!-- Navigation -->
	<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
		<div class="container">
			<a class="navbar-brand" href="#">Shop PP</a>
			<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
				<span class="navbar-toggler-icon"></span>
			</button>
			<div class="collapse navbar-collapse" id="navbarResponsive">
				<ul class="navbar-nav ml-auto">
					<li class="nav-item active">
						<a class="nav-link" href="index.php">Home
							<span class="sr-only">(current)</span>
						</a>
					</li>
					<li class="nav-item">
						<a class="nav-link" href="#">About</a>
					</li>
					<li class="nav-item">
						<a class="nav-link" href="admin.php">Admin</a>
					</li>
					<li class="nav-item">
						<a class="nav-link" href="#">Contact</a>
					</li>
				</ul>
			</div>
		</div>
	</nav>

	<!-- Page Content -->
  <div class="container">

    <div class="row">

      <div class="col-lg-3">

        <h1 class="my-4" style="font-family: serif;color: white">Category</h1>
        <div class="list-group">
          <a href="#" class="list-group-item" style="text-decoration: none;color: black">Smart phone</a>
          <a href="#" class="list-group-item" style="text-decoration: none;color: black">Smart TV </a>
          <a href="#" class="list-group-item" style="text-decoration: none;color: black">Laptop</a>
          <a href="#" class="list-group-item" style="text-decoration: none;color: black">...</a>
        </div>

      </div>
			<!-- /.col-lg-3 -->

			<div class="col-lg-9">		
				<?=$view?>
				<!-- /.card -->

				<!-- <div class="card card-outline-secondary my-4">
					<div class="card-header">
						Product Reviews
					</div>
					<div class="card-body">
						<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Omnis et enim aperiam inventore, similique necessitatibus neque non! Doloribus, modi sapiente laboriosam aperiam fugiat laborum. Sequi mollitia, necessitatibus quae sint natus.</p>
						<small class="text-muted">Posted by Anonymous on 3/1/17</small>
						<hr>
						<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Omnis et enim aperiam inventore, similique necessitatibus neque non! Doloribus, modi sapiente laboriosam aperiam fugiat laborum. Sequi mollitia, necessitatibus quae sint natus.</p>
						<small class="text-muted">Posted by Anonymous on 3/1/17</small>
						<hr>
						<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Omnis et enim aperiam inventore, similique necessitatibus neque non! Doloribus, modi sapiente laboriosam aperiam fugiat laborum. Sequi mollitia, necessitatibus quae sint natus.</p>
						<small class="text-muted">Posted by Anonymous on 3/1/17</small>
						<hr>
						<a href="#" class="btn btn-success">Leave a Review</a>
					</div>
				</div> -->
				<!-- /.card -->

			</div>
			<!-- /.col-lg-9 -->

		</div>

	</div>
	<!-- /.container -->
	
	<!-- Footer -->
	<footer class="py-5 bg-dark">
		<div class="container">
			<p class="m-0 text-center text-white">Copyright &copy; Your Website 2019</p>
		</div>
		<!-- /.container -->
	</footer>

	<!-- Bootstrap core JavaScript -->
	<script src="vendor/jquery/jquery.min.js"></script>
	<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

</body>

</html>



<!DOCTYPE html>
<html>
<head>
	<title>Contact Product</title>
	<!-- Latest compiled and minified CSS -->
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">

	<!-- jQuery library -->
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

	<!-- Popper JS -->
	<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>

	<!-- Latest compiled JavaScript -->
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
	<style type="text/css">
		body{
			margin-top: 100px;
		}
		footer.py-5.bg-dark {
			margin-top: 250px;
		}
		img {
			margin-left: 400px;
		}
		h1 {
			margin-left: 165px;
			margin-top: 25px;
		}
	</style>
</head>
<body>
	<!-- Navigation -->
  <nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
    <div class="container">
      <a class="navbar-brand" href="#">Shop PP</a>
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse" id="navbarResponsive">
        <ul class="navbar-nav ml-auto">
          <li class="nav-item active">
            <a class="nav-link" href="index.php">Home
              <span class="sr-only">(current)</span>
            </a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="#">About</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="admin.php">Admin</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="contact.php">Contact</a>
          </li>
        </ul>
      </div>
    </div>
  </nav>
	<div class="container">
		<div class="row">
			<div class="card-img">
				<img src="https://www.english-learning.net/wp-content/uploads/2018/03/Thank-you.jpg">
			</div>
			<div class="tksyou">
				<h1 style=" color: pink;">Yeah, that's right.</h1>
			</div>
		</div>
		
	</div>
	<!-- Footer -->
	<footer class="py-5 bg-dark">
		<div class="container">
			<p class="m-0 text-center text-white">Copyright &copy; Your PP</p>
		</div>
		<!-- /.container -->
	</footer>
</body>
</html>



create table product (
	id int primary key auto_increment,
	nameproduct varchar(100),
	link varchar(500),
	price float,
	installment int(11),
	title varchar(100)
)

create table contact (
	id int primary key auto_increment,
	contactname varchar(100),
	contact varchar(500)
)


NguyenHuuThanh [T1907A]

Ngày viết: 10:06 03/07/2020



https://github.com/congthanh6g/NewProject


Trần Anh Quân [T1907A]

Ngày viết: 14:17 02/07/2020



https://github.com/quantath1907006/Assignment


Phạm Ngọc Minh [T1907A]

Ngày viết: 12:32 02/07/2020

Phân Loại Bài Viết

Tài Liệu Tham Khảo

Đã sao chép!!!