initial commit
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Description of Ruwe Scores model
|
||||
*
|
||||
* @author Liesbeth
|
||||
* @date april 25 2013
|
||||
*/
|
||||
|
||||
class ModRuweScores extends MY_Model{
|
||||
|
||||
protected $tablename = 'tbRuweScores';
|
||||
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$models = array();
|
||||
$this->load->model($models);
|
||||
}
|
||||
function get_scores($partituurID){
|
||||
$this->sql ="SELECT r.pijlerID,
|
||||
r.score
|
||||
FROM tbRuweScores r
|
||||
LEFT JOIN tbPijlers p
|
||||
ON p.id = r.pijlerID
|
||||
WHERE r.partituurId={$partituurID}
|
||||
ORDER BY r.pijlerID";
|
||||
return $this->get_query_result();
|
||||
}
|
||||
|
||||
function get_partituurID($van, $tm, $orgid) {
|
||||
$this->sql = " SELECT MAX(partituurID) as partituurID
|
||||
FROM tbRuweScores r
|
||||
WHERE r.orgID ={$orgid}
|
||||
AND STR_TO_DATE('{$van}' ,'%Y-%m-%d') <= r.creation_date
|
||||
AND STR_TO_DATE('{$tm}' ,'%Y-%m-%d') >= r.creation_date ";
|
||||
return $this->get_query_row("partituurID");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user