Example #1
0
} else {
    $result['exists'] = false;
    $result['response'] = false;
    header("Content-Type: application/json");
    echo json_encode($result);
}
die;
//WSDL FILE
$wsdl = "https://login.workforce.fm/wpfront.asmx?WSDL";
//CREATE CLIENT
$client = new SoapClient($wsdl);
/* Do Sign Up */
if (isset($_GET['doSignUp'])) {
    $name = split_name($_GET['contactName']);
    $parameters = array('firstname' => $name['firstname'], 'lastname' => $name['surname'] ? $name['surname'] : ' ', 'email' => $_GET['emailAddress'], 'password' => $_GET['password'], 'comapanyname' => $_GET['companyName'], 'phoneno' => $_GET['phoneNo'], 'subdomain' => $_GET['subdomain'], 'nooffieldworker' => $_GET['noFieldWorkers']);
    $value = $client->CreateTrialCompany($parameters);
    $key = (string) $value->CreateTrialCompanyResult;
    $result['success'] = strlen($key) ? true : false;
    $result['key'] = $key;
    $result['subdomain'] = $_GET['subdomain'];
    $result['response'] = $value;
    //before response wait 5 seconds (To allow subdomain to be set up at Amazon because immediate redirect to the account will follow)
    sleep(5);
    header("Content-Type: application/json");
    echo json_encode($result);
    exit;
}
/* Check if Subdomain Exists */
if (isset($_GET['subdomainCheck'])) {
    $parameters = array('Subdomain' => $_GET['subdomain']);
    $value = $client->IsSubDomainExists($parameters);