function testselect_dbWeeks()
{
    $newWeek = new Week("03-30-14", "Bscah", "Active");
    $nd = insert_dbWeeks($newWeek);
    $id = "03-30-14";
    echo 'will test select_dbWeeks</br>';
    $result = select_dbWeeks($id);
    if ($result != null) {
        echo 'select_dbDates failed</br>';
    }
    $res = delete_dbWeeks($newWeek);
    if ($res == null) {
        echo 'Delete failed</br>';
    }
}
/**
 * retrieves a Week from the database
 *
 * @param $id = mm-dd-yy of the week to retrieve
 *
 * @return Week desired week, or null
 */
function get_dbWeeks($id)
{
    $result_row = select_dbWeeks($id);
    if ($result_row != null) {
        $dates = explode("*", $result_row['DATES']);
        $d = [];
        foreach ($dates as $date) {
            $temp = select_dbDates($date);
            $d[] = $temp;
        }
        $w = new Week($d, $result_row['STATUS']);
        return $w;
    } else {
        return null;
    }
}
Beispiel #3
0
/**
 * retrieves a Week from the database
 * @param $id = mm-dd-yy of the week to retrieve
 * @return the desired week, or null
 */
function get_dbWeeks($id)
{
    $result_row = select_dbWeeks($id);
    if ($result_row != null) {
        $dates = explode("*", $result_row['dates']);
        $d = array();
        foreach ($dates as $date) {
            $d[] = select_dbDates($date);
        }
        $w = new Week($d, $result_row['venue'], $result_row['status']);
        error_log("3");
        return $w;
    } else {
        return null;
    }
}