PageRenderTime 45ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/admin/view/template/catalog/review_list.tpl

https://gitlab.com/dadangnh/sb1-bon
Smarty Template | 176 lines | 167 code | 9 blank | 0 comment | 31 complexity | 83eb85264fb1b9178f3dfa208a41c163 MD5 | raw file
  1. <?php echo $header; ?><?php echo $column_left; ?>
  2. <div id="content">
  3. <div class="page-header">
  4. <div class="container-fluid">
  5. <div class="pull-right"><a href="<?php echo $add; ?>" data-toggle="tooltip" title="<?php echo $button_add; ?>" class="btn btn-primary"><i class="fa fa-plus"></i></a>
  6. <button type="button" data-toggle="tooltip" title="<?php echo $button_delete; ?>" class="btn btn-danger" onclick="confirm('<?php echo $text_confirm; ?>') ? $('#form-review').submit() : false;"><i class="fa fa-trash-o"></i></button>
  7. </div>
  8. <h1><?php echo $heading_title; ?></h1>
  9. <ul class="breadcrumb">
  10. <?php foreach ($breadcrumbs as $breadcrumb) { ?>
  11. <li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
  12. <?php } ?>
  13. </ul>
  14. </div>
  15. </div>
  16. <div class="container-fluid">
  17. <?php if ($error_warning) { ?>
  18. <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?>
  19. <button type="button" class="close" data-dismiss="alert">&times;</button>
  20. </div>
  21. <?php } ?>
  22. <?php if ($success) { ?>
  23. <div class="alert alert-success"><i class="fa fa-check-circle"></i> <?php echo $success; ?>
  24. <button type="button" class="close" data-dismiss="alert">&times;</button>
  25. </div>
  26. <?php } ?>
  27. <div class="panel panel-default">
  28. <div class="panel-heading">
  29. <h3 class="panel-title"><i class="fa fa-list"></i> <?php echo $text_list; ?></h3>
  30. </div>
  31. <div class="panel-body">
  32. <div class="well">
  33. <div class="row">
  34. <div class="col-sm-6">
  35. <div class="form-group">
  36. <label class="control-label" for="input-product"><?php echo $entry_product; ?></label>
  37. <input type="text" name="filter_product" value="<?php echo $filter_product; ?>" placeholder="<?php echo $entry_product; ?>" id="input-product" class="form-control" />
  38. </div>
  39. <div class="form-group">
  40. <label class="control-label" for="input-author"><?php echo $entry_author; ?></label>
  41. <input type="text" name="filter_author" value="<?php echo $filter_author; ?>" placeholder="<?php echo $entry_author; ?>" id="input-author" class="form-control" />
  42. </div>
  43. </div>
  44. <div class="col-sm-6">
  45. <div class="form-group">
  46. <label class="control-label" for="input-status"><?php echo $entry_status; ?></label>
  47. <select name="filter_status" id="input-status" class="form-control">
  48. <option value="*"></option>
  49. <?php if ($filter_status) { ?>
  50. <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
  51. <?php } else { ?>
  52. <option value="1"><?php echo $text_enabled; ?></option>
  53. <?php } ?>
  54. <?php if (!$filter_status && !is_null($filter_status)) { ?>
  55. <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
  56. <?php } else { ?>
  57. <option value="0"><?php echo $text_disabled; ?></option>
  58. <?php } ?>
  59. </select>
  60. </div>
  61. <div class="form-group">
  62. <label class="control-label" for="input-date-added"><?php echo $entry_date_added; ?></label>
  63. <div class="input-group date">
  64. <input type="text" name="filter_date_added" value="<?php echo $filter_date_added; ?>" placeholder="<?php echo $entry_date_added; ?>" data-date-format="YYYY-MM-DD" id="input-date-added" class="form-control" />
  65. <span class="input-group-btn">
  66. <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
  67. </span></div>
  68. </div>
  69. <button type="button" id="button-filter" class="btn btn-primary pull-right"><i class="fa fa-filter"></i> <?php echo $button_filter; ?></button>
  70. </div>
  71. </div>
  72. </div>
  73. <form action="<?php echo $delete; ?>" method="post" enctype="multipart/form-data" id="form-review">
  74. <div class="table-responsive">
  75. <table class="table table-bordered table-hover">
  76. <thead>
  77. <tr>
  78. <td style="width: 1px;" class="text-center"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);" /></td>
  79. <td class="text-left"><?php if ($sort == 'pd.name') { ?>
  80. <a href="<?php echo $sort_product; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_product; ?></a>
  81. <?php } else { ?>
  82. <a href="<?php echo $sort_product; ?>"><?php echo $column_product; ?></a>
  83. <?php } ?></td>
  84. <td class="text-left"><?php if ($sort == 'r.author') { ?>
  85. <a href="<?php echo $sort_author; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_author; ?></a>
  86. <?php } else { ?>
  87. <a href="<?php echo $sort_author; ?>"><?php echo $column_author; ?></a>
  88. <?php } ?></td>
  89. <td class="text-right"><?php if ($sort == 'r.rating') { ?>
  90. <a href="<?php echo $sort_rating; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_rating; ?></a>
  91. <?php } else { ?>
  92. <a href="<?php echo $sort_rating; ?>"><?php echo $column_rating; ?></a>
  93. <?php } ?></td>
  94. <td class="text-left"><?php if ($sort == 'r.status') { ?>
  95. <a href="<?php echo $sort_status; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_status; ?></a>
  96. <?php } else { ?>
  97. <a href="<?php echo $sort_status; ?>"><?php echo $column_status; ?></a>
  98. <?php } ?></td>
  99. <td class="text-left"><?php if ($sort == 'r.date_added') { ?>
  100. <a href="<?php echo $sort_date_added; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_date_added; ?></a>
  101. <?php } else { ?>
  102. <a href="<?php echo $sort_date_added; ?>"><?php echo $column_date_added; ?></a>
  103. <?php } ?></td>
  104. <td class="text-right"><?php echo $column_action; ?></td>
  105. </tr>
  106. </thead>
  107. <tbody>
  108. <?php if ($reviews) { ?>
  109. <?php foreach ($reviews as $review) { ?>
  110. <tr>
  111. <td class="text-center"><?php if (in_array($review['review_id'], $selected)) { ?>
  112. <input type="checkbox" name="selected[]" value="<?php echo $review['review_id']; ?>" checked="checked" />
  113. <?php } else { ?>
  114. <input type="checkbox" name="selected[]" value="<?php echo $review['review_id']; ?>" />
  115. <?php } ?></td>
  116. <td class="text-left"><?php echo $review['name']; ?></td>
  117. <td class="text-left"><?php echo $review['author']; ?></td>
  118. <td class="text-right"><?php echo $review['rating']; ?></td>
  119. <td class="text-left"><?php echo $review['status']; ?></td>
  120. <td class="text-left"><?php echo $review['date_added']; ?></td>
  121. <td class="text-right"><a href="<?php echo $review['edit']; ?>" data-toggle="tooltip" title="<?php echo $button_edit; ?>" class="btn btn-primary"><i class="fa fa-pencil"></i></a></td>
  122. </tr>
  123. <?php } ?>
  124. <?php } else { ?>
  125. <tr>
  126. <td class="text-center" colspan="7"><?php echo $text_no_results; ?></td>
  127. </tr>
  128. <?php } ?>
  129. </tbody>
  130. </table>
  131. </div>
  132. </form>
  133. <div class="row">
  134. <div class="col-sm-6 text-left"><?php echo $pagination; ?></div>
  135. <div class="col-sm-6 text-right"><?php echo $results; ?></div>
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. <script type="text/javascript"><!--
  141. $('#button-filter').on('click', function() {
  142. url = 'index.php?route=catalog/review&token=<?php echo $token; ?>';
  143. var filter_product = $('input[name=\'filter_product\']').val();
  144. if (filter_product) {
  145. url += '&filter_product=' + encodeURIComponent(filter_product);
  146. }
  147. var filter_author = $('input[name=\'filter_author\']').val();
  148. if (filter_author) {
  149. url += '&filter_author=' + encodeURIComponent(filter_author);
  150. }
  151. var filter_status = $('select[name=\'filter_status\']').val();
  152. if (filter_status != '*') {
  153. url += '&filter_status=' + encodeURIComponent(filter_status);
  154. }
  155. var filter_date_added = $('input[name=\'filter_date_added\']').val();
  156. if (filter_date_added) {
  157. url += '&filter_date_added=' + encodeURIComponent(filter_date_added);
  158. }
  159. location = url;
  160. });
  161. //--></script>
  162. <script type="text/javascript"><!--
  163. $('.date').datetimepicker({
  164. pickTime: false
  165. });
  166. //--></script></div>
  167. <?php echo $footer; ?>