PageRenderTime 38ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/view/SEIP143467/Summary Of Organization/trashed.php

https://gitlab.com/Mishu_ctg69/Princy_143467_B37_Atomic_project
PHP | 260 lines | 180 code | 75 blank | 5 comment | 31 complexity | fccc1671df68c72a182f28542b7dad00 MD5 | raw file
  1. <?php
  2. require_once("../../../vendor/autoload.php");
  3. use App\BITM\SEIP143467\Message\Message;
  4. if(!isset( $_SESSION)) session_start();
  5. $message1=Message::message();
  6. use App\BITM\SEIP143467\SummaryOfOrganization\SummaryOfOrganization;
  7. $obj= new SummaryOfOrganization();
  8. $all_organization= $obj->trashed();
  9. ######################## pagination code block#1 of 2 start ######################################
  10. $recordCount= count($all_organization);
  11. if(isset($_REQUEST['Page'])) $page = $_REQUEST['Page'];
  12. else if(isset($_SESSION['Page'])) $page = $_SESSION['Page'];
  13. else $page = 1;
  14. $_SESSION['Page']= $page;
  15. if(isset($_REQUEST['ItemsPerPage'])) $itemsPerPage = $_REQUEST['ItemsPerPage'];
  16. else if(isset($_SESSION['ItemsPerPage'])) $itemsPerPage = $_SESSION['ItemsPerPage'];
  17. else $itemsPerPage = 3;
  18. $_SESSION['ItemsPerPage']= $itemsPerPage;
  19. $pages = ceil($recordCount/$itemsPerPage);
  20. $someData = $obj->trashPaginator($page,$itemsPerPage);
  21. $serial = (($page-1) * $itemsPerPage) +1;
  22. ####################### pagination code block#1 of 2 end #########################################
  23. ?>
  24. <!--table-->
  25. <!DOCTYPE html>
  26. <html lang="en">
  27. <head>
  28. <meta charset="utf-8">
  29. <title> </title>
  30. <!-- Latest compiled and minified CSS -->
  31. <!-- Latest compiled and minified CSS -->
  32. <link rel="stylesheet" href="../../../resource/Bootstrap/css/bootstrap.min.css">
  33. <!-- Optional theme -->
  34. <link rel="stylesheet" href="../../../resource/Bootstrap/css/bootstrap-theme.min.css">
  35. <!-- <link rel="stylesheet" href="../../../resource/Bootstrap/css/booktitle.css"> -->
  36. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  37. </head>
  38. <style>
  39. .main{
  40. margin-top: 10%;
  41. margin-left: 15%;
  42. margin-right:15%;
  43. background-color: #679a9f;
  44. }
  45. body{
  46. background-image:url("../../../resource/assets/images/general1.jpg");
  47. background-repeat:no-repeat;
  48. background-size: 100% 925px;
  49. }
  50. </style>
  51. <body >
  52. <div class="container ">
  53. <div style="margin-top: 40px ;float: left;"> <a href="pdf.php" class="btn btn-primary btn-lg" role="button">Download As Pdf</a></br></br></div>&nbsp;&nbsp;&nbsp;
  54. <div style="margin-top: 40px ;float: left;"> <a href="xl.php" class="btn btn-danger btn-lg" role="button">Download As Xl</a></br></br>&nbsp;&nbsp;&nbsp;</div>
  55. <div style="margin-top: 40px ;float: left;"> <a href="email.php?list=1" class="btn btn-success btn-lg" role="button">Email To A Friend</a></br></br></div>
  56. <div style="margin-top: 40px ;float: right;"> <a href="../index.php" class="btn btn-info btn-info btn-lg" role="button">Go Atomic Project List</a></br></br></div>
  57. <div class="main">
  58. <div class="panel panel-default" >
  59. <div class="panel-heading">
  60. <div class="panel-heading">
  61. <h1 style="text-align: center"> Trashed Organization List</h1>
  62. </div>
  63. </div>
  64. <div class="panel-body">
  65. <form action="recovermultiple.php" method="post" id="multiple">
  66. <div class="table-responsive" >
  67. </br></br></br></br>
  68. <table class="table">
  69. <thead>
  70. <tr>
  71. <th>Select all <input id="select_all" type="checkbox" value="select all"></th>
  72. <th>#</th>
  73. <th>ID</th>
  74. <th>Organization Name</th>
  75. <th>Organization Summary</th>
  76. <th>Action</th>
  77. </tr>
  78. </thead>
  79. <tbody>
  80. <tr>
  81. <?php
  82. $serial=0;
  83. foreach($someData as $result){
  84. $serial++; ?>
  85. <td><input type="checkbox" class="checkbox" name="mark[]" value="<?php echo $result['id']?>"></td>
  86. <td><?php echo $serial?></td>
  87. <td><?php echo $result['id']?></td>
  88. <td><?php echo $result['organization_name']?></td>
  89. <td><?php echo $result['organization_summary']?></td>
  90. <td><a href="recover.php?id=<?php echo $result['id'] ?>" class="btn btn-primary" role="button">Recover</a>
  91. <a href="delete.php?id=<?php echo $result['id'] ?>" class="btn btn-danger" role="button" id="delete" Onclick="return ConfirmDelete()">Delete</a>
  92. </td>
  93. </tr>
  94. <?php }?>
  95. <a href="index.php " class="btn btn-info role="button"> Back to Index</a>
  96. </tbody>
  97. <a href="index.php" class="btn btn-info" role="button">Home</a> &nbsp;&nbsp;&nbsp;&nbsp;
  98. <button type="submit" class="btn btn-info">Recover Selected</button>&nbsp;&nbsp;&nbsp;&nbsp;
  99. <button type="button" class="btn btn-primary" id="delete">Delete all Selected</button>
  100. </table>
  101. <!-- ######################## pagination code block#2 of 2 start ###################################### -->
  102. <div align="left" class="container">
  103. <ul class="pagination">
  104. <?php
  105. $previous=$page-1;
  106. if($previous>0)
  107. {echo "<li><a href='index.php?Page=$previous'>" . "Previous" . '</a></li>';}
  108. for($i=1;$i<=$pages;$i++)
  109. {
  110. if($i==$page) echo '<li class="active"><a href="">'. $i . '</a></li>';
  111. else echo "<li><a href='?Page=$i'>". $i . '</a></li>';
  112. }
  113. $next=$page+1;
  114. if($next<=$pages)
  115. echo "<li><a href='index.php?Page=$next'>" . "Next" . '</a></li>';
  116. ?>
  117. <select class="form-control" name="ItemsPerPage" id="ItemsPerPage" onchange="javascript:location.href = this.value;" >
  118. <?php
  119. if($itemsPerPage==3 ) echo '<option value="?ItemsPerPage=3" selected >Show 3 Items Per Page</option>';
  120. else echo '<option value="?ItemsPerPage=3">Show 3 Items Per Page</option>';
  121. if($itemsPerPage==4 ) echo '<option value="?ItemsPerPage=4" selected >Show 4 Items Per Page</option>';
  122. else echo '<option value="?ItemsPerPage=4">Show 4 Items Per Page</option>';
  123. if($itemsPerPage==5 ) echo '<option value="?ItemsPerPage=5" selected >Show 5 Items Per Page</option>';
  124. else echo '<option value="?ItemsPerPage=5">Show 5 Items Per Page</option>';
  125. if($itemsPerPage==6 ) echo '<option value="?ItemsPerPage=6"selected >Show 6 Items Per Page</option>';
  126. else echo '<option value="?ItemsPerPage=6">Show 6 Items Per Page</option>';
  127. if($itemsPerPage==10 ) echo '<option value="?ItemsPerPage=10"selected >Show 10 Items Per Page</option>';
  128. else echo '<option value="?ItemsPerPage=10">Show 10 Items Per Page</option>';
  129. if($itemsPerPage==15 ) echo '<option value="?ItemsPerPage=15"selected >Show 15 Items Per Page</option>';
  130. else echo '<option value="?ItemsPerPage=15">Show 15 Items Per Page</option>';
  131. ?>
  132. </select>
  133. </ul>
  134. </div>
  135. <!-- ######################## pagination code block#2 of 2 end ###################################### -->
  136. <div id="confirmation_message" style="color:red;">
  137. <?php echo $message1 ?>
  138. </div>
  139. </div>
  140. </form>
  141. </div>
  142. </div>
  143. </div>
  144. </div>
  145. <script>
  146. $(document).ready(function(){
  147. $(function() {
  148. $('#confirmation_message').delay(3000).fadeOut();
  149. });
  150. });
  151. function ConfirmDelete()
  152. {
  153. var x = confirm("Are you sure you want to delete?");
  154. if (x)
  155. return true;
  156. else
  157. return false;
  158. }
  159. $('#delete').on('click',function(){
  160. document.forms[0].action="deletemultiple.php";
  161. $('#multiple').submit();
  162. });
  163. //select all checkboxes
  164. $("#select_all").change(function(){ //"select all" change
  165. var status = this.checked; // "select all" checked status
  166. $('.checkbox').each(function(){ //iterate all listed checkbox items
  167. this.checked = status; //change ".checkbox" checked status
  168. });
  169. });
  170. $('.checkbox').change(function(){ //".checkbox" change
  171. //uncheck "select all", if one of the listed checkbox item is unchecked
  172. if(this.checked == false){ //if this item is unchecked
  173. $("#select_all")[0].checked = false; //change "select all" checked status to false
  174. }
  175. //check "select all" if all checkbox items are checked
  176. if ($('.checkbox:checked').length == $('.checkbox').length ){
  177. $("#select_all")[0].checked = true; //change "select all" checked status to true
  178. }
  179. });
  180. </script>
  181. <script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
  182. <!-- Latest compiled and minified JavaScript -->
  183. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
  184. </body>
  185. </html>