コード例 #1
0
EOT;
$sql2 = $argv[1] . " and";
$sql3 = <<<EOT
 resumes.listing_type_sid=7 and
( jobs.TotalYearsExperience  is NULL or jobs.TotalYearsExperience = 0 or resumes.totalYearsExperience between jobs.TotalYearsExperience - 2 and jobs.TotalYearsExperience + 2)
and ( jobs.Location_State is NULL or jobs.Location_State = "" or resumes.Location_State = jobs.Location_State )
and (jobs.Location_District is NULL or jobs.Location_District = "" or resumes.Location_District = jobs.Location_District )
and (jobs.JobCategory is NULL  or jobs.JobCategory = "" or stringSetIntersect(jobs.JobCategory, resumes.JobCategory) = TRUE)
and (jobs.Occupations is NULL  or jobs.Occupations = "" or stringSetIntersect(jobs.Occupations, resumes.Occupations) = TRUE)
 ) as matchingresumes
where u.sid = matchingresumes.user_sid
EOT;
$sql = $sql1 . $sql2 . $sql3;
echo $sql;
$result = $conn->query($sql);
$conn->close();
if ($result->num_rows > 0) {
    $phoneNumbers = array();
    // output data of each row
    while ($row = $result->fetch_assoc()) {
        echo "phonenumber: " . $row["phonenumber"] . " - Name: " . $row["username"] . "\n";
        $phoneNumbers[] = $row["phonenumber"];
    }
    var_dump($phoneNumbers);
    $smsSender = new SMSSender();
    $result = $smsSender->send("You have been selected for the job of Welder ", $phoneNumbers);
    echo $result;
} else {
    echo "\n no matching results found";
}
// connect to the database
コード例 #2
0
ファイル: testsms.php プロジェクト: pradeepck/vagrant
<?php

/**
 * Created by PhpStorm.
 * User: pradeep.ck
 * Date: 5/29/2015
 * Time: 10:19 AM
 */
require "WebRequest.php";
$smsSender = new SMSSender();
$result = $smsSender->send("Testing with classes", array("7588529619", "7775928628"));
echo $result;
class SMSSender
{
    private $profileId = "20070311";
    private $user = "******";
    private $pwd = "Ui4gzn";
    private $senderId = "Anant Innovation";
    public function send($message, $list)
    {
        $webRequest = new WebRequest();
        $params = array("profileId" => $this->profileId, "user" => $this->user, "pwd" => $this->pwd, "senderId" => $this->senderId, "mobileno" => implode(",", $list), "msgtext" => "this is a test message");
        $result = $webRequest->get("http://bulksmsindia.mobi/sendurlcomma.aspx?", $params);
        return $result;
    }
}