Jump to content

Sugestion For Next Version


Recommended Posts

Hello guys, I have a great suggestion to be applied in phpvms.

My friend sent me a code to my application for dynamic signatures (http://www.starflightvirtual.com.br/ credits) and I tried but I could not adapt it to our vms.

I noticed that our signature (background) the codes are located in pilotdata.class from what I remember. Well I'll be leaving here the code of the signature dynamics transforming for someone to be our platform.

For those who do not know what would be a signature dynamics, it's the explanation: it is a sign that connects to the db and FSACARS and so this signing as an ACARS shows some images of every moment of the flight, taxiing, climbing, cruise, and all the situations of a flight, I already did mine, I'll be leaving here to look.

Grateful, waiting for an answer.

<?php


//error_reporting(0);

//CODIGO PROJETADO por Ian D. (Lucas Roquefort) para STARFLIGHT AVIATION VIRTUAL
//http://starflightvirtual.com.br
//antes de alterar ou publicar peça autorizaçao do autor!!!

//$base=$_GET['base'];
$id=$_GET['id'];
//$nome=$_GET['nome'];

$hostName = "localhost";
header("Content-type: image/png");
/* CHANGE THESE LINES BELOW TO YOUR DETAILS */
$userName = "";
$password = "";
$dbName = "";

/* make connection to database */
mysql_connect($hostName, $userName, $password) or die("Unable to connect to host $hostName");
mysql_select_db($dbName) or die("Unable to select database $dbName");

$idn=str_replace(array("STA"), "", $id);

$sql = "SELECT lat, lon, alt, gs, IATA, phase, timeDestApt, depAptICAO, destAptICAO  FROM positions WHERE pilot_num='$idn' AND last_update > DATE_SUB( NOW() , INTERVAL 15 MINUTE )";
$result = mysql_query( $sql );
$dados = mysql_fetch_assoc($result);
@$eta = mysql_result($result,0, "timeDestApt");
@$dep = mysql_result($result,0, "depAptICAO");
@$dest = mysql_result($result,0, "destAptICAO");

$sql = "SELECT * FROM phpbb_profile_fields_data p, phpbb_users u WHERE p.user_id = u.user_id AND pilot_num = '$id'";
$result = mysql_query( $sql );
$nome = mysql_result($result,0,"pf_realname");
$SAVID = mysql_result($result,0,"SAVID");

$query_hours = "SELECT sec_to_time(sum(time_to_sec(t2.duration))) AS duration_sum FROM phpbb_users t1, reports t2 WHERE t1.SAVID=$SAVID AND t1.SAVID=t2.SAVID";
$result_hours = mysql_query($query_hours);
$time = mysql_result($result_hours,0,"duration_sum");




if (mysql_num_rows($result) == 0) {
   ($im = ImageCreateFromPng("imagens/off.png"));
   $corTexto = imagecolorallocate($im, 255, 255, 255);
   imagestring($im, 3, 5, 102, "$id - $nome", $corTexto);
   imagestring($im, 3, 435, 102, "$time", $corTexto);


} elseif ($dados['phase'] == 1 ) {
      $im = ImageCreateFromPng("imagens/embarque.png");
      $corTexto = imagecolorallocate($im, 255, 255, 255);
          imagestring($im, 3, 5, 102, "$id - $nome", $corTexto);
          imagestring($im, 3, 430, 102, "$dep/$dest", $corTexto);
          imagestring($im, 3, 250, 102, "$eta", $corTexto);

      // Boarding 

} elseif ($dados['phase'] == 2 ) {
      $im = ImageCreateFromPng("imagens/taxiparapista.png");
      $corTexto = imagecolorallocate($im, 255, 255, 255);
          imagestring($im, 3, 5, 102, "$id - $nome", $corTexto);
          imagestring($im, 3, 430, 102, "$dep/$dest", $corTexto);
          imagestring($im, 3, 250, 102, "$eta", $corTexto);
      // Taxi From Gate

} elseif ($dados['phase'] == 3 ) {    
      $im = ImageCreateFromPng("imagens/decolando.png");
      $corTexto = imagecolorallocate($im, 255, 255, 255);
          imagestring($im, 3, 5, 102, "$id - $nome", $corTexto);
          imagestring($im, 3, 430, 102, "$dep/$dest", $corTexto);
          imagestring($im, 3, 245, 102, "$eta - $alt", $corTexto);
      // Departing

} elseif ($dados['phase'] == 4 ) {



      $im = ImageCreateFromPng("imagens/subida.png");
      $corTexto = imagecolorallocate($im, 255, 255, 255);
          imagestring($im, 3, 5, 102, "$id - $nome", $corTexto);
          imagestring($im, 3, 430, 102, "$dep/$dest", $corTexto);
          imagestring($im, 3, 245, 102, "$eta - $alt", $corTexto);
      // Climbing

} elseif ($dados['phase'] == 5 ) {


      $im = ImageCreateFromPng("imagens/cruzeiro.png");
      $corTexto = imagecolorallocate($im, 255, 255, 255);
          imagestring($im, 3, 5, 102, "$id - $nome", $corTexto);
          imagestring($im, 3, 430, 102, "$dep/$dest", $corTexto);
          imagestring($im, 3, 245, 102, "$eta - $alt", $corTexto);
      // Cruising

} elseif ($dados['phase'] == 6 ) {



      $im = ImageCreateFromPng("imagens/descida.png");
      $corTexto = imagecolorallocate($im, 255, 255, 255);
          imagestring($im, 3, 5, 102, "$id - $nome", $corTexto);
          imagestring($im, 3, 430, 102, "$dep/$dest", $corTexto);
          imagestring($im, 3, 245, 102, "$eta - $alt", $corTexto);
      // Descending

} elseif ($dados['phase'] == 7 ) {    


      $im = ImageCreateFromPng("imagens/pousando.png");
      $corTexto = imagecolorallocate($im, 255, 255, 255);
          imagestring($im, 3, 5, 102, "$id - $nome", $corTexto);
          imagestring($im, 3, 430, 102, "$dep/$dest", $corTexto);
          imagestring($im, 3, 245, 102, "$eta - $alt", $corTexto);
      // Landed

} elseif ($dados['phase'] == 8 ) {    


      $im = ImageCreateFromPng("imagens/taxiparagate.png");
      $corTexto = imagecolorallocate($im, 255, 255, 255);
          imagestring($im, 3, 5, 102, "$id - $nome", $corTexto);
          imagestring($im, 3, 430, 102, "$dep/$dest", $corTexto);
          //imagestring($im, 3, 250, 102, "$eta", $corTexto);
      // Taxi To Gate

} elseif ($dados['phase'] == 9 ) {  



      $im = ImageCreateFromPng("imagens/desembarque.png");
      $corTexto = imagecolorallocate($im, 255, 255, 255);
          imagestring($im, 3, 5, 102, "$id - $nome", $corTexto);
          imagestring($im, 3, 430, 102, "$dep/$dest", $corTexto);
          //imagestring($im, 3, 250, 102, "$eta", $corTexto);     
      // Arrived at Gate

} else {       


   ($im = ImageCreateFromPng("imagens/off.png"));
   $corTexto = imagecolorallocate($im, 255, 255, 255);
   imagestring($im, 3, 5, 102, "$id - $nome", $corTexto);
   imagestring($im, 3, 435, 102, "$time", $corTexto);


}   









imagepng($im);
imagepng($im, "$id.png");
imagedestroy($im); 

?>

post-386-087612400 1276127081_thumb.png

post-386-054568700 1276127103_thumb.png

post-386-026189800 1276127116_thumb.png

post-386-001100400 1276127126_thumb.png

post-386-043646000 1276127137_thumb.png

post-386-027783100 1276127148_thumb.png

Link to comment
Share on other sites

I've created a output Phasedetail!

here is the code

<?php
     $acars = ACARSData::get_flight_by_pilot($userinfo->pilotid);
?>
<?php echo $acars->phasedetail; ?>

It works perfect!

I needed the dynamic signature I've create this code:

if($status->old <> $status->new)
{ pilotdata::regeneratesiggy($pilot->id);}

Output working perfect in signature, but regenarating doesn't work...

here is a status (Test):  http://live-mix.ath....ures/KNI001.png    (at the left bottom)

Link to comment
Share on other sites

  • Administrators

Guys, I think I have figured out what you are trying to do. I have created a module that creates a "status" image depending on the pilots current flight status. It is similar to the vatsim indicators function except it is tied to the phpvms system.

What I have done,

Get all pilots and check to see if there is acars data available

if there is acars data available check and see if it is more than 10 minutes old

if it is current create a "online" status indicator image with the pilot name, id , flight, and phase detail from acars

if it is more than 10 min old create a "offline" status indicator image with the pilot name, id , flight, and phase detail (should be Arrived) from acars

In the case there is no acars data look for the last pirep

if there is a pirep use the newest one to create a "offline" status indicator image with the pilot name, id , last flight, and the date it was filed as "Last Seen"

if there are no PIREPS filed for the pilot create a "offline" image showing the pilot name and pid and the text "No Flights Filed"

This is all seperate from the signature badges. Is this what you are thinking. This is what I get....

http://www.westjetvirtual.net/index.php/Status/show_all

Link to comment
Share on other sites

Guys, I think I have figured out what you are trying to do. I have created a module that creates a "status" image depending on the pilots current flight status. It is similar to the vatsim indicators function except it is tied to the phpvms system.

What I have done,

Get all pilots and check to see if there is acars data available

if there is acars data available check and see if it is more than 10 minutes old

if it is current create a "online" status indicator image with the pilot name, id , flight, and phase detail from acars

if it is more than 10 min old create a "offline" status indicator image with the pilot name, id , flight, and phase detail (should be Arrived) from acars

In the case there is no acars data look for the last pirep

if there is a pirep use the newest one to create a "offline" status indicator image with the pilot name, id , last flight, and the date it was filed as "Last Seen"

if there are no PIREPS filed for the pilot create a "offline" image showing the pilot name and pid and the text "No Flights Filed"

This is all seperate from the signature badges. Is this what you are thinking. This is what I get....

http://www.westjetvi...Status/show_all

Hello simpilot!

yes this is it!

can you give us your script?

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...
  • 4 weeks later...
  • 3 weeks later...
  • 1 year later...
  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...