Update besar apk finance
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Customers extends CI_Controller {
|
||||
class Customers extends MY_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -73,7 +73,11 @@ class Customers extends CI_Controller {
|
||||
'nama' => $this->input->post('nama'),
|
||||
'alamat' => $this->input->post('alamat'),
|
||||
'telp' => $this->input->post('telp'),
|
||||
'email' => $this->input->post('email')
|
||||
'email' => $this->input->post('email'),
|
||||
'credit_limit' => max(0,(float)$this->input->post('credit_limit')),
|
||||
'payment_term_days' => max(0,(int)$this->input->post('payment_term_days')),
|
||||
'is_credit_blocked' => $this->input->post('is_credit_blocked') ? 1 : 0,
|
||||
'tax_number' => $this->input->post('tax_number',true)
|
||||
];
|
||||
|
||||
if (!$data['nama']) {
|
||||
@@ -114,7 +118,11 @@ class Customers extends CI_Controller {
|
||||
'nama' => $this->input->post('nama'),
|
||||
'alamat' => $this->input->post('alamat'),
|
||||
'telp' => $this->input->post('telp'),
|
||||
'email' => $this->input->post('email')
|
||||
'email' => $this->input->post('email'),
|
||||
'credit_limit' => max(0,(float)$this->input->post('credit_limit')),
|
||||
'payment_term_days' => max(0,(int)$this->input->post('payment_term_days')),
|
||||
'is_credit_blocked' => $this->input->post('is_credit_blocked') ? 1 : 0,
|
||||
'tax_number' => $this->input->post('tax_number',true)
|
||||
];
|
||||
|
||||
$this->dm->setTable('customers')->update($id, $data);
|
||||
@@ -149,4 +157,4 @@ class Customers extends CI_Controller {
|
||||
|
||||
echo json_encode(['status'=>true,'message'=>'Data berhasil dihapus']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user