Jump to content

Vatsim Pilots info


bass

Recommended Posts

a small code that displays information on the VATSIM pilot
in order to work the script I made in the database phpvms_pilots column "CID" and put in his ID number vatsim pilots.

2017-01-17_232609.jpg

 

<div class="col col_5_of_12">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-wifi" aria-hidden="true"></i> Vatsim Pilot </h3>
</div>
<div class="panel-body">
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://api.vateud.net/members/id/$userinfo->cid.json");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
$response = curl_exec($ch);
curl_close($ch);
$json=json_decode($response,true);
?>

<div id="vf">
<ul class="blocklist">
  <li>Дивизион : <?php echo $json['division']; ?></li>
  <li>Ранг Vatsim : <?php echo $json['humanized_pilot_rating']; ?></li>
  <li>Регион : <?php echo $json['region']; ?></li>
  <li>country : <?php echo $json['country']; ?></li>
</ul>
</div>
</div>
</div>                        
</div>

 

Link to comment
Share on other sites

I tried to put this code in the query, but it doesn't work(

<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://api.vateud.net/members/id/$userinfo->cid.json");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
---------------------------------------------------


"http://api.vateud.net/members/id/$userinfo->cid.json"

$userinfo->cid = <?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?>

<?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?>

Link to comment
Share on other sites

<?php $cidvatsim = PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?>
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://api.vateud.net/members/id/$cidvatsim.json");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
$response = curl_exec($ch);
curl_close($ch);
$json=json_decode($response,true);
?>

<div id="vf">
<ul class="blocklist">
  <li>Дивизион : <?php echo $json['division']; ?></li>
  <li>Ранг Vatsim : <?php echo $json['humanized_pilot_rating']; ?></li>
  <li>Регион : <?php echo $json['region']; ?></li>
  <li>country : <?php echo $json['country']; ?></li>
</ul>

 

Link to comment
Share on other sites

  • 1 month 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...