initial commit
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Description of Partituurs_model
|
||||
*
|
||||
* @author Theo Weijmer
|
||||
* @date mei 8, 2013 3:42 PM
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class Partituurs_model extends MY_Model{
|
||||
|
||||
|
||||
protected $tablename = 'tb_partituurs';
|
||||
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$models = array('ijkpartituur/Partactkosten_model','ijkpartituur/Modpartactiviteiten');
|
||||
$this->load->model($models);
|
||||
}
|
||||
|
||||
|
||||
function get_details($where){
|
||||
$records = $this->get_records_where($where);
|
||||
|
||||
if($records){
|
||||
foreach($records as $record){
|
||||
$details[] = $this->get_record_details($record);
|
||||
}
|
||||
}
|
||||
|
||||
if(!isset($details)) $details = FALSE;
|
||||
return $details;
|
||||
}
|
||||
|
||||
function get_single_details($where){
|
||||
$record = $this->get_records_where($where, TRUE);
|
||||
if($record){
|
||||
$details = $this->get_record_details($record);
|
||||
}else{
|
||||
$details = FALSE;
|
||||
}
|
||||
|
||||
return $details;
|
||||
}
|
||||
|
||||
function get_record_details($record){
|
||||
$details = new stdClass;
|
||||
|
||||
$details->id = $record->id;
|
||||
$details->naam = $record->partituur_naam;
|
||||
$details->actief = $record->partituur_actief;
|
||||
|
||||
$details->projectleider = $this->Users_model->get_user_detail_by_id($record->partituur_projectleider_id);
|
||||
|
||||
if (!$record->partituur_projectleider_id){
|
||||
$details->projectleider = new stdClass;
|
||||
$details->projectleider->fullname = '';
|
||||
$details->projectleider->fullname="onbekend";};
|
||||
$details->email = $record->partituur_email;
|
||||
$details->profielid = $record->partituur_profiel_id;
|
||||
|
||||
$details->startdatum = mysql2date($record->partituur_start);
|
||||
$details->einddatum = mysql2date($record->partituur_eind);
|
||||
|
||||
$details->kosten = $this->Partactkosten_model->get_partituur_kosten(array('partituurID'=>$record->id));
|
||||
$details->gereed = $this->Modpartactiviteiten->get_partituur_gereed($record->id);
|
||||
|
||||
return $details;
|
||||
}
|
||||
function getPartituren($orgid){
|
||||
$this->sql="SELECT id, partituur_naam as naam, partituur_actief as actief
|
||||
FROM tb_partituurs
|
||||
WHERE partituur_organisatie_id = $orgid";
|
||||
return $this->get_query_result() ;
|
||||
}
|
||||
function table_def(){
|
||||
$this->sql = "
|
||||
|
||||
";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user