Welcome - Authenticated User

<div>

<div class="imgbox_au">
</div>
<p style="margin-top:-3px;">

<div class="lftbox">
<p style="margin-top:10px;">
<em><a class="red" href="/obs/status">Recent observations</a> for <?php global $user; print_r($user->name); ?></em>
<p style="line-height:25px;">

<?php
// ========== Get Current observations status =================

// Link to the GOS database
$link = mysql_connect('localhost:80', 'goobs', 'zitonna8');
mysql_select_db('goobsstatus', $link);

// Get the 5 most recently modified observations for the current user
$sql = "SELECT id,status FROM gos LEFT JOIN gosuser ON gos.id = gosuser.gos WHERE (gosuser.userid='$user->uid') ORDER BY -tsubmit LIMIT 4;";
$result = mysql_query($sql, $link);
$num_gos = mysql_num_rows($result);

if($num_gos == 0) {
print "You have not requested any observations.<br>";
print "To make your own observations select<br><a href=\"/obs/\">Go Observing</a>\n";
} else {
print "<table style='border: 1px solid #797995;padding:1px;width:95%;font-weight: normal;margin:-3px auto 0px auto;'><tbody style='border: 0px;'>\n";
print "<tr style='background-color: #cccccc;padding:1px;margin: 0px;'>";
print "<td style='border-right: 1px solid #797995;'><small><b>ID</b></small></td><td style='border-right: 1px solid #797995;'><small><b>Programme</b></small></td><td><small><b>Status</b></small></td></tr>\n";
while ($gos = mysql_fetch_array($result, MYSQL_ASSOC)) {
$gosid = $gos['id'];
$res2 = mysql_query("SELECT progdesc FROM obsprog WHERE progname='$gosid';");
if(mysql_num_rows($res2) == 0) {
$progdesc = " ";
} else {
$_r = mysql_fetch_array($res2, MYSQL_NUM);
$progdesc = $_r[0];
}

$status = $gos['status'];
if(strpos($status, "error") !== FALSE) {
$statstr = "Error";
} else if(strpos($status, "download") !== FALSE) {
$statstr = "Observed";
} else if(strpos($status, "timeout") !== FALSE) {
$statstr = "Timed out";
} else {
$statstr = "Pending";
}

print "<tr style='background-color: #eeeeef;padding:1px;margin: 0px; border-top:1px solid #797995;'><td style='border-right: 1px solid #797995;'><small><a href='/obs/status?gosid=$gosid'>$gosid</a></small></td>\n";
print " <td style='border-right: 1px solid #797995;'><small>$progdesc</small></td>\n";
print " <td><small>$statstr</small></td></tr>\n";

}
print "</tbody></table>\n";
}

mysql_close($link); // Finished with the MySQL connection
?>

</div>

<div class="rgtbox">
<p style="margin-top:10px;">
<center><a href="/obs/iom/">Image of the Month</a></center>
<table style="margin-top:-5px;"><tbody style="border-style: none;"><tr><td>
<?php
$viewName = 'iom_front';
print views_embed_view($viewName);
?>
</td><td>
<?php
$viewName = 'iom_front_2';
print views_embed_view($viewName);
?>
</td></tr></tbody></table>
</div>

</div>
<!--break-->