PageRenderTime 49ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/day34_final_project/Final_Project/Group-4_CodeArtisan/bitm-final-project-master-bb727a6b10ebe8331078472b3bb62c2367544f1e/Views/freecourse.php

https://gitlab.com/redwan4re/web-apps-php-26
PHP | 155 lines | 130 code | 25 blank | 0 comment | 17 complexity | 752eef551100c7c38f51d4ac7278f728 MD5 | raw file
  1. <?php
  2. include_once '../vendor/autoload.php';
  3. use App\course\Course;
  4. $objIndex = new Course();
  5. $allData = $objIndex->ShowAllCourse();
  6. $i = 1;
  7. $serial = 1;
  8. ?>
  9. <?php include_once 'header.php'; ?>
  10. <!-- Page header -->
  11. <div class="page-header">
  12. <div class="page-header-content">
  13. <div class="page-title">
  14. <h4><i class="icon-arrow-left52 position-left"></i> <span class="text-semibold">List</span> Of All Courses</h4>
  15. </div><?php $objIndex->sessionMsg('deleteSuccess') ?>
  16. </div>
  17. </div>
  18. <!-- /page header -->
  19. <!-- Content area -->
  20. <div class="content">
  21. <!-- Detached sidebar -->
  22. <?php include_once 'sidebar.php'; ?>
  23. <!-- /detached sidebar -->
  24. <!-- Detached content -->
  25. <div class="container-detached">
  26. <div class="content-detached">
  27. <!-- Grid -->
  28. <div class="row">
  29. <div class="col-md-12">
  30. <!-- Horizontal form -->
  31. <div class="panel panel-flat">
  32. <div class="panel-body">
  33. <div class="table-responsive">
  34. <table class="table table-columned footable" data-page-size="10"
  35. data-next-text="Next" data-previous-text="Previous">
  36. <thead>
  37. <tr class="disabled bg-teal-600">
  38. <th>#</th>
  39. <th>Course<br>Name</th>
  40. <th>Duration</th>
  41. <th>Type</th>
  42. <th colspan="3"><center>Action</center></th>
  43. </tr>
  44. </thead>
  45. <tbody>
  46. <?php
  47. foreach ($allData as $singleData) {
  48. if($singleData['course_type']==1){
  49. continue;
  50. }
  51. if ($singleData['is_delete'] == 1) {
  52. continue;
  53. }
  54. ?>
  55. <tr class="<?php
  56. if ($i % 2 == 0) {
  57. echo "info";
  58. } else {
  59. echo "alpha-slate";
  60. }
  61. $i++;
  62. ?>">
  63. <td><?php echo $serial++; ?></td>
  64. <td><?php echo $singleData['title']; ?></td>
  65. <td><?php
  66. if ($singleData['duration'] == '15_days') {
  67. echo "15 Days Long";
  68. }
  69. if ($singleData['duration'] == '1_month') {
  70. echo "1 Month Long";
  71. }
  72. if ($singleData['duration'] == '2_months') {
  73. echo "2 Months Long";
  74. }
  75. if ($singleData['duration'] == '3_months') {
  76. echo "Maximum 3 Months";
  77. }
  78. ?></td>
  79. <?php
  80. if ($singleData['course_type'] == 2) {
  81. echo '<td><b><span class="text-danger">FREE Course</span></b></td>';
  82. } else {
  83. echo '<td>Paid Course</td>';
  84. }
  85. ?>
  86. <td class="text-center">
  87. <a class="btn bg-teal" type="button" href="show.php?id=<?php echo $singleData['unique_id']; ?>">
  88. <i class="icon-enlarge6 position-left"></i>
  89. Details
  90. </a>
  91. </td>
  92. <td class="text-center">
  93. <a class="btn bg-teal" type="button" href="edit.php?id=<?php echo $singleData['unique_id']; ?>">
  94. <i class="icon-pencil7 position-left"></i>
  95. Edit
  96. </a>
  97. </td>
  98. <td class="text-center">
  99. <a class="btn bg-teal" type="button" href="trash.php?id=<?php echo $singleData['unique_id']; ?>">
  100. <i class="icon-close2 position-left"></i>
  101. Delete
  102. </a>
  103. </td>
  104. </tr>
  105. <?php
  106. }
  107. ?>
  108. </tbody>
  109. <!-- Pagination -->
  110. <tfoot class="hide-if-no-paging">
  111. <tr>
  112. <td colspan="3">
  113. <div class="pagination text-center"></div>
  114. </td>
  115. </tr>
  116. </tfoot>
  117. <!-- /Pagination -->
  118. </table>
  119. </div>
  120. </div>
  121. </div>
  122. <!-- /horizotal form -->
  123. </div>
  124. </div>
  125. </div>
  126. <!-- /grid -->
  127. </div>
  128. </div>
  129. <!-- /detached content -->
  130. <?php include_once 'footer.php';?>