Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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);
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900