initial commit
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Description of Challanges_model
|
||||
*
|
||||
* @author Theo Weijmer
|
||||
* @date mei 11, 2013 12:33 PM
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class Challanges_model extends MY_Model{
|
||||
|
||||
|
||||
protected $tablename = 'tb_challanges';
|
||||
|
||||
|
||||
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){
|
||||
$details[] = $this->get_record_details($record);
|
||||
}
|
||||
}
|
||||
|
||||
if(!isset($details)) $details = FALSE;
|
||||
|
||||
return $details;
|
||||
}
|
||||
|
||||
function get_single_detail($where){
|
||||
$record = $this->get_records_where($where, TRUE);
|
||||
|
||||
$details = $this->get_record_details($record);
|
||||
|
||||
return $details;
|
||||
}
|
||||
|
||||
function get_record_details($record){
|
||||
$details = new stdClass;
|
||||
|
||||
$details->id = $record->id;
|
||||
|
||||
return $details;
|
||||
}
|
||||
|
||||
function table_def(){
|
||||
$this->sql = "
|
||||
|
||||
";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user