function get_calendar_shortcode($atts) { global $post; global $fl_calendar_script; $fl_calendar_script = true; //$timeticket_query = get_ticket_query_from_user($user_id); echo '<div id="fullcalendar"></div>'; is_device_availabel('44'); }
private function handle_device_list($online_devices_ids) { if (isset($_GET['devices'])) { $device_list = explode(',', $_GET['devices']); $selected_devices = array(); foreach ($device_list as $device_id) { if (in_array($device_id, $online_devices_ids)) { array_push($selected_devices, $device_id); } } echo '<div id="fl-device-string" data-devices-string="' . '&devices=' . $_GET['devices'] . '"></div>'; return $selected_devices; } else { if (isset($_GET['alldevices'])) { echo '<div id="fl-device-string" data-devices-string="' . '&alldevices' . '"></div>'; return $online_devices_ids; } else { if (isset($_GET['useddevices'])) { $selected_devices = array(); foreach ($online_devices_ids as $device_id) { if (!is_device_availabel($device_id)) { array_push($selected_devices, $device_id); } } echo '<div id="fl-device-string" data-devices-string="' . '&useddevices' . '"></div>'; return $selected_devices; } else { if (isset($_GET['freedevices'])) { $selected_devices = array(); foreach ($online_devices_ids as $device_id) { if (is_device_availabel($device_id)) { array_push($selected_devices, $device_id); } } echo '<div id="fl-device-string" data-devices-string="' . '&freedevices' . '"></div>'; return $selected_devices; } else { echo '<div id="fl-device-string" data-devices-string="' . '&alldevices' . '"></div>'; return $online_devices_ids; } } } } }
function print_deactivatet_tickets($device_id = '') { global $post; if ($device_id) { $meta_array = array(array('key' => 'ticket_type', 'value' => 'device'), array('key' => 'device_id', 'value' => $device_id)); } else { $meta_array = array(array('key' => 'ticket_type', 'value' => 'device')); } $query_arg = array('post_type' => 'ticket', 'orderby' => 'date', 'order' => 'ASC', 'post_status' => 'draft', 'meta_query' => $meta_array); $ticket_query = new WP_Query($query_arg); if ($ticket_query->have_posts()) { echo '<div class="draft-box">'; echo '<div class="draft-toggle"><p class="draft-title">Deaktivierte ' . fablab_get_captions('tickets_caption') . '</p></div>'; echo '<div id="draft-ticket-listing" hidden>'; while ($ticket_query->have_posts()) { $ticket_query->the_post(); $color = get_post_meta(get_post_meta($post->ID, 'device_id', true), 'device_color', true); $device_id = get_post_meta($post->ID, 'device_id', true); $availabel = is_device_availabel($device_id); check_and_delete_ticket($post->ID); ?> <div class="fl-ticket-element draft-content" data-ticket-id="<?php echo $post->ID; ?> " style="border-left: 5px solid <?php echo $color; ?> ;" data-ticket-id="<?php echo $post->ID; ?> " data-device-id="<?php echo $device_id; ?> " data-duration="<?php echo get_post_meta($post->ID, 'duration', true); ?> " data-user-id="<?php echo $post->post_author; ?> " data-device-name="<?php echo get_device_title_by_id($device_id); ?> " data-user="******" > <p><?php echo the_time('l, j. F, G:i'); ?> <p> <h2><?php echo $post->post_title; ?> </h2> <p>für <?php echo fablab_get_captions('device_caption'); ?> : <b><?php echo get_device_title_by_id($device_id); ?> </b></br> Benutzungsdauer: <b><?php echo get_post_time_string(get_post_meta($post->ID, 'duration', true)); ?> </b></p> <input type="submit" <?php echo $availabel ? "" : "disabled"; ?> class="ticket-btn assign-ticket" value="<?php echo fablab_get_captions('ticket_caption'); ?> zuweisen"/> <input type="submit" class="ticket-btn activate-ticket" value="<?php echo fablab_get_captions('ticket_caption'); ?> aktivieren"/> <input type="submit" class="ticket-btn delete-ticket" value="<?php echo fablab_get_captions('ticket_caption'); ?> löschen"/> </div> <?php } echo '</div>'; echo '<div class="draft-toggle"><div class="arrow-down"></div></div>'; echo '</div>'; } wp_reset_query(); }