From 6c95701c353a526ace3ea7997b6d23dcb44cbdfc Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Wed, 14 Jan 2026 15:33:39 -0500 Subject: [PATCH 01/23] first --- 02/index.php | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/02/index.php b/02/index.php index f953398..0243880 100644 --- a/02/index.php +++ b/02/index.php @@ -1,16 +1,36 @@ + Hello, my name is " . $firstName . " " . $lastname . "
"; +if ($isStudent) { + echo "I am a student
"; +} else { + echo "I am not a student.
"; +} //4. Loosely Typed Language Demo +$num1 = 1; +$num2 = 10; + +function add(int $num1,int $num2) : int { + return $num1 + $num2; +} + +echo "" . add($num1, $num2) . "
"; //5. Strict Types & Types Hints -//6. OOP with PHP +//6. OOP with PHP From 1f57adf59456373d3700ef110a81e8dfbcb57d1d Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Wed, 14 Jan 2026 15:34:08 -0500 Subject: [PATCH 02/23] first --- test.php | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 test.php diff --git a/test.php b/test.php new file mode 100644 index 0000000..61ace19 --- /dev/null +++ b/test.php @@ -0,0 +1,2 @@ + Date: Wed, 14 Jan 2026 16:00:38 -0500 Subject: [PATCH 03/23] Delete test.php --- test.php | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 test.php diff --git a/test.php b/test.php deleted file mode 100644 index 61ace19..0000000 --- a/test.php +++ /dev/null @@ -1,2 +0,0 @@ - Date: Wed, 14 Jan 2026 16:34:07 -0500 Subject: [PATCH 04/23] lab-1 --- 02/index.php | 2 +- assignments/labs/lab_one/car.php | 22 ++++++++++++++++++++++ assignments/labs/lab_one/footer.php | 1 + assignments/labs/lab_one/index.php | 10 +++++++++- 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 assignments/labs/lab_one/car.php diff --git a/02/index.php b/02/index.php index 0243880..960f2f5 100644 --- a/02/index.php +++ b/02/index.php @@ -3,7 +3,7 @@ //1. Set Up & Start -//2. Code Commenting +//2. Code Commenting // inline comment //3. Variables, Data Types, Concatenation, Conditional Statements & Echo diff --git a/assignments/labs/lab_one/car.php b/assignments/labs/lab_one/car.php new file mode 100644 index 0000000..46b9086 --- /dev/null +++ b/assignments/labs/lab_one/car.php @@ -0,0 +1,22 @@ +make = $make; + $this->model = $model; + $this->year = $year; + } + + // Method to get car details + public function getDetails(): string { + return "Car Details: " . $this->year . " " . $this->make . " " . $this->model; + } + +} \ No newline at end of file diff --git a/assignments/labs/lab_one/footer.php b/assignments/labs/lab_one/footer.php index 78e2b2b..fd8438f 100644 --- a/assignments/labs/lab_one/footer.php +++ b/assignments/labs/lab_one/footer.php @@ -1,3 +1,4 @@ + Follow the instructions outlined in instructions.txt to complete this lab. Good luck & have fun!😀 "; -require "footer.php"; \ No newline at end of file +echo "Car Details: " . $car->getDetails() . "
"; + +require "footer.php"; \ No newline at end of file From 4976aae8839cb01cae185dec11bff8f995abf276 Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Thu, 15 Jan 2026 17:11:05 -0500 Subject: [PATCH 05/23] lab one complete --- assignments/labs/lab_one/car.php | 6 +++--- assignments/labs/lab_one/connect.php | 21 +++++++++++++++++++++ assignments/labs/lab_one/index.php | 23 +++++++++++++++++++++-- 3 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 assignments/labs/lab_one/connect.php diff --git a/assignments/labs/lab_one/car.php b/assignments/labs/lab_one/car.php index 46b9086..39fde42 100644 --- a/assignments/labs/lab_one/car.php +++ b/assignments/labs/lab_one/car.php @@ -1,4 +1,5 @@ -year . " " . $this->make . " " . $this->model; + return $this->year . " " . $this->make . " " . $this->model; } - } \ No newline at end of file diff --git a/assignments/labs/lab_one/connect.php b/assignments/labs/lab_one/connect.php new file mode 100644 index 0000000..3ab3604 --- /dev/null +++ b/assignments/labs/lab_one/connect.php @@ -0,0 +1,21 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + // echo "Connected successfully"; // optional for testing +} catch (PDOException $e) { + // Display error message if connection fails + echo "Database connection failed: " . $e->getMessage(); + exit; +} diff --git a/assignments/labs/lab_one/index.php b/assignments/labs/lab_one/index.php index 825b075..2b293bb 100644 --- a/assignments/labs/lab_one/index.php +++ b/assignments/labs/lab_one/index.php @@ -1,12 +1,31 @@ Car: " . $car->getDetails() . ""; + +// Output instructions message echo "Follow the instructions outlined in instructions.txt to complete this lab. Good luck & have fun!😀
"; -echo "Car Details: " . $car->getDetails() . "
"; +/* +Reflection: +I found creating the Car class and using require statements easy +because it followed examples from class. The most challenging part +was setting up the PDO database connection and making sure XAMPP +was configured correctly. +*/ + +// Include shared footer HTML require "footer.php"; \ No newline at end of file From b86133cc735c5ca611f1d3f208b94eeb164508e9 Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Thu, 22 Jan 2026 20:42:09 -0500 Subject: [PATCH 06/23] changes --- 02/index.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/02/index.php b/02/index.php index 7d72d4a..aa49b70 100644 --- a/02/index.php +++ b/02/index.php @@ -45,10 +45,6 @@ function add(int $num1,int $num2) : int { $num1 = 5; $num2 = "10"; -function add($num1, $num2) { - return $num1 + $num2; -} - echo "" . add($num1, $num2) . "
"; //4. Strict Types & Types Hints From ec9179590993316eed9a4990dbff2b412f3a5e67 Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Thu, 22 Jan 2026 20:44:05 -0500 Subject: [PATCH 07/23] fix --- 02/index.php | 89 +++++++++------------------------------------------- 1 file changed, 14 insertions(+), 75 deletions(-) diff --git a/02/index.php b/02/index.php index bb3b725..aa49b70 100644 --- a/02/index.php +++ b/02/index.php @@ -1,4 +1,3 @@ -<<<<<<< HEAD " . add($num1, $num2) . ""; -======= ->>>>>> 887d712389e053d3dafe0a3fb57445c135748ca9 +echo "Hello there, my name is " . $firstname . " " . $lastName . "
"; -echo "Hello there, my name is ". $firstName . " ". $lastName ."
"; -if($isInstructor) { - echo "I am your teacher.
"; -} -else { - echo "Whoops, teach didn't show!
"; +if ($is_student === true) { + echo "I am your teacher!
"; +} else { + echo "Uh oh, teach didn't show!
"; } //3. PHP is loosely typed -//create two variables, one called num1 and one called num2, in num1 store an integer and in num2 store a number but treat as string "10" -$num1 = 10; //integer -$num2 = "10"; //string +$num1 = 5; +$num2 = "10"; -<<<<<<< HEAD echo "" . add($num1, $num2) . "
"; -======= -//add type hints to make PHP less loosey goosey -/*function add(int $num1, int $num2) : int { - return $num1 + $num2; -} -echo "" . add($num1,$num2) . "
"; ->>>>>>> 887d712389e053d3dafe0a3fb57445c135748ca9 +//4. Strict Types & Types Hints +/* Add declare(strict_types=1) and type hints +//strict types tell PHP not to automatically convert values when calling functions. Type hints tell PHP what to expect */ +/*function add(int $num1, int $num2): int { + return $num1 + $num2; +} +echo add($num1, $num2); */ -<<<<<<< HEAD //6. OOP with PHP -======= -// OOP with PHP { - -class Person { - public string $name; - public int $age; - public bool $isInstructor; - - public function __construct(string $name, int $age, bool $isInstructor) { - $this->name = $name; - $this->age = $age; - $this->isInstructor = $isInstructor; - } - - public function getBadge(): string { - $role = $this->isInstructor ? "Instructor" : "Student"; - return "Name : {$this->name} | Age: {$this->age} | Role : $role"; - } -} - -//create an instance of the object - -$person = new Person("Jessica", 40, true); - -echo $person->getBadge(); - - - - - - - - - ->>>>>>> 887d712389e053d3dafe0a3fb57445c135748ca9 From 276d3847a509d20fad3ea790b8004e40375fc3e4 Mon Sep 17 00:00:00 2001 From: keiferg37 <200488755@student.georgianc.on.ca> Date: Thu, 22 Jan 2026 22:25:18 -0500 Subject: [PATCH 08/23] Add initial files for lab_two including header, footer, nav, and data --- assignments/labs/lab_two/data.php | 6 ++++++ assignments/labs/lab_two/includes/footer.php | 6 ++++++ assignments/labs/lab_two/includes/header.php | 9 +++++++++ assignments/labs/lab_two/includes/nav.php | 5 +++++ assignments/labs/lab_two/index.php | 14 ++++++++++++++ 5 files changed, 40 insertions(+) create mode 100644 assignments/labs/lab_two/data.php create mode 100644 assignments/labs/lab_two/includes/footer.php create mode 100644 assignments/labs/lab_two/includes/header.php create mode 100644 assignments/labs/lab_two/includes/nav.php create mode 100644 assignments/labs/lab_two/index.php diff --git a/assignments/labs/lab_two/data.php b/assignments/labs/lab_two/data.php new file mode 100644 index 0000000..1610764 --- /dev/null +++ b/assignments/labs/lab_two/data.php @@ -0,0 +1,6 @@ + +© 2026
+ + +