function timeticket_details_meta() { echo '<p><label>Start Zeit: </label><input type="text" name="timeticket_start_time" class="start_time" value="' . get_timeticket_field("timeticket_start_time") . '" /></p>'; echo '<p><label>End Zeit: </label><input type="text" name="timeticket_end_time" class="end_time" value="' . get_timeticket_field("timeticket_end_time") . '" /> </p>'; $device_selected = get_timeticket_field("timeticket_device"); $timeticket_user = get_timeticket_field("timeticket_user"); $device_list = get_online_devices(); // after this no get_timeticket_field working echo '<p><label>' . fablab_get_captions('device_caption') . ': </label><select name="timeticket_device">'; foreach ($device_list as $device) { if ($device['id'] == $device_selected) { echo '<option selected value="' . $device['id'] . '">' . $device['device'] . '</option>'; } else { echo '<option value="' . $device['id'] . '">' . $device['device'] . '</option>'; } } echo '</select></p>'; $userlist = get_users(array('fields' => array('display_name', 'id'))); echo '<p><label>User: </label><select name="timeticket_user">'; foreach ($userlist as $user) { if ($user->id == $timeticket_user) { echo '<option selected value="' . $user->id . '">' . $user->display_name . '</option>'; } else { echo '<option value="' . $user->id . '">' . $user->display_name . '</option>'; } } echo '</select></p>'; }
public function __construct() { global $fl_ticketlist_user; $fl_ticketlist_user = true; $device_colums = 1; $ticket_rows = 3; $ticket_width = 600; $ticket_height = 200; $initial_height = 300; $online_devices = get_online_devices(); $online_decices_ids = $this->get_online_devices_ids($online_devices); $selected_devices = $this->handle_device_list($online_decices_ids); if (isset($_GET['fullscreen'])) { if (!isset($_GET['width'])) { echo '<div id="refreshnow" data-now="1"></div>'; } echo '<input type="text" id="fullscreen" disabled hidden value="' . isset($_GET['fullscreen']) . '">'; $device_colums = floor($_GET['width'] / $ticket_width); $ticket_rows = max(floor(($_GET['height'] - $initial_height) / $ticket_height), 1); echo '<div class="fl-fullscreen-layer">'; echo '<a href="#" id="close-fullscreen" class="close">x</a>'; echo '<div class="devices-box" style="width: ' . $device_colums * $ticket_width . 'px;">'; $this->display_devicelist($selected_devices, $device_colums, $ticket_rows); echo '</div>'; echo '</div>'; echo '<div class="fl-fullscreen-background"></div>'; } else { echo '<div class="reload">'; echo '<a style="text-decoration: none;" id="get-fullscreen" href="#">⤢ fullscreen</a>'; echo '</div>'; $this->display_options($online_devices, $selected_devices); $this->display_devicelist($selected_devices, count($selected_devices)); } }
function fablab_user_list() { ?> <h2>User Liste</h2> <div id="error-message-box"></div> <h3 style="font-size: 2.3em;">User Berechtigungen</h3> <p>Änderungen werden automatisch gespeichert!</p> <?php $user_query = new WP_User_Query(array('orderby' => 'name', 'order' => 'ASC')); $device_list = get_online_devices(); // User Loop if (!empty($user_query->results)) { ?> <table class="wp-list-table widefat striped users"> <thead> <tr> <th>Benutzername</th> <th>Berechtigungen</th> </tr> </thead> <tbody id="the-list" data-wp-lists="list:user"> <?php foreach ($user_query->results as $user) { ?> <tr id='<?php echo $user->ID; ?> '> <td><?php echo $user->display_name; ?> </td> <td> <?php echo get_user_permission_checkboxes($user->ID, $device_list); ?> </td> </tr> <?php } echo '</table></tbody>'; } else { echo 'No users found.'; } }
private function display_devices_page() { echo '<h2>' . fablab_get_captions('devices_caption') . '</h2>'; echo '<p>Hier werden dir die aktiven ' . fablab_get_captions('devices_caption') . ' angezeigt:</p>'; $device_list = get_online_devices(); if (count($device_list) != 0) { foreach ($device_list as $device) { echo '<div class="device-list-box">'; echo '<div class="device-toggle" style="border-left: 4px solid ' . get_post_meta($device['id'], 'device_color', true) . ';"><p><b>' . $device['device'] . '</b></p></div>'; echo '<div class="device-dropdown" hidden>'; echo '<div class="device-listing">'; $this->display_devices($device['id']); echo '</div>'; echo '<div class="device-close"><p><b>x</b> Schließen</br></p></div>'; echo '</div></div>'; } } else { echo '<p style="margin-bottom:40px; opacity: 0.6;"> -- Keine aktiven ' . fablab_get_captions('tickets_caption') . '! -- </p>'; } }
function get_instruction_devices_string($post_id) { $device_list = get_online_devices(); $device_selected = get_post_meta($post_id, "instruction_devices"); $device_array = array(); foreach ($device_list as $device) { if ($device_selected[0][$device['id']] == '1') { array_push($device_array, $device['device']); } } if (empty($device_array)) { return '--'; } return implode(", ", $device_array); }
public function __construct() { $devices = get_online_devices(); $user_id = get_current_user_id(); $show = true; foreach ($devices as $device) { if (get_user_meta($user_id, $device['id'], true)) { $show = false; } } $captions = fablab_get_captions(); $ticket_caption = $captions['ticket_caption']; $tickets_caption = $_captions['tickets_caption']; $device_caption = $captions['device_caption']; $devices_caption = $captions['devices_caption']; ?> <div class="help-container"> <input type="submit" class="help-button" value="Erste Schritte" /> <div class="help-box" <?php echo $show ? "" : "hidden"; ?> > <div><p class="help-headder">1. <?php echo fablab_get_captions('instruction_caption'); ?> </p> <div class="help-content" hidden> <p><?php echo $devices_caption; ?> für die du noch nicht eingeschult wurdest, werden grau angezeigt.</p> <ol> <li>Stelle eine <?php echo fablab_get_captions('instruction_request_caption'); ?> für dein gewünschtes <?php echo $device_caption; ?> </li> <li>Komm zu einer <?php echo fablab_get_captions('instruction_caption'); ?> </li> </ol> </div></div> <div><p class="help-headder">2. Zugang zu einem <?php echo $device_caption; ?> </p> <div class="help-content" hidden> <p>Für dich verfügbare <?php echo $devices_caption; ?> werden farbig angezeigt.</p> <ol> <li>Gewünschtes <?php echo $device_caption; ?> auswählen</li> <li>Benutzungsdauer auswählen</li> <li><?php echo $ticket_caption; ?> ziehen</li> </ol> </div></div> <div><p class="help-headder">3. <?php echo $ticket_caption; ?> ändern</p> <div class="help-content" hidden> <p>Gezogene <?php echo $tickets_caption; ?> werden unter <?php $tickets_caption; ?> angezeigt.</p> <ol> <li><?php echo $ticket_caption; ?> bearbeiten klicken</li> <li><?php echo $device_caption; ?> oder Dauer ändern</li> <li><?php echo $ticket_caption; ?> speichern</li> </ol> </div></div> <div><p class="help-headder">4. Du bist an der Reihe</p> <div class="help-content" hidden> <p>Wenn dein gewünschtes <?php echo $device_caption; ?> verfügbar ist (<?php echo $ticket_caption; ?> blinkt), melde dich bei dem Manager, er wird dir dein <?php echo $device_caption; ?> zuweisen.</p> </div></div> <div><p class="help-headder">5. <?php echo $device_caption; ?> benutzen</p> <div class="help-content" hidden> <p>Wenn dir ein <?php echo $device_caption; ?> zugewiesen wurde, wird dir ein <?php echo fablab_get_captions('time_ticket_caption'); ?> angezeigt.</p> <ul> <li>Du bist früher fertig: <b>"Jetzt Beenden"</b> klicken.</li> <li>Du brauchst länger: <b>"+30 Minuten"</b> klicken. (Maximale Benutzungsdauer: 2h)</li> </ul> </div></div> </div> </div> <?php }