Skip to content

Commit

Permalink
cart
Browse files Browse the repository at this point in the history
  • Loading branch information
TMuthulakshmi committed Jan 20, 2023
1 parent 878f349 commit 9a52e0a
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions app/Controllers/Api/Event/Index.php
Expand Up @@ -70,14 +70,15 @@ public function listandsearch()

}

public function detail($id){

$userdetail = getSiteUserDetails() ? getSiteUserDetails() : [];
$userid = (isset($userdetail['id'])) ? $userdetail['id'] : 0;
$event = $this->event->getEvent('row', ['event', 'barn', 'stall', 'rvbarn', 'rvstall', 'feed', 'shaving', 'users', 'startingstallprice'],['id' => $id, 'type' =>'1']);

$data['bookings'] = $this->booking->getBooking('row', ['booking', 'event'],['user_id' => $userid, 'eventid' => $id,'status'=> ['1']]);
$data['comments'] = $this->comments->getComments('all', ['comments','users','replycomments'],['commentid' => '0', 'eventid' => $id,'status'=> ['1']]);
public function detail(){
$requestData = $this->request->getPost();
$userid = (isset($requestData['userid'])) ? $requestData['userid'] : 0;

$event = $this->event->getEvent('row', ['event', 'barn', 'stall', 'rvbarn', 'rvstall', 'feed', 'shaving', 'users', 'startingstallprice'],['id' => $requestData['id'], 'type' =>'1']);

$data['bookings'] = $this->booking->getBooking('row', ['booking', 'event'],['user_id' => $userid, 'eventid' => $requestData['id'],'status'=> ['1']]);

$data['comments'] = $this->comments->getComments('all', ['comments','users','replycomments'],['commentid' => '0', 'eventid' => $requestData['id'],'status'=> ['1']]);

if ($data && count($data) > 0){
$data['event'] =[
Expand Down Expand Up @@ -163,8 +164,10 @@ function checkincheckout(){
$eventid = $post['eventid'];
$checkin = formatdate($post['checkin']);
$checkout = formatdate($post['checkout']);
$result['occupied'] = getOccupied($eventid, ['checkin' => $checkin, 'checkout' => $checkout]);
$result['reserved'] = getReserved($eventid,['checkin' => $checkin, 'checkout' => $checkout]);
$result['occupied'] = getOccupied($eventid, ['checkin' => $checkin, 'checkout' => $checkout]);
$result['reserved'] = getReserved($eventid,['checkin' => $checkin, 'checkout' => $checkout]);
$result['blockunblock1'] = getBlockunblock($eventid);
$result['blockunblock2'] = getBlockunblock($eventid, ['checkin' => $checkin, 'checkout' => $checkout, 'type' => 2]);

if(count($result)>0){
$json = ['1', count($result) . ' Record(s) Found', $result];
Expand Down

0 comments on commit 9a52e0a

Please sign in to comment.