echo mysql_error();
 }
 //upcoming vacancies
 if (mysql_num_rows($vacancy_list) > 0) {
     echo '<div class="vacancyBox">';
     echo '<p><strong>Upcoming Vacancies (next two weeks):</strong><ul>';
     while ($thisRow = mysql_fetch_array($vacancy_list, MYSQL_ASSOC)) {
         $vacancies = $thisRow['slots'] - sizeof(explode(',', $thisRow['persons']));
         if ($vacancies > 0) {
             echo '<li type="circle"><a href="' . $path . 'editCrew.php?id=' . $thisRow['id'] . '">' . get_crew_name_from_id($thisRow['id']) . '</a></li>';
         }
     }
     echo '</ul></p></div><br>';
 }
 // active volunteers who haven't worked recently
 $everyone = getall_names("active", "volunteer");
 if ($everyone && mysql_num_rows($everyone) > 0) {
     //active volunteers who haven't worked for the last two months
     $two_months_ago = $today - 60 * 86400;
     echo '<div class="inactiveBox">';
     echo '<p><strong>Unscheduled active house volunteers who haven\'t worked during the last two months:</strong>';
     echo '<table class="searchResults"><tr><td class="searchResults"><u>Name</u></td><td class="searchResults"><u>Date Last Worked</u></td></tr>';
     while ($thisRow = mysql_fetch_array($everyone, MYSQL_ASSOC)) {
         if (!preg_match("/manager/", $thisRow['type'])) {
             $crews = selectScheduled_dbCrews($thisRow['id']);
             $havent_worked = true;
             $last_worked = "";
             for ($i = 0; $i < count($crews) && $havent_worked; $i++) {
                 $date_worked = mktime(0, 0, 0, get_crew_month($crews[$i]), get_crew_day($crews[$i]), get_crew_year($crews[$i]));
                 $last_worked = substr($crews[$i], 0, 8);
                 if ($date_worked > $two_months_ago) {
Example #2
0
     echo mysql_error();
 }
 //upcoming vacancies
 if (mysql_num_rows($vacancy_list) > 0) {
     echo '<div class="vacancyBox">';
     echo '<p><strong>Upcoming Vacancies:</strong><ul>';
     while ($thisRow = mysql_fetch_array($vacancy_list, MYSQL_ASSOC)) {
         $shift_date = mktime(0, 0, 0, substr($thisRow['id'], 0, 2), substr($thisRow['id'], 3, 2), substr($thisRow['id'], 6, 2));
         if ($shift_date > $today && $shift_date < $two_weeks) {
             echo '<li type="circle"><a href="' . $path . 'editShift.php?shift=' . $thisRow['id'] . '">' . get_shift_name_from_id($thisRow['id']) . '</a></li>';
         }
     }
     echo '</ul></p></div><br>';
 }
 // active volunteers who haven't worked recently
 $everyone = getall_names("active", "volunteer", $_SESSION['venue']);
 if ($everyone && mysql_num_rows($everyone) > 0) {
     //active volunteers who haven't worked for the last two months
     $two_months_ago = $today - 60 * 86400;
     echo '<div class="inactiveBox">';
     echo '<p><strong>Unscheduled active house volunteers who haven\'t worked during the last two months:</strong>';
     echo '<table class="searchResults"><tr><td class="searchResults"><u>Name</u></td><td class="searchResults"><u>Date Last Worked</u></td></tr>';
     while ($thisRow = mysql_fetch_array($everyone, MYSQL_ASSOC)) {
         if (!preg_match("/manager/", $thisRow['type'])) {
             $shifts = selectScheduled_dbShifts($thisRow['id']);
             $havent_worked = true;
             $last_worked = "";
             for ($i = 0; $i < count($shifts) && $havent_worked; $i++) {
                 $date_worked = mktime(0, 0, 0, get_shift_month($shifts[$i]), get_shift_day($shifts[$i]), get_shift_year($shifts[$i]));
                 $last_worked = substr($shifts[$i], 0, 8);
                 if ($date_worked > $two_months_ago) {