Example #1
0
 public function index()
 {
     $offset = $this->general->get_offset();
     $limit = $this->general->get_limit();
     $total = $this->user_model->count_all();
     $xdata['action'] = 'user/search' . get_query_string();
     $xdata['action_delete'] = 'user/delete' . get_query_string();
     $xdata['add_btn'] = anchor('user/add', '<span class="glyphicon glyphicon-plus"></span> Tambah', array('class' => 'btn btn-success btn-sm'));
     $xdata['delete_btn'] = '<button id="delete-btn" class="btn btn-danger btn-sm"><span class="glyphicon glyphicon-trash"></span> Delete Checked</button>';
     $this->table->set_template(tbl_tmp());
     $head_data = array('kode' => 'Kode', 'nama' => 'Fullname', 'level_nama' => 'Level', 'ip_login' => 'IP', 'user_agent' => 'User Agent', 'date_login' => 'Date', 'status_nama' => 'Status');
     $heading[] = form_checkbox(array('id' => 'selectAll', 'value' => 1));
     $heading[] = '#';
     foreach ($head_data as $r => $value) {
         $heading[] = anchor('user' . get_query_string(array('order_column' => "{$r}", 'order_type' => $this->general->order_type($r))), "{$value} " . $this->general->order_icon("{$r}"));
     }
     $heading[] = 'Action';
     $this->table->set_heading($heading);
     $result = $this->user_model->get()->result();
     $i = 1 + $offset;
     foreach ($result as $r) {
         $this->table->add_row(array('data' => form_checkbox(array('name' => 'check[]', 'value' => $r->id)), 'width' => '10px'), $i++, anchor('user/edit/' . $r->id . get_query_string(), $r->kode), array('data' => img(array('src' => get_user_photo($r->photo), 'class' => 'img-circle img-table')) . ' ' . $r->nama, 'width' => '200'), $r->level_nama, $r->ip_login, $r->user_agent, $r->date_login, '<label class="label label-' . ($r->status_kode == 'ON' ? 'success' : 'danger') . '">' . $r->status_nama . '</label>', anchor('user/edit/' . $r->id . get_query_string(), 'Edit') . "&nbsp;|&nbsp;" . anchor('user/delete/' . $r->id . get_query_string(), 'Delete', array('onclick' => "return confirm('you sure')")) . "&nbsp;|&nbsp;" . anchor('user_event?user='******'Event'));
     }
     $xdata['table'] = $this->table->generate();
     $xdata['total'] = page_total($offset, $limit, $total);
     $config = pag_tmp();
     $config['base_url'] = "user" . get_query_string(null, 'offset');
     $config['total_rows'] = $total;
     $config['per_page'] = $limit;
     $this->pagination->initialize($config);
     $xdata['pagination'] = $this->pagination->create_links();
     $data['content'] = $this->load->view('user_list', $xdata, true);
     $this->load->view('template', $data);
 }
Example #2
0
echo form_label('Status', 'status', array('class' => 'control-label'));
?>
				<?php 
echo form_dropdown('status', $this->master_model->dropdown('user_status', 'Status'), set_value('status', isset($row->status) ? $row->status : ''), 'required=required class="form-control input-sm"');
?>
				<small><?php 
echo form_error('status');
?>
</small>
			</div>
			<div class="form-group form-inline">
				<?php 
echo form_label('Photo', 'userfile', array('class' => 'control-label'));
?>
				<img src="<?php 
echo get_user_photo(isset($row->photo) ? $row->photo : '');
?>
" class="form-control">
				<?php 
echo form_upload(array('name' => 'userfile', 'class' => 'btn form-control'));
?>
			</div>			
		</div>
		<div class="box-footer">
			<button class="btn btn-success btn-sm" type="submit" onclick="return confirm('Are you sure')"><span class="glyphicon glyphicon-save"></span> Save</button>
			<?php 
echo anchor($breadcrumb, '<span class="glyphicon glyphicon-repeat"></span> Back', array('class' => 'btn btn-danger btn-sm'));
?>
		</div>
	</div>
	<?php 
Example #3
0
        <ul class="nav navbar-nav">
          <li class="dropdown user user-menu">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              <img src="<?php 
echo get_user_photo($this->general->get_user_info('photo'));
?>
" class="user-image" alt="User Image">
              <span class="hidden-xs"><?php 
echo $this->general->get_user_info('nama');
?>
</span>
            </a>
            <ul class="dropdown-menu">
              <li class="user-header">
                <img src="<?php 
echo get_user_photo($this->general->get_user_info('photo'));
?>
" class="img-circle" alt="User Image">
                <p>
                  <?php 
echo $this->general->get_user_info('nama');
?>
                  <small><?php 
echo $this->general->get_user_info('level');
?>
</small>
                </p>
              </li>
              <li class="user-footer">
                <div class="pull-left">
                  <?php