Jump to content

bass

Members
  • Posts

    240
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by bass

  1. I make a simple VATSIM card and have a problem. It is impossible to output an array of all coordinates, now only one is displayed.

    <h3 id="example">Example:</h3>
    
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.1/dist/leaflet.css" />
    
    <script src="https://unpkg.com/leaflet@1.0.1/dist/leaflet.js"></script>
    
    <div id="map" style="width: 800px; height: 400px"> </div>
    <script src="http://code.jquery.com/jquery-2.0.3.min.js"> </script>
    
    <script> 
    //var map = L.map('map').setView([0,0], 2);
    var map = L.map('map', {
      'center': [48.11815, 16.55964],
      'zoom': 3,
      'layers': [
        L.tileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
          attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="http://cartodb.com/attributions">CartoDB</a>'
        })
      ]
    });
    
    function moveISS (data) {
       $.getJSON('http://test.uspeh-partner.xyz/fsbuild/json.php', 
    function(data) {
    data.forEach(function(item, index) {
            var lat = item.latitude;
            var lon = item.longitude;
    		 iss.setLatLng([lat, lon]);
            isscirc.setLatLng([lat, lon]);
            map.panTo([lat, lon], animate=true);
    		
    
       });
           // iss.setLatLng([lat, lon]);
           // isscirc.setLatLng([lat, lon]);
           // map.panTo([lat, lon], animate=true);
        });
        setTimeout(moveISS, 10000); 
    	}
    
    
    	
    	
    var ISSIcon = L.icon({
        iconUrl: 'http://open-notify.org/Open-Notify-API/map/ISSIcon.png',
        iconSize: [50, 30],
        iconAnchor: [25, 15],
        popupAnchor: [50, 25],
        shadowUrl: 'http://open-notify.org/Open-Notify-API/map/ISSIcon_shadow.png',
        shadowSize: [60, 40],
        shadowAnchor: [30, 15]
    });
    
    
    var iss = L.marker([0, 0], {icon: ISSIcon}).addTo(map);
    var isscirc = L.circle([0,0], 2200e3, {color: "#c22", opacity: 0.3, weight:1, fillColor: "#c22", fillOpacity: 0.1}).addTo(map); 
    
    moveISS();
    console.log(data);
    </script>

     

  2. Hello, for my site I made a check whether the pilot arrived at the right airport or not.

    The script is installed in pirep_viewreport.tpl

    This script I found on the Internet and applied it to the site.
    In fact it is a distance rival.
    1) You set an acceptable landing distance from the point (Airport) to an example of 35 km.
    2) The data is compared, Example:
    If the pilot landed the aircraft no further than 35 km from the point of coordinates of your arrival airport, the Value is ALL GOOD, if this distance is more than permissible (in my case 35 km), So the pilot arrived at some other airport and issued a warning !.

    • This photo shows that I should fly to UNNT, but I made a circle and returned to the airport of departure.

    2017-10-29_144044.jpg

     

    On this photo you can see a warning !!!

    "You did not land the plane at the designated airport!"

    2017-10-29_144541.jpg

     

    This is the conclusion of an example when everything is fine. The pilot arrived at the right airport.

    2017-10-29_144902.jpg

     

    This is the code itself.

    <!--Скрипт сравнения расстояния-->
    <?php
    // Радиус земли
    define('EARTH_RADIUS', 6372795);
    
    function calculateTheDistance ($φA, $λA, $φB, $λB) {
     
        // перевести координаты в радианы
        $lat1 = $φA * M_PI / 180;
        $lat2 = $φB * M_PI / 180;
        $long1 = $λA * M_PI / 180;
        $long2 = $λB * M_PI / 180;
     
        // косинусы и синусы широт и разницы долгот
        $cl1 = cos($lat1);
        $cl2 = cos($lat2);
        $sl1 = sin($lat1);
        $sl2 = sin($lat2);
        $delta = $long2 - $long1;
        $cdelta = cos($delta);
        $sdelta = sin($delta);
     
        // вычисления длины большого круга
        $y = sqrt(pow($cl2 * $sdelta, 2) + pow($cl1 * $sl2 - $sl1 * $cl2 * $cdelta, 2));
        $x = $sl1 * $sl2 + $cl1 * $cl2 * $cdelta;
     
        //
        $ad = atan2($y, $x);
        $dist = $ad * EARTH_RADIUS;
     
        return $dist;
    }
     
       
    $query = "SELECT * FROM phpvms_airports WHERE icao='$pirep->arricao'";
    $Result = DB::get_results($query);
    foreach($Result as $a)
    {
    $lat1 =  $a->lat;
    $long1 =  $a->lng;
    }
    $lat2 = round($latP, 4); //LAT точки приземления
    $long2 = round($lngP, 4); //LON точки прибытия
    ?>
    <br>
    <?php
    $dopustimaia = 35000; // Это число в метрах допустимых от точки (Аэропорта)
    $itogovaia = calculateTheDistance($lat1, $long1, $lat2, $long2);  // Это должна быть переменная точки приземления
    if ($dopustimaia > $itogovaia) {
     echo '<div class="view-header">
                            
                            <div class="header-icon">
                                <i class="pe page-header-icon pe-7s-map-marker"></i>
                            </div>
                            <div class="header-title">
                                <h3>Благодарность от администрации</h3>
                                <small>
                                    Рейс окончен в назначенном аэропорту.
                                </small>
                            </div>
                        </div>';
    }
     else {
     echo '<div class="view-header">
                            
                            <div class="header-icon">
                                <i class="pe page-header-icon pe-7s-speaker"></i>
                            </div>
                            <div class="header-title">
                                <h3>Предупреждение!</h3>
                                <small>
                                    С вас будет взысконно -1000 миль и -10 часов налета. Вы посадили самолет не в назначенном аэропорту!
                                </small>
                            </div>
                        </div>';
    }
     
    ?>

     

  3. I saw the Log in the report with your application. How is it different from the others? It makes no sense to install your agent.

    I'm looking for a software that transmits the Log high, visibility, wind, flaps, speed, steering, stalling, lights, weather conditions (rain, snow, storm), and so on, I have a script that calculates the errors and exposes the Rating for the flight and sweeps the data into the database. Below taking notes. For example (+5 for taking off in strong winds, -10 for not included lamp, -15 over the speed limit release flap )

    2017-05-09_232437.jpg

  4. Departure boards.

    New scoreboard built on a frame of HTML and CSS.
    Output <?php include('departure.tpl'); ?> in any part of your website.

    38214332.jpg

    In this form you can display any table with your information.
    Who in flight (acars)
    Extreme flight
    Booked flights
    and so on...

    Details here

  5. Hey all, I made a small module that generates the Personal ID card of the pilot, and even generates the overall statistics of the company. 
    All information is displayed on the foreground of any pictures JPG
    Who is interested in the module, write in PM)

    The module generates links that you can embed on sites, forums, blogs with information about the company or the personal card pilot. =)

    --------------------------------------------------------------------------------------------------------------

    2017-03-25_192435.jpg

    --------------------------------------------------------------------------------

    2017-03-25_192516.jpg

  6. Help to make in PHP code.

    A visual example of what I want to show on the page of the pilot.

    events.jpg

    Want to get to the page profile_main.TPL information.

    In a Reminder that I'm part of the event (date of event date and time )

    Tried to put some of the code from events_event.tpl

     

    <?php
                $check = EventsData::check_signup(Auth::$userinfo->pilotid, 6);
                if($check->total >= '1') {
                    echo '<td>Yes</td>';
                    }
               else {
                    echo '<td>No</td>';?>
    <?php
    }
    ?>

     

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

×
×
  • Create New...