initial commit
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Description of Eigenpijlers_model
|
||||
*
|
||||
* @author Theo Weijmer
|
||||
* @date mei 8, 2013 4:21 PM
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class Eigenpijlers_model extends MY_Model{
|
||||
|
||||
|
||||
protected $tablename = 'tb_eigenpijlers';
|
||||
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$models = array();
|
||||
$this->load->model($models);
|
||||
}
|
||||
|
||||
function get_pijlers_not_in_partituur($orgid, $partID){
|
||||
$this->sql ="SELECT id, eigenpijler_naam as naam
|
||||
FROM tb_eigenpijlers ep
|
||||
WHERE ep.orgID = {$orgid}
|
||||
AND ep.id not in (SELECT eigenpijlerID FROM tb_parteigenpijlers pep where pep.partituurID = {$partID})";
|
||||
return $this->get_query_result();
|
||||
}
|
||||
|
||||
function get_details($where){
|
||||
$records = $this->get_records_where($where);
|
||||
|
||||
$details = $this->get_records_details($records);
|
||||
|
||||
return $details;
|
||||
}
|
||||
|
||||
function get_records_details($records){
|
||||
if($records){
|
||||
|
||||
foreach($records as $record){
|
||||
$details[] = $this->get_record_details($record);
|
||||
}
|
||||
}
|
||||
|
||||
if(!isset($details)) $details = FALSE;
|
||||
|
||||
return $details;
|
||||
}
|
||||
|
||||
function get_record_details($record){
|
||||
$details = new stdClass;
|
||||
|
||||
$details->id = $record->id;
|
||||
|
||||
$details->naam = $record->eigenpijler_naam;
|
||||
|
||||
return $details;
|
||||
}
|
||||
|
||||
function table_def(){
|
||||
$this->sql = "
|
||||
|
||||
";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user