diff --git a/account/application/controllers/accounts/Accountheads.php b/account/application/controllers/accounts/Accountheads.php index a553941..8dfb86d 100644 --- a/account/application/controllers/accounts/Accountheads.php +++ b/account/application/controllers/accounts/Accountheads.php @@ -64,6 +64,19 @@ class Accountheads extends CI_Controller case 'edit': $id = $this->uri->segment(4); if (isset($_POST['submit'])) { + $config['upload_path'] = './uploads/'; + $config['allowed_types'] = 'gif|jpg|jpeg|png'; + $config['max_size'] = 128 * 1024; + $this->load->library('upload', $config); + + if ($this->upload->do_upload('account_image')) { + $account_image_data = $this->upload->data(); + $account_image = $account_image_data['file_name']; + }else{ + $current_account_image = $this->db->query("SELECT account_image FROM tbl_accounts WHERE account_id = '$id'")->row()->account_image; + $account_image = $current_account_image; + } + // print_r($account_image);die; $TableData = array( 'accategory_id' => filter_var($_POST['accategory_id']), //'account_code' => filter_var($_POST['account_code']), @@ -78,6 +91,7 @@ class Accountheads extends CI_Controller 'account_partyemail' => filter_var($_POST['account_partyemail']), 'account_partycontactperson' => filter_var($_POST['account_partycontactperson']), 'account_partycontactpersoncontact' => filter_var($_POST['account_partycontactpersoncontact']), + 'account_image' => $account_image, 'created_on' => date('Y-m-d H:i:s'), 'created_by' => 'admin', 'remarks' => filter_var($_POST['remarks']), diff --git a/account/application/views/accounts/accountheads/details.php b/account/application/views/accounts/accountheads/details.php index cec1a7f..a3d8b31 100644 --- a/account/application/views/accounts/accountheads/details.php +++ b/account/application/views/accounts/accountheads/details.php @@ -60,7 +60,7 @@
- User profile picture + User profile picture
diff --git a/account/application/views/accounts/accountheads/edit.php b/account/application/views/accounts/accountheads/edit.php index 89207ba..9b8c226 100644 --- a/account/application/views/accounts/accountheads/edit.php +++ b/account/application/views/accounts/accountheads/edit.php @@ -20,15 +20,15 @@
- -
-
- - -
- -
-
+ +
+
+ + +
+
+
+
@@ -66,6 +66,14 @@
+ + + +
+ Account Image +
+ +
@@ -154,4 +162,15 @@
- \ No newline at end of file + + + \ No newline at end of file