I have made a calendar in PHP CodeIgniter. When we click on any date we can register an event and also we can see the registered events and click on them to track them. On the tracking page, I want to add 2 buttons next and previous to go on next or prev event in the calendar.
What I have tried:
$("#btn_track").click(function(){
var form = $(this).parent("form");
var input = form.find('input[type="text"]');
form.attr("action", base_url("app/track/"+input.val()));
form.submit();
});
Above is the js code for track button what should I do for next and prev events?
P.s There are multiple events registered on a single date also.
Controller side code:
public function track(){
//Update Payment Status if form submitted
$action = $this->input->post("action");
$order_id = ($this->input->post("order_id")) ? $this->input->post("order_id") : $this->uri->segment(3);
if(!empty($order_id)){
$data["page"] = "track";
//Get Event Data
$data["event"] = $this->crud->read_row("*", "event", array("eid" => $order_id));
//Get Items List
$data["items_list"] = $this->crud->read("*", "item", array("event_id" => $order_id));
//Get Payment Data
$data["payment_data"] = $this->crud->read("*", "payment", array("event_id" => $order_id));
//Get Client Data
$data["client"] = $this->crud->read_row("*", "client", array("id" => $data["event"]["client_id"]));
}
else{
$data["page"] = "404";
}
//$data["user"] = $this->userU;
$data["CSession"] = $_SESSION;
$this->load->view("app/index", $data);
}