This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Server file | |
class PushNotifications { | |
// (Android)API access key from Google API's Console. | |
private static $API_ACCESS_KEY = 'AIzaSyDG3fYAj1uW7VB-wejaMJyJXiO5JagAsYI'; | |
// (iOS) Private key's passphrase. | |
private static $passphrase = 'joashp'; | |
// (Windows Phone 8) The name of our push channel. | |
private static $channelName = "joashp"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE FUNCTION `lat_lng_distance` (lat1 FLOAT, lng1 FLOAT, lat2 FLOAT, lng2 FLOAT) | |
RETURNS FLOAT | |
DETERMINISTIC | |
BEGIN | |
RETURN 6371 * 2 * ASIN(SQRT( | |
POWER(SIN((lat1 - abs(lat2)) * pi()/180 / 2), | |
2) + COS(lat1 * pi()/180 ) * COS(abs(lat2) * | |
pi()/180) * POWER(SIN((lng1 - lng2) * | |
pi()/180 / 2), 2) )); | |
END |