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">Course List</h4> <ul class="db-breadcrumb-list"> <li><a href="index.php"><i class="fa fa-home"></i>Home</a></li> <li>Course 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>Categories</th> <th>Course Name</th> <th>Author</th> <th>Author Image</th> <th>Author Description</th> <th>Author Sign</th> <th>Course Image</th> <th>Course Video</th> <th>Price</th> <th>Duration</th> <th>Small Description</th> <th>What you'll learn</th> <th>Requirements </th> <th>Description </th> <th>Who this course is for</th> <th>Date</th> <th>Edit/Delete</th> <th>Add Course Content</th> <th>Featued on Homepage?</th> </thead> <tbody> <?php $i=1; $query = "SELECT c.*, c.id as cid, s.id, s.sub_category FROM courses c LEFT JOIN sub_category s ON c.sub_category_id = s.id"; $sql = mysqli_query($conn,$query) OR die(mysqli_error($conn)); while($row = mysqli_fetch_assoc($sql)){ ?> <tr> <td><?=$i;?></td> <td><?=$row['sub_category'];?><br><a href="course_content_list.php?id=<?=$row['cid']?>" class="btn btn-primary btn-sm">View Course Content</a></td> <td><?=$row['course_name'];?></td> <td><?=$row['author'];?></td> <td><a href="course_img/<?=$row['author_img'];?>" target="blank"><img src="course_img/<?=$row['author_img'];?>"></a></td> <td><?=$row['author_description'];?></td> <td><a href="course_img/<?=$row['author_sign'];?>" target="blank"><img src="course_img/<?=$row['author_sign'];?>"></a></td> <td><a href="course_img/<?=$row['course_img'];?>" target="blank"><img src="course_img/<?=$row['course_img'];?>"></a></td> <td><a href="course_video/<?=$row['course_video'];?>" target="blank"><i class="fa fa-play-circle" style="font-size: 40px;"></i></a></td> <td><?=$row['price'];?></td> <td><?=$row['duration'];?></td> <td><?=$row['small_description'];?></td> <td><?=$row['what_you_learn'];?></td> <td><?=$row['requirements'];?></td> <td><?=$row['description'];?></td> <td><?=$row['who_this_course_is_for'];?></td> <td><?=$row['created_date'];?></td> <td> <a href="edit_course.php?id=<?=$row['cid']?>" class="btn btn-primary btn-sm">Edit</a> <a href="javascript:void(0);" class="btn btn-danger btn-sm" onclick="delete_course(<?=$row['cid']?>);">Delete</a></td> <td><a href="add_course_content.php?id=<?=$row['cid']?>" class="btn btn-info btn-sm">Add</a></td> <td> <?php if($row['feature_course']==1){ ?> <a href="javascript:void(0);" onclick="remove_featured_course(<?=$row['cid']?>);" class="btn btn-danger btn-sm" id="remove_featured_course">Remove from featured</a> <?php } else { ?> <a href="javascript:void(0);" onclick="add_featured_course(<?=$row['cid']?>);" class="btn btn-info btn-sm" id="add_featured_course">Add to featured</a> <?php } ?> </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_course(id){ $.ajax({ type:'POST', url: 'admin_ajax.php', data:{ id:id, type : 'delete_course'}, 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> <script type="text/javascript"> function remove_featured_course(courseID){ $.ajax({ url : 'admin_ajax.php', type : 'POST', async: false, data : {id:courseID,type:'remove_featured_course'}, success : function(result){ var res = JSON.parse(result); if(res.success == true){ alert(res.message); location.reload(); } else { alert(res.message); location.reload(); } } }); } function add_featured_course(courseID){ $.ajax({ url : 'admin_ajax.php', type : 'POST', async: false, data : {id:courseID,type:'add_featured_course'}, success : function(result){ var res = JSON.parse(result); if(res.success == true){ alert(res.message); location.reload(); } else { alert(res.message); location.reload(); } } }); } </script>