<?php
ob_start();
////////////////////// CORE FUNCTION | MODULE FUNCTION (c) i2d Technologies //////////////////////////////////
if (!function_exists('echoout')) {
function echoout($var,$caption=0,$file_name="somefile.php",$line_no="undefined") { 

if($caption!==0){
$string="<strong>".$caption." is</strong> : ".$var." ";
}
else{
$string="<strong> Variable is</strong> : ".$var." ";	
}
   //$file=basename(__FILE__, '.php');
   //$file=$_SERVER["SCRIPT_FILENAME"];
   $file=$file_name;
   $line=$line_no;
   $complete=$string."<strong>placed in : </strong>".$file." &line is ".$line."<br />";
   
   echo $complete;
} 
}
/////////////////////////// function ends /////////////////////////////////



/////////////////////////////// Function starts
if (!function_exists('session_fetch')) {
function session_fetch($value) { 

if (!isset($_SESSION) || $_SESSION=''){ session_start();}
if(isset($_SESSION[$value])){
$returned=$_SESSION[$value];
return $returned;
}
else{
echoout("SESSION FETCH","EMPTY!",__FILE__,__LINE__);	
$returned="0";

}	

}
} 

/////////////////////////// function ends /////////////////////////////////
/////////////////////////////// Function starts
if (!function_exists('session_fetch_login')) {
function session_fetch_login($value) {
	
if (!isset($_SESSION)){ 
session_start();
}
if(array_key_exists($value,$_SESSION) && !empty($_SESSION[$value])){
$returned=$_SESSION[$value];
}
else{
echoout("SESSION FETCH","EMPTY!",__FILE__,__LINE__);	
$returned="no session";
}	

return $returned;


} 
}
/////////////////////////// function ends /////////////////////////////////

////////////////////// CORE FUNCTION | MODULE FUNCTION (c) i2d Technologies //////////////////////////////////
if (!function_exists('get_auth')) {
function get_auth() { 

    if (!isset($_SESSION)){ 
session_start();
}
$rt=$_SESSION['auth'];

if(!empty($rt)){
	 return $rt;
}
else{
logout_user("/login/");
}	
} 
}
/////////////////////////// function ends /////////////////////////////////
















ob_flush();
?>