<?php
		include_once('../config1.php');
        $Data = json_encode($_POST);  
        mysql_query("insert into test (name) values('$Data')");  
		 
		mysql_query("insert into test (name) values('Entered') ");  
		die;
		
		$result  = mysql_query("select * from paid_members ");
		while($row = mysql_fetch_object($result))
		{
			$current_date =  date("Y-m-d");    
			$seconds = strtotime($current_date) - strtotime($row->membership_date); 
			$days    = floor($seconds / 86400);  
			
			if( ($row->post_id==1) ||  ($row->post_id==2) )
			{ 	
				if($days >= $row->days)
				{
					$tb_name = "city_tabel_".$row->city_id;
					mysql_query("update $tb_name set user_type = 0 where cust_id='$row->cust_id' and category_id=$row->category_id and post_id = $row->post_id "); 
					mysql_query("update paid_members  set user_type = 0 where cust_id='$row->cust_id' and category_id=$row->category_id and post_id = $row->post_id ");  
				}  
			}   
		}     
?>
