[eluser]Unknown[/eluser]
Hi to all of you,
I have one problem with calendar library. So far I managed to preview calendar, add prev/next button and change starting day. The problem is next - when I clik on prev/next button, it only changes to +one month, or -one month but only in address bar while calendar with date stays the same.
Here is my home.php controller :
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
session_start(); //we need to call PHP's session object to access it through CI
class Home extends CI_Controller {
function __construct()
{
parent::__construct();
}
function index()
{
$this->load->view('header_view');
$conf = array (
'start_day' => 'monday',
'show_next_prev' => 'true',
'next_prev_url' => base_url() . 'home/index',
);
$this->load->library('calendar', $conf);
if($this->session->userdata('logged_in'))
{
$session_data = $this->session->userdata('logged_in');
$data['username'] = $session_data['username'];
$this->load->view('home_view', $data, $conf);
}
else
{
//If no session, redirect to login page
redirect('login', 'refresh');
}
$this->load->view('footer_view');
}
function logout()
{
$this->session->unset_userdata('logged_in');
session_destroy();
redirect('home', 'refresh');
}
}
?>
and home view :
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head>
<title>Simple Login with CodeIgniter - Private Area</title>
</head>
<body>
<div id="login_ok">
<h1></h1>
<h2>Welcome <?php echo $username; ?>!</h2>
<div id="calendar">
<?php echo $this->calendar->generate(); ?>
</div>
<a id="logout_button" href="home/logout">Logout</a>
</div>
</body>
</html>
Hope you can help me.