76 lines
1.6 KiB
PHP
76 lines
1.6 KiB
PHP
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
|
/**
|
|
* Description of Mails_model
|
|
*
|
|
* @author Theo Weijmer
|
|
* @date juli 22, 2013 11:28 AM
|
|
*
|
|
*
|
|
*
|
|
*/
|
|
|
|
|
|
class Mails_model extends MY_Model{
|
|
|
|
|
|
protected $tablename = 'tb_mails';
|
|
|
|
|
|
function __construct(){
|
|
parent::__construct();
|
|
$models = array('ijkpartituur/Mailadresses_model');
|
|
$this->load->model($models);
|
|
}
|
|
|
|
function get_details($where=FALSE){
|
|
$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_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;
|
|
$details->naam = $record->mail_name;
|
|
$details->template = $record->mail_template;
|
|
$details->uitleg = $record->uitleg;
|
|
|
|
$data = array('mailadress_mail_id'=>$record->id, 'mailadress_organisatie_id'=>$this->globorgid);
|
|
$details->adresses = $this->Mailadresses_model->get_details($data);
|
|
|
|
return $details;
|
|
}
|
|
|
|
function table_def(){
|
|
$this->sql = "
|
|
|
|
";
|
|
|
|
}
|
|
|
|
} |