چون همیشه دوست داشتم بنویسم و اما وقت نکردم الا یک نمونه ساده نوشتم کسی خواست استفاده کنه
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
*{
font-family:tahoma;
font-size:8pt;
}
</style>
</head>
<body>
<?php
error_reporting(E_ALL);
$conn = mysql_connect('localhost','root','');
mysql_select_db('users');
mysql_set_charset("utf-8");
date_default_timezone_set('Asia/Tehran');
include('persian_date.class.php');
include('PersianCalendar.php');
$dt = new persian_date();
$now_time = date("Y-m-d H:i:s", time());
$today_date= strtotime($now_time);
if(isset($_POST['btn_save']))
{
$value = $_POST['expire_time'];
$time_type = $_POST['time_type'];
mysql_query("INSERT INTO `users_info`(`id`, `username`, `password`, `email`, `register_time`, `expire_time`) VALUES ('','".$_POST['username']."','".$_POST['password']."','".$_POST['email']."',now(),(NOW() + INTERVAL $value $time_type))",$conn);
}
if(isset($_POST['btn_add']))
{
$value = $_POST['expire_time'];
$time_type = $_POST['time_type'];
mysql_query("UPDATE `users_info` SET `expire_time`=`expire_time`+ INTERVAL $value $time_type WHERE `username`='".$_POST['username']."'",$conn);
}
?>
<br/>
<p align="center">add new user </p>
<br/>
<form action="" method="post" >
<table dir="rtl" style="font-family:tahoma;font-size:8pt;" align="center">
<tr style="border-bottom-color:black;">
<th> نام کاربری </th>
<th> کلمه عبور <th>
<th> ایمیل </th>
<th> expire Time </th>
<th> expire type </th>
<th> action </th>
</tr>
<tr >
<td> <input type="text" name="username" /> </td>
<td> <input type="text" name="password" /> <td>
<td> <input type="text" name="email" /> </td>
<td> <input type="text" name="expire_time" /> </td>
<td>
<select name="time_type">
<option value="minute">دقیقه</option>
<option value="hour">ساعت</option>
<option value="day">روز</option>
<option value="Week">هفته</option>
<option value="month">ماه</option>
<option value="year" >سال</option>
</select>
</td>
<td> <input type="submit" name="btn_save" value="ذخیره" /> </td>
</tr>
</table>
</form>
<br/>
<p align="center">add time to expire </p>
<br/>
<form action="" method="post" >
<table dir="rtl" style="font-family:tahoma;font-size:8pt;" align="center">
<tr style="border-bottom-color:black;">
<th> نام کاربری </th>
<th> expire Time </th>
<th> expire type </th>
<th> action </th>
</tr>
<tr >
<td> <input type="text" name="username" /> </td>
<td> <input type="text" name="expire_time" /> </td>
<td>
<select name="time_type">
<option value="minute">دقیقه</option>
<option value="hour">ساعت</option>
<option value="day">روز</option>
<option value="Week">هفته</option>
<option value="month">ماه</option>
<option value="year" >سال</option>
</select>
</td>
<td> <input type="submit" name="btn_add" value="++" /> </td>
</tr>
</table>
</form>
<br/>
<p align="center"> All Data Record (curent date time : <?php echo $now_time; ?> )</p>
<hr/>
<table dir="rtl" style="font-family:tahoma;font-size:8pt;width:60%;" align="center">
<tr style="border-bottom-color:black;">
<th> نام کاربری </th>
<th> کلمه عبور <th>
<th> ایمیل </th>
<th> تاریخ عضویت </th>
<th> expire Time </th>
<th> user status </th>
</tr>
<?php
$result = mysql_query("select * from users_info ; ",$conn);
if(mysql_num_rows($result)>0)
{
while($rows = mysql_fetch_array($result))
{
?>
<tr>
<th> <?php echo $rows['username']; ?> </th>
<th> <?php echo $rows['password']; ?> <th>
<th> <?php echo $rows['email']; ?> </th>
<th> <?php echo $rows['register_time']; ?> </th>
<th> <?php echo $rows['expire_time']; ?> </th>
<th> <?php echo (strtotime($rows['expire_time'])- $today_date>0)?'<p style="color:green;">Valid</p>':'<p style="color:red;">Expire</p>'; ?> </th>
</tr>
<?php
}
}
?>
</table>
</body>
</html>