<?php defined('BASEPATH') OR exit('No direct script access allowed');
ini_set('max_execution_time', -1);
class Update_cron extends CI_Controller
{
	public function index()
	{
		$this->load->model('common_model');
		$time = $this->common_model->getAllRow('trigger_table',array('id'=>1));
		//print_r($time);
		if((time()-300) > $time['current_value'])
		{
			$ch = curl_init();
			//curl_setopt($ch, CURLOPT_URL, 'https://www.google.co.in');
			curl_setopt($ch, CURLOPT_URL, 'https://castleevents.com/newsletter');
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
			$contents = curl_exec($ch);
			//print_r($contents); die;
		}
		else
		{
			echo 1;
		}die;
	}
}