Path : /var/www/html/smart_kpp2_bk17 มีค 69/time/
File Upload :
Current File : /var/www/html/smart_kpp2_bk17 มีค 69/time/qrcode.php

<!DOCTYPE html>
<html lang="en">
<head>
  <title>QR-CODE ลงเวลาปฎิบัติราชการ</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<?php include ("meta.php");?> 
<?php require_once ("Connections/smartconn.php");?>
 <meta http-equiv="refresh" content="1800" />
</head>
<body>

  <div class="container-fluid">
<div class="row">

 <div class="col-lg-12">
    <div class="card ">
      <div class="card-header bg-primary"><a href="index.php"><h1 style="color: #ffffff;"><?php echo $system_name?></h1>

<h2 style="color: #ffffff;"><?php echo $address;?></h2></a>
      </div>  
      <div class="card-body">

<?php
  
$URL2 =(get_magic_quotes_gpc()) ? $_GET ['URL']  : addslashes($_GET['URL']);
$date =(get_magic_quotes_gpc()) ? $_GET ['date']  : addslashes($_GET['date']);
$URL2 = "$URL2"."?date=$date";
$thai_w=array("อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัสบดี","ศุกร์","เสาร์");
  $thai_n=array("มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม");
  $w=$thai_w[date("w")];
  $d=date("d");
  $n=$thai_n[date("n") -1];
  $y=date("Y") +543;
  $t=date("เวลา H นาฬิกา i นาที s วินาที");
  $t2=date("เวลา H. i น.");
  $date_thai = "$d $n $y";
  
  //$date_today = date("Y-m-d"); //วันปัจจุบัน คศ. 2020-03-15
  $date_today = $date;
  $day=date('w', strtotime("$date_today")); //เช็ควัน 0-6 วันอาทิตย์ - วันเสาร์
?>
<center>
<?php
   //$date =date("Y-m-d H:i:s");
  //กำหนดวันเดือนปีไทย
  $thai_w=array("อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัสบดี","ศุกร์","เสาร์");
  $thai_n=array("มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม");
  $w=$thai_w[date("w")];
  $d=date("d");
  $n=$thai_n[date("n") -1];
  $y=date("Y") +543;
  $t=date("เวลา H นาฬิกา i นาที s วินาที");
  $t2=date("เวลา H. i น.");
  $date_thai = "$d $n $y";
  
  $date_today = date("Y-m-d"); //วันปัจจุบัน คศ. 2020-03-15
  $day=date('w', strtotime("$date_today")); //เช็ควัน 0-6 วันอาทิตย์ - วันเสาร์
  //$day=1;
  if($day==0){
    $day_name="<font color=red>วันอาทิตย์</font>";
  }else if($day==1){
    $day_name="<font color=#FFCC33>วันจันทร์</font>";
  }else if($day==2){
    $day_name="<font color=FUCHSIA>วันอังคาร</font>";
  }else if($day==3){
    $day_name="<font color=GREEN>วันพุธ</font>";
  }else if($day==4){
    $day_name="<font color=#FF6600>วันพฤหัสบดี</font>";
  }else if($day==5){
    $day_name="<font color=#3399FF>วันศุกร์</font>";
  }else if($day==6){
    $day_name="<font color=#990099>วันเสาร์</font>";
  }

  echo "<h2> $day_name ที่ $date_thai";
  //แสดงวันหยุด

  if($day == 0 or $day == 6){
  $Holiday = '1';
  echo "<font color=red> (วันหยุดราชการ)</font></h2>";
  }
  ?>
<form name="checkForm">
<h1><input type="text" class="btn btn-danger btn-lg" name="txtTime" id="txtTime" width="200" maxlength="200" value="" /></h1>

<script>
function show(){
var Digital=new Date()
var hours=Digital.getHours()
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
var dn="AM" 
if (hours>=24)
dn="PM"
txt="ขณะนี้เวลา :: "
n="น."
if (hours>24)
hours=hours-24
if (hours==0)
hours=24
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
document.checkForm.txtTime.value=txt+""+hours+" : "+minutes+" : "
+seconds+" "+n
setTimeout("show()",1000)
}
show()
</script>
</form>
<img lass="img-thumbnail" src="https://chart.googleapis.com/chart?chs=400x400&cht=qr&chl=<?php echo $URL2; ?>&choe=UTF-8"/><img lass="img-thumbnail" src="https://chart.googleapis.com/chart?chs=400x400&cht=qr&chl=<?php echo $URL2; ?>&choe=UTF-8"/>
<br><font color='red'>สแกน QR-CODE เพื่อลงเวลาปฏิบัติราชการ</font> </center>


</div>
</div>

<div class="col-lg-12">
  <br>
<?php include ("footer.php");?>

</div>

</div>
</div>
</body>
</html>