Advertisement
Guest User

Untitled

a guest
Aug 14th, 2012
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.73 KB | None | 0 0
  1. <?php
  2.  
  3. echo '<table width="100%"';
  4.  
  5.  
  6. // error handler function
  7. function myErrorHandler($errno, $errstr, $errfile, $errline)
  8. {
  9.     switch ($errno) {
  10.     case E_USER_ERROR:
  11.         echo '<b>My ERROR</b> [$errno] $errstr<br />n';
  12.         echo '  Fatal error on line $errline in file $errfile';
  13.         echo ', PHP ' . PHP_VERSION . ' (' . PHP_OS . ')<br />n';
  14.         echo 'Aborting...<br />n';
  15.         exit(1);
  16.         break;
  17.  
  18.     case E_USER_WARNING:
  19.         echo '<b>My WARNING</b> [$errno] $errstr<br />n';
  20.         break;
  21.  
  22.     case E_USER_NOTICE:
  23.         echo '<b>My NOTICE</b> [$errno] $errstr<br />n';
  24.         break;
  25.  
  26.     default:
  27.         //echo "Unknown error type: [$errno] $errstr $errline in
  28. $errfile;
  29.         break;
  30.     }
  31.  
  32.     /* Don't execute PHP internal error handler */
  33.     return true;
  34. }
  35.  
  36.  
  37. // set to the user defined error handler
  38. $old_error_handler = set_error_handler("myErrorHandler");
  39.  
  40. //OPEN UP THE VATSIM STATS FILE
  41.     $row_count = 0;
  42.    $color1 = "#F5F5F5";
  43.    $color2 = "#FFFFFF";
  44.    if(file_exists("C:\\nesto\\xampp\htdocs\scgvacc\status\data\status.txt")){
  45.    $fp = fopen("C:\\nesto\\xampp\htdocs\scgvacc\status\data\status.txt", "r");
  46.      
  47.  
  48.        while (!feof($fp))
  49.          {
  50.            $line = fgets($fp, 999);
  51.          
  52.          
  53. //Put the Callsign Prefixes in : e.g. if callsign = VTBB_CTR enter VTBB or
  54. if(preg_match('/^(LYBA|LYBE|LYPG|LYNI|LYTV|)_[A-Z0-9]*_*(TWR|APP|CTR)/',
  55. $line))
  56.            {
  57.                   list($position, $cid, $name, $clienttype, $frequency,
  58. $latitude, $longitude, $altitude, $groundspeed, $planned_aircraft,
  59. $planned_tascruise, $planned_depairport, $planned_altitude,
  60. $planned_destairport, $server, $protrevision, $rating, $transponder,
  61. $facilitytype, $visualrange, $planned_revision, $planned_flighttype,
  62. $planned_deptime, $planned_actdeptime, $planned_hrsenroute,
  63. $planned_minenroute, $planned_hrsfuel, $planned_minfuel,
  64. $planned_altairport, $planned_remarks, $planned_route,
  65. $planned_depairport_lat, $planned_depairport_lon,
  66. $planned_destairport_lat,
  67. $planned_destairport_lon, $atis_message, $time_last_atis_received,
  68. $time_logon, $heading) = split(":", $line);
  69.          if($rating == 1) { $rating = "Observer"; }
  70.          if($rating == 2) { $rating = "Ground Controller"; }
  71.          if($rating == 3) { $rating = "Tower Controller"; }
  72.          if($rating == 4) { $rating = "Approach Controller"; }
  73.          if($rating == 5) { $rating = "Controller"; }
  74.          if($rating == 7) { $rating = "Senior Controller"; }
  75.          if($rating == 8) { $rating = "Instructor"; }
  76.          if($rating == 10) { $rating = "Senior Instructor"; }
  77.          if($rating == 11) { $rating = "Supervisor"; }
  78.          if($rating == 12) { $rating = "Administrator"; }
  79.          $rowcolor = ($row_count % 2) ? $color1 : $color2;
  80.          $newatis = str_replace('^§', '<br>', $atis_message);
  81.          $newatis = str_replace("'", "", $newatis);
  82.          $newatis = str_replace('"', "", $newatis);
  83.  
  84. /* this is where the table and checking should go */
  85.  
  86.  
  87.  
  88.  
  89.  
  90.          $row_count++;
  91.            }
  92.      }
  93. echo '</table>';
  94. echo '<table width="200" align="center" cellpadding="2" cellspacing="0">';
  95.  
  96.  
  97. if($row_count == 0)
  98.    {
  99.       echo '<tr><td align="center"><br>There are no controllers
  100. online.</td></tr>';
  101.    }
  102. else if($row_count == 1)
  103.    {
  104.       //MODIFY NEXT LINE WITH CORRECT ICAO FOR YOUR ARTCC/FIR
  105.       echo '<tr><td align="center"><br><font size="1">Currently 1 SCGvACC
  106. Controller Online</font></td></tr>';
  107.    }
  108. else
  109.    {
  110.             //MODIFY NEXT LINE WITH CORRECT ICAO FOR YOUR ARTCC/FIR
  111.          echo '<tr><td align="center"><br><font size="1">Currently ';
  112.          echo  $row_count;
  113. echo " SCGvACC Controllers Online</font></td></tr>";
  114.    }
  115. }
  116.  
  117. echo '</table>';
  118. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement