Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Yehor Tsyba
/
cooking-website
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
ea104af4
authored
Apr 22, 2020
by
Yehor Tsyba
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Removed spaces
parent
05351192
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
17 deletions
application/controllers/Pages.php
application/controllers/User.php
application/models/User_model.php
application/views/pages/articles.php
application/views/pages/profile.php
application/controllers/Pages.php
View file @
ea104af4
<?php
class
Pages
extends
CI_Controller
{
var
$private_pages
=
array
(
'profile'
,
'logout'
);
var
$restrict_pages
=
array
(
'signin'
);
...
...
@@ -23,4 +22,5 @@ class Pages extends CI_Controller {
$this
->
load
->
view
(
'pages/'
.
$page
,
$data
);
$this
->
load
->
view
(
'templates/footer'
,
$data
);
}
}
\ No newline at end of file
}
?>
\ No newline at end of file
application/controllers/User.php
View file @
ea104af4
<?php
<?php
class
User
extends
CI_Controller
{
function
__construct
()
{
parent
::
__construct
();
...
...
@@ -186,4 +186,4 @@
redirect
(
site_url
(
'/pages/view/home'
));
}
}
?>
?>
application/models/User_model.php
View file @
ea104af4
...
...
@@ -66,6 +66,6 @@ class User_model extends CI_Model {
}
$this
->
authenticate
(
$this
->
session
->
userdata
(
'logged_in'
)[
'username'
],
$this
->
session
->
userdata
(
'logged_in'
)[
'password'
]);
return
$this
;
}
}
\ No newline at end of file
}
}
?>
\ No newline at end of file
application/views/pages/articles.php
View file @
ea104af4
...
...
@@ -4,12 +4,12 @@
<input
class=
"form-control"
id=
"listSearch"
type=
"text"
placeholder=
"Type something to search list items"
onkeyup=
"filter()"
>
<br>
<ul
class=
"list-group"
id=
"myList"
>
<?php
<?php
$query
=
$this
->
db
->
query
(
"SELECT * FROM article LIMIT 50"
);
foreach
(
$q
=
$query
->
result
()
as
$row
)
{
echo
"<li class=
\"
list-group-item
\"
><h3>"
.
$row
->
title
.
"</h3><br><p>"
.
$row
->
description
.
"</p></li>"
;
}
?>
?>
</ul>
</div>
</div>
...
...
application/views/pages/profile.php
View file @
ea104af4
...
...
@@ -10,10 +10,10 @@
<div
class=
"col-12 col-sm-auto mb-3"
>
<div
class=
"mx-auto"
style=
"width: 140px;"
>
<div
class=
"d-flex justify-content-center align-items-center rounded"
style=
"height: 140px; background-color: rgb(233, 236, 239);"
>
<?php
<?php
echo
"<img src="
.
(
strlen
(
$this
->
session
->
userdata
(
'logged_in'
)[
'photo'
])
>
0
?
'data:image/jpeg;base64,'
.
base64_encode
(
$this
->
session
->
userdata
(
'logged_in'
)[
'photo'
])
:
resources
()
.
'default.jpg'
)
.
" class=
\"
card-img-top
\"
>"
?>
?>
</div>
</div>
</div>
...
...
@@ -22,7 +22,7 @@
<h4
class=
"pt-sm-2 pb-1 mb-0 text-nowrap"
>
<?php
echo
$this
->
session
->
userdata
(
'logged_in'
)[
'name'
];
?>
</h4>
<p
class=
"mb-0"
>
<?php
echo
'@'
.
$this
->
session
->
userdata
(
'logged_in'
)[
'username'
]
?>
</p>
<div
class=
"mt-2"
>
<?php
echo
form_open_multipart
(
'user/upload'
);
?>
<?php
echo
form_open_multipart
(
'user/upload'
);
?>
<input
type=
"file"
name=
"photo"
/>
<input
type=
"submit"
value=
"Upload photo"
class=
"btn btn-primary"
type=
"button"
/>
</form>
...
...
@@ -34,9 +34,8 @@
</div>
</div>
</div>
<?php
echo
validation_errors
();
?>
<?php
echo
form_open
(
"user/update"
);
?>
<?php
echo
validation_errors
();
?>
<?php
echo
form_open
(
"user/update"
);
?>
<form
class=
"row flex-lg-nowrap"
>
<ul
class=
"nav nav-tabs"
>
...
...
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