Commit 3dbf2dca by Bojan Borovcanin

controller changed

parent 608f9301
Showing with 17 additions and 0 deletions
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment