Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Bojan Borovcanin
/
WBT1920_team30
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c47d6628
authored
May 12, 2020
by
Bojan Borovcanin
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
two more
parent
a731bb64
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
71 additions
and
26 deletions
test/controllers/Activity.php
test/controllers/Pages.php
test/controllers/User.php
test/controllers/Worker.php
test/hooks/acl.php
test/views/pages/activities.php
test/views/pages/moreAboutApartment.php
test/views/pages/successfulUserReg.php
test/views/pages/successfulWorkerReg.php
test/controllers/Activity.php
View file @
c47d6628
...
...
@@ -31,9 +31,7 @@ class Activity extends CI_Controller{
$this
->
Activity_model
->
deleteActivity
(
$this
->
input
->
post
(
'id'
));
$array
[
'activities'
]
=
$this
->
Activity_model
->
getAllActivities
();
$this
->
load
->
view
(
'templates/header'
);
$this
->
load
->
view
(
'pages/activities'
,
$array
);
$this
->
load
->
view
(
'templates/footer'
);
redirect
(
base_url
()
.
"activity/showActivities"
,
$array
);
}
}
...
...
@@ -98,9 +96,8 @@ class Activity extends CI_Controller{
$this
->
Activity_model
->
addNewActivity
(
$data
);
$array
[
'activities'
]
=
$this
->
Activity_model
->
getAllActivities
();
$this
->
load
->
view
(
'templates/header'
);
$this
->
load
->
view
(
'pages/activities'
,
$array
);
$this
->
load
->
view
(
'templates/footer'
);
redirect
(
base_url
()
.
"activity/showActivities"
,
$array
);
}
}
...
...
test/controllers/Pages.php
View file @
c47d6628
...
...
@@ -54,16 +54,14 @@ public function __construct()
$array
[
'apartments'
]
=
$this
->
Apartment_model
->
getAllApartments
();
$this
->
load
->
view
(
'templates/header'
);
$this
->
load
->
view
(
'pages/home'
,
$array
);
$this
->
load
->
view
(
'templates/footer'
);
redirect
(
base_url
()
.
"Pages/view"
,
$array
);
}
}
public
function
addNewApartment
()
{
$this
->
form_validation
->
set_rules
(
'title'
,
'Title'
,
'required|max_length[30]'
);
$this
->
form_validation
->
set_rules
(
'description'
,
'Description'
,
'required|max_length[200]'
);
$this
->
form_validation
->
set_rules
(
'number_of_beds'
,
'Number of beds'
,
'required'
);
...
...
@@ -109,9 +107,7 @@ public function __construct()
$array
[
'apartments'
]
=
$this
->
Apartment_model
->
getAllApartments
();
$this
->
load
->
view
(
'templates/header'
);
$this
->
load
->
view
(
'pages/home'
,
$array
);
$this
->
load
->
view
(
'templates/footer'
);
redirect
(
base_url
()
.
"Pages/view"
,
$array
);
}
...
...
test/controllers/User.php
View file @
c47d6628
...
...
@@ -31,10 +31,10 @@ class User extends CI_Controller{
$array
[
'profileInfo'
]
=
$this
->
User_model
->
getProfileInfo
(
$_SESSION
[
'logged_in'
][
'username'
]);
$this
->
load
->
view
(
'templates/header'
);
$this
->
load
->
view
(
'pages/myProfile'
,
$array
);
$this
->
load
->
view
(
'templates/footer'
);
redirect
(
base_url
()
.
"profile/myProfile"
,
$array
);
}
...
...
@@ -103,11 +103,12 @@ class User extends CI_Controller{
$this
->
User_model
->
addUser
(
$data
);
$this
->
load
->
view
(
'/templates/header'
,
$data
);
$this
->
load
->
view
(
'/pages/
login
'
);
$this
->
load
->
view
(
'/pages/
successfulUserReg
'
);
$this
->
load
->
view
(
'/templates/footer'
,
$data
);
}
}
public
function
username_is_unique
(
$string
)
{
...
...
test/controllers/Worker.php
View file @
c47d6628
...
...
@@ -35,9 +35,7 @@
$array
[
'apartments'
]
=
$this
->
Apartment_model
->
getAllApartments
();
$this
->
load
->
view
(
'templates/header'
);
$this
->
load
->
view
(
'pages/home'
,
$array
);
$this
->
load
->
view
(
'templates/footer'
);
redirect
(
base_url
()
.
"Pages/view"
,
$array
);
}
}
...
...
@@ -96,15 +94,20 @@
$this
->
Worker_model
->
insertWorker
(
$data
);
$array
[
'apartments'
]
=
$this
->
Apartment_model
->
getAllApartments
();
$this
->
load
->
view
(
'templates/header'
);
$this
->
load
->
view
(
'pages/home'
,
$array
);
$this
->
load
->
view
(
'templates/footer'
);
redirect
(
base_url
()
.
"worker/successfulReg"
);
}
}
public
function
successfulReg
()
{
$this
->
load
->
view
(
'/templates/header'
);
$this
->
load
->
view
(
'/pages/successfulWorkerReg'
);
$this
->
load
->
view
(
'/templates/footer'
);
}
public
function
worker_name_is_unique
(
$string
)
{
...
...
test/hooks/acl.php
View file @
c47d6628
...
...
@@ -21,6 +21,7 @@ $allowOnly[2]['activity']['moreAboutActivity'] = True;
//worker
$allowOnly
[
1
][
'user'
][
'logout'
]
=
true
;
$allowOnly
[
1
][
'worker'
][
'successfulReg'
]
=
true
;
$allowOnly
[
1
][
'user'
][
'signUp'
]
=
False
;
$allowOnly
[
1
][
'profile'
][
'workerProfile'
]
=
true
;
$allowOnly
[
1
][
'worker'
][
'workerSignup'
]
=
true
;
...
...
test/views/pages/activities.php
View file @
c47d6628
...
...
@@ -15,7 +15,6 @@
<link
rel=
"stylesheet"
href=
"
<?php
echo
base_url
();
?>
assets/css/activities.css"
>
</style>
</head>
<body>
...
...
test/views/pages/moreAboutApartment.php
View file @
c47d6628
...
...
@@ -40,30 +40,35 @@
<br>
<label>
With
</label>
<br>
<input
type=
"text"
name=
"title"
size=
"1"
disabled=
"true"
value=
"
<?php
echo
$apartment
[
'number_of_beds'
];
?>
"
>
beds
<br>
<label>
Parking:
</label>
<br>
<input
type=
"text"
name=
"title"
size=
"1"
disabled=
"true"
value=
"
<?php
echo
$apartment
[
'parking'
];
?>
"
>
parking places
<br>
<label>
Name of the owner:
</label>
<br>
<input
type=
"text"
name=
"title"
disabled=
"true"
value=
"
<?php
echo
$apartment
[
'full_name'
];
?>
"
>
<br>
<label>
Phone number of the owner:
</label>
<br>
<input
type=
"text"
name=
"title"
disabled=
"true"
value=
"
<?php
echo
$apartment
[
'phone_number'
];
?>
"
>
<br>
<label>
Email of the owner:
</label>
<br>
<input
type=
"text"
name=
"title"
size=
"30"
disabled=
"true"
value=
"
<?php
echo
$apartment
[
'email'
];
?>
"
>
...
...
test/views/pages/successfulUserReg.php
0 → 100644
View file @
c47d6628
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<link
rel=
"stylesheet"
href=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
>
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"
></script>
<script
src=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"
></script>
<link
href=
"https://fonts.googleapis.com/css?family=Montserrat"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"https://fonts.googleapis.com/css?family=Lato"
rel=
"stylesheet"
type=
"text/css"
>
<link
rel=
"stylesheet"
href=
"
<?php
echo
base_url
();
?>
assets/css/activities.css"
>
</head>
<body>
<h3>
You are now registered !Click on the link to go to login page
</h3>
<a
href=
"
<?php
base_url
();
?>
loginButton"
>
Login page
</a>
</body>
</html>
\ No newline at end of file
test/views/pages/successfulWorkerReg.php
0 → 100644
View file @
c47d6628
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<link
rel=
"stylesheet"
href=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
>
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"
></script>
<script
src=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"
></script>
<link
href=
"https://fonts.googleapis.com/css?family=Montserrat"
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"https://fonts.googleapis.com/css?family=Lato"
rel=
"stylesheet"
type=
"text/css"
>
<link
rel=
"stylesheet"
href=
"
<?php
echo
base_url
();
?>
assets/css/activities.css"
>
</head>
<body>
<h3>
You have added a new worker
</h3>
</body>
</html>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment