<?php
require_once ("varables.php");

$myJSON['message'] = "4004";
$myJSON['mmm'] = array();

// if(isset($_POST["nekot"]) && isset($_POST["an1d"]))
// {
    $connect = @mysqli_connect($hostname,$username,$password,$database);
    if($connect)
    {
        @mysqli_query($connect,"SET CHARACTER SET utf8;");

			$query_all = "SELECT * FROM tbl_androidid";
			$allres = @mysqli_query($connect,$query_all);
			if($allres){
        $countins = 0;
			 while($row = @mysqli_fetch_assoc($allres))
          $countins++;
          $date = jdate('Y/m/d');
         $date = remMounths($date,1); 
         $date = addNumbers($date,15);
      $query_all = "SELECT * FROM tbl_androidid WHERE date > '".$date."'";
			$allres = @mysqli_query($connect,$query_all);
			if($allres){
        $countactivity = 0;
			 while($row = @mysqli_fetch_assoc($allres))
          $countactivity++;
          
          
          $myJSON['message']="تا الآن " .$countins . " نفر برنامه فروشگاهی شما رو نصب کردن و " . $countactivity . " نفر در دو هفته گذشته فعال بوده اند." ;
      }
        else{
          $myJSON['message']="4004.";
        }

      }
        else{
          $myJSON['message']="4004.";
        }
	}
	 else
		 $myJSON['message']="400";

// }
echo json_encode($myJSON);
?>
