<?php session_start(); include_once "config/worklog.php"; if (isset($_POST['log']) && $_POST['log'] == true) { $worklog = new worklog(); $worklog->setID($_POST['id']); $worklog->setMode($_POST['mode']); $worklog->setTimespan($_POST['timespan']); $worklog->saveworklog(); } if (isset($_POST['getlog'])) { //retrieve work log $result = worklog::getworklog($_POST['id'], date('Y/m/d')); $output = ""; echo "<table class='table table-striped'>" . "<tr><th colspan='4'> Timesheet for: " . date('Y/m/d') . "</th></tr>"; echo "<tr><td>Log #</td><td>Timespan</td><td>Check In</td> <td>Check Out</td> </tr>"; $i = 0; $j = 1; while ($row = mysql_fetch_array($result)) { $output .= "<tr>"; $output .= "<td>" . $j . "</td>"; $output .= "<td>" . gmdate("H\\h i\\m s\\s", $row['log_time']) . "</td>"; $output .= "<td>" . $row['user_login'] . "</td>"; $output .= "<td>" . $row['user_logout'] . "</td>"; $output .= "</tr>"; $i++; } if ($i > 0) { echo $output; } else {
?> &usergroup=<?php echo md5(1); ?> ' class='badge'><?php echo worklog::get_checkin_users_count(date('Y-m-d')); ?> </a></li> <li class="list-group-item">Employee who have not checked-in today: <a href='timeanalytics.php?logdate=<?php echo date('d-m-Y'); ?> &usergroup=<?php echo md5(3); ?> ' class='badge'><?php echo worklog::get_non_checkin_users_count(date('Y-m-d')); ?> </a></li> </ul> </div> </div> <?php } else { ?> <div class="panel panel-primary" id="timer-block" style="width:600px; margin:100px auto;"> <div class="panel-heading"> <h3 class="panel-title"><span class="glyphicon glyphicon-calendar" data-toggle="modal" data-target=".bs-example-modal-lg"></span> Time Logger</h3> </div> <div class="panel-body">
$table .= "<td>" . $row['user_name'] . "</td>"; $table .= "<td> No Check-In</td>"; $table .= "</tr>"; $i++; } if ($i > 0) { echo "<table class='table table-bordered'>" . "<tr><th>Sl. No.</th><th>User Name</th><th>Status</th></tr>" . $table . "</table>"; } } if (strcmp(md5('4'), $_GET['usergroup']) == 0 && isset($_GET['startlogdate']) && isset($_GET['endlogdate'])) { $startdate = explode('-', $_GET['startlogdate']); $enddate = explode('-', $_GET['endlogdate']); //$userlog = $_GET['user']; include_once 'config/worklog.php'; //$result = worklog::get_user_work_duration( $_GET['month'] , $_GET['year'] ); $result = worklog::get_user_work_duration($startdate[2] . "-" . $startdate[1] . "-" . $startdate[0], $enddate[2] . "-" . $enddate[1] . "-" . $enddate[0]); $i = 0; $table = ""; while ($row = mysql_fetch_array($result)) { $table .= "<tr>"; $table .= "<td>" . ($i + 1) . "</td>"; $table .= "<td>" . $row['log_date'] . "</td>"; $table .= "<td>" . $row['user_name'] . "</td>"; if (isset($row['hwork']) && $row['hwork'] != "") { $table .= "<td><span >"; $table .= intval($row['hwork'] / 3600) . " hr "; $min = intval($row['hwork'] % 3600); $table .= intval($min / 60) . " min "; $sec = intval($min % 60); $table .= $sec . " sec </span></td>"; } else {