Location: PHPKode > projects > Dynamic COMPAS - COMPAS Dynamique > index.php
<?php
/**
 * Login page of the Dynamic COMPAS.
 *
 * Input parameters:
 * - exit: optional, comes from GET : if =1, clear the current session
 *
 * License: available at the root of the htdocs folder. 
 * 
 * Coding standard: since Release v1.2, the coding standard used as guidelines
 *    is the Zend Framework PHP Coding Standard available at:
 *      http://framework.zend.com/manual/en/coding-standard.html
 *         
 * @version    SVN Revision: $Rev: 268 $ 
 * @since      File available since Release v1.0 
*/

  session_start();
  
  //If parameter "exit" is given in the URL, and is assigned value 1, renew session
  if ( isset($_GET['exit']) ) {
    if ( $_GET['exit'] == "1" ) {
      session_destroy();
    }
  }
	
	if (!isset($lang))
	{ 
		if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
		{ 
			$navigator_lang = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']); 
			$navigator_lang = strtolower(substr(chop($navigator_lang[0]),0,2));
			if ( in_array($navigator_lang, array("en", "es", "fr")) ) {
				$lang = $navigator_lang;
			}
		}
	}
	//Default language assignation
	if ( !isset($lang) ) {
		$lang = "fr";
	}
	$_SESSION['lang']=$lang;
	include("include/db_func.inc.php");
	include("lang/general_".$lang.".php");
	$select=array("fr"=>"","en"=>"","es"=>"");
	$select[$lang]="selected=\"selected\"";
	mysql_connect("$CDYN_MYSQL_HOST:$CDYN_MYSQL_PORT",$CDYN_MYSQL_LOGIN,$CDYN_MYSQL_PASSWORD);
	if(!mysql_select_db($CDYN_MYSQL_DBNAME))
		header("Location: install/index.php");
	else
	{
  $query_test_user = "SELECT count(*) cnt_user FROM user";
	$result_test_user = mysql_query($query_test_user);
	$count_users = mysql_fetch_row($result_test_user);
	if($count_users[0] == 0) {
	 header("Location: install/index.php?e=1");
  } else {
	include("class/Institution.php");
	$ins = new Institution();
	$title = $index_title;
	
?><head>
<title><?= $index_title ?> -- <?= $word_site_title ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="css/style_public.css" rel="stylesheet" type="text/css">
<link rel="icon" type="image/png" href="favicon.ico" />
<script language="javascript" type="text/javascript" src="fonctions/func.inc.js"></script>
</head>

<body onBeforeUnload="">
<table width="720" align="center" cellpadding="0" cellspacing="0" class="main" border="0">
	<tr>
		<td colspan="2">
			<table align="center" width="100%">
				<tr>
					<td width="60" rowspan="2" align="left" valign="top"><img src="images/logo_<?= $lang ?>.png"></td>
					<td  align="left" valign="middle" >
						<table>
							<tr>
								<td>&nbsp;&nbsp;<img src="images/ans-icon.gif" />
								</td>
								<td class="header_title"><?= $title?>
								</td>
							</tr>
						</table>
					</td>
					<td  align="right" valign="middle" >					  
					</td>
				</tr>

				<tr>
					<td colspan="3" valign="bottom"><hr>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td colspan="2" valign="top">
		<form action="phase_common/index.php" method="post" enctype="multipart/form-data">
		<input type="hidden" name="ident" value="1">
			<table width="80%" border="0" cellspacing="3" cellpadding="3" align="center">
  				<tr>
  					<td colspan="3">
						<table width="60%" align="center">
							<tr>
  								<!--<td width="25%" align="left"><img src="images/acronyme_<?= $lang ?>.gif"></td>-->
								<td width="73%" align="center" class="TitleOrange">COMPAS Dynamique<br><br><br>
								  <table width="100%">
                                    <tr>
                                      <td width="21%" rowspan="3"><img src="images/login.gif" width="64" height="64"></td>
                                      <td width="29%"><?= $index_login ?>
                                      </td>
                                      <td width="50%"><input name="login" type="text" id="login"></td>
                                    </tr>
                                    <tr>
                                      <td><?= $index_pass ?>
                                      </td>
                                      <td><input name="pwd" type="password" id="pwd"></td>
                                    </tr>
                                    <tr>
                                      <td><?= $index_lang ?>
                                      </td>
                                      <td>
                                        <select name="lang">
                                          <option value="fr" <?= $select["fr"] ?>>Fran├žais</option>
                                          <option value="en" <?= $select["en"] ?>>English</option>
                                          <option value="es" <?= $select["es"] ?>>Espa&ntilde;ol</option>
                                        </select>
                                      </td>
                                    </tr>
                                    <tr>
                                      <td colspan="3" align="center"><br><br><input type="submit" name="Submit" value="<?= $index_connect ?>"></td>
                                    </tr>
                                  </table></td>
							</tr>
						</table>
					</td>
  				</tr>
				<tr>
					<td>&nbsp;				</td>
				</tr>
  				<tr>
					<td colspan="3"><br><br>
					<div align="center">					</div>
					</td>
  				</tr>
			</table>		
			</form>
		</td>
	</tr>

	<tr>
		<td align="left">
		<?
		if(file_exists($ins->file_logo)){
		?>&nbsp;&nbsp;<img src="../CDYN6/images/<?= $ins->file_logo ?>" /> </td>
	    <?
		}
		?>
		<td align="right"><img src="images/logo_urd.gif"><br>
	      <?=$in_version; ?> <br>
&copy; 2006-<?=date('Y')?>, GROUPE URD</td>
	</tr>

	<tr>
		<td colspan="2" valign="bottom"><img src="images/footer_bis.gif"></td>
	</tr>
</table>
<!--
<br />
	<a href="javascript:ow('pouet.html','2','left')">pop-up</a><br />
	<textarea id="answer"></textarea>
	<a href="javascript:verif_text('../pouet.html','answer','<?= $lang ?>')">verif_text</a>
-->


<?

}
}
?>
</body>
</html>
Return current item: Dynamic COMPAS - COMPAS Dynamique