diff --git a/app/Controllers/BkoReports.php b/app/Controllers/BkoReports.php index f37bfd9..5bfbff8 100644 --- a/app/Controllers/BkoReports.php +++ b/app/Controllers/BkoReports.php @@ -132,28 +132,11 @@ public function employersList() :ResponseInterface { */ $sig_count = 0; $data = $this->request->getPost(); - //$insert_data = $data; + $insert_data = $data; - $insert_data['employer_uid'] = $data['employer_uid']; - $insert_data['name'] = $data['name']; - $insert_data['title'] = $data['title']; - $insert_data['email'] = $data['email']; - $insert_data['phone'] = $data['phone']; - if ( $insert_data['employer_uid'] !='' - && $insert_data['name'] !='' - && $insert_data['title'] !='' - && $insert_data['email'] !='' - && $insert_data['phone'] !='' ){ - $result = $this-> insert_db('employers', $insert_data); - $sig_count = $this->updateSignatoryCount( $data['employer_uid'] ); - } - else{ - $result = [ - "error" => "Missing Required Data" - ]; - } + $result = $this-> insert_db('employers', $insert_data); $result_data = [ 'call_return' => '100', 'signatory_count' => $sig_count, @@ -192,9 +175,31 @@ public function employersList() :ResponseInterface { ]; return $this->respond($data, 200); } + + public function signatoryAdd():ResponseInterface{ + /* + $insert_data['employer_uid'] = $data['employer_uid']; + $insert_data['name'] = $data['name']; + $insert_data['title'] = $data['title']; + $insert_data['email'] = $data['email']; + $insert_data['phone'] = $data['phone']; + + if ( $insert_data['employer_uid'] !='' + && $insert_data['name'] !='' + && $insert_data['title'] !='' + && $insert_data['email'] !='' + && $insert_data['phone'] !='' ){ + + } + else{ + $result = [ + "error" => "Missing Required Data" + ]; + } + */ $data = $this->request->getPost(); -$loc = 100; + $loc = 100; $employer_uid = $data["employer_uid"]; if ( $employer_uid !=''){ $query = $this->db->query("SELECT id FROM employers WHERE uid = '".$employer_uid."' "); @@ -208,6 +213,7 @@ $loc = 100; $insert_data['title'] = $data['title']; $insert_data['phone'] = $data['phone']; $result = $this-> insert_db('employers_signatory', $insert_data); + $sig_count = $this->updateSignatoryCount( $data['employer_uid'] ); } else {