$name, 'google_ads_customer_id' => $google_ads_customer_id ?: null, 'google_ads_start_date' => $google_ads_start_date ?: null, ]; if ( $id ) { \factory\Clients::update( $id, $data ); \S::alert( 'Klient został zaktualizowany.' ); } else { \factory\Clients::create( $data ); \S::alert( 'Klient został dodany.' ); } header( 'Location: /clients' ); exit; } static public function delete() { $id = \S::get( 'id' ); if ( $id ) { \factory\Clients::delete( $id ); } echo json_encode( [ 'success' => true ] ); exit; } static public function get() { $id = \S::get( 'id' ); $client = \factory\Clients::get( $id ); echo json_encode( $client ?: [] ); exit; } }