| @@ 1056-1068 (lines=13) @@ | ||
| 1053 | $uploadedFile = $file["tmp_name"]; |
|
| 1054 | $file_name = $file['name']; |
|
| 1055 | $file_type = $file['type']; |
|
| 1056 | if ($file_type == 'image/jpg' || $file_type == 'image/png' || $file_type == 'image/jpeg') { |
|
| 1057 | $dir_path = FCPATH. "upload/"; |
|
| 1058 | $path = $dir_path . $accountinfo['id']."_".$file['name']; |
|
| 1059 | if (move_uploaded_file($uploadedFile, $path)) { |
|
| 1060 | $this->session->set_flashdata('astpp_errormsg', gettext('files added successfully!')); |
|
| 1061 | } else { |
|
| 1062 | $this->session->set_flashdata('astpp_notification', "File Uploading Fail Please Try Again"); |
|
| 1063 | redirect(base_url() . 'invoices/invoice_conf/'); |
|
| 1064 | } |
|
| 1065 | } else { |
|
| 1066 | $this->session->set_flashdata('astpp_notification', 'Please upload only image!'); |
|
| 1067 | redirect(base_url() . 'invoices/invoice_conf/'); |
|
| 1068 | } |
|
| 1069 | } |
|
| 1070 | $post_array['logo'] = $file_name; |
|
| 1071 | ||
| @@ 635-647 (lines=13) @@ | ||
| 632 | $uploadedFile = $file["tmp_name"]; |
|
| 633 | $file_name = $file['name']; |
|
| 634 | $file_type = $file['type']; |
|
| 635 | if ($file_type == 'image/jpg' || $file_type == 'image/png' || $file_type == 'image/jpeg') { |
|
| 636 | $dir_path = FCPATH. "upload/"; |
|
| 637 | $path = $dir_path . $add_array['accountid']."_".$file['name']; |
|
| 638 | if (move_uploaded_file($uploadedFile, $path)) { |
|
| 639 | $this->session->set_flashdata('astpp_errormsg', gettext('files added successfully!')); |
|
| 640 | } else { |
|
| 641 | $this->session->set_flashdata('astpp_notification', "File Uploading Fail Please Try Again"); |
|
| 642 | redirect(base_url() . 'user/user_invoice_config/'); |
|
| 643 | } |
|
| 644 | } else { |
|
| 645 | $this->session->set_flashdata('astpp_notification', 'Please upload only image!'); |
|
| 646 | redirect(base_url() . 'user/user_invoice_config/'); |
|
| 647 | } |
|
| 648 | } |
|
| 649 | $add_array['logo'] = $file_name; |
|
| 650 | unset($add_array['submit']); |
|