hjkhghopjkertteerterterterertertrtoirh
bnmbertsurhetertertertertertertertpdf'tdfg
/
opt
/
codebharat
/
htdocs
/
admin
/
Upload FileeE
HOME
<?php include 'header.php'; ?> <!--Main container start --> <main class="ttr-wrapper"> <div class="container-fluid"> <div class="db-breadcrumb"> <h4 class="breadcrumb-title">Quiz List</h4> <ul class="db-breadcrumb-list"> <li><a href="index.php"><i class="fa fa-home"></i>Home</a></li> <li>Quiz List</li> </ul> </div> <div class="row"> <!-- Your Profile Views Chart --> <div class="col-lg-12 m-b30"> <div class="widget-box"> <div class="widget-inner"> <form class="edit-profile m-b30" id="add_sub_category"> <div class="row"> <div class="col-md-12 table-responsive"> <table class="table table-bordered" id="myTable"> <thead> <th>Sr.</th> <th>Course Name</th> <th>Topic</th> <th>Question</th> <th>Option 1</th> <th>Option 2</th> <th>Option 3</th> <th>Option 4</th> <th>Answer</th> <th>Date</th> <th>Edit/Delete</th> </thead> <tbody> <?php $i=1; $query = "SELECT q.*, q.id as qid, c.id, c.course_name FROM quiz q LEFT JOIN courses c ON q.course=c.id "; $sql = mysqli_query($conn,$query) OR die(mysqli_error($conn)); while($row = mysqli_fetch_assoc($sql)){ ?> <tr> <td><?=$i;?></td> <td><?=$row['course_name'];?></td> <td><?=$row['topic'];?></td> <td><?=$row['question'];?></td> <td><?=$row['option1'];?></td> <td><?=$row['option2'];?></td> <td><?=$row['option3'];?></td> <td><?=$row['option4'];?></td> <td><?=$row['answer'];?></td> <td><?=$row['created_date'];?></td> <td><a href="edit_quiz.php?id=<?=$row['qid']?>" class="btn btn-primary btn-sm">Edit</a> <a href="javascript:void(0);" class="btn btn-danger btn-sm" onclick="delete_quiz(<?=$row['qid']?>);">Delete</a></td> </tr> <?php $i++; } ?> </tbody> </table> </div> </div> </form> </div> </div> </div> <!-- Your Profile Views Chart END--> </div> </div> </main> <div class="ttr-overlay"></div> <?php include 'footer.php'; ?> <script> function delete_quiz(id){ if(confirm('Are you sure')){ $.ajax({ type:'POST', url: 'admin_ajax.php', data:{ id:id, type : 'delete_quiz'}, success : function(result){ //console.log(result); var res = JSON.parse(result); if(res.success == true){ alert(res.message); location.reload(); } else{ alert(res.message); } } }) } } </script>