<?php
	/*
	Hezecom Email Solution
	Author: Hezecom Technologies (http://hezecom.com) info@hezecom.net
	COPYRIGHT 2014 ALL RIGHTS RESERVED
	
	You must have purchased a valid license from CodeCanyon.com in order to have 
	access this file.

	You may only use this file according to the respective licensing terms 
	you agreed to when purchasing this item.
	*/

include('../config/config.php');
include_once('../libraries/class_dbcon.php');

$db=DB::getInstance();
$username = trim($_POST['username']);
	$fuser=$username.'@'.C_URL;
	$sql = "SELECT COUNT(*) AS username from mailusers WHERE cusername =:username LIMIT 1";
	$stmt=$db->prepare($sql);
	$stmt->bindParam(':username',$fuser);
	$stmt->execute();
	$row=$stmt->fetch(PDO::FETCH_OBJ);
	
if($row->username>0){
	echo 0;
}else{
	echo 1;
}

?>