Hi all
I want a solution to add 25 every login after 24 hours please check my following code.
<?
session_start();
ob_start();
header("Cache-control: private");
if((!isset($HTTP_SESSION_VARS["user"]))||(!isset($HTTP_SESSION_VARS["user_type"])))
{
header("Location:view_authentication.htm");
}
include("connection.php");
$lv_last_loginx=$HTTP_SESSION_VARS["user_last_login"];
$lv_user_typex=$HTTP_SESSION_VARS["user_type"];
?>
<?
$lv_user_name=$HTTP_SESSION_VARS["user"];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Welcome</title>
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
.style2 {
font-size: 10pt;
font-weight: bold;
}
-->
</style>
</head>
<body>
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table border="1" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" bgcolor="E4E3E3"><? include("includes/menu_dash.php"); ?></td>
</tr>
<tr>
<td bgcolor="E4E3E3">
<?php
$po=25;
$bon=10;
$date=date('d-M-Y');
$date1="";
$count=0;
if((!isset($lv_last_loginx))||($lv_last_loginx==null))
{
echo " New Account Creation 25 + 10";
}
else
{
$timediff= getTimeDiff("15:34","15:33");
if($timediff >="23:59:00")
{
$po1= ($po+25);
}
echo "<br>";
echo "User Stats <br>";
echo "You have ".($po1);
}
?>
<?php
FUNCTION getTimeDiff($dtime,$atime){
$nextDay=$dtime>$atime?1:0;
$dep=EXPLODE(':',$dtime);
$arr=EXPLODE(':',$atime);
$diff=ABS(MKTIME($dep[0],$dep[1],0,DATE('n'),DATE('j'),DATE('y'))-MKTIME($arr[0],$arr[1],0,DATE('n'),DATE('j')+$nextDay,DATE('y')));
$hours=FLOOR($diff/(60*60));
$mins=FLOOR(($diff-($hours*60*60))/(60));
$secs=FLOOR(($diff-(($hours*60*60)+($mins*60))));
IF(STRLEN($hours)<2){$hours="0".$hours;}
IF(STRLEN($mins)<2){$mins="0".$mins;}
IF(STRLEN($secs)<2){$secs="0".$secs;}
RETURN $hours.':'.$mins.':'.$secs;
}
?>
</td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>