function get_people_for_shift($master_shift, $master_shift_length) { /* $master_shift is a MasterScheduleEntry object * an associative array of (venue, my_group, day, time, * start, end, slots, persons, notes) */ $people = get_persons($master_shift->get_id()); $slots = get_total_slots($master_shift->get_id()); if (!$people[0]) { array_shift($people); } $p = "<br>"; for ($i = 0; $i < count($people); ++$i) { if (is_array($people[$i])) { $p = $p . " " . $people[$i]['first_name'] . " " . $people[$i]['last_name'] . "<br>"; } else { $p = $p . " " . $people[$i] . "<br>"; } } if ($slots - count($people) > 0) { $p = $p . " <b>Vacancies (" . ($slots - count($people)) . ")</b><br>"; } else { if (count($people) == 0) { $p = $p . " <br>"; } } return substr($p, 0, strlen($p) - 4); }
$users = get_persons($where); $desc = __('Asistentes'); $local_url = 'persons'; } elseif (Action == 'controlpersons') { $where .= ' AND P.id_tasistente < 100'; $users = get_persons($where); $desc = __('Control/Asistentes'); $local_url = 'persons'; } elseif (Action == 'workshopattendees') { preg_match('#^admin/proposals/(\\d+)/persons$#', $q, $matches); $proposal_id = !empty($matches) ? (int) $matches[1] : 0; $proposal = get_proposal($proposal_id); $where .= ' AND P.id IN (SELECT id_asistente FROM ' . $CFG->prefix . 'inscribe WHERE id_evento = ' . $proposal->id_evento . ')'; $desc = __('Asistentes'); $local_url = 'persons'; $users = get_persons($where); } ?> <h1><?php echo __('Lista de'); ?> <?php echo $desc; ?> </h1> <?php if (Action == 'workshopattendees') { ?>
function get_people_for_shift($master_shift) { /* $master_shift is a MasterScheduleEntry object * an associative array of people */ $people = get_persons($master_shift->get_group(), $master_shift->get_day(), $master_shift->get_week_no()); $slots = get_total_slots($master_shift->get_group(), $master_shift->get_day(), $master_shift->get_week_no()); if (!$people[0]) { array_shift($people); } $p = "<br>"; for ($i = 0; $i < count($people); ++$i) { if (is_array($people[$i])) { $fr = filter_roles($master_shift->get_group(), "(" . $people[$i]['role'] . ")"); if ($fr != "()") { $p = $p . " " . $people[$i]['first_name'] . " " . $people[$i]['last_name'] . " " . $fr . "<br>"; } else { $p = $p . " " . $people[$i]['first_name'] . " " . $people[$i]['last_name'] . "<br>"; } } else { $p = $p . " " . $people[$i] . "<br>"; } } if ($slots - count($people) > 0) { $p = $p . " <b>Vacancies (" . ($slots - count($people)) . ")</b><br>"; } else { if (count($people) == 0) { $p = $p . " <br>"; } } return substr($p, 0, strlen($p) - 4); // remove the last )<br> }
function get_total_vacancies($Schedule_type, $day, $time) { $slots = get_total_slots($Schedule_type, $day, $time); $persons = count(get_persons($Schedule_type, $day, $time)); return $slots - $persons; }
function get_total_vacancies($group, $day, $week_no) { $slots = get_total_slots($group, $day, $week_no); $persons = count(get_persons($group, $day, $week_no)); return $slots - $persons; }
" class="person_label"> <div class="person_label_icon" style="background-image: url('<?php echo $imageBase64 != NULL ? "data:image;base64," . $imageBase64 : "views/icons/businessman94.png"; ?> ');"></div> <div class="person_label_content"><b><?php echo ($name ? $name . " " : "... ") . ($surname ? $surname : "..."); ?> </b> </div> <div class="person_label_tools"> <div class="loader facebookG"> <div id="blockG_1" class="facebook_blockG"></div> <div id="blockG_2" class="facebook_blockG"></div> <div id="blockG_3" class="facebook_blockG"></div> </div> </div> </div> <div class="Person_Container" style="display: none;"><!--*ajax*--></div> </div> <?php } if (NULL != ($records = get_persons($userid, $items, $page))) { for ($row = 0; $row <= count($records); $row++) { if ($row != count($records)) { put_person($records[$row]['personid'], $records[$row]['imageBase64'], $records[$row]['sex'], $records[$row]['name'], $records[$row]['surname']); } } } else { $_SESSION['notice'] = "<b>persons.php:</b><br />No contacts found. To add new contacts press 'add contact'."; }
function process_unfill_shift($post, $msentry) { $persons = get_persons($msentry->get_id()); if (!$persons[0]) { array_shift($persons); } for ($i = 0; $i < count($persons); ++$i) { if (array_key_exists('_submit_filled_slot_' . $i, $post)) { if (is_array($persons[$i])) { unschedule_person($msentry, $persons[$i]['id']); remove_from_future_shifts($persons[$i]['id']); } else { unschedule_person($msentry, $persons[$i]); remove_from_future_shifts($persons[$i]); } return true; } } return false; }
function process_unfill_crew($post, $group, $day, $week_no) { $persons = get_persons($group, $day, $week_no); if (!$persons[0]) { array_shift($persons); } for ($i = 0; $i < count($persons); ++$i) { if (array_key_exists('_submit_filled_slot_' . $i, $post)) { if (is_array($persons[$i])) { unschedule_person($group, $day, $week_no, $persons[$i]['id']); } else { unschedule_person($group, $day, $week_no, $persons[$i]); } return true; } } return false; }