Jump to content

Wingthor

Members
  • Posts

    44
  • Joined

  • Last visited

Everything posted by Wingthor

  1. A cron task will do the job, for those who has linux based server. Not sure about those with a windows based server...
  2. I know there is a trigger function built in with Mysql, I think will have a look at that. http://dev.mysql.com/doc/refman/5.0/en/triggers.html
  3. Ok, that helped me alot. The php variant returns blank, but putting the action.php into the XMLHttpRequest.open method's URL works perfect. Now the XMLHttpRequest responseText returns what I want and nothing more! Thanks alot!!! Regards
  4. Seems like something happens when I use URL directly to the php file. The tag returns empty. Seems like I must build an independently library file. Anyone?
  5. Then you understand twice as much as me You must understand AJAX to understand. As we speak I have tried an other method which seems to give med the same result: document.getElementById("main_time").innerHTML = <?php $SITE_URL . "/mymodule/getGmt"; ?>;
  6. Wingthor

    Ajax/PHP/VMS

    I am building a module for PHPVms which I wan't to be AJAX driven. When passing an URL through the to the PHPVms website by a XMLHttpRequest, I want my module's public function to 'echo' a variable to the Javascript. But phpvms send all the headers and the whole site again, even if the modules function only echoes out a variable. Is there a way to prevent phpvms to resend the whole page? I am using the open method with GET, url and async = true. And I am receiving responseText, which I only wan't to be an variable used in an innerHTML tag. The PHP function is just echo "blah blah blal"; Can anyone help me with this? Regards. Wingthor.
  7. Ok, but also remember that MySQL you can download and run from your PC. Just dump your phpvms DB or the airports tbl, with the backup function in phpMyAdmin and get into your local Mysql where you have all grants. In case it will not work. I am using heidiSQL to manipulating the DB. http://www.heidisql.com/download.php
  8. And check that you have 'EXECUTE' rights from localhost on the DB.
  9. Which version of MySql do you have. http://dev.mysql.com/doc/refman/5.1/en/stored-programs-logging.html I works fine on my MySql 5.0.75.
  10. Yes, run as SQL... And add fucntion before QRY's. As you can see the QRY use calls to the function. You need directly access to the DB as this is pure SQL. So if you have phpMyAdmin paste in as SQL and run it. I don't have phpMySQL, right now. So my instruction can only be bried. But as I remember there was an option to run SQL on a DB when you have selected it. But im sure there is experienced phpMyAdmins users on the forum which can give more detailed instruction on how to run SQL from phpMyAdmin. Check this http://community.mybb.com/thread-4720.html I can't verify of mentions reasons...
  11. Well since no one came up with a link, I had to find my own solution which I think i so briliant that I will share it with you. Adding schedules is a hack, adding airports is not. An obvousily you don't want a schedule for an airport that is not in your DB. Most of you will have accsess to send queries directly to the DB by, webmin, phpmyadmin heidi sql or even odbc. So why don't add the greatcircle formula to the phpvms DB, and get the airports data straigt from the DB. SET GLOBAL log_bin_trust_function_creators=TRUE; DROP FUNCTION IF EXISTS GreaterCircleNm; DELIMITER go CREATE FUNCTION GreaterCircleNm( lat1 FLOAT, lon1 FLOAT, lat2 FLOAT, lon2 FLOAT ) RETURNS float BEGIN DECLARE pi, q1, dist FLOAT; SET pi = PI(); SET lat1 = lat1 * pi / 180; SET lon1 = lon1 * pi / 180; SET lat2 = lat2 * pi / 180; SET lon2 = lon2 * pi / 180; SET q1 = ACOS(sin(lat1)*sin(lat2)+COS(lat1)*COS(lat2)*COS(lon1-lon2)); SET dist = q1*180*60/pi; RETURN dist; END; go DELIMITER ; Make sure it goes in your phpvms DB. So I lets say I wan't generate routes to and from all the airports in my DB... SELECT NULL, depart.icao, arrive.icao, ROUND(GreaterCircDistNm(depart.lat,depart.lng,arrive.lat,arrive.lng),2) as Nm FROM airports AS depart INNER JOIN airports AS arrive ON depart.icao <> arrive.icao There you go now you have a node between every node in you selection which easely can be exported as CVS. But just to show the briliance. I have a aircraft which has a limit on 1000NM, I whish the plane to be station at London HTRW. 'EGLL'.... Well into the QRY it goes... SELECT NULL, depart.icao, arrive.icao, ROUND(GreaterCircDistNm(depart.lat,depart.lng,arrive.lat,arrive.lng),2) as Nm FROM airports AS depart INNER JOIN airports AS arrive ON depart.icao <> arrive.icao where depart.icao = 'EGLL' HAVING Nm <= 1000; And there you have a circle. Get it into your sheet template, and sky is the limit..... Regards...
  12. Indeed, http://www.php.net/manual/en/ref.session.php. Thanks!
  13. I have read the API's documentataion regarding sending variables to scrips using the URL. Like index.php/moduletest/pageone/apple/red Gives the varible 'apple' the value 'red' to the script function pageone However I wan't a module to remember the setting, while fetching an other variable, like /beer/isgood. Next time the page is loaded the scripts remember that the user already has seleced red apples, when the user select the option beer is good. Then can process a page based on these settings? I am gone use this for creating dynamic SQL's where the where clause might cange, in terms of value and number of criterias given. Eg, first click filters on pilotid, next click filter on bids, and so on. Regards
  14. Don't know, guess they want to see upcoming flights? I would choose from both, and perhaps even bids. Did it work?
  15. I might talk over my head now, but you can try to change the "from" clause in the SQL you are using to acarsdata. SELECT * FROM acarsdata ORDER BY deptime + 0 ASC And see if you get any... Perhaps also after $list = DB::get_results($query); if (empty($list)) { echo "No one is flying to day"; exit; } But you are on your own here...
  16. Ok, from my understanding of the thread, the data shows flights according to schedule. Not live flights. Maybe I am wrong
  17. Not sure what you mean, but there might an issue with the table prefix.
  18. Or as an real board, you make two arrays, where you have one for arrivals and one for departures. Just add to the where clause after '6') to the where clause eg. Arrivals: AND depicao = 'EGGL' Departures: AND arricao = 'EGGL' Regards
  19. I am not sure if this would help, but in my phpvms DB the table for schedules is named schedules not phpvms_schedules, so check it out. Guess you get that error since array list$ is empty, due to the naming error of the table in the SQL. To get date converted. You seem to not need all the fields in the query, use rather this selec function: select id, depicao, arricao, date_format(convert_TZ(concat(curdate()," ", left(deptime,5)) , '+00:00','+2:00'),'%T') as 'deptime', date_format(convert_TZ(concat(curdate()," ", left(arrtime,5)), '+00:00','+2:00'),'%T') as 'arrtime', aircraft, daysofweek from schedules where instr(daysofweek,'6')>0 order by arrtime ASC Make a php variable which finds out which day of week it is, and convert to a value that fits in with the daysofweek field. <$php $curday=cal_to_jd(CAL_GREGORIAN,date("m"),date("d"),date("Y")); ?> or something... and put $curday in to where clause rather than six. This query will select all flight for a saturday. To convert the time to local, change the timenumbera after the both '+' om the sql. The first is the time relative to GMT and second is your relative to GMT. I have not testet other than as pure SQL directly on the server. So test at own risk. Regards
  20. Think I will just make a module which parses to the exisitng awards table. But also make an verify option, so you actually have to confirm the award before actually given. So that the module will be more like a "awards recomendation" thing. It's kind of an irreversible ting, you don't withdraw an award likely. OT: (Like your logo though, FLST here...)
  21. Yes, you have to change to URL. Assumingen the files has been copied in the directories as described, you just add /index.php/TouchdownStats/top_landing_this_month to you site's URL. When I click on the URL you sent the page comes up fine? Regards
  22. Since my database is quite sparse, I am not sure, but I think the following sql will give you best landing grouped by month and pilot for a given year. You can test if you have webmin, phpmyadmin or heidi SQl Whatevere. Perhaps that is interestning? SELECT pilotid, date_format(submitdate,'%M') as month, code, flightnum, depicao, arricao, aircraft, max(landingrate) as 'best landing', format(avg(landingrate),2) as 'average', submitdate FROM `pireps` group by month(submitdate),(pilotid) having year(submitdate)=2011 Change year to whatever you like...
  23. Probably 100 ways tu fix, but add and year(submitdate) = year(curdate()) after the month(now()) clause
×
×
  • Create New...