SugarCRM Contact Automatic find Birthday and send sms

SugarCRM Contact Automatic find Birthday and send sms

April 1, 2018 PHP SugarCRM Uncategorized 0

<?php

$sqlcon = mysql_connect('localhost',user,password);

$sql_db = mysql_select_db("db",$sqlcon);

$result0 = "Select * from contacts where deleted=0";

$res0 = mysql_query($result0);

$b1=null;

$c1=null;

$a1=null;

while ($row0 = mysql_fetch_array($res0))

{

 

  $salutation = $row0['salutation'];

  $fname = $row0['first_name'];

  $lname = $row0['last_name'];

$nm =$salutation." ".$fname." ".$lname;

  $bday = $row0['birthdate'];

$bday1= explode("-",$bday);

$bdayc=$bday1[2]."-".$bday1[1];

$a1=$a1.','.$nm;

$b1 = $b1.','.$bdayc;

$nbday=explode(",",$bdayc);

 

$mob = $row0['phone_mobile'];

$c1 = $c1.','.$mob;

$number=null;

}

$name1=explode(",",$a1);

$date1=explode(",",$b1);

$mob1=explode(",",$c1);

$today=date("d-m");

 

//print($today);

for($i=0;$i<=100;$i++)

{

if($date1[$i]==$today){

$p='91'.$mob1[$i];

$m='test'.$name1[$i];

 

$str="user=username&password=password&sender=sendername&sender=910000000000&text=$m&PhoneNumber=$p&track=1";

ob_start();

$number=$number.$p.',';

 

}

}

$nn=substr($number,0,-1);

//print($nn);

$m='Wish you a many many happy returns of the day. May God blessyou with health,Wealth and prosperity in your life, Happy Birthday.  -From company Ltd. ';

//print(strlen($m));

$str="user=user&password=password&sender=sender&sender=919860609000&text=$m&PhoneNumber=$nn&track=1";

header("Location:http://www.sms.in/sendsmsv2.asp?$str");

?>

 

Leave a Reply

Your email address will not be published. Required fields are marked *