Commit 906b9ac2 by Hussain Mohamed

changes

parent 669ba57c
...@@ -28,13 +28,15 @@ class ExamController extends CI_Controller ...@@ -28,13 +28,15 @@ class ExamController extends CI_Controller
public function getExamQuestions() public function getExamQuestions()
{ {
$this->db->select('y.year, es.academic, es.exam_schedule, es.objective_date, es.objective_time, es.id,et.exam_type_name as name'); $this->db->select('y.year, es.academic,u.email,es.id as sid,ea.question_category,es.exam_schedule, es.objective_date, es.objective_time, es.id,et.exam_type_name as name');
$this->db->from('question as q'); $this->db->from('question as q');
$this->db->join('exam_schedule as es', 'es.id = q.schedule_id', 'left'); $this->db->join('exam_schedule as es', 'es.id = q.schedule_id', 'left');
$this->db->join('accadamic_year as y', 'y.id = q.academic', 'left'); $this->db->join('accadamic_year as y', 'y.id = q.academic', 'left');
$this->db->join('exam_type as et', 'et.id = q.exam_type', 'left'); $this->db->join('exam_type as et', 'et.id = q.exam_type', 'left');
$this->db->join('exam_assigned as ea', 'ea.schedule = q.schedule_id', 'left');
$this->db->join('users as u', 'u.user_id = ea.user_id', 'left');
$this->db->where('es.status', 1); $this->db->where('es.status', 1);
$this->db->group_by('q.schedule_id'); $this->db->group_by('q.schedule_id,ea.user_id');
$query = $this->db->get(); $query = $this->db->get();
return $result = $query->result(); return $result = $query->result();
} }
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
</div> </div>
</div> </div>
</div> </div>
<!--column--> <!--column-->
<div class="col-xl-12 wow fadeInUp" data-wow-delay="1.5s"> <div class="col-xl-12 wow fadeInUp" data-wow-delay="1.5s">
<div class="table-responsive full-data"> <div class="table-responsive full-data">
...@@ -36,6 +37,8 @@ ...@@ -36,6 +37,8 @@
<tr> <tr>
<th class="wd-20p">S.No</th> <th class="wd-20p">S.No</th>
<th class="wd-25p">Academic Year</th> <th class="wd-25p">Academic Year</th>
<th class="wd-25p">Assigned User</th>
<th class="wd-25p">Schedule Name</th>
<th class="wd-15p">Exam Type</th> <th class="wd-15p">Exam Type</th>
<th class="wd-15p">Date</th> <th class="wd-15p">Date</th>
<th class="wd-15p">Time</th> <th class="wd-15p">Time</th>
...@@ -49,11 +52,13 @@ ...@@ -49,11 +52,13 @@
<tr> <tr>
<td><?= $i ?></td> <td><?= $i ?></td>
<td><?= $row->year ?></td> <td><?= $row->year ?></td>
<td><?= $row->email ?></td>
<td><?= $row->exam_schedule ?></td>
<td><?= $row->name ?></td> <td><?= $row->name ?></td>
<td><?= isset($row->date) ? date('d-m-Y',strtotime($row->objective_date)) :'' ?></td> <td><?= isset($row->objective_date) ? date('d-m-Y',strtotime($row->objective_date)) :'' ?></td>
<td><?= isset($row->time) ? date('H:i a',strtotime($row->objective_time)) :'' ?></td> <td><?= isset($row->objective_time) ? date('H:i a',strtotime($row->objective_time)) :'' ?></td>
<td> <td>
<a href="javascript:takeExam('<?= $row->id ?>')" data-toggle="tooltip" id="edit" data-placement="top" title="Edit" data-original-title="Edit" class="btn btn-sm btn-info">View</a> <a href="javascript:takeExam('<?= $row->user_id ?>','<?= $row->sid ?>','<?= $row->question_category ?>',)" data-toggle="tooltip" id="edit" data-placement="top" title="Edit" data-original-title="Edit" class="btn btn-sm btn-info">View</a>
</td> </td>
</tr> </tr>
<?php $i++; } ?> <?php $i++; } ?>
...@@ -82,6 +87,9 @@ ...@@ -82,6 +87,9 @@
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<input type="hidden" id="userId" value=""/>
<input type="hidden" id="Sid" value=""/>
<input type="hidden" id="Cat" value=""/>
<h4 class="text-center">Asian College of Journalism</h4> <h4 class="text-center">Asian College of Journalism</h4>
<h5>English Entrance Examination</h5> <h5>English Entrance Examination</h5>
<br> <br>
...@@ -130,10 +138,20 @@ original sentence. (5 marks)</h5> ...@@ -130,10 +138,20 @@ original sentence. (5 marks)</h5>
</div> </div>
<script> <script>
//user,sid,cat
function takeExam(user,sid,cat)
{ $('#userId').val(cat);
$('#Sid').val(user);
$('#Cat').val(sid);
$('#examModal').modal('show');
}
function takeExam(id) function close()
{ {
$('#examModal').modal('show'); $('#userId').val('');
$('#Sid').val('');
$('#Cat').val('');
$('#examModal').modal('hide');
} }
function startExam(id) function startExam(id)
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
</div> --> </div> -->
<div> <div>
<button type="button" class="btn btn-primary waves-effect waves-light" onclick="getCheckedId(this)">Assing Test</button> <button type="button" class="btn btn-primary waves-effect waves-light" onclick="getCheckedId(this)">Assing Exam</button>
</div> </div>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment