Jump to content

vlowe

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

vlowe's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hi, i am trying to filter my gps history points. i would like to ignore points if they are too close to the previous position. i can do this like so. $old_lat = $old_long = "0"; foreach($history['data'] as $record) { //calculate distance in meters $distance = distance($record['latitude'], $record['longitude'], $old_lat, $old_long, "V"); if($distance >= 300) { echo 'add(jQuery(this), number += 1, "' . date("d-m-Y @ h:i:s",$record['timestamp']) . '", "map_post.php?n=' . $name . 'u=' . $history['user'] . '", "' . $history['user'] . '", "' . $record['latitude'] . '", "' . $record['longitude'] . '");'; $old_lat = $record['latitude']; $old_long = $record['longitude']; } the problem with the above is that if i arrive home at 6pm on friday and stay outside my house for 24hours, it will show the latest position as at 6pm on fri. i would like it to show the 6pm friday position but with a date 'from and to' time like (28/10/11 18:00 - 29/10/11 18:00) rarther than just (28/10/11 18:00) which looks inacurate. Possible?
  2. Hi i am looping through some history data i have collected via soap. i have the data in an array containing lat, lon and timestamp. foreach($history['data'] as $record) { echo 'add(jQuery(this), number += 1, "' . date("d-m-Y @ h:i:s",$record['timestamp']) . '", "map_post.php?n=' . $name . 'u=' . $history['user'] . '", "' . $history['user'] . '", "' . $record['latitude'] . '", "' . $record['longitude'] . '");'; } i wondered it it would be possible to check if each position is within say 300 metres of the last position and if so dont display it?
  3. LOL seems obvious now, thank for that. im not selecting from database im getting data from soap.
  4. hi i have an array that returns the longitude, latitude and timestamp of multiple users. then i use a for each loop to echo the details to add markers to google maps. the problem is that if one of the users has no gps position i dont want to include it it my foreach loop. foreach($positions as $name => $status) { echo 'add(jQuery(this), number += 1, "' . $name . '", "map_post.php?n=' . $name . '&u=' . $status['user_id']. '", "' . date("d-m-Y @ h:i:s",$status['timestamp']) . '", "' . $status['latitude'] . '", "' . $status['longitude'] . '", "' . $status['user_id']. '");'; } how can i get the foreach to ignore the users with no data?
  5. i think i have it <? session_start(); $sendAfter = (10)*(60); // in seconds $sendEmail = false; $now = date('Y-m-d H:i:s'); if(!isset($_SESSION['sent_time'])) // if you are first time send email { $sendMail = true; $_SESSION['sent_time'] = $now; } else { $diff = strtotime($now) - strtotime($_SESSION['sent_time']); if($diff >= $sendAfter)// if difference is more than 10 min then only send mail { $sendMail = true; $_SESSION['sent_time'] = $now; } } if($sendMail) echo "mail sending code here"; else echo "nothing to do"; ?>
  6. cheers voip03 but isnt currenttime always going to be > session sent time? i need to compare the time differance between current time and session sent time, then check if the differance is greater than 10 mins..
  7. the email will only be sent while an alert exists. so if i did something like if((SENDEMAIL == "TRUE") && ($ALERT)) { send_email(); } that will send an email if SENDEMAIL is set to true and an alert is present. so i will then need to record the time the email was sent $_SESSION['sent_time'] = date('h:i:s'); and add to IF somehow to check? if((SENDEMAIL == "TRUE") && ($ALERT) && ($_SESSION['sent_time'] > 10 minutes ago!)) { send_email(); } LOL how can i check if $_SESSION['sent_time'] is greater than 10 mins ago?
  8. Im still trying to work this one out but what i would like to do is send an email if an alert is present. but not resend the email on every page refresh where the alert is still present. so i was thinking of using something like $_SESSION['sent_time'] to record when the last email was sent and only send another email if the current time is greater than 10 mins from the $_SESSION['sent_time']. How can i record the time into the session variable in a format which i can use to compare with the current time? and how will i compare? cheers for any suggestions
  9. Hi, Im trying to do a screen scrape for the first time and can't get my head around it I have tried various tutorials using curl & dom but still cant get the results i want. What im trying to do is scrape the mixes from the main table on this page http://djmix.net/AMP/mixes Im not fussed about the image but i would like all the other info e.g AMP - MIXAMP017 House [79:33] 80 mp3 New stuff and new mixes of old stuff. Light up a cigar and enjoy the ride. Launch Player obviously for each mix in the table And then i will need to fix the link for the title (AMP - MIXAMP017) to point to "http://djmix.net/AMP/MIXAMP017" rarther than "/AMP/MIXAMP017" Can anyone help?
  10. no still dint work. got it working tho using SELECT DISTINCT in sql query.. DOE
  11. Yo frost, when i said both have given the original result i meant both ways have not worked, the still show multiple entries for the same composers. any other ideas?
  12. cheers guys but both solutions have given the same original result. hmmmmmmm
  13. Yea i was just hinking that, here it is. select ARTIST, ORDER from WEBDATA where (order BETWEEN 15 AND 1000) ORDER BY ARTIST
  14. Hey, I am using ODBC to get records from an access database. i want to produce a list of composers as a dropdown box, so i did this: while (odbc_fetch_row($res)) { $composer=odbc_result($res,"ARTIST"); $comid=odbc_result($res,"ORDER"); echo '<option value="' .$comid. '">' .$composer. '</option>'; } but this shows the composers name duplicate times depending on how many albums are available by that composer. how can i strip out the duplicates and show each composers name once? thanks for any help you can provide
  15. no i can see the id is correct in the url $query = "DELETE FROM cru_name WHERE id = 10"; gives the same error  ??? ??? tried $query = "DELETE FROM cru_name WHERE id = '10'"; also but same. can someone post a definate working delete query with the 'mysql_query($query)' bits to execute it. i will try that and see what i get
×
×
  • 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.