Jump to content

The list of pilots and reports as JSON, XML (API)


bass

Recommended Posts

Hi all.
I did a widget for other sites that would show information about my company. 
Has the ability to display code on other sites.

Pilots

<!-- Запрос на получения данных Новые пилоты-->
<?php
$xml = simplexml_load_file("http://exemple.ru/lib/rss/latestpilots.rss");	
$json = json_encode($xml);
$data = json_decode($json, TRUE);
?>
 <table width="500" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>Pilots</td>
  </tr>
<?php 
foreach($data['channel']['item'] as $row)
{  
 ?>  
  <tr>
    <td><?php echo $row['title'];?></td>
  </tr>
  <?php
}
?>
</table>

<!--конец-->

 

Reports

<!-- Запрос на получения данных Крайний рейс-->
<?php
$xml = simplexml_load_file("http://exemple.ru/lib/rss/latestpireps.rss");	
$json = json_encode($xml);
$data = json_decode($json, TRUE);
?>
 <table width="500" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>Pireps</td>
	<td>Pilots</td>
  </tr>
<?php 
foreach($data['channel']['item'] as $row)
{  
 ?>  
  <tr>
    <td><?php echo $row['title'];?></td>
	<td><?php echo $row['description'];?></td>
  </tr>
  <?php
}
?>
</table>
<!--конец-->

 

2017-03-09_105304.jpg

Link to comment
Share on other sites

  • Moderators
On 9/3/2017 at 3:55 AM, bass said:

Hi all.
I did a widget for other sites that would show information about my company. 
Has the ability to display code on other sites.

Pilots


<!-- Запрос на получения данных Новые пилоты-->
<?php
$xml = simplexml_load_file("http://exemple.ru/lib/rss/latestpilots.rss");	
$json = json_encode($xml);
$data = json_decode($json, TRUE);
?>
 <table width="500" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>Pilots</td>
  </tr>
<?php 
foreach($data['channel']['item'] as $row)
{  
 ?>  
  <tr>
    <td><?php echo $row['title'];?></td>
  </tr>
  <?php
}
?>
</table>

<!--конец-->

 

Reports


<!-- Запрос на получения данных Крайний рейс-->
<?php
$xml = simplexml_load_file("http://exemple.ru/lib/rss/latestpireps.rss");	
$json = json_encode($xml);
$data = json_decode($json, TRUE);
?>
 <table width="500" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>Pireps</td>
	<td>Pilots</td>
  </tr>
<?php 
foreach($data['channel']['item'] as $row)
{  
 ?>  
  <tr>
    <td><?php echo $row['title'];?></td>
	<td><?php echo $row['description'];?></td>
  </tr>
  <?php
}
?>
</table>
<!--конец-->

 

2017-03-09_105304.jpg

It works with wordpress?

I did a frame in my wordpress and works better.

Take a look =)

www.travelskyalliance.com

*Attached pics of Pilot_list and last_reports

3.png

1.png

2.png

Edited by joooseb
Link to comment
Share on other sites

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...