Jump to content

malkocoglu

Members
  • Posts

    32
  • Joined

  • Last visited

About malkocoglu

  • Birthday 06/06/1977

Profile Information

  • Gender
    Male
  • Location
    London
  • Age
    35

malkocoglu's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I get it now. Brilliant idea. Thank you guys.....
  2. Thank you guys for prompt answer. The difficulty I will have with that is that I say saloon car can take 2 large 1 small which is 3 suitcases. If I allow them to choose 3 suitcases in total then they could choose 3 large suitcase which will not fit in a saloon car. Hope it makes sense...
  3. Hello All, I need to figure out a way to get a value from data base. The difficulty is that the query will be based on a form request. I have a table called VEHICLES. And I need to pull all values using the data from submitted form field of passengers, large_bags, small_bags by visitor. This table contains different vehicles like a Saloon car which can take up to 4 passengers, 2 large bags and 1 small bag So Example. If a visitor Selects 2 Passengers, 2 Large Bags and 0 Small Bags. It should only pull the vehicle which can take 2 Passengers, 2 Large Bags. current code I have is like this which only selects a specific value from the table. It does not SELECT * FROM vehicles WHERE passengers ='$passengers' AND large_case='$large_bags' AND small_case='$small_bags' This will only return the value according to what ever the visitor select and because of that 32 Saloon vehicle needs to be created which is not practical. I need to make a code that calculates the option using the values from the form and pulls only the vehicle which is suitable for the entered value Example: We have following vehicles; Salooon => up to 4 Passengers, 2 Large Bags, 1 Small Bag Estate => up to 4 Passengers, 4 Large Bags or 3 Large bags and 2 Small Bag or 2 Large Bags and 4 Small bags or some other combunations MPV => Up to 6 Passengers, 3 Large Bags and 2 Small Bags or other combinations Minibus => Up to 8 Passengers and 10 Large Bags and 5 Small bags or other combinations of large and small bags Form Entry: 3 Passengers + 3 Large Bags + 2 Small Bags This should only Return ESTATE. I hope I could explain enough.
  4. // First, we need to take their postcode and get the lat/lng pair: $postcode = $_REQUEST['postcode']; // Sanitize their postcode: $search_code = urlencode($postcode); $url = 'http://maps.googleapis.com/maps/api/geocode/json?address=' . $search_code . '&sensor=false'; $json = json_decode(file_get_contents($url)); $lat = $json->results[0]->geometry->location->lat; $lng = $json->results[0]->geometry->location->lng; // Now build the lookup: $address_url = 'http://maps.googleapis.com/maps/api/geocode/json?latlng=' . $lat . ',' . $lng . '&sensor=false'; $address_json = json_decode(file_get_contents($address_url)); $address_data = $address_json->results[0]->address_components; $street = str_replace('Dr', 'Drive', $address_data[1]->long_name); $town = $address_data[2]->long_name; $county = $address_data[3]->long_name; $city = $address_data[4]->long_name; $country = $address_data[5]->long_name; $array = array('street' => $street, 'town' => $town, 'city' => $city, 'country' => $country); //echo json_encode($array); echo $array = implode(", ",$array);
  5. // First, we need to take their postcode and get the lat/lng pair: $postcode = $_REQUEST['postcode']; // Sanitize their postcode: $search_code = urlencode($postcode); $url = 'http://maps.googleapis.com/maps/api/geocode/json?address=' . $search_code . '&sensor=false'; $json = json_decode(file_get_contents($url)); $lat = $json->results[0]->geometry->location->lat; $lng = $json->results[0]->geometry->location->lng; // Now build the lookup: $address_url = 'http://maps.googleapis.com/maps/api/geocode/json?latlng=' . $lat . ',' . $lng . '&sensor=false'; $address_json = json_decode(file_get_contents($address_url)); $address_data = $address_json->results[0]->address_components; $street = str_replace('Dr', 'Drive', $address_data[1]->long_name); $town = $address_data[2]->long_name; $county = $address_data[3]->long_name; $city = $address_data[4]->long_name; $country = $address_data[5]->long_name; $array = array('street' => $street, 'town' => $town, 'city' => $city, 'country' => $country); //echo json_encode($array); echo $array = implode(", ",$array);
  6. So can I do this with mysql too. Can the following code output the same result? ($pickup is populated from database) $pickup= array ($pickup); natsort($pickup); echo '<pre>',print_r($pickup, true),'</pre>';
  7. Hello, I have the following code to get data from mysql. SELECT COUNT(*),pickup FROM journeys WHERE pickup_type='postcode' GROUP BY pickup HAVING COUNT(*)>=1 The result is like this; E1 E10 E11 E12 E13 E2 E3 E4 ....... I need to display the data starting from E1 ...... to ....E13 (or whatever the last entry is). Could anyone help? Regards
  8. Update: I managed to changed the payment status to "Completed" but I still dont get the email confirming that. see code below if ($payment_status == "Completed"){ mail('testemail@gmail.com', 'IPN Progress', 'Section 4 Completed'); }
  9. Quick Update, I found out that the payment status is "Pending". I am not sure why but this is why the section 4 is not completed. So could anyone tell me how to change the status to "Completed"
  10. Ok, I have the follwing code. I inserted mail() functions to check the process of the codes. Emails come up to Section 3 Completed and stops. So there is a little problem with section 4. I think payment status is not Completed but I am not sure how to check that. Could anyone give me his opinion how to go from here? <?php ini_set('log_errors', true); ini_set('error_log', 'ipn_errors.log'); //connect to database //$error = "Problem connecting"; //mysql_connect('localhost','_prince','getmeout') or die($error); //mysql_select_db('hmt_cms') or die($error); mail('email@gmail.com', 'IPN Progress', 'Section 1 Completed'); // read the post from PayPal system and add 'cmd' $req = 'cmd=_notify-validate'; foreach ($_POST as $key => $value) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; } mail('email@gmail.com', 'IPN Progress', 'Section 2 Completed'); // post back to PayPal system to validate $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; $fp = fsockopen ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30); mail('email@gmail.com', 'IPN Progress', 'Section 3 Completed'); // assign posted variables to local variables $item_name = $_POST['item_name']; $item_number = $_POST['item_number']; $payment_status = $_POST['payment_status']; $payment_amount = $_POST['mc_gross']; $payment_currency = $_POST['mc_currency']; $txn_id = $_POST['txn_id']; $receiver_email = $_POST['receiver_email']; $payer_email = $_POST['payer_email']; if (!$fp) { mail('email@gmail.com', 'IPN Progress', 'IPN Error 1'); } else { fputs ($fp, $header . $req); while (!feof($fp)) { $res = fgets ($fp, 1024); if (strcmp ($res, "VERIFIED") == 0) { if ($payment_status == "Completed") { mail('email@gmail.com', 'IPN Progress', 'Section 4 Completed'); if ($payment_amount==0.01 && $payment_currency=="GBP") { mail('email@gmail.com', 'IPN Progress', 'Section 5 Completed'); //$update = mysql_query("UPDATE cms SET premium='1' WHERE email='$payer_email'"); } } // check the payment_status is Completed // check that txn_id has not been previously processed // check that receiver_email is your Primary PayPal email // check that payment_amount/payment_currency are correct // process payment } else if (strcmp ($res, "INVALID") == 0) { // log for manual investigation mail('email@gmail.com', 'IPN Progress', 'IPN Error 2'); } } fclose ($fp); } ?>
  11. Thanks for the reply, I already have and i couldnt find the information I needed.
  12. Hello everyone, I have been searching on internet about using paypal payment for a minicab booking form I havebut I couldnt find anything that I could use. What I have; The visitor comes to website and start completing the form. They get a price on the second page and the third page is the process page. The data goes to database and customer gets an email and the website admin gets the booking form in email. What I want to do; I want to enable paypal payment so visitor can pay for the minicab journey online. I need the get this working in a way that visitor gets the second page and sees the price, clicks Book & Pay by paypal button and visitor is redirected to paypal for payment, after payment, all the data enters the database (The variables are about 10-15) and customer gets the email and also lands on the success page. If the payment is not successfull then nothing goes to data base and visitor does not get email and visitor then is redirected to cancellation page. I hope I could explained, Could anyone help me how to do it or where I can find the information I needed. Regards
  13. Hello, That is what i need to find out. How to do it with Ajax.
  14. Quick update: I have managed to solve the first part where multiple same value to display one by the following code; $sql = "SELECT COUNT(*),pickup FROM journeys GROUP BY pickup HAVING COUNT(*)>=1"; $retval = mysql_query( $sql ); if(!$retval){die('Could not get data: ');} Now i need to load the second SELECT BOX with data from where pickup is first SELECT BOX as mention above by Freak Dr. Any idea anyone?
×
×
  • 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.