emprit

buat_tabel

Dec 7th, 2012
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.26 KB | None | 0 0
  1. ------------------------Controller-----------------------
  2. public function buat_tabel()
  3.     {
  4.     if($this->session->userdata('sudah_login')){
  5.     $content['query'] = $this->kriteria_model->buat_tabel();
  6.         if($content['query']) {
  7.         $array = array('title' => 'Tabel Penilaian',
  8.                         'content' => $this->load->view('template_admin/sukses',$content,true),
  9.                         'footer' => $this->load->view('template_admin/footer','',true));
  10.         $array['waktu'] = $this->login_model->selisih();
  11.         $this->load->view('template_admin/home', $array);
  12.         }else {
  13.         $array = array('title' => 'Tabel Penilaian',
  14.                         'content' => $this->load->view('template_admin/error','',true),
  15.                         'footer' => $this->load->view('template_admin/footer','',true));
  16.         $array['waktu'] = $this->login_model->selisih();
  17.         $this->load->view('template_admin/home', $array);
  18.             }
  19.     }else{
  20.     redirect ('sudah_login');
  21.     }
  22.     }
  23.  
  24. ------------------------Model-----------------------------
  25. function buat_tabel(){
  26.         $queryform = $this->db->query("SELECT * FROM form WHERE type != '0'");
  27.         return $queryform;
  28.         foreach($queryform as $row){
  29.             $query = $this->db->query('CREATE TABLE penilaian
  30.                                             (
  31.                                                 no_urut varchar(100),
  32.                                                 $row->id_form varchar(2550),
  33.                                         )');
  34.         }
  35.         return $query;
  36.     }
Advertisement
Add Comment
Please, Sign In to add comment