126 lines
		
	
	
		
			7.4 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			126 lines
		
	
	
		
			7.4 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
|     defined('BASEPATH') OR exit('No direct script access allowed');
 | |
| 
 | |
|     use Coduo\PHPHumanizer\DateTimeHumanizer;
 | |
| 
 | |
| ?>
 | |
| <!-- page content -->
 | |
| <div class="right_col" role="main">
 | |
|     <div class="">
 | |
|         <div class="row">
 | |
|             <div class="col-md-12 col-sm-12 col-xs-12">
 | |
|                 <div class="x_panel">
 | |
|                     <div class="x_title">
 | |
|                         <h2>Feedbacks</h2>
 | |
|                         <div class="clearfix"></div>
 | |
|                     </div>
 | |
|                     <div class="x_content">
 | |
|                         <p class="text-muted font-13 m-b-30">
 | |
|                             Hier sind alle bisher erhaltenden Feedback-Meldungen der Nutzer aufgelistet.
 | |
|                         </p>
 | |
|                         <div style="overflow-x: auto">
 | |
|                             <table id="datatable-fixed-header" class="table table-striped table-bordered"
 | |
|                                    data-page-length="25" data-order='[[ 7, "asc" ], [1, "desc"]]'>
 | |
|                                 <thead>
 | |
|                                 <tr>
 | |
|                                     <th>ID</th>
 | |
|                                     <th>Datum</th>
 | |
|                                     <th>Seite</th>
 | |
|                                     <th>Nachricht</th>
 | |
|                                     <th>Anonym?</th>
 | |
|                                     <th>Nutzer</th>
 | |
|                                     <th>Email-Adresse</th>
 | |
|                                     <th>Status</th>
 | |
|                                     <th>Status-Nachricht</th>
 | |
|                                     <th>Supporter</th>
 | |
|                                     <th>Tools</th>
 | |
|                                 </tr>
 | |
|                                 </thead>
 | |
|                                 <tbody>
 | |
|                                 <?php foreach ($feedback as $entry) { ?>
 | |
|                                     <tr id="entry-<?= $entry['ID'] ?>">
 | |
|                                         <td><?= $entry['ID'] ?></td>
 | |
|                                         <?php $datetime = strtotime($entry['datetime']) ?>
 | |
|                                         <td><?= date("d.m.Y", $datetime) . " - " . DateTimeHumanizer::difference(new \DateTime(), new \DateTime("@$datetime"), $_SESSION['site_lang']) ?></td>
 | |
|                                         <td>
 | |
|                                             <a href="<?= base_url($entry['page']) ?>"
 | |
|                                                target="_blank"><?= $entry['page'] ?></a>
 | |
|                                         </td>
 | |
|                                         <td><?= $entry['message'] ?></td>
 | |
|                                         <td><?= $entry['anonymous'] ? '<i class="fa fa-check-circle"></i> Ja' : '<i class="fa fa-times-circle"></i> Nein' ?></td>
 | |
|                                         <td>
 | |
|                                             <a href="<?= base_url('user/' . $entry['username']) ?>">
 | |
|                                                 <?= $entry['userDisplayname'] ?>
 | |
|                                             </a>
 | |
|                                         </td>
 | |
|                                         <td><?= $entry['email'] ?></td>
 | |
|                                         <td data-order="<?= $entry['feedbackState'] ?>"><?= $entry['feedbackStateDisplayname'] ?></td>
 | |
|                                         <td><?= $entry['feedbackStatusMessage'] ?></td>
 | |
|                                         <td>
 | |
|                                             <a href="<?= base_url('user/' . $entry['supporterUsername']) ?>"><?= $entry['supporterDisplayname'] ?></a>
 | |
|                                         </td>
 | |
|                                         <td>
 | |
|                                             <?php if ($entry['supporterID'] != $_SESSION['user']['ID']): ?>
 | |
|                                                 <a href="<?= base_url('admin/feedback/takeover/' . $entry['ID'] . '/' . $entry['feedbackState']) ?>" data-toggle="tooltip" data-placement="top" title="Support übernehmen">
 | |
|                                                     <button type="button" class="btn btn-xs btn-default">
 | |
|                                                         <i class="fa fa-bullhorn"></i>
 | |
|                                                     </button>
 | |
|                                                 </a>
 | |
|                                             <?php else: ?>
 | |
|                                                 <a href="#" data-toggle="tooltip" data-placement="top" title="Status ändern">
 | |
|                                                     <button type="button" class="btn btn-xs btn-primary" data-toggle="modal" data-target="#statusModal" data-id="<?= $entry['ID'] ?>" data-state="<?= $entry['feedbackStateName'] ?>">
 | |
|                                                         <i class="fa fa-gavel"></i>
 | |
|                                                     </button>
 | |
|                                                 </a>
 | |
|                                                 <?php if ($entry['feedbackState'] >= 10): ?>
 | |
|                                                     <a href="#" onclick="archiveFeedback(<?= $entry['ID'] ?>)" class="btn btn-xs btn-red" data-toggle="tooltip" data-placement="top" title="Archivieren">
 | |
|                                                         <i class="fa fa-trash"></i>
 | |
|                                                     </a>
 | |
|                                                 <?php endif; ?>
 | |
|                                             <?php endif; ?>
 | |
|                                         </td>
 | |
|                                     </tr>
 | |
|                                 <?php } ?>
 | |
|                                 </tbody>
 | |
|                             </table>
 | |
|                         </div>
 | |
|                     </div>
 | |
|                 </div>
 | |
|             </div>
 | |
|         </div>
 | |
|     </div>
 | |
| </div>
 | |
| 
 | |
| <div class="modal fade" id="statusModal" role="dialog" tabindex="-1" aria-labelledby="statusModalTitle">
 | |
|     <div class="modal-dialog modal-dialog-centered" role="document">
 | |
|         <div class="modal-content">
 | |
|             <div class="modal-header">
 | |
|                 <button type="button" class="close" data-dismiss="modal" aria-label="Schließen">
 | |
|                     <span aria-hidden="true">×</span>
 | |
|                 </button>
 | |
|                 <h4 class="modal-title" id="statusModalTitle">Status ändern</h4>
 | |
|             </div>
 | |
|             <form method="post">
 | |
|                 <div class="modal-body">
 | |
|                     <div class="form-group">
 | |
|                         <label for="feedbackState">Neuer Status
 | |
|                             <select name="feedbackState" class="form-control" id="feedbackState">
 | |
|                                 <option value="new" disabled>ungelesen</option>
 | |
|                                 <option value="read">gelesen</option>
 | |
|                                 <option value="question">Rückfrage</option>
 | |
|                                 <option value="fixing">in Bearbeitung</option>
 | |
|                                 <option value="paused">pausiert</option>
 | |
|                                 <option value="closed">geschlossen</option>
 | |
|                                 <option value="fixed">geschlossen & gelöst</option>
 | |
|                             </select>
 | |
|                         </label>
 | |
|                     </div>
 | |
|                 </div>
 | |
|                 <div class="modal-footer">
 | |
|                     <button class="btn btn-default" type="button" data-dismiss="modal">Schließen</button>
 | |
|                     <button class="btn btn-primary" type="submit">Status ändern</button>
 | |
|                 </div>
 | |
|             </form>
 | |
|         </div>
 | |
|     </div>
 | |
| </div>
 |