//cal time
date_default_timezone_set('Asia/Bangkok');
mysql_select_db($dbname);
$sqlCalTime="select timelogin,timelogout";
$sqlCalTime.=" from tb_vdotime where memberid='$sess_memberid'";
$resCalTime=mysql_query($sqlCalTime) or die($sqlCalTime);
$rowCalTime=mysql_fetch_row($resCalTime);
$timeStart=$rowCalTime[0];
$timeStop=$rowCalTime[1];
//cal time use
$start="$timeStart";
$end="$timeStop";
$dif=strtotime($end)-strtotime($start);
$tmpTimeUse=date('H:i:s', $dif);
$sql_timeuse="update tb_vdotime";
$sql_timeuse.=" set timeuse='$tmpTimeUse'";
$sql_timeuse.=" where memberid='$sess_memberid'";
$res_timeuse=mysql_db_query($dbname,$sql_timeuse);