FIX_Notification : ps
This commit is contained in:
parent
c0010f229b
commit
5cb852b513
@ -92,32 +92,35 @@ class Notifications extends BaseController
|
|||||||
$this->render_page('notifications_form', $data);
|
$this->render_page('notifications_form', $data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}else if ($records['type'] == 'document') {
|
}elseif ($records['type'] == 'document') {
|
||||||
if (isset($records['media_doc'])) {
|
$doc_details = $this->request->getFile('media_doc');
|
||||||
if ($doc_details->isValid() && $doc_details->getClientMimeType() === 'image/jpeg') {
|
$doc_path = APPPATH . '../public/uploads/';
|
||||||
$doc_name = $doc_details->getName();
|
|
||||||
if ($doc_name !== '') {
|
if (empty($doc_details)) {
|
||||||
$doc_details->move($doc_path, $doc_name);
|
session()->setFlashdata('error', 'Please select a file to upload.');
|
||||||
$params->media_url = base_url().'public/uploads/'.$doc_name;
|
|
||||||
$params->type = "media";
|
|
||||||
$this->logger->error("Name After Upload: " . $doc_name);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$this->logger->error("Err on upload name not Founded ".$records['media_doc']);
|
|
||||||
session()->setFlashdata('error', 'Media Document Missing Please Try again..');
|
|
||||||
$this->render_page('notifications_form', $data);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
session()->setFlashdata('error', 'Please upload a JPEG image.');
|
|
||||||
$this->render_page('notifications_form', $data);
|
$this->render_page('notifications_form', $data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
session()->setFlashdata('error', 'Please upload a JPEG image.');
|
if (!$doc_details->isValid() || $doc_details->getClientMimeType() !== 'image/jpeg') {
|
||||||
$this->render_page('notifications_form', $data);
|
session()->setFlashdata('error', 'Please upload a valid JPEG image.');
|
||||||
return;
|
$this->render_page('notifications_form', $data);
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$doc_name = $doc_details->getName();
|
||||||
|
|
||||||
|
if ($doc_name === '') {
|
||||||
|
$this->logger->error("Err on upload: name not found");
|
||||||
|
session()->setFlashdata('error', 'Document name not found. Please try again.');
|
||||||
|
$this->render_page('notifications_form', $data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$doc_details->move($doc_path, $doc_name);
|
||||||
|
$params->media_url = base_url() . 'public/uploads/' . $doc_name;
|
||||||
|
$params->type = "media";
|
||||||
|
$this->logger->error("Name After Upload: " . $doc_name);
|
||||||
}else{
|
}else{
|
||||||
$params->type = "text" ;
|
$params->type = "text" ;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user