Jump to content

Naseem

New Members
  • Posts

    2
  • Joined

  • Last visited

Naseem's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a HTML form with a drop down list, which has my entire buyers list populated from the database. In addition to that, I have an option on the top of the drop down such as : <select name="sms_buyer"> <option value="alll">ALL</option> <?php require_once '../model/notifications.php'; @$result2= Notifications::getAllBuyers(); while($value2=mysql_fetch_assoc($result2)){ ?> <option value="<?php echo $value2['buyer_code']; ?>"> <?php echo $value2['buyer_name'] ?> </option> <?php } ?> </select> In the Controller I have the following code segment: function sendNotificationSMS(){ $sms_buyer=$_REQUEST['sms_buyer']; $sms_message=$_REQUEST['sms_message']; $sender='MY CLIENT'; $url='http://localhost:9333/ozeki?'; $url.="action=sendMessage"; $url.="&login=admin"; $url.="&password=abc123"; $obj=new Notifications(); if($sms_buyer=='alll'){ require_once '../model/notifications.php'; $obj=new Notifications(); $result=$obj->getAllBuyers(); while($value=mysql_fetch_assoc($result)){ $rec[]=$value['tel_no']; } foreach ($rec as $recepient) { $url.="&recepient=".urlencode($recepient); } } else{ $res=$obj->getBuyerTelNo($sms_buyer); $sms=mysql_fetch_assoc($res); $recepient=$sms['tel_no']; $url.="&recepient=".urlencode($recepient); } $message=$sms_message; $message.=' Thank You.'; $url.="&messageData=".urlencode($message); $url.="&sender=".urlencode($sender); file($url); header("location:../view/send_notifications.php?s=3#sent"); } If I type print_r($url), the output which I am intending is not appearing... Sending SMS to a single recepient is fine. The problem is sending sms to multiple recepients. Any help is appreciated. Thanks.
  2. I need a map which locates all the stores addresses(Less than 10). Those address must be retreived from the database. But the database don't contain any lat or long field. Therefore geocoding an address into their corresponding lat and long coordinates must be done and appropriate markers must be placed. The code which I have at the moment is as follows:- <?php require_once '../model/stores.php'; $obj=new Stores(); $result=$obj->getStores(); $new_array = array(); while($row=mysql_fetch_assoc($result)){ $new_array[] = $row['stores_address']; } $add_js = json_encode( $new_array ); ?> <html> <head> <style> #map_canvas { width: 500px; height: 500px; } </style> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> <script> $(document).ready(function () { var map; var elevator; var myOptions = { zoom: 1, center: new google.maps.LatLng(0, 0), mapTypeId: 'terrain' }; map = new google.maps.Map($('#map_canvas')[0], myOptions); //var addresses = ['Norway', 'Africa', 'Asia','North America','South America']; var addresses = <?php echo $add_js ?>;; for (var x = 0; x < addresses.length; x++) { $.getJSON('http://maps.googleapis.com/maps/api/geocode/json? address=' +addresses[x]+'&sensor=false', null, function (data) { var p = data.results[0].geometry.location var latlng = new google.maps.LatLng(p.lat, p.lng); new google.maps.Marker({ position: latlng, map: map }); }); } }); </script> </head> <body> <div id="map_canvas"></div> </body> </html> I have looked on various forums and other web resources but no use as none of them worked out for me...Hope any genius would help me to solve the problem.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.