Esempio n. 1
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['SHIFTID'], 0, 2), substr($thisRow['SHIFTID'], 3, 2), substr($thisRow['SHIFTID'], 6, 2));
         if ($shift_date > $today && $shift_date < $two_weeks) {
             echo '<li type="circle"><a href="' . $path . 'editShift.php?shift=' . $thisRow['SHIFTID'] . '">' . get_shift_name_from_id($thisRow['SHIFTID']) . '</a></li>';
         }
     }
     echo '</ul></p></div><br>';
 }
 //active applicants
 //     connect();
 //Checks all of the volunteers to see if they are within 7 days old, if so add them to $array_New_Volunteers
 $one_Week = 7;
 $array_New_Volunteers;
 $volunteers_within_week = getall_persons();
 foreach ($volunteers_within_week as $temp_Week_Volunteer) {
     $daysAsVolunteer = check_Days_As_Volunteer($temp_Week_Volunteer->get_date_added());
     if ($daysAsVolunteer <= $one_Week) {
         #array_push($array_New_Volunteers, $temp_Week_Volunteer);
         $array_New_Volunteers[] = $temp_Week_Volunteer;
     }
 }
 //If $array_New_Volunteers has any new volunteers it will display their first and last name, else it will say there are no new volunteers.
 echo '<div class="applicantsBox"><p><strong>New Volunteers (within a week):</strong><ul>';
 if (empty($array_New_Volunteers)) {
     echo 'There are no new volunteers within the past week.';
 } else {
     //Old way of displaying applicants
     /* $applicants_tab = getall_applicants();
        $numLines = 0;
include 'header.php';
?>
			<div id="content">
				<!-- your main page data goes here. This is the place to enter content -->
				<p><strong>View Persons in the Database</strong><br />
					To find a specific person, <a href="searchPeople.php">search the database</a>!</p>
					<?php 
if ($_SESSION['access_level'] < 1) {
    //you can only edit your own entry
    echo '<p>You do not have sufficient permissions to view all persons in the database. You can <a href="searchPeople.php">search</a> or you can ';
    echo '<a href="personEdit.php?id=' . $_SESSION['_id'] . '">edit</a> your own profile.</p>';
} else {
    //grab stuff from the db
    include_once 'database/dbPersons.php';
    include_once 'domain/Person.php';
    $allPersons = getall_persons();
    //the beginnings of not listing all people at once.
    $i = 0;
    $num_results = $_GET['num_results'];
    if (!$num_results) {
        $num_results = 25;
        $page_num = 0;
    } else {
        $page_num = $_GET['page_num'];
    }
    $min_num = $num_results * $page_num;
    $max_num = $num_results * ($page_num + 1);
    if (sizeof($allPersons) <= $max_num) {
        $max_num = sizeof($allPersons);
    }
    echo "Viewing results " . ($min_num + 1) . "-" . $max_num . ". Showing ";
 */
?>

<html>
<title>
Database Sandbox Initialization
</title>
<body>
<?php 
include_once dirname(__FILE__) . '/dbZipCodes.php';
include_once dirname(__FILE__) . '/dbPersons.php';
create_dbZipCodes();
/* now add counties to the address of all Maine persons in the database
 * 
 */
$every_person = getall_persons();
$allpersons = sizeof($every_person);
$mainepersons = $countiesadded = 0;
foreach ($every_person as $person) {
    if ($person->get_state() == "ME") {
        $mainepersons += 1;
        $countydata = false;
        if ($person->get_zip() != "") {
            $countydata = retrieve_dbZipCodes($person->get_zip(), "");
        } else {
            if (!$countydata) {
                $countydata = retrieve_dbZipCodes("", $person->get_city());
            }
        }
        if ($countydata) {
            $person->set_county($countydata[3]);