Example #1
0
    } else {
        $p = array('user_email' => $array['email'], 'user_password' => md5($array['pwd']), 'user_name' => $array['fullName'], 'user_contact_no1' => $array['mobileNumber']);
        //                     echo $array['mobileNumber'];
        $user = $db->users()->insert($p);
        $data = array("registerStatus" => "successfully registered", 'userEmail' => $array['email']);
        $_SESSION['user'] = $email;
    }
    $app->response()->header('Content-Type', 'application/json');
    echo json_encode($data);
});
$app->post("/jobApplication", function () use($app, $db) {
    $data = array();
    $inputData = (array) json_decode($app->request()->getBody());
    $response = array("applicationSubmitted" => false);
    if ($inputData) {
        $user = $db->careers()->insert($inputData);
        $response['applicationSubmitted'] = true;
    }
    $to = "*****@*****.**";
    $subject = "Job Application for" . $inputData['jobTitle'];
    $body = "Hi Sudhir, \n\n";
    $body .= "You have a job application for " . $inputData['jobTitle'] . " with the following details \n";
    $body .= "Applicant Name: " . $inputData['name'] . "\n";
    $body .= "Applicant Email: " . $inputData['email'] . "\n";
    $body .= "Applicant Mobile Number: " . $inputData['mobileNumber'] . "\n";
    $body .= "Applicant Github Profile: " . $inputData['gitHub'] . "\n";
    $body .= "Applicant Linkedin Profile: " . $inputData['linkedin'] . "\n";
    $body .= "Applicant Past Experience: " . $inputData['pastExperience'] . "\n";
    $body .= "\n\n";
    $body .= "Best Regards \n Tourepedia Team";
    $from = "From: support@tourepedia.com";