Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------------Controller--------------------
- function administrasi() {
- if($this->session->userdata('sudah_login_pelamar')){
- $isi['query'] = $this->kriteria_model->lihat();
- $array = array( 'content' => $this->load->view('akun_pelamar/administrasi',$isi,true) );
- $this->load->view('akun_pelamar/menu',$array);
- }else {
- redirect('index/index');
- }
- }
- ---------------------Model-------------------------
- function lihat()
- {
- $this->db->order_by('id_form','ASC');
- $query = $this->db->get('form');
- return $query->result();
- }
- ------------------View-------------------------
- <form name='administrasi' method='POST' enctype='multipart/form-data' action='<?php echo base_url();?>halamanpelamar/administrasi_tambah'>
- <?php
- foreach($query as $row){
- echo "$row->label :";
- if($row->type == 'text' OR $row->type == 'file' OR $row->type == 'password'){
- echo "<input type='$row->type' name='$row->nama' value=''>";
- }elseif($row->type == 'checkbox'){
- $row->value = json_decode($value);
- echo "<input type='$row->type' name='$row->nama' value='$value'>$value";
- }
- }
- ?>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment