Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

surveyList.view.php 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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. <p><small><?php echo $this->view->ccStringList; ?>.</small></p>
  9. </div>
  10. <div class="col-lg-6 clearfix">
  11. <div class="float-right">
  12. <button type="button" class="btn btn-info btn-refresh-list"><span class="icon-loop2"></span></button>
  13. </div>
  14. </div>
  15. </div>
  16. <?php //debug($this->view->testt); ?>
  17. <?php if(is_array($this->view->survey)): ?>
  18. <?php echo $this->partial('Layout/pagination'); ?>
  19. <form id="form-survey-list" autocomplete="off">
  20. <div class="table-overflow">
  21. <table class="table table-striped">
  22. <thead>
  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 class="text-center"><?php echo _('Viewed'); ?></th>
  28. <th class="text-center" nowrap><?php echo $this->helper->setSortableCol(_('Filled'), 'survey-list/'.time(), 'sy.aswered_date', 'desc'); ?></th>
  29. <th nowrap><?php echo $this->helper->setSortableCol(_('Reception'), 'survey-list/'.time(), 'sq.msg_delay_at', 'desc'); ?></th>
  30. <th><?php echo _('Type'); ?></th>
  31. <?php if($this->view->isGlobal): ?>
  32. <th><?php echo _('Manager'); ?></th>
  33. <?php endif; ?>
  34. <th><?php echo _('Patient name'); ?></th>
  35. <th><?php echo _('E-mail'); ?></th>
  36. <th><?php echo _('Phone'); ?></th>
  37. <th nowrap><?php echo $this->helper->setSortableCol(_('Request'), 'survey-list/'.time(), 'sy.created_at', 'desc'); ?></th>
  38. <!--<th width="1%"></th>-->
  39. <th width="1%"></th>
  40. <th width="1%"></th>
  41. </thead>
  42. <tbody>
  43. <tr>
  44. <td>
  45. <select class="form-control request-search-ctrl" name="searchData[tlc_linked]" style="min-width: 32px;">
  46. <option value="-1"></option>
  47. <option value="0" <?php echo $this->session->getSessionValue('search_survey_tlc_linked') === 0 ? 'selected' : ''; ?>><?php echo _('Without report'); ?></option>
  48. <option value="1" <?php echo $this->session->getSessionValue('search_survey_tlc_linked') == 1 ? 'selected' : ''; ?>><?php echo _('With report'); ?></option>
  49. </select>
  50. </td>
  51. <td></td>
  52. <td></td>
  53. <td></td>
  54. <td class="text-center">
  55. <select class="form-control request-search-ctrl" name="searchData[mail_opened]" style="min-width: 32px;">
  56. <option value="-1"></option>
  57. <option value="0" <?php echo $this->session->getSessionValue('search_survey_email_opened') === 0 ? 'selected' : ''; ?>><?php echo _('Not viewed'); ?></option>
  58. <option value="1" <?php echo $this->session->getSessionValue('search_survey_email_opened') == 1 ? 'selected' : ''; ?>><?php echo _('Viewed'); ?></option>
  59. </select>
  60. </td>
  61. <td class="text-center">
  62. <select class="form-control request-search-ctrl" name="searchData[survey_filled]" style="min-width: 32px;">
  63. <option value="-1"></option>
  64. <option value="0" <?php echo $this->session->getSessionValue('search_survey_filled') === 0 ? 'selected' : ''; ?>><?php echo _('Not filled'); ?></option>
  65. <option value="1" <?php echo $this->session->getSessionValue('search_survey_filled') == 1 ? 'selected' : ''; ?>><?php echo _('Filled'); ?></option>
  66. </select>
  67. </td>
  68. <td>
  69. <select class="form-control request-search-ctrl" name="searchData[email_delivered]" style="min-width: 32px;">
  70. <option value="-1"></option>
  71. <option value="0" <?php echo $this->session->getSessionValue('search_survey_email_delivered') === 0 ? 'selected' : ''; ?>><?php echo _('Not received'); ?></option>
  72. <option value="1" <?php echo $this->session->getSessionValue('search_survey_email_delivered') == 1 ? 'selected' : ''; ?>><?php echo _('Received'); ?></option>
  73. </select>
  74. </td>
  75. <td>
  76. <select class="form-control request-search-ctrl" name="searchData[survey_type]">
  77. <option value=""></option>
  78. <?php foreach($this->view->typeList as $id => $label): ?>
  79. <option value="<?php echo $id; ?>" <?php echo $this->session->getSessionValue('search_survey_type') == $id ? 'selected' : ''; ?> ><?php echo $label; ?></option>
  80. <?php endforeach; ?>
  81. </select>
  82. </td>
  83. <?php if($this->view->isGlobal): ?>
  84. <td></td>
  85. <?php endif; ?>
  86. <td>
  87. <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;">
  88. </td>
  89. <td></td>
  90. <td></td>
  91. <td></td>
  92. <td></td>
  93. <td>
  94. <button type="button" class="btn btn-outline-dark btn-sm btn-search-refresh-list"><i class="fa fa-search" aria-hidden="true"></i></button>
  95. </td>
  96. </tr>
  97. <?php foreach($this->view->survey as $item): ?>
  98. <tr class="<?php if((bool)$item['email_failure']) echo 'cell-danger'; ?>">
  99. <!--<td>
  100. <?php if((bool)$item['aswered_recipient']): ?>
  101. <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>
  102. <?php endif; ?>
  103. </td>-->
  104. <td class="text-center" nowrap>
  105. <?php if((int)$item['remote_added'] == 1): ?>
  106. <i class="fa fa-upload" aria-hidden="true" title="<?php echo _('Report created'); ?>"></i>
  107. <?php else: ?>
  108. <i class="fa fa-ellipsis-h text-muted" aria-hidden="true" title="<?php echo _('Report is creating or updating'); ?>"></i>
  109. <?php endif; ?>
  110. <?php if($item['remote_auto_tlc_id'] > 0): ?>
  111. <div class="text-muted"><small><i class="fa fa-external-link" aria-hidden="true"></i> <i>#<?php echo $item['remote_auto_tlc_id']; ?></i></small></div>
  112. <?php endif; ?>
  113. </td>
  114. <td class="text-center">
  115. <?php if($item['attach_count'] > 0): ?>
  116. <i class="fa fa-paperclip" aria-hidden="true" title="<?php echo _('Attachments'); ?>: <?php echo $item['attach_count']; ?>"></i>
  117. <?php endif; ?>
  118. </td>
  119. <td class="text-center">
  120. <?php if((bool)$item['email_failure']): ?>
  121. <i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
  122. <?php endif; ?>
  123. </td>
  124. <td class="text-center"><?php echo $item['survey_id']; ?></td>
  125. <td class="text-center">
  126. <?php $envelope_color = is_null($item['msg_sent']) ? 'text-warning' : 'text-success'; ?>
  127. <span class="fa-stack">
  128. <?php if((int)$item['opened_recipient'] == 0): ?>
  129. <i class="fa fa-envelope <?php echo $envelope_color; ?>" aria-hidden="true"></i>
  130. <?php if($envelope_color == 'text-warning'): ?>
  131. <i class="fa fa-ban fa-stack-2x text-danger"></i>
  132. <?php endif; ?>
  133. <?php else: ?>
  134. <i class="fa fa-envelope-open-o" aria-hidden="true"></i>
  135. <?php endif; ?>
  136. </span>
  137. </td>
  138. <td class="text-center" nowrap>
  139. <?php if((int)$item['aswered_recipient'] == 0): ?>
  140. <i class="fa fa-clock-o" aria-hidden="true"></i>
  141. <?php else: ?>
  142. <div><small><i class="fa fa-check" aria-hidden="true"></i> <?php echo $this->helper->getDateString($item['aswered_date']); ?></small></div>
  143. <?php endif; ?>
  144. </td>
  145. <td>
  146. <?php
  147. if (!is_null($item['msg_delay_at'])) {
  148. if ($this->utility->isDateInThePast($item['msg_delay_at']) && $item['msg_sent'] == 0) {
  149. $badge_class = 'badge-danger';
  150. $badge_icon = '<i class="fa fa-clock-o" aria-hidden="true"></i>';
  151. } else {
  152. if ($this->utility->isDateInThePast($item['msg_delay_at'])) {
  153. $badge_class = 'badge-success';
  154. $badge_icon = '<i class="fa fa-check" aria-hidden="true"></i>';
  155. } else {
  156. $badge_class = 'badge-warning';
  157. $badge_icon = '<i class="fa fa-clock-o" aria-hidden="true"></i>';
  158. }
  159. }
  160. } else {
  161. $badge_class = '';
  162. $badge_icon = '';
  163. }
  164. ?>
  165. <span class="badge <?php echo $badge_class; ?>"><?php echo $badge_icon; ?> <?php echo $this->helper->getDateString($item['msg_delay_at'], false); ?></span>
  166. </td>
  167. <td><?php echo $item['survey_label']; ?></td>
  168. <?php if($this->view->isGlobal): ?>
  169. <td><?php echo $item['manager_surname'], ' ', $item['manager_name']; ?></td>
  170. <?php endif; ?>
  171. <td nowrap><?php echo $item['surname'], ' ', $item['name']; ?></td>
  172. <td><span class="<?php if((bool)$item['email_failure']) echo 'string-wave'; ?>"><?php echo $item['email']; ?></span></td>
  173. <td><?php echo $item['phone']; ?></td>
  174. <td nowrap><small><?php echo $this->helper->getDateString($item['survey_created_at']); ?></small></td>
  175. <?php /*
  176. <td>
  177. <?php if($item['extra_buttons']): ?>
  178. <button type="button" title="Reinvia subito la richiesta di televisita al paziente" 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>
  179. <?php endif; ?>
  180. </td>
  181. */ ?>
  182. <td>
  183. <?php if($item['extra_buttons']): ?>
  184. <a title="<?php echo _("Add a new remote visit or edit the patient's data"); ?>" class="btn btn-outline-dark btn-sm" href="/survey-edit/<?php echo time(); ?>/<?php echo $item['survey_id']; ?>"><i class="fa fa-plus" aria-hidden="true"></i></a>
  185. <?php endif; ?>
  186. </td>
  187. <td>
  188. <?php if($item['extra_buttons']): ?>
  189. <button type="button" title="<?php echo _('Delete'); ?>" 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>
  190. <?php endif; ?>
  191. </td>
  192. </tr>
  193. <?php endforeach; ?>
  194. </tbody>
  195. </table>
  196. </div>
  197. </form>
  198. <?php echo $this->partial('Layout/pagination'); ?>
  199. <?php else: ?>
  200. <div class="alert alert-warning" role="alert">
  201. <?php echo _('No data available in this list.'); ?>
  202. </div>
  203. <?php endif; ?>
  204. </div>
  205. </div>
  206. </div>
  207. <div class="modal" id="dialog-survey-preview" tabindex="-1" role="dialog">
  208. <div class="modal-dialog modal-lg" role="document">
  209. <div class="modal-content">
  210. <div class="modal-header">
  211. <h5 class="modal-title"><?php echo _('Survey preview'); ?></h5>
  212. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  213. <span aria-hidden="true">&times;</span>
  214. </button>
  215. </div>
  216. <div class="modal-body">
  217. <div class="text-center" id="dialog-loader"><img src="<?php echo $this->layout->getPublicUri(); ?>images/ajaxloader.svg" width="50"></div>
  218. <div class="modal-body-survey-preview"></div>
  219. </div>
  220. <div class="modal-footer">
  221. <button type="button" class="btn btn-primary" data-dismiss="modal"><?php echo _('Close'); ?></button>
  222. </div>
  223. </div>
  224. </div>
  225. </div>