From afca839d54f4f955b0d35bb7770c7e8c49bea045 Mon Sep 17 00:00:00 2001 From: NikhitaPaturu Date: Tue, 1 May 2018 15:43:27 +0100 Subject: [PATCH] deleted the date function --- app/controller/partycontroller.ctrl.php | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/app/controller/partycontroller.ctrl.php b/app/controller/partycontroller.ctrl.php index 3d86191d..b80dd9c8 100644 --- a/app/controller/partycontroller.ctrl.php +++ b/app/controller/partycontroller.ctrl.php @@ -122,8 +122,8 @@ public function create() if(empty($error)) { - $startTime = date('Y-m-d', $event_date) . ' ' . $start; - $endTime = date('Y-m-d', $event_date) . ' ' . $end; + $startTime = $event_date . ' ' . $start; + $endTime = $event_date . ' ' . $end; $dtStart = new DateTime($startTime); $dtDiff = $dtStart->diff(new DateTime($endTime)); @@ -147,8 +147,6 @@ public function create() ); $idParty = $this->Party->create($data); - - if($idParty){ /** check and create User List **/ @@ -522,10 +520,8 @@ public function manage($id){ array('key' => 'party_stats', 'value' => $idparty), array('key' => 'party_lat', 'value' => $party->latitude), array('key' => 'party_lon', 'value' => $party->longitude) - ); - /** Start WP XML-RPC **/ $wpClient = new \HieuLe\WordpressXmlrpcClient\WordpressClient(); $wpClient->setCredentials(WP_XMLRPC_ENDPOINT, WP_XMLRPC_USER, WP_XMLRPC_PSWD); @@ -540,7 +536,6 @@ public function manage($id){ 'custom_fields' => $custom_fields ); - // Check for WP existence in DB // $theParty = $this->Party->findOne($idparty); if(!empty($party->wordpress_post_id)){ @@ -548,8 +543,6 @@ public function manage($id){ // we need to remap all custom fields because they all get unique IDs across all posts, so they don't get mixed up. $thePost = $wpClient->getPost($party->wordpress_post_id); - - foreach( $thePost['custom_fields'] as $i => $field ){ foreach( $custom_fields as $k => $set_field){ if($field['key'] == $set_field['key']){ @@ -587,19 +580,16 @@ public function manage($id){ $this->set('response', $response); } - $party = $this->Party->findThis($id, true); $categories = $Category->listed(); $restarters = $User->find(array('idroles' => 4)); - $party->co2 = 0; $party->ewaste = 0; $party->fixed_devices = 0; $party->repairable_devices = 0; $party->dead_devices = 0; - if(!empty($party->devices)){ foreach($party->devices as $device){ @@ -679,7 +669,6 @@ public function delete($id){ } } - public function stats($id, $class = null){ $Device = new Device; @@ -736,12 +725,8 @@ public function deleteimage(){ $Image->deleteImage($id, $path); - - echo json_encode(array('hey' => 'Deleting stuff here!')); - - } } - } + } \ No newline at end of file