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
3dbf2dca
authored
May 11, 2020
by
Bojan Borovcanin
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
controller changed
parent
608f9301
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
test/controllers/Pages.php
test/controllers/Pages.php
View file @
3dbf2dca
...
...
@@ -92,6 +92,23 @@ public function __construct()
$data
[
'phone_number'
]
=
$this
->
input
->
post
(
'phone_number'
);
$data
[
'email'
]
=
$this
->
input
->
post
(
'email'
);
$content
;
$tmpname
=
$_FILES
[
'inpImage'
][
'tmp_name'
];
//The temporary filename of the file in which the uploaded file was stored on the server.
$filesize
=
$_FILES
[
'inpImage'
][
'size'
];
$filetype
=
$_FILES
[
'inpImage'
][
'type'
];
$allowedtypes
=
array
(
"image/jpeg"
,
"image/jpg"
,
"image/png"
,
"image/gif"
);
if
(
$filesize
>=
0
){
if
(
in_array
(
$filetype
,
$allowedtypes
))
{
$fp
=
fopen
(
$tmpname
,
'r'
);
$content
=
fread
(
$fp
,
filesize
(
$tmpname
));
$data
[
'image'
]
=
$content
;
//it adds blackslashes after each quote(double or single)
fclose
(
$fp
);
}
}
$this
->
Apartment_model
->
addNewApartment
(
$data
);
$array
[
'apartments'
]
=
$this
->
Apartment_model
->
getAllApartments
();
...
...
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