<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * CodeIgniter
 *
 * An open source application development framework for PHP 5.1.6 or newer
 *
 * @package		CodeIgniter
 * @author		Ahmad Sanusi
 * @copyright	Copyright (c) 2014 Ahmad Sanusi
 * @license		http://codeigniter.com/user_guide/license.html
 * @link		http://codeigniter.com
 * @since		Version 1.0
 * @filesource
 */

// ------------------------------------------------------------------------

/**
 * CodeIgniter Model Class
 *
 * @package		CodeIgniter
 * @subpackage	Libraries
 * @category	Libraries
 * @author		Ahmad Sanusi
 * @link		http://codeigniter.com/user_guide/libraries/config.html
 */
class Pesertadidik_long_m extends MY_Model {

	/**
	 * Constructor
	 *
	 * @access public
	 */
	protected $_table_name = 'peserta_didik_longitudinal';
    protected $_order_by   = 'peserta_didik_id DESC';
    protected $_primary_key = 'peserta_didik_id';
    
	public function __construct()
	{
		parent::__construct();
    }

    public function save_data_periodik($data, $where = array())
    {
        // Insert
        if (count($where) <= 0){
            $this->db->set($data);
            $this->db->insert($this->_table_name);
            $id = $this->db->insert_id();
        }
        // Update
        else{
            $id = $where['peserta_didik_id'];
            $this->db->set($data);
            $this->db->where($where);
            $this->db->update($this->_table_name);
        }
        return $id;
    }
    
}
// END Pesertadidik_long_m Class

/* End of file Pesertadidik_long_m.php */
/* Location: ./Application/modules/student/models/Pesertadidik_long_m.php */