<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Email_pcs2 extends CI_Controller {
	public function __construct()
	{
		parent::__construct();
		session_start();
		
		date_default_timezone_set('Asia/Singapore');
		$this->load->model('edm_m');
	}
	
	public function t($code='',$company_code='',$link)
	{
		print 'z';
		
	}
	 
	 
	public function edm_content($code='',$company_code='',$link)
	{
		$content = "
		<p>Dear Regular Members,</p>
<p>
If you've missed our previous emails due to your busy schedule, this is a gentle reminder to complete the <strong>online Professional Conduct Statement</strong> <a href='".$link."'>here</a> if you have not already done so. Please ensure your submission is done by <strong>7 March 2025</strong>.
</p>
<p>We appreciate your prompt attention to this matter. If you have any questions, feel free to contact the IMAS Secretariat at <a href='mailto:replies@imas.org.sg'>replies@imas.org.sg</a>.
</p>
";
		
		$data['content'] = $content;
		
		$html = $this->load->view('emails/mass-email.php',$data,TRUE);
		
		
		return $html;
		
	}
	 
	public function index()
	{			
	
		$listing = $this->edm_m->submitted_pcs();
		
		
		$reminder_pending_list = $this->edm_m->reminder_pending_list();
		
		
		$count = 0;
		
		foreach($listing as $b)
		{	
		
			$record = $this->edm_m->find_co($b['company_code']);
			
			if(empty($record))
			{
				print_r($b);
			}
			
			/*
			$status = $this->edm_m->update_email_blast5($b['company_code']);
			
			if(!$status)
			{
				print $b['company_code'].'<br>';
				
			} else {
				
				$count++;
			}
			
			*/
		}
		
		print $count;		
				
		print 'DONE';
		
	}
	
	public function index2()
	{			
	
		$listing = $this->edm_m->pcs_reminder_list();
		
		
		foreach($listing as $b)
		{	
		
			print $b['company_name'].'|'.$b['id'].'<br>';
			
			
		}
		
		
		
	}
}
/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */