コード例 #1
0
ファイル: register.php プロジェクト: rifaiaja/orpsystem
 public function proses()
 {
     $account_model = new account_model();
     if ($account_model->cekAvaibleEmail($this->input->post('email'))) {
         $idrefstore = $this->orm->refstore->max('idrefstore');
         if (empty($idrefstore)) {
             $idrefstore = 1;
         } else {
             $idrefstore = $idrefstore + 1;
         }
         $data = array();
         $data['idrefstore'] = $idrefstore;
         $data['nama'] = $this->input->post('nama_refstore', true);
         //        $data['tlp'] =  '';
         //        $data['email'] =  '';
         //        $data['lokasi'] =  '';
         //        $data['keterangan'] =  '';
         $ress_refstore = $this->orm->refstore->insert($data);
         $data = array();
         $data['email'] = $this->input->post('email', true);
         $data['namalengkap'] = $this->input->post('namalengkap', true);
         $data['password'] = $this->encrypt_callback($this->input->post('password', true));
         $data['idrole'] = 6;
         // Administrator Store
         $data['idrefstore'] = $idrefstore;
         $ress_user = $this->orm->useraccount->insert($data);
         $_SESSION['message'] = 'Register Successfully';
         redirect('login');
     } else {
         $_SESSION['message'] = 'Email Not Available, Already Registered';
         redirect('register');
     }
 }
コード例 #2
0
ファイル: login.php プロジェクト: rifaiaja/orpsystem
 public function process()
 {
     $account_model = new account_model();
     $data = array();
     $this->output->enable_profiler(FALSE);
     $email = $this->input->post('email');
     $password = $this->encrypt_callback($this->input->post('password'));
     if (!empty($email) || !empty($password)) {
         if ($account_model->cekLogin($email, $password)) {
             $user = $this->orm->useraccount->where('email', $email)->fetch();
             $data['namalengkap'] = $user['namalengkap'];
             $data['nomorhp'] = $user['nomorhp'];
             $data['email'] = $user['email'];
             $data['alamat'] = $user['alamat'];
             $data['idrole'] = $user['idrole'];
             $data['idrefstore'] = $user['idrefstore'];
             $data['role'] = $user->role['role'];
             $_SESSION['user'] = $data;
             $_SESSION['login'] = TRUE;
             redirect('home');
         } else {
             redirect('login');
         }
     } else {
         redirect('login');
     }
 }
コード例 #3
0
ファイル: header_view.php プロジェクト: rifaiaja/orpsystem
            <a href="#sidepanel" class="sidepanel-open-button"><i class="fa fa-outdent"></i></a>
            <!-- End Sidepanel Show-Hide Button -->

            <!-- Start Top Right -->
            <ul class="top-right">

                <li class="dropdown link">
                    <a href="#" data-toggle="dropdown" class="dropdown-toggle profilebox"><img src="<?php 
echo base_url();
?>
front_assets/img/profileimg.png" alt="img">
                       <?php 
echo $_SESSION['user']['namalengkap'];
?>
 | <b><?php 
$account_model = new account_model();
echo $account_model->_getStoreName($_SESSION['user']['idrefstore']);
?>
</b><span class="caret"></span></a>
                    <ul class="dropdown-menu dropdown-menu-list dropdown-menu-right">
                        <li><a href="<?php 
echo PARENT_URL;
?>
index.php/login/login/logout"><i class="fa falist fa-power-off"></i> Logout</a></li>
                    </ul>
                </li>
            </ul>
            <!-- End Top Right -->
        </div>
        <!-- END TOP -->