PageRenderTime 39ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/application/views/admin/user/add_post/add_post_list.php

https://bitbucket.org/Yatindra_Mohite/spectre
PHP | 239 lines | 221 code | 16 blank | 2 comment | 11 complexity | ebc6c629e66582fcaa25e718e069d9cb MD5 | raw file
Possible License(s): MIT, Apache-2.0, LGPL-2.1, MPL-2.0-no-copyleft-exception, GPL-2.0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>Add Post</title>
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta content="width=device-width, initial-scale=1" name="viewport" />
  8. <meta content="" name="description" />
  9. <meta content="" name="author" />
  10. <!-- BEGIN GLOBAL MANDATORY STYLES -->
  11. <?php $this->load->view("admin/head.php"); ?>
  12. </head>
  13. <!-- END HEAD -->
  14. <body class="page-container-bg-solid page-header-fixed page-sidebar-closed-hide-logo page-md">
  15. <!-- BEGIN HEADER -->
  16. <div class="page-header navbar navbar-fixed-top">
  17. <!-- BEGIN HEADER INNER -->
  18. <?php $this->load->view("admin/new_header1"); ?>
  19. <!-- END HEADER INNER -->
  20. </div>
  21. <div class="clearfix"></div>
  22. <div class="page-container">
  23. <!-- BEGIN SIDEBAR -->
  24. <?php $this->db->query("UPDATE add_post SET notify = '1'");?>
  25. <?php $this->load->view("admin/new_sidebar1"); ?>
  26. <div class="page-content-wrapper">
  27. <!-- BEGIN CONTENT BODY -->
  28. <div class="page-content">
  29. <div class="page-head">
  30. <!-- BEGIN PAGE TITLE -->
  31. <div class="page-title">
  32. <h1>Add Post
  33. <small>dashboard & statistics</small>
  34. </h1>
  35. </div>
  36. <!-- END PAGE TITLE -->
  37. <!-- BEGIN PAGE TOOLBAR -->
  38. <!-- END PAGE TOOLBAR -->
  39. </div>
  40. <!-- END PAGE HEAD-->
  41. <!-- BEGIN PAGE BREADCRUMB -->
  42. <ul class="page-breadcrumb breadcrumb">
  43. <li>
  44. <a href="<?php echo base_url()?>dashboard/">Home</a>
  45. </li>
  46. <li>
  47. <span class="active">Add Post</span>
  48. </li>
  49. </ul>
  50. <!-- BEGIN PAGE HEAD-->
  51. <div class="row">
  52. <div class="col-md-12">
  53. <!-- BEGIN EXAMPLE TABLE PORTLET-->
  54. <?php if($this->session->flashdata('failed')){?>
  55. <div class="alert alert-danger">
  56. <button class="close" data-close="alert"></button>
  57. <span> <?php echo $this->session->flashdata('error');?></span>
  58. </div>
  59. <?php }?>
  60. <?php if($this->session->flashdata('success')){?>
  61. <div class="alert alert-success">
  62. <button class="close" data-close="alert"></button>
  63. <span> <?php echo $this->session->flashdata('success');?></span>
  64. </div>
  65. <?php }?>
  66. <div class="portlet box green">
  67. <div class="portlet-title">
  68. <div class="caption">
  69. <i class="fa fa-user"></i>Add Post</div>
  70. </div>
  71. <div class="portlet-body">
  72. <table class="table table-striped table-bordered table-hover table-header-fixed" id="sample_2">
  73. <thead>
  74. <tr>
  75. <th><center> S.No </center></th>
  76. <th><center> User Name </center></th>
  77. <th><center> Car Name </center></th>
  78. <th><center> Model </center></th>
  79. <th><center> Colour </center></th>
  80. <th><center> Car Type </center></th>
  81. <th><center> Condition </center></th>
  82. <th><center> Version </center></th>
  83. <th><center> Year </center></th>
  84. <th><center> Mileage</center></th>
  85. <th><center> Price </center></th>
  86. <th><center> View </center></th>
  87. <th><center> Delete </center></th>
  88. <!-- <th><center>Neg. Sectional Mark </center></th> -->
  89. <th><center>Status</center></th>
  90. <!-- <th><center>Action</center></th> -->
  91. </tr>
  92. </thead>
  93. <tfoot>
  94. <tr>
  95. <th><center> S.No </center></th>
  96. <th><center> User Name </center></th>
  97. <th><center> Car Name </center></th>
  98. <th><center> Model </center></th>
  99. <th><center> Colour </center></th>
  100. <th><center> Car Type </center></th>
  101. <th><center> Condition </center></th>
  102. <th><center> Version </center></th>
  103. <th><center> Year </center></th>
  104. <th><center> Mileage</center></th>
  105. <th><center> Price </center></th>
  106. <th><center> View </center></th>
  107. <th><center> Delete </center></th>
  108. <!-- <th><center>Neg. Sectional Mark </center></th> -->
  109. <th><center>Status</center></th>
  110. <!-- <th><center>Action</center></th> -->
  111. </tr>
  112. </tfoot>
  113. <tbody>
  114. <?php
  115. if(!empty($post_data))
  116. { $i = 0;
  117. foreach($post_data as $key)
  118. {
  119. $i++;
  120. ?>
  121. <tr>
  122. <td><center><?php echo $i;?></center></td>
  123. <td><center><?php $user = $this->common_model->common_getRow('user',array('user_id'=>$key->user_id)); echo ucwords($user->full_name);?></center> </td>
  124. <td><center><?php echo $key->car_name;?></center></td>
  125. <td><center><?php echo $key->model;?></center></td>
  126. <td><center><?php echo $key->color;?></center></td>
  127. <td><center><?php if($key->car_type == 1){echo "AC";}else{echo "Non AC";};?></center></td>
  128. <td><center><?php echo $key->car_condition;?></center></td>
  129. <td><center><?php echo $key->version;?></center></td>
  130. <td><center><?php echo $key->year?></center></td>
  131. <td><center><?php echo $key->mileage?></center></td>
  132. <td><center><?php echo $key->price?></center></td>
  133. <td><center><a href="<?php echo 'show/'.$key->add_id;?>"><span class="glyphicon glyphicon-picture" aria-hidden="true"></a></span></center></td>
  134. <td><center><a onclick='deletemain("<?php echo $key->add_id;?>");' href="javascript:void(0);" title="click here to delete"><i class="glyphicon glyphicon-trash"></i></a></center></td>
  135. <td><center><select style="" class="form-control" onchange="changestatus('<?php echo $key->add_id;?>',this.value)">
  136. <option value="1"<?php if($key->status==1){ echo 'selected';} ?>> Disaprove </option>
  137. <option value="0"<?php if($key->status==0){ echo 'selected';} ?>> Approve </option>
  138. </select></center></td>
  139. <!-- <td><center><a href="<?php echo 'edit/'.$this->common_model->id_encrypt($key->id);?>"><span class="glyphicon glyphicon-edit" aria-hidden="true"></a></span></center></td> -->
  140. </tr>
  141. <?php
  142. } }
  143. else
  144. {?>
  145. <tr class="even pointer">
  146. <td class="" ></td>
  147. <td class="" ></td>
  148. <td class="" ></td>
  149. <td class="" ></td>
  150. <td class="" ></td>
  151. <td class="" ></td>
  152. <td class="" ></td>
  153. <td class="" ><center><?php echo "Record not found";?></center></td>
  154. <td class="" ></td>
  155. <td class="" ></td>
  156. <td class="" ></td>
  157. <td class="" ></td>
  158. <td class="" ></td>
  159. </tr>
  160. <?php
  161. }?>
  162. </tbody>
  163. </table>
  164. </div>
  165. </div>
  166. <!-- END EXAMPLE TABLE PORTLET-->
  167. </div>
  168. </div>
  169. <!-- END PAGE BASE CONTENT -->
  170. </div>
  171. <!-- END CONTENT BODY -->
  172. </div>
  173. <a href="javascript:;" class="page-quick-sidebar-toggler">
  174. <i class="icon-login"></i>
  175. </a>
  176. </div>
  177. <?php $this->load->view("admin/footer"); ?>
  178. <!-- END THEME LAYOUT SCRIPTS -->
  179. </body>
  180. </html>
  181. <script type="text/javascript">
  182. function changestatus(id,status)
  183. {
  184. var str = "user_id="+id+"&admin_status="+status;
  185. //alert(str);
  186. var r = confirm('Are you really want to change status?');
  187. if(r==true)
  188. {
  189. $.ajax({
  190. type:"POST",
  191. url:"<?php echo base_url('add_post/change_status')?>/",
  192. data:str,
  193. success:function(data)
  194. { //alert(data);
  195. if(data==1000)
  196. {
  197. location.reload();
  198. }
  199. }
  200. });
  201. }location.reload();
  202. }
  203. </script>
  204. <script>
  205. function deletemain(id)
  206. {
  207. var r = confirm('Are you really want to delete?');
  208. if(r==true)
  209. {
  210. $.ajax({
  211. url:"<?php echo base_url('add_post/delete_by_admin')?>/"+id,
  212. success:function(data)
  213. {
  214. // alert(data);
  215. if(data==1000)
  216. {
  217. location.reload();
  218. }
  219. }
  220. });
  221. }
  222. }
  223. </script>