Location: PHPKode > projects > phpHamLog > phphamlog/phphamlog/index.php
<?php 
/***************************************************************************
 phpHamLog

 $Id: index.php,v 1.2 2006/04/29 02:53:53 kc9aop Exp $

 Copyright (c) 2005 KC9AOP

 Portions of this file are Copyright (c) 2001 The phpBB group

 ***************************************************************************/

include "configure.php";
include "auth.php";;

session_start();
$result = session_is_registered("logcallid");

switch ($program) {
	case "FIELDDAY":
		$result = session_is_registered("logcallid");
		if ($result) {
			$tmpcall = $_VARS["logcallid"];
			$sql = "SELECT logcallid, storage FROM cookies WHERE logcallid = '$tmpcall' ";
			$result = mysql_query ($sql, $db)
  				or error_die ("Could not get 'cookies' data from database");
			$myrow = mysql_fetch_array($result);
		}
		break;
	default:
		$sql = "SELECT storage FROM cookies WHERE storeid = '1' ";
		$result = mysql_query ($sql, $db)
  			or error_die ("Could not check cookie data in database  - $sql  - $db");
		$myrow = mysql_fetch_array($result);
}

switch ($myrow[storage]) {
	case 'Y':
		$loggedin = TRUE;
		break;
	default:
		$loggedin = FALSE;
}

?>
<html>
<head>
<title>phpHamLog for 
<?php
/* All variations of logging are in "switch", the default is the original logging function */
/* To expand the logging to other "contest" variations, simply add a new "case" and appropriate statements*/
/* 73 de N4FWD */

switch ($program) {
	case "FIELDDAY":
		echo $mastercall;
		break;
	default:
 		echo $mycallsign; 
}

?>
</title>
<meta http-equiv="pragma" content="no-cache">
<link rel="stylesheet" type="text/css" href="login_style.css" />
</head>
<body <?php echo "bgcolor = \"$pagebackground\""; ?>>
<font face="Arial" size="6"><center><b>
<?php 
switch ($program) {
	case "FIELDDAY":
		echo $mastercall;
		break;
	default:
		echo $mycallsign; 
} 
?>'s phpHamLog</b></center></font><br><br>

<?
    	if ( $loggedin) {
            echo "<p class=\"menu\">";
            echo "<a href=\"logentry.php?user=owner\">QSO Entry</a> |";
            echo "<a href=\"view.php?user=owner\">Browse the Log</a> |";
            echo "<a href=\"logout.php\">Logout</a>";
            echo "</p>";
        } else {
            echo "<p class=\"menu\">";
            echo "<a href=\"view.php?user=owner\">Browse the Log</a> |";
            echo "</p>";
        }
?>

<blockquote>

<table width = "90%">
 <tr>
  <td><font face="Arial"><b>User Functions</b></font>
  </td>
  <td>
<?php
switch ($program) {
	case "FIELDDAY":
		if ($loggedin) {
  			echo "<font face=\"Arial\"><b>Field Day Logging - You are logged in as \"$logcallid\".</b></font>";
 		} else { 
  			echo "<font face=\"Arial\"><b>Field Day Logging - use your Callsign as the password</b></font>";
		}
		break;
	default:
  		echo "<font face=\"Arial\"><b>Owner Functions</b></font>";
}
	if ( isset($_GET['o']) && $_GET['o'] == "error" ) 
		echo "<br><b>Incorrect password. Please try again!</b>";
?>
  </td>
 </tr>
 <tr>
  <td>
    <?php
    echo "<form action=\"view.php?user=owner\" method=\"post\">Find Call: 
             <input type=\"text\" size=\"15\" name=\"search_call\">\n";
    echo "<input type=\"submit\" name=\"submit\" value=\"Submit\"></form>\n";
   ?>
  </td>
  <td>
   <?php 
     if ($loggedin) {
       echo "<br><br><a href=\"logout.php\">Log Out</a>";
     } else {
       echo "<form action=\"login.php\" method=\"post\">Login: <input type=\"password\"  name=\"password\"><input
            type=\"submit\" name=\"submit\" value=\"Submit\"></form>\n";
     } 
   ?>
  </td>
</tr>
<tr>
	<td>&nbsp;</td>
	<td>
	&nbsp;
	<?php
    	if ( $loggedin) {
		echo "<a href=\"cabrillo.php?user=owner\"><font face=\"Arial\">Generate Log Files</font></a> (Contesting/Field Day Only)<br>\n";
    	} 
    	?>
	</td>
</tr>
</table>
</blockquote>

<P><br><br></P>
<center>
<table width = "50%" cellspacing = "10" cellpadding = "10">
  <tr>
    <td>
      <font face="Arial" size="1"><a href="http://sourceforge.net/projects/phphamlog">phpHamLog</a> Copyright 
      &copy;2005 KC9AOP. &nbsp;&nbsp;phpHamLog is free software and is released under the terms of the 
      <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>.</center></font>
    </td>
  </tr>
</table>
</form>
</body>
</html>
Return current item: phpHamLog