diff --git a/src/model/emailList.php b/src/model/emailList.php deleted file mode 100644 index a7e7bcf5b19c9fae749739959724af4605d91d8c..0000000000000000000000000000000000000000 --- a/src/model/emailList.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -/** - * Created by PhpStorm. - * User: iqbal - * Date: 03/10/17 - * Time: 23:43 - */ - -$emailList = array("iqbal@gmail.com", "test@ymail.com", "cloud@dagojek.com"); - -$emailInput = $_REQUEST["q"]; - -if (filter_var($emailInput, FILTER_VALIDATE_EMAIL)) { - $response = checkAvailability($emailInput, $emailList); -} else { - $response = "unavailable"; -} - -echo $response; - -function checkAvailability($string, $aList) { - if ($string !== "") { - $found = false; - $i = 0; - while ($i < count($aList) && !$found) { - if ($string === $aList[$i]) { - $found = true; - } else { - $i++; - } - } - if ($found) { - return "unavailable"; - } else { - return "available"; - } - } -} \ No newline at end of file diff --git a/src/model/usernameList.php b/src/model/usernameList.php deleted file mode 100644 index 9b76f882799125c9c9533fb34001fa90d244b6e9..0000000000000000000000000000000000000000 --- a/src/model/usernameList.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php -/** - * Created by PhpStorm. - * User: iqbal - * Date: 03/10/17 - * Time: 23:43 - */ - -$usernameList = array("iqbal", "test", "cloud"); - -$usernameInput = $_REQUEST["q"]; -$response = checkAvailability($usernameInput, $usernameList); -echo $response; - -function checkAvailability($string, $aList) { - if ($string !== "") { - $found = false; - $i = 0; - while ($i < count($aList) && !$found) { - if ($string === $aList[$i]) { - $found = true; - } else { - $i++; - } - } - if ($found) { - return "unavailable"; - } else { - return "available"; - } - } -} \ No newline at end of file