Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

deleted the date function #280

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 3 additions & 18 deletions app/controller/partycontroller.ctrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -147,8 +147,6 @@ public function create()
);
$idParty = $this->Party->create($data);



if($idParty){

/** check and create User List **/
Expand Down Expand Up @@ -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);
Expand All @@ -540,16 +536,13 @@ 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)){
// echo "WP id present (" . $party->wordpress_post_id . ")! Editing...<br />";
// 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']){
Expand Down Expand Up @@ -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){

Expand Down Expand Up @@ -679,7 +669,6 @@ public function delete($id){
}
}


public function stats($id, $class = null){
$Device = new Device;

Expand Down Expand Up @@ -736,12 +725,8 @@ public function deleteimage(){

$Image->deleteImage($id, $path);



echo json_encode(array('hey' => 'Deleting stuff here!'));


}
}

}
}