Server IP : 68.65.122.142  /  Your IP : 3.137.188.66
Web Server : LiteSpeed
System : Linux server167.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User : glenirhm ( 1318)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/glenirhm/myglenbow.ca/../mygc.glenbowcollege.ca/student/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/glenirhm/myglenbow.ca/../mygc.glenbowcollege.ca/student/scheduling.php
<?php
$modules = array(
    array("GCEA-101", "Schooling in Alberta", 20),
    array("GCEA-102", "IT literacy", 60),
    array("GCEA-103", "Effective Communication Skills", 20),
    array("GCEA-104", "Positive Behaviour Support", 24),
    array("GCEA-105", "Crisis Prevention and Intervention", 50),
    array("GCEA-106", "Classroom Management", 60),
    array("GCEA-107", "Children and Their Development", 88),
    array("GCEA-108", "Language and Self Development in Children", 40),
    array("GCEA-109", "Teaching Students with Special Needs", 88),
    array("GCEA-110", "Tech Tools for Students with Learning Disabilities", 20),
    array("GCEA-111", "Basics of Online Education", 30),
    array("GCEA-112", "Readiness for Career", 40),
);

foreach ($modules as $module) {
    echo "Code: " . $module[0] . " Name: " . $module[1] . " Hours: " . $module[2] . "<br>";
}

// Potentially buggy
echo date ( 'Y-m-j' , strtotime ( '3 weekdays' ) );

echo "<br>";

function addDays($timestamp, $days, $skipdays = array("Saturday", "Sunday"), $skipdates = NULL) {
    // $skipdays: array (Monday-Sunday) eg. array("Saturday","Sunday")
    // $skipdates: array (YYYY-mm-dd) eg. array("2012-05-02","2015-08-01");
   //timestamp is strtotime of ur $startDate
    $i = 1;

    while ($days >= $i) {
        $timestamp = strtotime("+1 day", $timestamp);
        if ( (in_array(date("l", $timestamp), $skipdays)) || (in_array(date("Y-m-d", $timestamp), $skipdates)) )
        {
            $days++;
        }
        $i++;
    }

    //return $timestamp;
    return date("m/d/Y",$timestamp);
}
echo date("Y/m/d");
echo "<br>";
//addDays(strtotime($startDate), 20, $skipdays,$skipdates = array());
echo addDays(strtotime(date("2021-01-01")), 3, [],[]);

echo "<br>";

//Get the first Wednesday of December, 2015
echo date("j, d-M-Y", strtotime("first monday 2022-01"));
//Result is: Wednesday, 02-Dec-2015

// Variables defining the start date
// Example only - this could be any valid date
$year = '2021';
$month = '01';
$day = '01';
/*
// set to the desired starting date and time
$the_date = new DateTime($year . '-' . $month . '-' . $day);

// Jump to the first day of this month
$the_date->modify("first day of this month");

// add 14 days, so we'll land on the 15th
$the_date->add(new DateInterval("P14D"));

// add 1 month - guaranteed to work!
$the_date->add(new DateInterval("P1M"));

// calculate how many days to add to 15 to get back to the **day** we started with...
// (as an integer, regardless of whether it is a valid day of the current month)
$number_days_to_add_back = intval($day) - 15;

// determine the last day of the month stored in $the_date
$test_last_date = clone $the_date;
$test_last_date->modify("last day of this month");
$day_last = $test_last_date->format('j'); // This provides the day, 01-31

// Test if adding $number_days_to_add_back runs past
// the end of the month; if so, adjust it so it won't run past
// the last day of the month
if (15 + $number_days_to_add_back > intval($day_last)) {
    $number_days_to_add_back = intval($day_last) - 15;
}

// Now make the final adjustment
$the_date->modify("" . $number_days_to_add_back . " day");

// Test it - a month has been added
$test = date_format($the_date, 'Y-m-d');*/
?>