Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ph read updates #22

Open
wants to merge 110 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
bb5511e
edits
May 23, 2020
f805f25
Merge pull request #1 from izabela01/izzyedit
izabela01 May 23, 2020
674f4cc
homepage
Balakraa May 24, 2020
8bfe567
homepagecssfile
Balakraa May 24, 2020
ab2e5ad
Merge pull request #2 from izabela01/homepage
izabela01 May 24, 2020
47fa6cb
views pages
Balakraa May 25, 2020
e7aac7e
Merge pull request #3 from izabela01/views
izabela01 May 25, 2020
5944757
readAllblogfunctionality
Balakraa May 25, 2020
05d2a56
updates for readAllblogs
Balakraa May 25, 2020
0ebdf60
readAll and read blog posts
Balakraa May 26, 2020
c3faa9a
connection
Balakraa May 26, 2020
5fc7bc5
Merge pull request #4 from izabela01/readAllblog
izabela01 May 26, 2020
ce9605d
addingform
May 26, 2020
fb405fa
changes
May 26, 2020
a9fd895
hshsh
May 27, 2020
79d17a2
createblogfunction
Balakraa May 27, 2020
94dd563
add links, photo and style
May 27, 2020
16427a3
Added validation and functionality to the login and reg from
Phali18 May 27, 2020
375809d
Merge pull request #5 from izabela01/login2
izabela01 May 27, 2020
23a5ae5
uploadting
May 27, 2020
30eae57
uploadstuff
May 28, 2020
aa70d2e
second commit
May 28, 2020
ff46fed
Merge pull request #6 from izabela01/fixtheaboutuspage
izabela01 May 28, 2020
62eff5e
blogcontroller
Balakraa May 28, 2020
4daedff
Merge branch 'master' into createblog
izabela01 May 28, 2020
c3e6ad9
Merge pull request #7 from izabela01/createblog
izabela01 May 28, 2020
9fd3afd
Log in Page
May 28, 2020
6d6367f
izzy
May 28, 2020
dc68a13
Merge branch 'master' into login
izabela01 May 28, 2020
3d13c00
Merge pull request #8 from izabela01/login
izabela01 May 28, 2020
6e23048
aboutuscontroller and contact us
May 30, 2020
60511c3
changes to the contactus mvc
May 30, 2020
1cc57db
Log and Reg Form and other updates
May 30, 2020
815d133
Merge pull request #9 from izabela01/jennychanges
izabela01 May 30, 2020
2f44862
Updates
May 30, 2020
cce890c
Update layout.php
izabela01 May 30, 2020
13cccb9
Merge branch 'master' into Precieuse_updates
izabela01 May 30, 2020
e81d0d4
Merge pull request #10 from izabela01/Precieuse_updates
izabela01 May 30, 2020
a960f5b
contactus: connection, create php updated, model, controller updated
May 31, 2020
86942d5
linkchanges
May 31, 2020
1920bd7
new changes
May 31, 2020
2ea6cd1
update & delete
May 31, 2020
a18c2da
updatesStuff
May 31, 2020
302f046
Merge pull request #11 from izabela01/linkage
izabela01 May 31, 2020
50204a1
Merge branch 'master' into PH_updates
izabela01 May 31, 2020
3c684ed
Merge pull request #15 from izabela01/PH_updates
izabela01 May 31, 2020
bfc7ba1
Merge branch 'master' into jccontactuschange
izabela01 May 31, 2020
f7e7b34
Merge pull request #16 from izabela01/jccontactuschange
izabela01 May 31, 2020
89a2307
subscribe stuff and home
Balakraa May 31, 2020
8c0756e
Merge pull request #18 from izabela01/thesubscribefunction
izabela01 May 31, 2020
c11abed
further changes made to blog and contactus and tested
May 31, 2020
fb73293
Merge pull request #19 from izabela01/groupchanges
izabela01 May 31, 2020
e386c9c
updates
May 31, 2020
fa6db98
Precieuse's updates
May 31, 2020
078f901
Updates
May 31, 2020
e0053d8
Merge branch 'master' into Precieuse-updates
izabela01 May 31, 2020
b0a9011
Merge pull request #20 from izabela01/Precieuse-updates
izabela01 May 31, 2020
96fe73e
create.php updates
May 31, 2020
c06be92
Merge pull request #21 from izabela01/Precieuse-updates
izabela01 May 31, 2020
0faff9c
read&images
May 31, 2020
f0109fd
Merge pull request #22 from izabela01/BLOGJAZZFINALE
izabela01 Jun 1, 2020
e313000
Background pictures and drop menu added to nav for register and login
Jun 1, 2020
d278472
fixinghome
Jun 1, 2020
aefa1a5
Merge pull request #23 from izabela01/Precieuse-updates
izabela01 Jun 1, 2020
ad79923
Merge pull request #24 from izabela01/BLOGJAZZFINALE
izabela01 Jun 1, 2020
81bb2a0
uploadstyled
Jun 1, 2020
e6e9fdf
Merge pull request #25 from izabela01/iz
izabela01 Jun 1, 2020
e2d392f
fixingupload
Jun 1, 2020
ba85f12
Merge pull request #26 from izabela01/iz
izabela01 Jun 1, 2020
0829772
Updated homepage pictues, titles and descriptions
Jun 1, 2020
2c08181
updatepage
Jun 1, 2020
9bf78d6
Merge pull request #27 from izabela01/Precieuse-updates
izabela01 Jun 1, 2020
d07bdee
Merge pull request #28 from izabela01/iz
izabela01 Jun 1, 2020
9f6111e
updated about us photos and background and text
Jun 1, 2020
78d14e9
Merge pull request #29 from izabela01/isitoveryet
izabela01 Jun 1, 2020
99bc12c
minor HTML changes to the files
Jun 1, 2020
d216a6d
update
Jun 1, 2020
9cbe7ce
Merge pull request #30 from izabela01/iz1
izabela01 Jun 1, 2020
628923a
Merge branch 'master' into updates_PH
izabela01 Jun 1, 2020
5c4ddf5
subscibe maeve
Maeve1 Jun 1, 2020
9af5c84
padding added to homepage and styling for read imaages
Jun 1, 2020
e3245ae
Update project.xml
izabela01 Jun 1, 2020
4a72b55
Update index.php
izabela01 Jun 1, 2020
6f36bb0
Update connection.php
izabela01 Jun 1, 2020
f62622a
Merge pull request #32 from izabela01/subscribemaeve
izabela01 Jun 1, 2020
4c480e5
Merge pull request #31 from izabela01/updates_PH
izabela01 Jun 1, 2020
7a224a1
updated typos
Jun 1, 2020
3c01fb8
Merge pull request #33 from izabela01/updatetypo
izabela01 Jun 2, 2020
7817d0e
readAllchanges
Jun 2, 2020
3bc33bb
Update create.php
izabela01 Jun 2, 2020
ad9af7b
Merge branch 'master' into iz2
izabela01 Jun 2, 2020
97d5e30
Merge pull request #34 from izabela01/iz2
izabela01 Jun 2, 2020
8ca4898
links from home to readAll
Jun 2, 2020
081df87
Merge pull request #35 from izabela01/iz2
izabela01 Jun 2, 2020
8c76852
admin to blogger
Jun 2, 2020
b19c5e8
Merge pull request #36 from izabela01/iz2
izabela01 Jun 2, 2020
5aac988
background cover change for subscribe
Jun 2, 2020
37e271b
Reads styling
Jun 2, 2020
c4ecfb3
Merge pull request #37 from izabela01/PH-read-updates
izabela01 Jun 2, 2020
1a741d1
Merge branch 'master' into Precieuse-branch
izabela01 Jun 2, 2020
850f125
Merge pull request #38 from izabela01/Precieuse-branch
izabela01 Jun 2, 2020
0920bf4
final changes
Jun 2, 2020
e13107e
Merge pull request #39 from izabela01/thisisdeflasttime
izabela01 Jun 2, 2020
dcf5f17
minor changes
Maeve1 Jun 3, 2020
29cff2a
Update aboutus.php
izabela01 Jun 3, 2020
3de379e
Merge pull request #40 from izabela01/changes_meee
izabela01 Jun 3, 2020
1b49b9d
minorchanges
Jun 3, 2020
981e389
Merge pull request #41 from izabela01/iz3
izabela01 Jun 3, 2020
2ca0bd1
PH bio and upload redirect
Jun 3, 2020
ac1ad7f
Merge branch 'master' into PH-read-updates
izabela01 Jun 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/nbproject/private/
6 changes: 4 additions & 2 deletions connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ class DB {
//Singleton Design Pattern
public static function getInstance() {
if (!isset(self::$instance)) {
$pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
self::$instance = new PDO('mysql:host=localhost;dbname=php_mvc', 'root', '', $pdo_options);
$pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;

self::$instance = new PDO('mysql:host=localhost;dbname=blogjazz', 'root', '', $pdo_options);

}
return self::$instance;
}
Expand Down
35 changes: 35 additions & 0 deletions controllers/authentication_controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

class AuthenticationController {



public function create() {
if ($_SERVER['REQUEST_METHOD'] == 'GET') {



require_once('views/pages/signup.php'); // takes it to the form that they need to sign up

} else {
Authentication::insertAdmin();
}
}

public function login() {
if ($_SERVER['REQUEST_METHOD'] == 'GET') {


require_once('views/pages/login.php');

} else {

Authentication::login();


}
}

}


100 changes: 100 additions & 0 deletions controllers/blog_controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@


<?php

//change everything that is product to your controller BLOG

class blogController {

public function readAll() {
// we store all the posts in a variable
$blog = blog::all();
require_once('views/blog/readAll.php');
}


public function readAllAdminUser(){


$blog = blog::all();
require_once('views/blog/readAllUser.php');
}



//changed until this point, need to change the below.
public function read() {
// we expect a url of form ?controller=posts&action=show&id=x
// without an id we just redirect to the error page as we need the post id to find it in the database
if (!isset($_GET['id']))
return call('pages', 'error');

try{
// we use the given id to get the correct post
$blog = blog::find($_GET['id']);
require_once('views/blog/read.php');
}
catch (Exception $ex){
return call('pages','error');
}
}
public function create() { //when you click it shows you the blank form
// we expect a url of form ?controller=products&action=create
// if it's a GET request display a blank form for creating a new product
// else it's a POST so add to the database and redirect to readAll action
if($_SERVER['REQUEST_METHOD'] == 'GET'){

require_once('views/blog/create.php');

}
else {
blog::add();
$blog = blog::all();
require_once('views/blog/readAllUser.php');
//if (!empty($_POST)){
//$title = ($_POST["title"]);
// $body =($_POST["body"]);
// $date = date("y-m-d");
//$blogDescription = ($_POST["blogDescription"]);
//}

//calling the add function that sends query into the database

// $products = blog::all(); //$products is used within the view
// require_once('views/products/readAll.php');

//require_once('views/blog/readAll.php');
}

}
public function update() {

if($_SERVER['REQUEST_METHOD'] == 'GET'){
if (!isset($_GET['id']))
return call('pages', 'error');

// we use the given id to get the correct product
$blog = Blog::find($_GET['id']);

require_once('views/blog/update.php');
}
else
{
$blogID = $_GET['id'];
Blog::update($blogID);

$blog = blog::all();
require_once('views/blog/readAllUser.php');
}

}
public function delete() {
blog::remove($_GET['id']);

$blog = blog::all();
require_once('views/blog/readAllUser.php');
}

}

?>
28 changes: 28 additions & 0 deletions controllers/contactus_controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

class contactusController {

/* public function readAll() {
// we store all the posts in a variable
$contactus = contactus::all();
require_once('views/contactus/create.php');
}
*/
public function create() { //when you click it shows you the blank form
// we expect a url of form ?controller=products&action=create
// if it's a GET request display a blank form for creating a new product
// else it's a POST so add to the database and redirect to readAll action
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
require_once('views/contactus/create.php');
} else {
contactus::add(); //calling the add function that sends query into the database

/* $contactus = contactus::all();
require_once('views/contactus/create.php');

}//takes you back to all products
}
*/
}

}}
22 changes: 15 additions & 7 deletions controllers/pages_controller.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
<?php

class PagesController {

public function home() {
//example data to use in the home page
$first_name = 'Lisa';
$last_name = 'Simpson';
require_once('views/pages/home.php');
//example data to use in the home page
$first_name = 'Izzy';
$last_name = 'Drabek';
require_once('views/pages/home.php');
}

public function aboutus() {
require_once('views/pages/aboutus.php');
}

public function error() {
require_once('views/pages/error.php');
require_once('views/pages/error.php');
}


public function contactus() {
require_once('views/pages/contactus.php');
}

}
11 changes: 7 additions & 4 deletions controllers/product_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
class ProductController {
public function readAll() {
// we store all the posts in a variable


$products = Product::all();
require_once('views/products/readAll.php');
}

public function read() {

// we expect a url of form ?controller=posts&action=show&id=x
// without an id we just redirect to the error page as we need the post id to find it in the database
if (!isset($_GET['id']))
Expand All @@ -22,19 +25,19 @@ public function read() {
return call('pages','error');
}
}
public function create() {
public function create() { //when you click it shows you the blank form
// we expect a url of form ?controller=products&action=create
// if it's a GET request display a blank form for creating a new product
// else it's a POST so add to the database and redirect to readAll action
if($_SERVER['REQUEST_METHOD'] == 'GET'){
require_once('views/products/create.php');
}
else {
Product::add();
Product::add(); //calling the add function that sends query into the database

$products = Product::all(); //$products is used within the view
require_once('views/products/readAll.php');
}
require_once('views/products/readAll.php');
}//takes you back to all products

}
public function update() {
Expand Down
44 changes: 44 additions & 0 deletions controllers/sc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
class AuthenticationController {

public $errors = array();

public function validate() {
if (!isset($_GET['email']))
return call('pages', 'error');

try {
$row = Auth::duplicate_check($_GET['email']);
//require_once('../views/auth/signup.php');
} catch (Exception $e) {
$e->getMessage();
}
}

public function create() {
if ($_SERVER['REQUEST_METHOD'] == 'GET') {

require_once('views\products\signup.php'); // takes it to the form that they need to sign up


}else{ Authentication::insertAdmin();
$stmt = Authentication::all();

}
}



public function login() {
if ($_SERVER['REQUEST_METHOD'] == 'GET') {

require_once('views\products\login.php');
} else {

Authentication::login();

// $row=Authentication::all();
}
}

}
26 changes: 26 additions & 0 deletions controllers/subscribe_controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php


class subscribeController {

/* public function readAll() {
// we store all the posts in a variable
$contactus = contactus::all();
require_once('views/contactus/create.php');
}
*/
public function create() { //when you click it shows you the blank form
// we expect a url of form ?controller=products&action=create
// if it's a GET request display a blank form for creating a new product
// else it's a POST so add to the database and redirect to readAll action
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
require_once('views/subscribe/create.php');
} else {
subscribe::add(); //calling the add function that sends query into the database

// $subscribe = subscribe::all();
// require_once('views/subscribe/create.php');
// }//takes you back to all products
}

}}
7 changes: 6 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
<html>
<head>
<meta charset="UTF-8">
<title>MVC Skeleton</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" href="views/images/img/favicon2.png" sizes="32x32">
<title>GITS ABROAD</title>

</head>
<body>
<?php
require_once('connection.php');


// these are getters so they get it from the href as the value controller = products && action = readall , for example
if (isset($_GET['controller']) && isset($_GET['action'])) {
$controller = $_GET['controller'];
$action = $_GET['action'];
Expand Down
Loading