File: /home/imensosw/www/imenso.co/matrix/completed.php
<?php include 'header.php';?>
<div class="container-area">
<div class="pt-4 pb-5">
<div class="container">
<h3 class="m-0">Completed Assignments <span class="total_count">[0]</span></h3>
<input type="text" name="search" class="mt-3 assignment_complete" placeholder="Search: [Folder Index]" id="search" style="text-align: center;">
<div class="row document-card">
<form action="download_excel.php" method="post" name="form" id="download_form">
<input type="hidden" name="list[]" id="list" value="">
</form>
<div class="col-sm-12 border-right mb-4">
<div class="pull-right">
<a href="#" id="download_excel"><input class="btn btn-primary" type="submit" name="download" value="Download Xls" /></a>
</div>
<div class="table-responsive" id="assignment_complete_table">
<table class="table table-striped table-sm table-bordered" >
<thead>
<tr>
<th>Action</th>
<th><a href="#" class="column_sort" id="folder_index" data-order="desc"> Folder Index</a> </th>
<th><a href="#" class="column_sort" id="data_count" data-order="desc"> Data Count</a></th>
<th><a href="#" class="column_sort" id="assigned_date" data-order="desc"> Assigned Date </a></th>
<th> <a href="#" class="column_sort" id="completed_date" data-order="desc">Completed Date </a></th>
</tr>
</thead>
<tbody>
<?php
$total = 0 ;
$sql = "SELECT assignments.*, count(assignment_details.id) as totalCount , DATE_FORMAT(assignments.submit_date, '%m/%d/%Y') as submit_date_mdy FROM assignments left join assignment_details on assignment_details.assignment_id = assignments.id
WHERE assignments.deleted=0 AND assignments.user_id = '".$_SESSION['user_id']."' and assignments.assignment_status_id = 2 group by assignments.id order by id desc";
$result = $conn->query($sql);
while($row = $result->fetch_assoc()) {
$total = $total + $row['no_of_record'] ;
?>
<tr>
<td><input type="checkbox" class="chk_doc_no" name="doc_no[]" value="<?php echo $row['assignment_no'] ?>" file_count="<?php echo $row['no_of_record'] ?>" /></td>
<td><a href="data_view.php?assignment_no=<?php echo $row['assignment_no'] ?>" target="_blank" > <?php echo $row['assignment_no'] ?></a> </td>
<td> <?php echo $row['no_of_record'] ?></td>
<td><?php echo date('m/d/Y ', strtotime($row['assignment_date'])) ?></td>
<td><?php echo date('m/d/Y ', strtotime($row['submit_date'])) ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function(){
$(".total_count").html("(<?php echo $total ?>)");
});
$('#download_excel').on('click', function(e) {
e.preventDefault(); // prevents a window.location change to the href
var SlectedList = new Array();
$("input.chk_doc_no:checked").each(function() {
SlectedList.push($(this).val());
});
$("#list").val(SlectedList);
if(SlectedList.length>0)
{
$('#download_form').submit();
}
});
</script>
<?php include 'footer.php';?>