You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

surveyList.view copy 2.php 8.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <?php echo $this->partial('Layout/nav'); ?>
  2. <div class="container-fluid">
  3. <div class="container-page-wrapper shodowed bordered">
  4. <div class="container-page-container">
  5. <div class="row">
  6. <div class="col-lg-6">
  7. <h1><?php echo $this->actionTitle; ?></h1>
  8. </div>
  9. <div class="col-lg-6 clearfix">
  10. <div class="float-right">
  11. <button type="button" class="btn btn-info btn-refresh-list"><span class="icon-loop2"></span></button>
  12. </div>
  13. </div>
  14. </div>
  15. <?php //debug($this->view->survey); ?>
  16. <?php if(is_array($this->view->survey)): ?>
  17. <?php echo $this->partial('Layout/pagination'); ?>
  18. <form id="form-survey-list">
  19. <div class="table-overflow">
  20. <table class="table table-striped">
  21. <thead>
  22. <th width="1%"></th>
  23. <th width="1%"></th>
  24. <th width="1%"></th>
  25. <th width="1%"></th>
  26. <th class="text-center" width="1%">#ID</th>
  27. <th>Ricezione</th>
  28. <th>Tipo</th>
  29. <?php if($this->view->isGlobal): ?>
  30. <th>Gestore</th>
  31. <?php endif; ?>
  32. <th>Paziente</th>
  33. <th>E-mail</th>
  34. <th>Tel.</th>
  35. <th class="text-center"><?php echo _('Opened'); ?></th>
  36. <th class="text-center">Compilato</th>
  37. <th><?php echo _('Sent'); ?></th>
  38. <th width="1%"></th>
  39. <th width="1%"></th>
  40. <th width="1%"></th>
  41. </thead>
  42. <tbody>
  43. <tr>
  44. <td></td>
  45. <td></td>
  46. <td></td>
  47. <td></td>
  48. <td></td>
  49. <td></td>
  50. <td>
  51. <select class="form-control request-search-ctrl" name="searchData[survey_type]">
  52. <option value=""></option>
  53. <?php foreach($this->view->typeList as $id => $label): ?>
  54. <option value="<?php echo $id; ?>" <?php echo $this->session->getSessionValue('search_survey_type') == $id ? 'selected' : ''; ?> ><?php echo $label; ?></option>
  55. <?php endforeach; ?>
  56. </select>
  57. </td>
  58. <?php if($this->view->isGlobal): ?>
  59. <td></td>
  60. <?php endif; ?>
  61. <td>
  62. <input type="text" class="form-control request-search-ctrl" name="searchData[survey_patient]" value="<?php echo trim($this->session->getSessionValue('search_survey_patient')) != '' ? trim($this->session->getSessionValue('search_survey_patient')) : ''; ?>" style="width: 180px;">
  63. </td>
  64. <td></td>
  65. <td></td>
  66. <td></td>
  67. <td></td>
  68. <td></td>
  69. <td></td>
  70. <td></td>
  71. <td>
  72. <a class="btn btn-outline-dark btn-sm" href="/survey-list/<?php echo time(); ?>/created_at/desc/1"><i class="fa fa-search" aria-hidden="true"></i></a>
  73. </td>
  74. </tr>
  75. <?php foreach($this->view->survey as $item): ?>
  76. <tr class="<?php if((bool)$item['email_failure']) echo 'cell-danger'; ?>">
  77. <td>
  78. <?php if((bool)$item['aswered_recipient']): ?>
  79. <button type="button" class="btn btn-outline-dark btn-sm btn-survey-preview" data-surveyid="<?php echo $item['survey_id']; ?>"><i class="fa fa-eye" aria-hidden="true"></i></button>
  80. <?php endif; ?>
  81. </td>
  82. <td class="text-center">
  83. <?php if((int)$item['remote_added'] == 1): ?>
  84. <i class="fa fa-upload" aria-hidden="true"></i>
  85. <?php endif; ?>
  86. </td>
  87. <td class="text-center">
  88. <?php if($item['attach_count'] > 0): ?>
  89. <i class="fa fa-paperclip" aria-hidden="true" title="<?php echo $item['attach_count']; ?>"></i>
  90. <?php endif; ?>
  91. </td>
  92. <td class="text-center">
  93. <?php if((bool)$item['email_failure']): ?>
  94. <i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
  95. <?php endif; ?>
  96. </td>
  97. <td class="text-center"><?php echo $item['survey_id']; ?></td>
  98. <td>
  99. <?php
  100. if (!is_null($item['msg_delay_at'])) {
  101. if ($this->utility->isDateInThePast($item['msg_delay_at']) && $item['msg_sent'] == 0) {
  102. $badge_class = 'badge-danger';
  103. $badge_icon = '<i class="fa fa-clock-o" aria-hidden="true"></i>';
  104. } else {
  105. if ($this->utility->isDateInThePast($item['msg_delay_at'])) {
  106. $badge_class = 'badge-success';
  107. $badge_icon = '<i class="fa fa-check" aria-hidden="true"></i>';
  108. } else {
  109. $badge_class = 'badge-warning';
  110. $badge_icon = '<i class="fa fa-clock-o" aria-hidden="true"></i>';
  111. }
  112. }
  113. } else {
  114. $badge_class = '';
  115. $badge_icon = '';
  116. }
  117. ?>
  118. <span class="badge <?php echo $badge_class; ?>"><?php echo $badge_icon; ?> <?php echo $this->helper->getDateString($item['msg_delay_at'], false); ?></span>
  119. </td>
  120. <td><?php echo $item['survey_label']; ?></td>
  121. <?php if($this->view->isGlobal): ?>
  122. <td><?php echo $item['manager_surname'], ' ', $item['manager_name']; ?></td>
  123. <?php endif; ?>
  124. <td><?php echo $item['surname'], ' ', $item['name']; ?></td>
  125. <td><span class="<?php if((bool)$item['email_failure']) echo 'string-wave'; ?>"><?php echo $item['email']; ?></span></td>
  126. <td><?php echo $item['phone']; ?></td>
  127. <td class="text-center">
  128. <?php if((int)$item['opened_recipient'] == 0): ?>
  129. <i class="fa fa-envelope" aria-hidden="true"></i>
  130. <?php else: ?>
  131. <i class="fa fa-envelope-open-o" aria-hidden="true"></i>
  132. <?php endif; ?>
  133. </td>
  134. <td class="text-center">
  135. <?php if((int)$item['aswered_recipient'] == 0): ?>
  136. <i class="fa fa-clock-o" aria-hidden="true"></i>
  137. <?php else: ?>
  138. <div><i class="fa fa-check" aria-hidden="true"></i></div>
  139. <div><small><?php echo $this->helper->getDateString($item['aswered_date']); ?></small></div>
  140. <?php endif; ?>
  141. </td>
  142. <td><?php echo $this->helper->getDateString($item['survey_created_at']); ?></td>
  143. <td>
  144. <?php if($item['extra_buttons']): ?>
  145. <button type="button" title="Reinvia" class="btn btn-outline-dark btn-sm btn-survey-resend" data-surveyuuid="<?php echo $item['code']; ?>" data-surveyid="<?php echo $item['survey_id']; ?>" data-recipient="<?php echo $item['email']; ?>"><i class="fa fa-repeat" aria-hidden="true"></i></button>
  146. <?php endif; ?>
  147. </td>
  148. <td>
  149. <?php if($item['extra_buttons']): ?>
  150. <a title="Modifica" class="btn btn-outline-dark btn-sm" href="/survey-edit/<?php echo time(); ?>/<?php echo $item['survey_id']; ?>"><i class="fa fa-pencil" aria-hidden="true"></i></a>
  151. <?php endif; ?>
  152. </td>
  153. <td>
  154. <?php if($item['extra_buttons']): ?>
  155. <button type="button" title="Elimina" class="btn btn-outline-danger btn-sm btn-survey-delete" data-surveyuuid="<?php echo $item['code']; ?>" data-surveyid="<?php echo $item['survey_id']; ?>" data-recipient="<?php echo $item['email']; ?>"><i class="fa fa-times" aria-hidden="true"></i></button>
  156. <?php endif; ?>
  157. </td>
  158. </tr>
  159. <?php endforeach; ?>
  160. </tbody>
  161. </table>
  162. </div>
  163. </form>
  164. <hr>
  165. <?php echo $this->partial('Layout/pagination'); ?>
  166. <?php else: ?>
  167. <div class="alert alert-warning" role="alert">
  168. <?php echo _('No data available in this list.'); ?>
  169. </div>
  170. <?php endif; ?>
  171. </div>
  172. </div>
  173. </div>
  174. <div class="modal" id="dialog-survey-preview" tabindex="-1" role="dialog">
  175. <div class="modal-dialog modal-lg" role="document">
  176. <div class="modal-content">
  177. <div class="modal-header">
  178. <h5 class="modal-title"><?php echo _('Survey preview'); ?></h5>
  179. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  180. <span aria-hidden="true">&times;</span>
  181. </button>
  182. </div>
  183. <div class="modal-body">
  184. <div class="text-center" id="dialog-loader"><img src="<?php echo $this->layout->getPublicUri(); ?>images/ajaxloader.svg" width="50"></div>
  185. <div class="modal-body-survey-preview"></div>
  186. </div>
  187. <div class="modal-footer">
  188. <button type="button" class="btn btn-primary" data-dismiss="modal"><?php echo _('Close'); ?></button>
  189. </div>
  190. </div>
  191. </div>
  192. </div>