<?php 
class M_select extends CI_Model
{	    
    function input_select($name,$data,$nilai,$req='',$class='') {
		$hasil='<select class="form-control '.$class.'" name="'.$name.'" '.$req.' >';		
		foreach($data as $key => $value) {
			if($key==$nilai) {
				$cl='selected';
			} else {
				$cl='';
			}
			$hasil = $hasil . '<option value="'.$key.'" '.$cl.'>'.$value.'</option>';			
		}
		return $hasil.'</select>';							
	}	
    
	
    public function get_pekerjaan()
    {
        $a=$this->db->query("select * from pekerjaan")->result_array();        
		$ar1=array();
		$ar2=array();
		foreach($a as $row) {
			$b1 = $row['id'];
			$b2 = $row['pekerjaan'];			
			array_push($a1,$b1);
			array_push($a2,$b2);
		}				
		array_unshift($a1, '');
		array_unshift($a2, '-- Pilih Pekerjaan --');				
		$sh=array_combine($a1,$a2);
		return $sh;
    }
	function get_bulan(){
        $bln = array(
            '1' =>  'Januari',
            '2' =>  'Februari',
            '3' =>  'Maret',
            '4' =>  'April',
            '5' =>  'Mei',
            '6' =>  'Juni',
            '7' =>  'Juli',
            '8' =>  'Agustus',
            '9' =>  'September',
            '10'    =>  'Oktober',
            '11'    =>  'November',
            '12'    =>  'Desember'
        );
        return $bln;
    }
	function get_hari() {
		$a1 = array (
			'--pilih hari-'	=> '',
			'Sabtu'			=> 'Sabtu',
			'Ahad'			=> 'Ahad',
			'Senin'			=> 'Senin',
			'Selasa'		=> 'Selasa',
			'Rabu'			=> 'Rabu',
			'Kamis'			=> 'Kamis',
			"Jumat"			=> "Jum'at"
		);
		return $a1;
	
	}
	
}