Beispiel #1
0
  function mailbox_exists ($mailbox) {
    global $log; 
    if (!$mailbox) { 
      return false; 
    } 
    $voicemail_db = get_voicemail_db($this->db, $this->udomain);
    change_db($this->db, $voicemail_db);
    $q = "SELECT count(extension) " . 
         " FROM VM_Users  WHERE extension = " . $mailbox;
                                                                                                                                               
     $res = $this->db->query($q);
                                                                                                                                               
     if (DB::isError($res)) {
          $log->log("FAILED QUERY : $q",LOG_ERR);
          change_to_default_db($this->db);
           
          return false;
     }
     $row =  $res->fetchRow(DB_FETCHMODE_ORDERED) ;
     $res->free();
     change_to_default_db($this->db);

     $count = $row[0]; 
     if ($count == 1)  {
       return true; 
     } else {
       return false; 
     } 
  } 
Beispiel #2
0
  function savePerm($new_perm) {
    global $log ;
    if ($this->mailbox && preg_match("/SUPER|ADMIN|USER/", $new_perm))  {
       if (!$this->voicemail_db ) {
         $this->voicemail_db = get_voicemail_db($this->udomain);
       }
       change_db($this->db,$this->voicemail_db );

       $q="UPDATE VM_Users SET permission_id = '$new_perm' WHERE "
          . " extension=  ". $this->mailbox;
       $res=$this->db->query($q);
       if (DB::isError($res)) {
         $log->log("QUERY FAILED $q " . $res->getMessage());
       }
       change_to_default_db($this->db);

    } else {
      $log->log("ERRROR: Tried to savePerm with no extension " . $this->mailbox . " or invalid perm $new_perm");
    }
  }
					<tr align="center"><th class="col-sm-1">&nbsp;</th><th class="col-sm-1">&nbsp;</th><th class="col-sm-1">Flight</th><th class="col-sm-3">Aircraft</th><th class="col-sm-1" style="text-align:center;">Dir</th><th class="col-sm-3">Orgn/Dest</th><th class="col-sm-1">Time</th><th class="col-sm-1">Gate</th><th class="col-sm-1">Pilot</th><th class="col-sm-1">Status</th></tr>
				</thead>
				<tbody>	
<?php 
change_db($sqlconn, $rfedatabase);
$query = "SELECT f.id, f.flightnumber, f.origin, f.destination, IFNULL(DATE_FORMAT(f.deptime, '%H%i'),'----') AS deptime,\n                         IFNULL(DATE_FORMAT(f.arrtime, '%H%i'),'----') AS arrtime, IFNULL(DATE_FORMAT(deptime, '%H%i'),DATE_FORMAT(arrtime, '%H%i')) AS opstime, IFNULL(f.gate,'TBD') AS gate, f.acft, IFNULL(f.route,'TBD') AS route, f.vid, m.name\n                         FROM rfe_flights AS f\n\t\t\t\t\t          LEFT JOIN rfe_members AS m ON m.vid = f.vid\n\t\t\t\t\t\t\t    WHERE (f.origin='" . mysql_result($querysel, 0, "apticao") . "' OR f.destination='" . mysql_result($querysel, 0, "apticao") . "') AND (f.deptime > '17:00:00' OR f.arrtime > '17:00:00')\n\t\t\t\t\t\t\t    AND f.vid IS NOT NULL\n\t\t\t\t\t\t\t\t ORDER BY ABS(opstime)";
//echo $query;
$query = mysqlexec($sqlconn, $query);
$queryn = mysql_num_rows($query);
for ($i = 0; $i < $queryn; $i++) {
    change_db($sqlconn, $navdatabase);
    $queryorig = "SELECT Name FROM airports WHERE ICAO='" . mysql_result($query, $i, "origin") . "'";
    $queryorig = mysqlexec($sqlconn, $queryorig);
    $querydest = "SELECT Name FROM airports WHERE ICAO='" . mysql_result($query, $i, "destination") . "'";
    $querydest = mysqlexec($sqlconn, $querydest);
    change_db($sqlconn, $rfedatabase);
    ?>
					<tr>
					<td style="vertical-align:middle"><?php 
    if (mysql_result($query, $i, 'arrtime') == "----") {
        ?>
 <img src="images/dep.png"/> <?php 
    } else {
        ?>
 <img src="images/arr.png"/> <?php 
    }
    ?>
</td>
					<td style="vertical-align:middle"><?php 
    if (file_exists("logos/" . substr(mysql_result($query, $i, 'flightnumber'), 0, 3) . ".gif")) {
        ?>
Beispiel #4
0
  function change_to_conference_db(&$db) {
    global $log; 
    global $config;

    $new_db = $config->data_sql->db_name_conference;

    return change_db($db, $new_db); 
  }
Beispiel #5
0
}
?>
<body>
<div class="container">
    <div class="col-lg-3">
        <?php 
display_filter($link);
?>
    </div>
    <div class="col-lg-9">
        <?php 
if (isset($_POST['edit'])) {
    if (isset($_POST['id'])) {
        $res = change_db($link);
    } else {
        $res = change_db($link, true);
    }
    header("Locetion: " . $_SERVER['REQUEST_URI']);
}
$items = get_item($link);
?>
        <a href="/work_23_03/logout.php" class="pull-right btn btn-danger">Logout <?php 
echo $_SESSION['login'];
?>
</a>
        <div class="clearfix"></div>
        <?php 
if ($_SESSION['admin'] == 'y') {
    display_form();
}
echo "<div class='clearfix'></div>";
function getDetailsAD($icao)
{
    // SQL Pointer is a global variable
    global $navdatabase, $rfedatabase, $sqlconn;
    change_db($sqlconn, $navdatabase);
    $sql = "SELECT Latitude,Longtitude,Elevation FROM Airports WHERE ICAO='{$icao}'";
    $res = mysqlexec($iddata, $sql);
    change_db($sqlconn, $rfedatabase);
    $latitud = mysql_result($res, 0, 0);
    $longitud = mysql_result($res, 0, 1);
    $elevation = mysql_result($res, 0, 2);
    echo '<table class="table table-bordered table-condensed table-striped">';
    //echo '<table class="table table-condensed">';
    echo '<tr><th>Coordinates</th><td colspan="3">' . DECtoDMS($latitud, "Lat") . ', ' . DECtoDMS($longitud, "Lon") . ' (' . sprintf('%2.6f', $latitud) . ', ' . sprintf('%3.6f', $longitud) . ')</td></tr>';
    echo '<tr><th>Elevation</th><td colspan="3">' . $elevation . ' ft (' . bcmul($elevation, 0.3048, 0) . ' m)</td></tr>';
    echo '<tr><th>DMG</th><td colspan="3">' . getDMG($latitud, $longitud) . '</td></tr>';
    //echo '</table>';
    change_db($sqlconn, $navdatabase);
    $sql = "SELECT rwy.Ident,rwy.TrueHeading,rwy.Length,rwy.Width,rwy.Surface,ils.ident,ils.category,ils.Freq,ils.HasDME\n\t\t\tFROM Airports AS apt\n\t\t\tLEFT JOIN Runways AS rwy ON rwy.AirportID = apt.ID\n\t\t\tLEFT JOIN ILSes AS ils ON ils.RunwayID = rwy.ID\n\t\t\tWHERE apt.ICAO = '" . $icao . "' ORDER BY rwy.Ident";
    $res = mysqlexec($iddata, $sql);
    change_db($sqlconn, $rfedatabase);
    //echo '<table class="table table-bordered table-condensed table-striped">';
    echo '<tr><th colspan=4 style="background: #d4d4d4;"><center>Runways</center></th></tr>';
    echo "<tr><th style='text-align: center;'>ID</th><th style='text-align: center;'>Dimensions</th><th style='text-align: center;'>Surface</th><th style='text-align: center;'>ILS</th></tr>";
    for ($i = 0; $i < mysql_num_rows($res); $i++) {
        echo "<tr><td style='text-align: center;vertical-align: middle;'>" . mysql_result($res, $i, 0) . "</td><td style='text-align: center;vertical-align: middle;'>" . mysql_result($res, $i, 2) . " ft X " . mysql_result($res, $i, 3) . " ft<br>" . bcmul(mysql_result($res, $i, 2), 0.3048, 0) . " m X " . bcmul(mysql_result($res, $i, 3), 0.3048, 0) . " m</td><td style='text-align: center;vertical-align: middle;'>" . mysql_result($res, $i, 4) . "</td>";
        $ils = mysql_result($res, $i, 5);
        if (!empty($ils)) {
            if (mysql_result($res, $i, 6) == 0) {
                echo "<td style='text-align: center;vertical-align: middle;'>" . $ils . " (LOC) - " . bcdiv(dechex(mysql_result($res, $i, 7)), "10000", 3) . "</td></tr>";
            } else {
                echo "<td style='text-align: center;vertical-align: middle;'>" . $ils . " (CAT " . mysql_result($res, $i, 6) . ") - " . bcdiv(dechex(mysql_result($res, $i, 7)), "10000", 3) . "</td></tr>";
            }
        } else {
            echo "<td style='text-align: center;vertical-align: middle;'>none</td></tr>";
        }
    }
    echo "</table>";
}