Jump to content

Wingthor

Members
  • Posts

    44
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Sweden

Wingthor's Achievements

Newbie

Newbie (1/14)

4

Reputation

  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...
×
×
  • Create New...