| Server IP : 93.86.61.54 / Your IP : 216.73.216.60 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/projects/radvre_old/ |
Upload File : |
<!DOCTYPE html>
<!--
******************************
Project: Radno vreme, 2023.
Version: PHP 5-7
Author : M. Kukic
Note :
Link: http://net-nas/w3/radvre_v7/lista.php
******************************
-->
<html>
<head>
<style>
table, th, td {
border: 1px solid gray;
border-collapse: collapse;
}
th, td {
padding: 4px;
text-align: center;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel='shortcut icon' type='image/png' href='favicon.png'/>
<meta http-equiv="refresh" content="20">
<title>Radno vreme</title>
</head>
<body>
<div style="width:720px; word-wrap:break-word;">
<?php
//
//Get
$tip = $_GET["tip"];
//
include "config.php";
include "hed.php";
//
if ($tip==""){
$tip=0;
}
$tz=0;
$lz=0;
if ($tip=="0"){
//tekuca godina
$i_start = $lz*3600+$tz*3600+strtotime('first day of January', time());
$i_end = $lz*3600+$tz*3600+strtotime('last day of December', time());
}
if ($tip=="1"){
//tekuci mesec
$i_start = $lz*3600+$tz*3600+strtotime('first day of this month 00:00:00', time());
$i_end = $lz*3600+$tz*3600+strtotime('last day of this month 00:00:00', time());
}
if ($tip=="2"){
//prethodni mesec
$i_start = $lz*3600+$tz*3600+strtotime('first day of previous month 00:00:00', time());
$i_end = $lz*3600+$tz*3600+strtotime('last day of previous month 00:00:00', time());
}
if ($tip=="3"){
//prethodni + tekuci mesec
$i_start = $lz*3600+$tz*3600+strtotime('first day of previous month 00:00:00', time());
$i_end = $lz*3600+$tz*3600+strtotime('last day of this month 00:00:00', time());
}
if ($tip=="4"){
//tekuca nedelja
$i_start = $lz*3600+$tz*3600+strtotime('last Sunday', time());
$i_end = $lz*3600+$tz*3600+strtotime('next Sunday', time());
}
//
echo "<h2 style='font-family:arial'>KRETANJA ZAPOSLENIH</h2>";
//
//echo $i_start." - ".$i_end."<br>";
echo date("d/m/Y h:i:s A T",$i_start)." - ".date("d/m/Y h:i:s A T",$i_end)."<br><br>";
//
if ($db==5){ // MySQL ver 5
//$sql = "SELECT * FROM logdog WHERE dispname='Misko' ORDER BY dattim DESC";
$sql = "SELECT * FROM logdog ORDER BY dispname, dattim ASC";
$result = mysql_query($sql, $dbh) or die (mysql_error($dbh));
$nuz = mysql_num_rows($result);
//echo "<b>Uzoraka ".$nuz."</b><br>";
echo "<table style='background-color:#F0F8FF; width:720px; margin:0 auto;'>";
echo "<tr>";
echo "<th>LBr.</th>";
echo "<th>Disp-Name</th>";
echo "<th>In-Out</th>";
echo "<th>Vreme</th>";
echo "<th>Notes</th>";
echo "<th>Lokacija</th>";
echo "</tr>";
for ($i = 1; $i<($nuz+1); $i++) {
$row = mysql_fetch_array($result);
//
$dt=$row['dattim'];
$vreme= date("d/m/Y h:i:s A",$dt);
$dt=(int)$dt;
if (($dt>$i_start)AND($dt<$i_end)){
echo "<tr>";
//echo "<td>".$i."</td>";
echo "<td>".$row['id']."</td>";
echo "<td>".$row['dispname']."</td>";
echo "<td>".$row['in_out']."</td>";
echo "<td>".$vreme."</td>";
echo "<td>".$row['notes']."</td>";
echo "<td>".$row['lokc']."</td>";
echo "</tr>";
}
//
}
echo "</table>";
echo "<br>";
//
mysql_close($dbh);
}else{ // MySQL ver 7
//$sqli = "SELECT * FROM logdog WHERE dispname='Misko' ORDER BY dattim DESC";
$sql = "SELECT * FROM logdog ORDER BY dispname, dattim ASC";
$result = mysqli_query($dbh, $sql) or die (mysqli_error($dbh));
$nuz = mysqli_num_rows($result);
echo "<table style='background-color:#F0F8FF; width:720px; margin:0 auto;'>";
echo "<tr>";
echo "<th>LBr.</th>";
echo "<th>Disp-Name</th>";
echo "<th>In-Out</th>";
echo "<th>Vreme</th>";
echo "<th>Notes</th>";
echo "<th>Lokacija</th>";
echo "</tr>";
for ($i = 1; $i<($nuz+1); $i++) {
$row = mysqli_fetch_array($result);
//
$dt=$row['dattim'];
$vreme= date("d/m/Y h:i:s A",$dt);
$dt=(int)$dt;
if (($dt>$i_start)AND($dt<$i_end)){
echo "<tr>";
//echo "<td>".$i."</td>";
echo "<td>".$row['id']."</td>";
echo "<td>".$row['dispname']."</td>";
echo "<td>".$row['in_out']."</td>";
echo "<td>".$vreme."</td>";
echo "<td>".$row['notes']."</td>";
echo "<td>".$row['lokc']."</td>";
echo "</tr>";
}
//
}
echo "</table>";
echo "<br>";
//
mysqli_close($dbh);
} //END
?>
<hr>
<img src="img/b_white-2.png">
<a href="javascript:history.go(-1)"><img src="img/r_up.png" width="" height="48"></a>
<img src="img/b_white-2.png">
<a href="lista.php?tip=0"><img src="img/a_0.png" width="" height="48"></a>
<img src="img/b_white-2.png">
<a href="lista.php?tip=1"><img src="img/a_1.png" width="" height="48"></a>
<img src="img/b_white-2.png">
<a href="lista.php?tip=2"><img src="img/a_2.png" width="" height="48"></a>
<img src="img/b_white-2.png">
<a href="lista.php?tip=3"><img src="img/a_3.png" width="" height="48"></a>
<img src="img/b_white-2.png">
<a href="lista.php?tip=4"><img src="img/a_4.png" width="" height="48"></a>
<img src="img/b_white-2.png">
<a href="help.php"><img src="img/r_hlp.png" width="" height="48"></a>
</div>
<?php include "fut.php";?>
</body>
</html>