YaWK  24.1
Yet another WebKit
booking.php
Go to the documentation of this file.
1 <?php
2 // check if language is set
3 if (!isset($language) || (!isset($lang)))
4 { // inject (add) language tags to core $lang array
5  $lang = \YAWK\language::inject(@$lang, "../system/plugins/booking/language/");
6 }
7 include '../system/plugins/booking/classes/booking.php';
8 $booking = new \YAWK\PLUGINS\BOOKING\booking();
9 $field = '';
10 $value = '';
11 if (!isset($_GET['entries'])){
12  $i = "LIMIT 50";
13 } else {
14  $i = "";
15 }
16 if (isset($_GET['ip']))
17 {
18  $field = "ip";
19  $value = $_GET['ip'];
20 }
21 if (isset($_GET['email']))
22 {
23  $field = "email";
24  $value = $_GET['email'];
25 }
26 if (isset($_GET['phone']))
27 {
28  $field = "phone";
29  $value = $_GET['phone'];
30 }
31 if (isset($_GET['delete']) && ($_GET['delete'] === '1')) {
32  if (isset($_GET['id']) && (!empty($_GET['id'])))
33  {
34  $id = $_GET['id'];
35  }
36  else
37  {
38  $id = 0;
39  }
40  if ($booking->delete($db, $id)) {
41  print \YAWK\alert::draw("success", "$lang[SUCCESS]", "$lang[BOOKING] $lang[ID] #'".$_GET['id']."' $lang[DELETED]\"","",4200);
42  }
43  else
44  {
45  print \YAWK\alert::draw("danger", "$lang[ERROR]", "$lang[BOOKING_DEL_FAILED].","",3800);
46  }
47 }
48 ?>
49 <script type="text/javascript">
50  $(document).ready(function () {
51  $('#table-sort').dataTable({
52  "bPaginate": false,
53  "bLengthChange": false,
54  "bFilter": true,
55  "bSort": true,
56  "bInfo": true,
57  "bAutoWidth": false
58  });
59  });
60 </script>
61 <?php
62 // TEMPLATE WRAPPER - HEADER & breadcrumbs
63 echo "
64  <!-- Content Wrapper. Contains page content -->
65  <div class=\"content-wrapper\" id=\"content-FX\">
66  <!-- Content Header (Page header) -->
67  <section class=\"content-header\">";
68 /* draw Title on top */
69 echo \YAWK\backend::getTitle($lang['BOOKINGS'], $lang['BOOKING_SUBTEXT']);
70 echo"<ol class=\"breadcrumb\">
71  <li><a href=\"index.php\" title=\"$lang[DASHBOARD]\"><i class=\"fa fa-dashboard\"></i> $lang[DASHBOARD]</a></li>
72  <li><a href=\"index.php?page=plugins\" title=\"$lang[PLUGINS]\"> $lang[PLUGINS]</a></li>
73  <li class=\"active\"><a href=\"index.php?plugin=booking\" title=\"$lang[BOOKING]\"> $lang[BOOKING]</a></li>
74  <li><a href=\"index.php?plugin=booking-setup\" title=\"$lang[SETUP]\"> $lang[SETUP]</a></li>
75  </ol>
76  </section>
77  <!-- Main content -->
78  <section class=\"content\">";
79 /* page content start here */
80 ?>
81 <div class="box box-default">
82  <div class="box-body">
83 
84 <!-- backward btn -->
85 <a class="btn btn-default" href="index.php?plugin=booking&pluginpage=booking-setup" style="float:right;">
86 <i class="fa fa-wrench"></i> &nbsp;<?php print $lang['SETUP']; ?></a>
87 <!-- backward btn -->
88 <a class="btn btn-default" href="index.php?page=plugins" style="float:right;">
89 <i class="glyphicon glyphicon-backward"></i> &nbsp;<?php print $lang['BACK']; ?></a>
90 <!-- backward btn -->
91 <a class="btn btn-default" href="index.php?plugin=booking&pluginpage=booking-stats" style="float:right;">
92 <i class="fa fa-bar-chart"></i> &nbsp;<?php print $lang['STATS']; ?></a>
93 <!-- reload btn -->
94 <a class="btn btn-default" href="index.php?plugin=booking&entries=all" style="float:right;">
95 <i class="glyphicon glyphicon-search"></i> &nbsp;<?php print $lang['SHOW_ALL']; ?></a>
96 <!-- reload btn -->
97 <a class="btn btn-default" href="index.php?plugin=booking" style="float:right;">
98  <i class="glyphicon glyphicon-refresh"></i> &nbsp;<?php print $lang['REFRESH']; ?></a>
99 <!-- --BACKEND -- table header -->
100 <table width="100%" cellpadding="4" cellspacing="0" border="0" class="table table-hover" id="table-sort">
101  <thead>
102  <tr>
103  <td width="8%" style="text-align: center;"><strong><?php echo $lang['FIXATED']; ?></strong></td>
104  <td width="14%"><strong><?php print $lang['DATE_CREATED']; ?></strong></td>
105  <td width="10%"><strong><?php print $lang['NAME']; ?></strong></td>
106  <td width="5%" class=\"text-center\"><strong><?php print $lang['BOOKING_DATEWISH']; ?></strong></td>
107  <td width="39%"><strong><?php print $lang['MESSAGE']; ?></strong></td>
108  <td width="5%" class=\"text-center\"><strong><?php print $lang['BOOKING_VISITS']; ?></strong></td>
109  <td width="5%" class=\"text-center\"><strong><?php print $lang['IP']; ?></strong></td>
110  <td width="14%" class=\"text-center\"><strong><?php print $lang['ACTIONS']; ?></strong></td>
111  </tr>
112  </thead>
113  <tbody>
114  <?php print $booking->getBackendTable($db, $i, $field, $value); ?>
115  </tbody>
116 </table>
117 
118  </div>
119 </div>
static inject(array $lang, string $pathToFile)
allow plugins to inject language tags to $lang array
Definition: language.php:439
if(!isset($db)) $id
function a
Definition: browser.js:14
type
Definition: menu-new.php:35
print $_GET['id']
Definition: page-edit.php:357
$value
Definition: booking.php:10
$booking
Definition: booking.php:8
$field
Definition: booking.php:9
print $lang['SETUP']
Definition: booking.php:69
function i(e, t)
Definition: plyr.js:1
<!-- backend language -->< h3 >< i class="fa fa-language"></i > & nbsp
$i
document ready(function() { $('a[data-confirm]').click(function(ev) { modal='#dataConfirmModal';var href=$(this).attr('href');var title=$(this).attr('title');var icon=$(this).attr('data-icon');if(!icon) { icon='fa fa-trash-o';} if(!$(modal).length) { $('body').append('< div id="dataConfirmModal" class="modal fade" role="dialog" aria-labelledby="dataConfirmLabel" aria-hidden="true">< div class="modal-dialog">< div class="modal-content">< div class="modal-header">< button type="button" class="close" data-dismiss="modal" aria-hidden="true">< i class="fa fa-times"></i ></button >< br >< div class="col-md-1">< h3 class="modal-title">< i class="'+icon+'"></i ></h3 ></div >< div class="col-md-11">< h3 class="modal-title" id="dataConfirmLabel">'+title+'</h3 ></div ></h3 ></div >< div class="modal-body"></div >< div class="modal-footer">< button type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true">Abbrechen</button >< a type="button" class="btn btn-danger" id="dataConfirmOK">< i class="'+icon+'"></i > L &ouml;schen</a ></div ></div ></div ></div >');} $(modal).find('.modal-body').text($(this).attr('data-confirm'));$('#dataConfirmOK').attr('href', href);$(modal).modal({show:true});return false;});$('#terminateUser').click(function() { var terminate=window.confirm("ACHTUNG!\nDas wird Deinen Account permanent deaktivieren.\n"+"Bist Du Dir sicher, dass Du das tun willst?");if(terminate===true) { var terminateUser=window.confirm("Bist Du Dir wirklich ganz sicher?\n"+"Diese Aktion kann nicht rueckgaengig gemacht werden.");if(terminateUser===true) { $.get('system/templates/YaWK-bootstrap3/js/terminate-user.php', function(data) { if(data==="true") { setTimeout("window.location='logout.html'", 0);} else { alert("Fehler: "+data);} });} } });function dismissNotifications() { $.ajax({ url:'js/dismiss-notifications.php', type:'POST', success:function(data) { if(!data) { alert('Something went wrong!');return false;} } });$("#bell-label").fadeOut();$('#notification-header').html('You have 0 notifications');$('#notification-menu').fadeOut();} $("#dismiss").click(function() { dismissNotifications();});function disableButtons(delay) { $('#loginButton').removeClass().addClass('btn btn-success disabled').attr('id', 'LOGIN_FORBIDDEN');$('#resetPasswordButton').removeClass().addClass('btn btn-danger disabled');setTimeout(function() { $('#LOGIN_FORBIDDEN').attr('id', 'loginButton').removeClass().addClass('btn btn-success');$('#resetPasswordButton').removeClass().addClass('btn btn-danger');}, delay);} $("#loginButton").click(function(){ if($('#loginButton').length > 0) { if($('#loginButton').hasClass('btn') &&$('#loginButton').hasClass('btn-success') &&$('#loginButton').hasClass('disabled')) { } else { $("#loginForm").submit();disableButtons(10000);} } else if($('#LOGIN_FORBIDDEN').length > 0) { if($('#LOGIN_FORBIDDEN').hasClass('btn') &&$('#LOGIN_FORBIDDEN').hasClass('btn-success') &&$('#LOGIN_FORBIDDEN').hasClass('disabled')) { } else { } } });$("#blockedBtn").hover(function() { $("#blockedBtn").hide();$("#askBtn").fadeIn(820);});})