'Default', 'basePath' => dirname(__FILE__) )); $mysqlconfig = new Zend_Config( array( 'database' => array( 'adapter' => 'pdo_mysql', 'params' => array( 'host' => 'localhost', 'dbname' => 'intranet', 'username' => 'root', 'password' => 'metropolisitteam', ) ) ) ); $mysqldb = Zend_Db::factory($mysqlconfig->database); $mysqldb->setFetchMode(Zend_Db::FETCH_ASSOC); //echo "Start"; //echo $mysqldb."
"; //$leadid =htmlspecialchars(stripslashes($_GET['leadid']));// 14 if(isset($_GET['patientName'])){$patientName =htmlspecialchars(stripslashes($_GET['patientName']));}else{$patientName="";}// 20 if(isset($_GET['patientMobile'])){$patientMobile =htmlspecialchars(stripslashes($_GET['patientMobile']));}else{$patientMobile="";}// 100 if(isset($_GET['code'])){$code =htmlspecialchars(stripslashes($_GET['code']));}else{$code="";}// 20 if(isset($_GET['bookedBy'])){$bookedBy =htmlspecialchars(stripslashes($_GET['bookedBy']));}else{$bookedBy="";}// 20 if(isset($_GET['gender'])){$gender =htmlspecialchars(stripslashes($_GET['gender']));}else{$gender="";}// 100 if(isset($_GET['visitDate'])){$visitDate =htmlspecialchars(stripslashes($_GET['visitDate']));}else{$visitDate="";}// if(isset($_GET['tests'])){$tests =htmlspecialchars(stripslashes($_GET['tests']));}else{$tests="";}// 100 if(isset($_GET['specialInstructions'])){$specialInstructions =htmlspecialchars(stripslashes($_GET['specialInstructions']));}else{$specialInstructions="";}// 100 if(isset($_GET['address_line1'])){$address_line1 =htmlspecialchars(stripslashes($_GET['address_line1']));}else{$address_line1="";}// 100 if(isset($_GET['address_city'])){$address_city =htmlspecialchars(stripslashes($_GET['address_city']));}else{$address_city="";}// 100 if(isset($_GET['address_state'])){$address_state =htmlspecialchars(stripslashes($_GET['address_state']));}else{$address_state="";}// 6 if(isset($_GET['address_pincode'])){$address_pincode =htmlspecialchars(stripslashes($_GET['address_pincode']));}else{$address_pincode="";}// 20 if(isset($_GET['address_country'])){$address_country =htmlspecialchars(stripslashes($_GET['address_country']));}else{$address_country="";}// $leaddate=date("Y-m-d",strtotime("now")); //var_dump($leaddate); //exit; $leadid =$mysqldb->quote(addslashes($leadid)); $patientName =$mysqldb->quote(addslashes($patientName)); $patientMobile =$mysqldb->quote(addslashes($patientMobile)); $code =$mysqldb->quote(addslashes($code)); $bookedBy =$mysqldb->quote(addslashes($bookedBy)); $gender =$mysqldb->quote(addslashes($gender)); $visitDate =$mysqldb->quote(addslashes($visitDate)); $tests =$mysqldb->quote(addslashes($tests)); $specialInstructions =$mysqldb->quote(addslashes($specialInstructions)); $address_city =$mysqldb->quote(addslashes($address_city)); $address_line1=$mysqldb->quote(addslashes($address_line1)); $address_state =$mysqldb->quote(addslashes($address_state)); $address_pincode =$mysqldb->quote(addslashes($address_pincode)); $address_country =$mysqldb->quote(addslashes($address_country)); //var_dump($booking_status) ; // exit; $sql="INSERT INTO lybrate_leads( leaddate, leadid, patientName, patientMobile, code, bookedBy, gender, visitDate, tests, specialInstructions, address_line1, address_city, address_state, address_pincode, address_country ) VALUES ( '$leaddate', $leadid, $patientName, $patientMobile, $code, $bookedBy, $gender, $visitDate, $tests, $specialInstructions, $address_line1, $address_city, $address_state, $address_pincode, $address_country ) ;"; try { //echo $sql."
"; //var_dump($sql); $mysqldb->query($sql); $leadid =htmlspecialchars(stripslashes($_GET['leadid'])); $patientName =htmlspecialchars(stripslashes($_GET['patientName'])); $patientMobile =htmlspecialchars(stripslashes($_GET['patientMobile'])); $code =htmlspecialchars(stripslashes($_GET['code'])); $bookedBy =htmlspecialchars(stripslashes($_GET['bookedBy'])); $gender =htmlspecialchars(stripslashes($_GET['gender'])); $visitDate =htmlspecialchars(stripslashes($_GET['visitDate'])); $tests =htmlspecialchars(stripslashes($_GET['tests'])); $specialInstructions =htmlspecialchars(stripslashes($_GET['specialInstructions'])); $address_line1 =htmlspecialchars(stripslashes($_GET['address_line1'])); $address_city =htmlspecialchars(stripslashes($_GET['address_city'])); $address_state=htmlspecialchars(stripslashes($_GET['address_state'])); $address_pincode =htmlspecialchars(stripslashes($_GET['address_pincode'])); $address_country =htmlspecialchars(stripslashes($_GET['address_country'])); $leaddate=date("Y-m-d",strtotime("now")); $subject="New Lead from Pan Lybrate By- ".$patientMobile; $body="

Dear Team,

lead Id: ".$leadid."
Patient Name: ".$patientName."
Patient Mobile: ".$patientMobile."
Code:".$code."
Booked By:".$bookedBy."
Gender: ".$gender."
Visit Date: ".$visitDate."
Tests: ".$tests."
Special Instructions: ".$specialInstructions."
Address Line1:".$address_line1."
address City:".$address_city."
Address State:".$address_state."
Address Pincode:".$address_pincode."
Address Country:".$address_country."
Service Mode:".$servicemode."

Click Here To View Form

With Regards,
IT Team

"; // echo $body; // http://support.metropolisindia.com/mhl/lybrate_leads.php?patientName=Dummy patient&patientMobile=9022464280&code=1234444&bookedBy=sneha&visitDate=&gender=F&tests=dummy&address_line1=dummy&address_city=Mumbai&address_state=STATE&address_pincode=400002&address_country=COUNTRY // http://support.metropolisindia.com/mhl/lybrate_leads.php?patientName=Dummy patient&patientMobile=9022464280&code=1234444&bookedBy=sneha&visitDate=&gender=F&tests=COMMA_SEPARATED_IF_SPECIFIED&specialInstructions=IF_PROVIDED&address_line1=Dadar Worli&address_city=Pune&address_state=MAHARASHTRA&address_pincode=400007&address_country=India // http://support.metropolisindia.com/mhl/lybrate_leads.php?patientName=Dummy patient&patientMobile=9022464280&code=1234444&bookedBy=sneha&visitDate=12-08-2014&gender=F&tests=COMMA_SEPARATED_IF_SPECIFIEDspecialInstructions=IF_PROVIDED&address_line1=ADDRESS_LINE1&address_city=Mumbai&address_state=STATE&address_pincode=400002&address_country=COUNTRY //

Click Here To View Form

$to=array(); $sql=" SELECT location_id from lybrate_location WHERE location_name = '$address_city' ; "; // $sql=" SELECT location_id from lybrate_leads_location WHERE location_name = '$address_city' and location_name != 'Mumbai' ; "; $rec = $mysqldb->fetchall($sql) ; $location_id =$rec[0]["location_id"]; if(isset($location_id)) { $sql=" SELECT a.email from lybrate_location_user a inner join lybrate_location b on (a.location_id=b.location_id) WHERE b.location_name='$address_city' and a.email_flag ='1' "; $rsarr = $mysqldb->fetchall($sql) ; foreach($rsarr as $k=>$row) { array_push($to,$row['email']); } } else { $to=array("santosh.kumbhar@metropolisindia.com"); } $cc=array("it.support@metropolisindia.com"); // ,"sneha.anaokar@metropolisindia.com" $from="it.support@metropolisindia.com"; //if($dnc==0){ send_mail($subject,$from,$to,$cc,$body,$textbody); } catch (Exception $e) { //var_dump($e); $sql="INSERT INTO lybrate_leads_log_error( 'leaddate', leadid, patientName, patientMobile, code, bookedBy, gender, visitDate, tests, specialInstructions, address_line1, address_city, address_state, address_pincode, address_country ) VALUES ( $leaddate, $leadid, $patientName, $patientMobile, $code, $bookedBy, $gender, $visitDate, $tests, $specialInstructions, $address_line1, $address_city, $address_state, $address_pincode, $address_country ) ;"; $mysqldb->query($sql); } //echo $sql."
"; echo "Success"; function send_mail($subject,$from,$to,$cc,$htmlbody,$textbody) { $config = array('auth' => 'login', 'username' => 'it.support@metropolisindia.com', 'password' => 'metropolis', 'ssl' => 'tls'); $tr = new Zend_Mail_Transport_Smtp('192.168.23.66' , $config); Zend_Mail::setDefaultTransport($tr); $mail = new Zend_Mail(); $mail->setFrom((string)$from); foreach ($to as &$value) { $mail->addTo((string)$value); } if (isset($cc)) { foreach ($cc as &$value) { $mail->addCc((string)$value); } } $mail->setSubject((string)$subject); if($textbody=='') { $mail->setBodyHtml((string)$htmlbody); } if($htmlbody=='') { $mail->setBodyText((string)$textbody); } try { $mail->send($tr); } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; } } ?>