123456789101112131415161718192021222324252627282930313233343536373839 |
- <?PHP
-
- require_once('settings.php');
-
- mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS);
- mysql_select_db(MYSQL_DB);
-
- function m($sql) {
- return mysql_real_escape_string($sql);
- }
-
- function Oblong($message) {
- $key = trim(file_get_contents('/home/chris/oblong.key'));
- $chan = '#MD87.highvol';
-
- $fp = @fsockopen("oblong.md87.co.uk", 3302, $errno, $errstr, 30);
- if ($fp) {
- $out = $key.' '.$chan.' '.substr($message, 0, 460)."\n";
- fwrite($fp, $out);
- fclose($fp);
- }
- }
-
- function getStatusCodeReason($code) {
- switch ((int) $code) {
- case 2: return 'no IMEI code was specified';
- case 3: return 'no activity was specified';
- case 4: return 'no application version was specified';
- case 5: return 'no sensor data was included';
- case 6: return 'an invalid date was specified';
- case 7: return 'insufficient sensor data was included';
- case 8: return 'the sensor data was already submitted (duplicate)';
- case 9: return 'the sensor data contained long periods of identical values';
- }
-
- return 'unknown reason';
- }
-
- ?>
|