<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**/
function getGUID()
	{
		if (function_exists('com_create_guid')){
			return com_create_guid();
		}else{
			mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up.
			$charid = strtoupper(md5(uniqid(rand(), true)));
			$hyphen = chr(45);// "-"
			$uuid = substr($charid, 0, 8).$hyphen
				.substr($charid, 8, 4).$hyphen
				.substr($charid,12, 4).$hyphen
				.substr($charid,16, 4).$hyphen
				.substr($charid,20,12);
			return $uuid;
		}

}
function is_logged_in()
{
	$CI =& get_instance();
	$ss = $CI->session->userdata('isLogin');
	if($ss != '')
	{
	    // return TRUE;
		return TRUE;
	}else{
		return FALSE;
	}
	//return true;
}

if ( ! function_exists('log2file'))
{
	function log2file($msg)
	{
		$myFile = "log_file.txt";
		$fh = fopen($myFile, 'a') or die("can't open file");
		$stringData = date("Y-m-d h:m:s").chr(13);
		fwrite($fh, $stringData);
		
		fwrite($fh, $msg.chr(13).chr(13));
		fclose($fh);
	}
}
