Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter Calendar
#1

[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">
&lt;html &gt;
&lt;head&gt;
   &lt;title&gt;Simple Login with CodeIgniter - Private Area&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
  <div id="login_ok">
    <h1></h1>
    <h2>Welcome &lt;?php echo $username; ?&gt;!</h2>
     <div id="calendar">

      &lt;?php echo $this->calendar->generate(); ?&gt;
     </div>
    <a id="logout_button" href="home/logout">Logout</a>
</div>
&lt;/body&gt;
&lt;/html&gt;

Hope you can help me.




Theme © iAndrew 2016 - Forum software by © MyBB