<?php defined('BASEPATH') OR exit('No direct script access allowed');

class Cron_lady_image_approve extends CI_Controller
{
	public function index()
	{
		$this->load->model('common_model');
		$getFileData = $this->common_model->getAll('sys_files',array('filename !='=>'','free_membership_image'=>1,'accepted'=>0),array('ugal_images','ugal_images.file_id = sys_files.id'),'sys_files.created DESC','*,sys_files.created,sys_files.id');
		//pr($getFileData);
		if(!empty($getFileData))
		{
			foreach ($getFileData as $value) {
				if($value['created'] < time()-36*60*60)
				//if($value['created'] < time()-36*60*60)
				{
					$this->common_model->Updatedata('sys_files',array('accepted'=>1),array('id'=>$value['id']));
				}
			}
		}
	}
}