Exemplo n.º 1
0
 function masuk()
 {
     $this->load->model('login_model');
     $username = $this->input->post('username');
     $password = $this->input->post('password');
     $passwordx = md5($password);
     $sukses = $this->login_model->login($username, $passwordx)->num_rows();
     if ($sukses > 0) {
         $new_data = array('username' => $this->login_model->login($username, $passwordx)->row()->username, 'password' => $this->login_model->login($username, $passwordx)->row()->password, 'id' => $this->login_model->login($username, $passwordx)->row()->id_user, 'nama' => $this->login_model->login($username, $passwordx)->row()->nama, 'level' => $this->login_model->login($username, $passwordx)->row()->level, 'logged_in' => TRUE);
         $this->session->set_userdata($new_data);
         if (from_session('level') == 'admin') {
             redirect('admin');
         } elseif (from_session('level') == 'manager') {
             redirect('manager');
         } elseif (from_session('level') == 'bpw') {
             redirect('bpw');
         } else {
             redirect('kl');
         }
     } else {
         //redirect('home');
         echo '<script languange="javascript">
             alert("password / username salah atau ada field yang kosong. Mungkin anda diblokir");
             window.history.back(-1);
         </script>';
     }
 }
Exemplo n.º 2
0
function from_session_or_post($val) {
    $v = from_session($v);
    if ( is_null($v) || ( $v == false )  ) {
        $v = filter_input(INPUT_POST, $val,FILTER_SANITIZE_STRING);
    }
    return $v;
}
Exemplo n.º 3
0
 function Manager()
 {
     parent::__construct();
     if (from_session('logged_in') == FALSE && from_session('level') != 'manager') {
         redirect('login');
     } elseif ($this->session->userdata('logged_in') == TRUE && from_session('level') == 'admin') {
         redirect('admin');
     } elseif ($this->session->userdata('logged_in') == TRUE && from_session('level') == 'kl') {
         redirect('kl');
     } elseif ($this->session->userdata('logged_in') == TRUE && from_session('level') == 'bpw') {
         redirect('bpw');
     }
 }
Exemplo n.º 4
0
 function do_login()
 {
     $this->auth->restrict(true);
     $this->load->library('form_validation');
     $this->form_validation->set_rules('username', 'Username', 'trim|required');
     $this->form_validation->set_rules('password', 'Password', 'trim|required');
     $this->form_validation->set_rules('captcha', 'Captcha', 'trim|required|callback_valid_captcha');
     $this->form_validation->set_message('valid_captcha', '%s tidak sama');
     if ($this->form_validation->run() == FALSE) {
         $this->index();
     } else {
         $this->load->library('auth');
         $login = array('username' => $this->input->post('username'), 'password' => $this->input->post('password'));
         $return = $this->auth->do_login($login);
         if ($return) {
             echo warning('Selamat datang, ' . from_session('nama'), 'home');
         } else {
             echo warning('Maaf, username atau password yang Anda masukkan salah...', 'home');
         }
     }
 }
Exemplo n.º 5
0
<script type='text/javascript'>
$(function(){
    $('.date').calendar();
});
</script>
<h2>Pendaftaran <?php 
echo $hasilnya->row()->nama_paket . ' ( ' . $hasilnya->row()->jadwal_awal . ' s/d ' . $hasilnya->row()->jadwal_akhir . ' )';
?>
 </h2>
	<?php 
echo form_open('kl/save_jamaah');
?>
	<input type="hidden" name="id" value="<?php 
echo from_session('id');
?>
">
	<input type="hidden" name="id_paket" value="<?php 
echo $hasilnya->row()->id_paket;
?>
">
		<table width=650 border=0>
          <tr><td colspan=4><b><u>Data Kelengkapan Umrah</u></b></td></tr>
		  <tr>
    <td width=2%>1.</td>
    <td width=17%>Paket </td>
    <td width=2%>:</td>
    <td><?php 
echo $hasilnya->row()->nama_paket;
?>
</td>
	</tr>
Exemplo n.º 6
0
<link rel="stylesheet" type="text/css" href="<?php 
echo base_url();
?>
aset/style.css" />
<link rel="sortcut icon" href="<?php 
echo base_url();
?>
/aset/images/icon.jpg" />
</head>
<body>
<div id="header">
	<div id="menu">
      <ul>
		<li>&#187; <b>Distro <?php 
echo from_session('nama_kl');
?>
</b> </li>
        <li><a href="<?php 
echo base_url();
?>
manager">&#187; Home</a></li>
        <li><a href="<?php 
echo base_url();
?>
umum/editprofil">&#187; Manajemen User</a></li>
        <li><a href='?module=pendaftaran'>&#187; Pendaftaran</a></li>
                
        <li><a href="<?php 
echo base_url();
?>
Exemplo n.º 7
0
 function list_penjualan()
 {
     if (isset($_POST['submit'])) {
         $data['peg'] = $this->input->post('cari');
         $this->session->set_userdata('peg', $data['peg']);
     } else {
         $data['peg'] = $this->session->userdata('peg');
     }
     $this->db->like('nama', $data['peg']);
     $this->db->from('jamaah');
     $this->db->join('paket', 'jamaah.id_paket = paket.id_paket');
     $this->db->where('paket.blokir', 'N');
     $config['base_url'] = base_url() . 'umum/list_penjualan/page/';
     //set base url for pagination
     $config['total_rows'] = $this->db->count_all_results();
     //$jml;
     $config['per_page'] = '10';
     $config['uri_segment'] = 4;
     $config['full_tag_open'] = '<div>';
     $config['full_tag_close'] = '</div>';
     $config['num_links'] = 1;
     $this->pagination->initialize($config);
     $nilai['hasilnya'] = $this->admin_model->get_jamaah2($config['per_page'], $this->uri->segment(4), $data['peg']);
     $nilai['isi'] = 'umum/list_jamaah_aktif';
     //$nilai['hasilnya'] = $this->admin_model->get_pegawai();
     if (from_session('level') == 'bpw') {
         $this->load->view('bpw/index', $nilai);
     } elseif (from_session('level') == 'kl') {
         $this->load->view('kl/index', $nilai);
     } else {
         $this->load->view('admin/index', $nilai);
     }
 }
Exemplo n.º 8
0
 function nomor_jamaah_ueser($id)
 {
     $idx = from_session('id');
     $u = $this->db->query("SELECT * FROM kl WHERE `id_user`='{$idx}'");
     $klnya = $u->row()->id_kl;
     $this->db->where('id_paket', $id);
     $this->db->where('id_kl', $klnya);
     return $this->db->get('jamaah');
 }
Exemplo n.º 9
0
<br />

<?php 
$p = false;
if (in_array($cur_transaksi, array(9, 16))) {
    $piutang = $this->trmodel->get_list_piutang2();
    $p = true;
}
?>
<div class='title'>Input Transaksi</div>
<div class='the_content'>
    <form method='post' action='' name='form_transaksi'>
    <?php 
echo form_hidden('nomor');
echo form_hidden('transaksi');
echo form_hidden('user', from_session('user_id'));
echo form_hidden('tanggal_catat', time());
?>
    <table class='myform' style='width:100%'>
        <tr>
            <td class='a_right' valign='top'>Transaksi</td>
            <td valign='top'>:</td>
            <td class='a_left' valign='top'><span class='jenis'></span></td>
        </tr>
        <tr>
            <td class='a_right' valign='top'>Tanggal</td>
            <td valign='top'>:</td>
            <td class='a_left' valign='top'><input type='text' value='<?php 
echo date('Y-m-d');
?>
' class='date' name='tanggal_transaksi' autocomplete='off' style='width:100px' /></td>
Exemplo n.º 10
0
 function cek($id, $ret = false)
 {
     $menu = array('data_master' => '+admin+', 'manajemen_user' => '+admin+');
     $allowed = explode('+', $menu[$id]);
     if (!in_array(from_session('level'), $allowed)) {
         if ($ret) {
             return false;
         }
         echo $this->CI->fungsi->warning('Anda tidak diijinkan mengakses halaman ini.', site_url());
         die;
     } else {
         if ($ret) {
             return true;
         }
     }
 }
Exemplo n.º 11
0
 function get_saldo_pertanggal($buku, $tanggal)
 {
     $awal = 0;
     $this->db->select('(SUM(debet)-SUM(kredit)) as saldo');
     $this->db->from('transaksi');
     $this->db->where('user', from_session('user_id'));
     $this->db->where('buku', $buku);
     $this->db->where('tanggal_transaksi<="' . $tanggal . '"', '', false);
     $res = $this->db->get();
     if ($res->num_rows() > 0) {
         $row = $res->row();
         return $awal + $row->saldo;
     } else {
         return $awal;
     }
 }
Exemplo n.º 12
0
?>
" /><input class="tombol" type="submit" name="submit" value="Cari" />
 </form></td>
  </tr>
</table>

          <table width=650 border=1>
	<?php 
if (count($hasilnya) > 0) {
    ?>
	<tr><th rowspan=2>No</th><th rowspan=2>Nama</th><th colspan=2>Tanggal</th><th rowspan=2>Jumlah</th></tr>
		  <tr><th>Keberangkatan</th><th>Kepulangan</th></tr>
	<?php 
    $d = 1;
    foreach ($hasilnya as $row) {
        $id = from_session('id');
        $u = $this->db->query("SELECT * FROM kl WHERE `id_user`='{$id}'");
        $klnya = $u->row()->id_kl;
        $paket = $row['id_paket'];
        $a = $this->db->query("SELECT COUNT(`id_paket`) AS jumlah FROM jamaah WHERE `id_paket`='{$paket}' and id_kl='{$klnya}'");
        $b = $a->row()->jumlah;
        ?>
	
	<tr align="left">
		
		<td align=center><?php 
        echo $d;
        $d++;
        ?>
</td>
		<td align=center><?php 
Exemplo n.º 13
0
 function ex_all_jamaah_user()
 {
     $ids = from_session('id');
     $this->db->where('id_user', $ids);
     return $this->db->get('jamaah');
 }
Exemplo n.º 14
0
<h2>Selamat Datang <?php 
echo from_session('nama');
?>
</h2>
<p><b><?php 
echo from_session('nama');
?>
</b>, selamat datang di halaman website pendaftaran Online.</p><p>&nbsp;</p> <p>Silahkan klik menu pilihan yang berada 
          di sebelah kiri untuk mengelola content website. </p><p></p>
          <p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>
          <p align=right>Login : <?php 
date_default_timezone_set('Asia/Jakarta');
echo $this->tanggal->hari(date('D')) . ', ' . $this->tanggal->tanggal3(date('Y-m-d'));
echo ' | ' . date('H:i:s') . ' WIB';
?>
</p>