<commit_before><?php
  $title = "main page";
  $cvs="\$Id$";
  $keywords="logbook online";

  include "include/init.inc";

  if(isset($rvar_psearch)) {
    $pilotdesc = "Pilots Matching [$rvar_psearch]";
    $pilotlist = pilot_search($rvar_psearch);
  } else {
    $pilotdesc = "Top Pilots";
    $pilotlist = pilot_search("");
  }
  usort($pilotlist,"pilot_cmp");
  $pilotlist = array_slice($pilotlist,0,5);

  if(isset($rvar_asearch)) {
    $airportdesc = "Airports Matching [$rvar_asearch]";
    $airportlist = airport_search($rvar_asearch);
  } else {
    $airportdesc = "Top Airports";
    $airportlist = airport_search("");
  }
  usort($airportlist,"airport_cmp");
  $airportlist = array_slice($airportlist,0,10);

  include "include/head.inc";

  $flightslist = logbook_recent();

?>

  <div id="block1">
    <h3><?php print $pilotdesc; ?></h3>
    <form action="index.php" method ="get">
      Search: <input type="text" name="psearch" size="20" />
    </form>
    <?php
      if(isset($pilotlist)) {
        print "<table>\n";
        for($i=0; $i<count($pilotlist); $i++) {
          print "<tr>";
          print "<td><a href=\"pilot.php?pilot=$pilotlist[$i]\">" . pilot_name($pilotlist[$i]) . "</a></td>";
          print "<td>" . hobbs(pilot_hours($pilotlist[$i])) . "</td>";
          print "</tr>";
        }
        print "</table>\n";
      }
    ?>
  </div>

  <div id="block2">
    <h3><?php print $airportdesc; ?></h3>
    <form action="index.php" method ="get">
      Search: <input type="text" name="asearch" size="20" />
    </form>
    <?php
      if(isset($airportlist)) {
        print "<table>\n";
        for($i=0; $i<count($airportlist); $i++) {
          $buf2 = airport_detail($airportlist[$i]);
          print "<tr>";
          print "<td><a href=\"airport.php?ident=$airportlist[$i]\">" . airport_name($airportlist[$i]) . "</a></td>";
          print "<td class=\"integer\">$buf2[visits]</td>";
          print "</tr>";
        }
        print "</table>\n";
      }
    ?>
  </div>

  <div id="block3">
    <h3>Most Recent Flights</h3>
    <?php
      if(isset($flightslist)) {
        print "<table>\n<tr><th>Date</th><th>Pilot</th><th>Route</th><th colspan=\"2\">Hours</th></tr>";
        for($i=0; $i<count($flightslist); $i++) {
          $buf3 = logbook_detail($flightslist[$i]);
          $detaillink = "detail_logbook.php?id=$flightslist[$i]";
          ?>
          <tr class="<?php print $class; ?>" onMouseOver=this.style.backgroundColor="#ffffff"
                                     onMouseOut=this.style.backgroundColor=""
                                     onclick="window.location.href='<?php print $detaillink; ?>'" >
           <td><?php print $buf3['date']; ?></td>
           <td><?php print pilot_name($buf3['pilot_id']); ?></td>
           <td><?php print $buf3['route']; ?></td>
           <td><?php print split_decimal(logbook_hours($flightslist[$i])); ?></td>
          </tr>
          <?php
        }
        print "</table>\n";
      }
    ?>
  </div>

<?php

  include "include/foot.inc";

?><commit_msg>fix hours formatting, apply logbook style<commit_after><?php
  $title = "main page";
  $cvs="\$Id$";
  $keywords="logbook online";

  include "include/init.inc";

  if(isset($rvar_psearch)) {
    $pilotdesc = "Pilots Matching [$rvar_psearch]";
    $pilotlist = pilot_search($rvar_psearch);
  } else {
    $pilotdesc = "Top Pilots";
    $pilotlist = pilot_search("");
  }
  usort($pilotlist,"pilot_cmp");
  $pilotlist = array_slice($pilotlist,0,5);

  if(isset($rvar_asearch)) {
    $airportdesc = "Airports Matching [$rvar_asearch]";
    $airportlist = airport_search($rvar_asearch);
  } else {
    $airportdesc = "Top Airports";
    $airportlist = airport_search("");
  }
  usort($airportlist,"airport_cmp");
  $airportlist = array_slice($airportlist,0,10);

  include "include/head.inc";

  $flightslist = logbook_recent();

?>

  <div id="block1">
    <h3><?php print $pilotdesc; ?></h3>
    <form action="index.php" method ="get">
      Search: <input type="text" name="psearch" size="20" />
    </form>
    <?php
      if(isset($pilotlist)) {
        print "<table>\n";
        for($i=0; $i<count($pilotlist); $i++) {
          print "<tr>";
          print "<td><a href=\"pilot.php?pilot=$pilotlist[$i]\">" . pilot_name($pilotlist[$i]) . "</a></td>";
          print "<td>" . hobbs(pilot_hours($pilotlist[$i])) . "</td>";
          print "</tr>";
        }
        print "</table>\n";
      }
    ?>
  </div>

  <div id="block2">
    <h3><?php print $airportdesc; ?></h3>
    <form action="index.php" method ="get">
      Search: <input type="text" name="asearch" size="20" />
    </form>
    <?php
      if(isset($airportlist)) {
        print "<table>\n";
        for($i=0; $i<count($airportlist); $i++) {
          $buf2 = airport_detail($airportlist[$i]);
          print "<tr>";
          print "<td><a href=\"airport.php?ident=$airportlist[$i]\">" . airport_name($airportlist[$i]) . "</a></td>";
          print "<td class=\"integer\">$buf2[visits]</td>";
          print "</tr>";
        }
        print "</table>\n";
      }
    ?>
  </div>

  <div id="block3">
   <div id="logbook">
    <h3>Most Recent Flights</h3>
    <?php
      if(isset($flightslist)) {
        print "<table>\n<tr><th>Date</th><th>Pilot</th><th>Route</th><th colspan=\"2\">Hours</th></tr>";
        for($i=0; $i<count($flightslist); $i++) {
          $buf3 = logbook_detail($flightslist[$i]);
          $detaillink = "detail_logbook.php?id=$flightslist[$i]";
          ?>
          <tr class="<?php print $class; ?>" onMouseOver=this.style.backgroundColor="#ffffff"
                                     onMouseOut=this.style.backgroundColor=""
                                     onclick="window.location.href='<?php print $detaillink; ?>'" >
           <td><?php print $buf3['date']; ?></td>
           <td><?php print pilot_name($buf3['pilot_id']); ?></td>
           <td><?php print $buf3['route']; ?></td>
           <?php print split_decimal(logbook_hours($flightslist[$i])); ?>
          </tr>
          <?php
        }
        print "</table>\n";
      }
    ?>
   </div>
  </div>

<?php

  include "include/foot.inc";

?>
{'fraction_non_alphanumeric': 0.21672327349183243, 'fraction_numerical': 0.009057092026524341, 'mean_word_length': 2.614260666277031, 'pattern_counts': {'":': 0, '<': 157, '<?xml version=': 0, '>': 151, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2046715', 'n_tokens_mistral': 2241, 'n_tokens_neox': 2185, 'n_words': 355}