initial commit
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Description of partactkosten_model
|
||||
*
|
||||
* @author Theo Weijmer
|
||||
* @date mei 8, 2013 4:41 PM
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class Partactkosten_model extends MY_Model{
|
||||
|
||||
|
||||
protected $tablename = 'tbPartActKosten';
|
||||
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$models = array();
|
||||
$this->load->model($models);
|
||||
}
|
||||
|
||||
function get_details($where){
|
||||
$records = $this->get_records_where($where);
|
||||
|
||||
$details = $this->get_records_details($records);
|
||||
|
||||
return $details;
|
||||
}
|
||||
|
||||
function get_records_details(){
|
||||
if($records){
|
||||
|
||||
foreach($records as $record){
|
||||
$this->get_record_details($record);
|
||||
}
|
||||
}
|
||||
|
||||
if(!isset($details)) $details = FALSE;
|
||||
|
||||
return $details;
|
||||
}
|
||||
|
||||
function get_record_details($record){
|
||||
$details = new stdClass;
|
||||
|
||||
return $details;
|
||||
}
|
||||
|
||||
function get_partituur_kosten($where){
|
||||
$this->db->from($this->tablename);
|
||||
$this->db->join( 'tbPartActiviteiten', 'tbPartActiviteiten.id = '.$this->tablename.'.ActiviteitID');
|
||||
|
||||
$query = $this->db->get();
|
||||
$actkosten = $query->result();
|
||||
|
||||
$kosten = 0;
|
||||
if($actkosten){
|
||||
foreach($actkosten as $actkost){
|
||||
$kosten = $kosten + $actkost->Kosten;
|
||||
}
|
||||
}
|
||||
|
||||
return $kosten;
|
||||
}
|
||||
|
||||
function table_def(){
|
||||
$this->sql = "
|
||||
|
||||
";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user