Welcome Guest, Not a member yet? Register   Sign In
load Session in same file controller failed
#1

[eluser]Rosiadi[/eluser]
hello guys. I'm still newbie in CI. I try to load session which set in same file controller. after set the session, I load the view. and in that view I call again a function in controller. but there is no data set. can someone explain where my false??
here ini my code which set the session

Code:
function ViewUpdate($data)
{
         $this->session->set_userdata('nota2', $this->nota);
  
  $this->data['h2_title']   = 'NotaDinas > Update Data';
  $this->data['tampilan']   = 'NotaDinasUpdate';
  $this->data['link']    = array('link_back' => anchor('NotaDinasUpdate/','kembali', array('class' => 'back'))
          );
          
  $this->data = array_merge($this->data, $data);

  
  $tmpl = array( 'table_open'    => '<table border="0" cellpadding="2" cellspacing="2">',
         'row_alt_start'  => '<tr class="zebra">',
        'row_alt_end'    => '</tr>'
         );
  $this->table->set_caption("Address Book");
  
  /*--------------------------------Table List Dari-----------------------------------------------*/
   $milis = $this->NotaModel->getAllStaff();
   $this->table->set_template($tmpl);
   $this->table->set_empty("&nbsp;");
  
   foreach ($milis as $mil)
   {
    //print_r($mil);
    $this->table->add_row($mil->KODE_OBJEK,$mil->NAMA_OBJEK,anchor('ControllerBukaNota/addedAtasan/'.$mil->KODE_OBJEK,'Pilih'));
   }
   $this->data['tableDari'] = $this->table->generate();
   $this->table->clear();
  
  
   /*--------------------------------End Table List Dari----------------------------------------*/
   /*--------------------------------Table List Pemeriksa-----------------------------------------------*/
   $milis = $this->NotaModel->getAllStaff();
   $this->table->set_template($tmpl);
   $this->table->set_empty("&nbsp;");
  
   foreach ($milis as $mil)
   {
    $this->table->add_row($mil->KODE_OBJEK,$mil->NAMA_OBJEK,anchor('ControllerBukaNota/addedPemeriksa/'.$mil->KODE_OBJEK,'Pilih'));
   }
   $this->data['tablePemeriksa'] = $this->table->generate();
   $this->table->clear();
  
  
   /*--------------------------------End Table List Pemeriksa----------------------------------------*/
   /*--------------------------------Table List Tembusan-----------------------------------------------*/
   $milis = $this->NotaModel->getAllStaff();
   $this->table->set_template($tmpl);
   $this->table->set_empty("&nbsp;");
  
   foreach ($milis as $mil)
   {
    $this->table->add_row($mil->KODE_OBJEK,$mil->NAMA_OBJEK,anchor('ControllerBukaNota/addedTembusan/'.$mil->KODE_OBJEK,'Pilih'));
   }
   $this->data['tableTembusan'] = $this->table->generate();
   $this->table->clear();
  
  
   /*--------------------------------End Table List tembusan----------------------------------------*/
   /*--------------------------------Table List Kode Masalah--------------------------------------------*/
   $milis = $this->NotaModel->getKodeMasalah();
   $this->table->set_template($tmpl);
   $this->table->set_empty("&nbsp;");
   foreach ($milis as $mil)
   {
    $this->table->add_row($mil->KODE_MASALAH,$mil->NAMA_MASALAH,anchor('ControllerBukaNota/addedKM/'.$mil->KODE_MASALAH.'/'.$data['awal'],'Pilih'));
   }
   $this->data['tabelKM'] = $this->table->generate();
   $this->table->clear();
  
   /*--------------------------------End Table Kode Masalah-------------------------------------*/
   /*--------------------------------Table List BUMN--------------------------------------------*/
   $milis = $this->NotaModel->getAllBUMN();
   $this->table->set_template($tmpl);
   $this->table->set_empty("&nbsp;");
   foreach ($milis as $mil)
   {
    $this->table->add_row($mil->KODE_OBJEK,$mil->NAMA_OBJEK,anchor('ControllerBukaNota/addedBumn/'.$mil->KODE_OBJEK,'Pilih'));
   }
   $this->data['tabelBUMN'] = $this->table->generate();
   $this->table->clear();
  
   /*--------------------------------End Table BUMN-------------------------------------*/
   /*--------------------------------Table List Pegawai--------------------------------------------*/
   $milis = $this->NotaModel->getAllStaff();
   $this->table->set_template($tmpl);
   $this->table->set_empty("&nbsp;");
   foreach ($milis as $mil)
   {
    $this->table->add_row($mil->KODE_OBJEK,$mil->NAMA_OBJEK,anchor('ControllerBukaNota/addToFieldKepada/'.$mil->KODE_OBJEK.'/'.$data['awal'],'Pilih'));
   }
   $this->data['tabelPegawai'] = $this->table->generate();
   $this->table->clear();
  
   /*--------------------------------End Table List Pegawai-------------------------------------*/
   $this->load->helper('form');
  
   $this->session->set_userdata('data',$this->data);
  $this->load->view('test', $this->data);
}



and here my code which want to load $this->data
Code:
public function AddedKM($kmi, $dat)
{
  $this->data['tabelKM'] = $kmi;
  $this->session->set_userdata("data",$this->data);
                $this->ViewUpdate($this->data);                  
  
  
}


my goal in here just to replace $this->data['tabelKM'] in the session but there was no data in $this->data. it's empty. please help me...


Messages In This Thread
load Session in same file controller failed - by El Forum - 08-23-2012, 12:26 PM
load Session in same file controller failed - by El Forum - 08-23-2012, 12:51 PM
load Session in same file controller failed - by El Forum - 08-23-2012, 01:17 PM
load Session in same file controller failed - by El Forum - 08-23-2012, 01:35 PM
load Session in same file controller failed - by El Forum - 08-23-2012, 01:41 PM
load Session in same file controller failed - by El Forum - 08-23-2012, 01:43 PM
load Session in same file controller failed - by El Forum - 08-23-2012, 01:50 PM
load Session in same file controller failed - by El Forum - 08-23-2012, 02:21 PM
load Session in same file controller failed - by El Forum - 08-23-2012, 05:40 PM



Theme © iAndrew 2016 - Forum software by © MyBB