sparqapi/api/application/controllers/GC_Event_Controller.php
2022-05-24 17:35:17 +05:30

58 lines
1.7 KiB
PHP

<?php
/**
* User: VE10
* This Controller deals with GC_Event Related CRUD Operations
*/
defined('BASEPATH') OR exit('No direct script access allowed');
require_once APPPATH . '/libraries/REST_Controller.php';
//require APPPATH . 'vendor/autoload.php';
class GC_Event_Controller extends REST_Controller {
public function __construct()
{
parent::__construct();
$this->load->library('Googleapi');
}
public function addGoogleCalenterEvent_post()
{
// log_message('ERROR','#/# G-Calender-Event Fns Entered');
$post = $this->post();
$data = array();
$event = array(
'location' => !empty($post['location'])?trim($post['location']):'Perambalur',
'summary' => !empty($post['summary'])?trim($post['summary']):'Google meet link',
'start' => !empty($post['start'])?trim($post['start']):'10:30',
'end' => !empty($post['end'])?trim($post['end']):'17:00',
'pdid' => !empty($post['pdid'])?trim($post['pdid']):'17:00'
);
$data = $this->googleapi->addGoogleCalenterEvent($event);
$this->response($data,REST_Controller::HTTP_OK);
}
public function getGoogleCalenderEventList_get()
{
$data = ($this->googleapi->getEventListFromGoogleCalender());
$this->response($data,REST_Controller::HTTP_OK);
}
public function getEventFromGoogleCalender_get()
{
$eventId = $this->get('eventid');// = '112e17c49k57uni51qp8l7gf18'
$data = ($this->googleapi->getGoogleCalenderEvent($eventId));
$this->response($data,REST_Controller::HTTP_OK);
}
}