【发布时间】:2020-07-06 10:19:18
【问题描述】:
我想知道是否有人可以帮助我?
我有一个 PHP 员工时间表,通过输入开始和结束时间来跟踪他们的工作时间,代码如下;
<input type="text" id="myInput" onkeyup="myFunction()" placeholder="Type Month/Date/Year" title="Type Month/Date/Year">
<table id="myTable">
<tr class="header">
<th scope="col">Date</th>
<th scope="col">Start Time</th>
<th scope="col">End Time</th>
<th scope="col">Activity</th>
</tr>
<?php foreach($activity as $user_activity) { ?>
<tr>
<td scope="row"><?php echo $user_activity['date']; ?></td>
<td><?php echo $user_activity['start_time']; ?></td>
<td><?php echo $user_activity['end_time']; ?></td>
<td><?php echo $user_activity['activity']; ?></td>
</tr>
<?php } ?>
</table>
</div>
<form method="post" action="index.php">
<div class="form-row">
<input type="hidden" name="user_id" value="<?php echo $_SESSION['id']; ?>">
<div class="form-group col-md-4">
<label for="inputEmail4">Start time</label>
<input type="time" class="form-control" id="inputEmail4" name="start_time" required>
</div>
<div class="form-group col-md-4">
<label for="inputPassword4">End Time</label>
<input type="time" class="form-control" id="inputPassword4" name="end_time" required>
</div>
</div>
<div class="form-group">
<label for="inputAddress">Activity Details</label>
<!-- <input type="text" class="form-control" name="activity"> -->
<textarea name="activity" id="" cols="30" class="form-control" rows="5"></textarea>
</div>
<button type="submit" class="btn btn-primary">Add</button>
</form>
</div>
请问我是否可以生成报告并获取每个员工在 4 周内的总工作时数?
非常感谢:)
【问题讨论】:
-
表task_activity id user_id start_time end_time 活动日期