Skip to main content

PHP#17MySQL#13 - Admin/theloai.php - Lọc thể loại theo ngôn ngữ, selected ngôn ngữ, chuyển trang kèm theo ngôn ngữ

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>Thể Loại</title>

</head>


<body>

<p>

<?php 

if(isset($_GET['lang'])) $lang=$_GET['lang'];

else $lang="vi";

?>

 <form id="form1" name="form1" method="get" action="">

  <label for="lang">Chọn ngôn ngữ:</label>

  <select name="lang" id="lang" onChange="form1.submit();">

    <option value="vi">Việt</option>

    <option value="en"<?php if($lang=="en") echo "selected";?>>English</option>

  </select>

 </form>

</p>

<table width="700" border="1" cellspacing="0" cellpadding="0">

  <tbody>

    <tr>

      <th scope="col">Thứ tự</th>

      <th scope="col">Tên thể loại</th>

      <th scope="col">Tên không dấu</th>

      <th scope="col">Trang thái</th>

      <th scope="col"><a href="theloai_them.php?lang=<?php echo $lang;?>">Thêm</a></th>

    </tr>

    <?php

include("../connect.php");

$sl="select * from theloai where lang='$lang' order by ThuTu";

$kq=mysqli_query($link,$sl);

while($d=mysqli_fetch_array($kq)){

?>

    <tr>

      <td><?php echo $d['ThuTu'];?></td>

      <td><?php echo $d['TenTL'];?></td>

      <td><?php echo $d['TenTL_KhongDau'];?></td>

      <td><?php if($d['AnHien']) echo "Hiện"; else echo "Ẩn";?></td>

      <td>Xóa/Sửa</td>

    </tr>

    <?php }?>

  </tbody>

</table>


</body>

</html>

Comments

Popular posts from this blog

PHP#33MySQL#29 - Đếm lượt truy cập (KẾT THÚC KHÓA HỌC)

//hitcounter.php <?php session_start();  ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <?php  include("../connect.php"); //cập nhật số luowhtj truy cập: $sl="update counter set cnt=cnt+1"; mysqli_query($link,$sl); //Lấy dữ liệu số lượt truy cập để hiển thị ra web: $sl2="select * from counter"; $kq=mysqli_query($link,$sl2); $d=mysqli_fetch_array($kq); //Định dạng: $chuoi=str_pad($d['cnt'],6,"0",STR_PAD_LEFT); $luottrycap=""; for($i=0;$i<strlen($chuoi);$i++) { $tam=substr($chuoi,$i,1); $luottrycap.="<img src='images/$tam.png'/>"; } /*-Khi user truy cập vào website: +lần đầu tuy cập: Lưu thông tin của user lên csdl +Sau lần đầu tiên: cập nhtaaj lastvisit - Xóa các dòng dữ liệu quá 1 phút (Quy ước thời gian để khẳng định online hay offline: 1 phút) - Thống kê số liệu người dùng o...

2 (giao diện Visual C#) Solution Explorer

Bài 2 - SOME OTHER TIME - Vào dịp khác