Guest User

Untitled

a guest
Apr 25th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.79 KB | None | 0 0
  1. <form method="POST">
  2. <div class="table-responsive">
  3. <table id="dataTablesFullDesc" class="table table-striped table-hover">
  4. <thead>
  5. <tr>
  6. <th><?php _e('ID'); ?></th>
  7. <th><?php _e('Project Name');?></th>
  8.  
  9. <th><?php _e('Status'); ?></th>
  10.  
  11. <th><?php _e('Assigned To'); ?></th>
  12. <th><?php _e('Assigned By')?></th>
  13. <th><?php _e('Estimated Time'); ?></th>
  14. <th><?php _e('Time spent ');?><i class="fa fa-exclamation-circle" data-toggle='tooltip' title='<?php echo __("It will show time spent for today.") ?>'></i></th>
  15. <?php if($isEmployee) { ?><th><?php _e('Hours Worked today')?></th> <?php } ?>
  16.  
  17. </tr>
  18. </thead>
  19.  
  20.  
  21. <?php if($isAdmin){ ?>
  22. <tbody>
  23.  
  24. </tbody>
  25. <?php }else{ ?>
  26. <tbody>
  27. <?php $i = 0 ;?>
  28. <?php foreach ($issues as $issue) { ?>
  29. <tr>
  30. <td><?php echo $issue['id']; ?></td>
  31. <td>
  32. <?php if($issue['projectid'] != 0) { ?>
  33. <a href='<?php if(in_array("manageProject",$perms)) { ?>?route=projects/manage&id=<?php echo $issue['projectid']; ?><?php } else echo "#"; ?>'>
  34. <span><?php echo getSingleValue("projects","name",$issue['projectid']); ?> </span>
  35. </a>
  36. <?php }else{ ?>
  37. <a href='#'><?php _e('None'); ?></a>
  38. <?php } ?>
  39. </td>
  40. <input type="hidden" name="taskid[]" id="taskid" value="<?php echo $issue['id'] ?>">
  41. <input type="hidden" name="timespent[]" id="timespent" value="<?php echo $issue['timespent'] ?>">
  42.  
  43. <td><b><?php echo $issue['name']; ?></b></td>
  44.  
  45. <td>
  46. <?php if($issue['status'] == "To Do") echo "<span class='badge bg-green'>".__("To Do")."</span>"; ?>
  47. <?php if($issue['status'] == "In Progress") echo "<span class='badge bg-blue'>".__("In Progress")."</span>"; ?>
  48. <?php if($issue['status'] == "Done") echo "<span class='badge bg-gray'>".__("Done")."</span>"; ?>
  49. <?php if($issue['status'] != "Done" && date('Y-m-d H:i', $issue['duedate']) < date('Y-m-d H:i') && $issue['duedate'] != "" || $issue['timespent'] > $issue['estimated_hrs']) echo "<span class='badge bg-red'>".__("Overdue")."</span>"; ?>
  50. </td>
  51. <!--<td><?php if($issue['duedate'] != "") echo date('d-m-Y h:i A', $issue['duedate']); else echo "<span class='text-muted'>".__("None")."</span>" ?></td>-->
  52. <td><?php if($issue['adminid'] != 0) echo getSingleValue("people","name",$issue['adminid']); else echo "<span class='text-muted'>".__("Nobody")."</span>"; ?></td>
  53. <td><?php if($issue['assignid'] != 0) echo getSingleValue("people","name",$issue['assignid']); else echo "<span class='text-muted'>".__("Nobody")."</span>"; ?></td>
  54. <td><?php echo min_to_hours($issue['estimated_hrs']);?> Hours</td>
  55. <?php $timesheets[$issue['id']] = isset($timesheets[$issue['id']])? $timesheets[$issue['id']]:0; ?>
  56. <td><?php echo min_to_hours($timesheets[$issue['id']]); ?> Hours</td>
  57. <?php if($isEmployee){ ?>
  58. <td style="width: 14%;">
  59. <div class="col-xs-12">
  60. <div class="form-group">
  61. <div class="input-group">
  62.  
  63. <input type="number" class="form-control" id="totalwork" name="totalwork[]" min="0.00" step="0.01" value="<?php echo $timesheets[$issue['id']]/60; ?>">
  64. <input type="hidden" name="prevtimespent[]" value="<?php echo $timesheets[$issue['id']]; ?>" />
  65. <span class="input-group-addon"><i class="fa fa-clock-o"></i></span>
  66. </div>
  67. </div>
  68. </div>
  69.  
  70. </td>
  71. <?php } ?>
  72.  
  73. </tr>
  74.  
  75. <?php } ?>
  76.  
  77.  
  78. </tbody>
  79. <?php } ?>
  80. </table>
  81.  
  82. </div>
  83.  
  84.  
  85. <?php if(isset($_GET['date'])){ ?>
  86. <input type="hidden" id="dateadded" name="dateadded" value="<?php echo $_GET['date']; ?>">
  87. <?php } ?>
  88. <input type="hidden" name="action" value="updateTimesheet">
  89. <input type="hidden" name="route" value="issues/all&date=<?php echo $_GET['date']; ?>">
  90. <input type="hidden" name="routeid" value="">
  91. <input type="hidden" name="section" value="">
  92.  
  93. <?php if($isEmployee){ ?>
  94. <!--month dropdown-->
  95. <?php if(isset($_GET['peopleid'])){
  96. $peopleid = $_GET['peopleid'];
  97. }else{
  98. global $liu;
  99. $peopleid = $liu['id'];
  100. } ?>
  101. <div class="pull-left">
  102. <select class="form-control select2 select2-hidden-accessible " onchange="window.location.href='?route=issues/all&date='+this.value+'&peopleid='+<?php echo $peopleid; ?>" id="respondid" name="respondid" style="width: 100%;" tabindex="-1" aria-hidden="true">
  103.  
  104.  
  105. <?php global $date;
  106. for($i=1;$i<=12;$i++){
  107. $m = str_pad($i, 2, '0', STR_PAD_LEFT);
  108. echo $first_date = date('Y-'.$m.'-01');
  109. echo $last_date = date('Y-'.$m.'-t');
  110.  
  111. $_GET['date'] = isset($_GET['date'])? $_GET['date']: date('Y-m-d');
  112. ?>
  113. <option value="<?php echo date('Y-'.$m.'-01');?>" <?php if(($first_date <= $_GET['date']) &&($last_date >= $_GET['date']) ) {echo "selected";} if((!$_GET['date']) && ($first_date <= $date) &&($last_date >= $date) ){echo "selected";}?> ><?php echo date('M', mktime(0, 0, 0, $i, 1)); ?> </option>
  114. <?php } ?>
  115. </select>
  116. </div>
  117. <?php } ?>
  118.  
  119. <?php $previousDate = strftime('%Y-%m-%d',(strtotime($timesheetDaysUpdate.'days ago')));?>
  120. <!--check the limit for update limit or restrict user to upload others timesheet-->
  121. <?php if((!isset($_GET['peopleid'])) || $liu['id'] == $_GET['peopleid']){ ?>
  122. <?php if(isset($_GET['date']) && $_GET['date']<=$previousDate){ ?>
  123. <div class="pull-right"><button type="submit" class="btn btn-danger btn-sm" disabled><i class="fa fa-hourglass-half"></i> <?php _e('UPDATE TIME SHEET'); ?></button></div>
  124. <?php }else{ ?>
  125. <div class="pull-right"><button type="submit" class="btn btn-danger btn-sm"><i class="fa fa-hourglass-half"></i> <?php _e('UPDATE TIME SHEET'); ?></button></div>
  126. <?php }}?>
  127. </form>
Add Comment
Please, Sign In to add comment