Location: PHPKode > projects > phpMyPrepaid > phpmyprepaid/www/body.header.php
<body>
<div class="pagewrapper">
<div class="header"><table style="text-align: left; width: 100%;" border="0">
<?php 

// GET DEFAULT CONFIGURATION FOR LOCATION CHANGE
if ($_SESSION['locID']=='')
{
	$result = getLocationNameHeader($oreon->user);
$row = $oreon->database->database->fetch_object($result); 
$_SESSION['locID']=$row->ID;
$_SESSION['LocName']=$row->LocationName;
$oreon->user->set_status(get_user_status_location($oreon->user,$_SESSION['locID']));
$oreon->phpmyprepaid=$oreon->database->getphpmyprepaid($_SESSION['locID']);
$oreon->pdfprint=$oreon->database->getpdfprintconfiguration($_SESSION['locID']);
$oreon->generalopt=$oreon->database->getoptgen('1');
}

if (isset($_POST['LocationChange'])) {
	$_SESSION['LocName']=$_POST['LocationChange'];
#echo 'LOCATION ANME '.$_SESSION['LocName'];
	$_SESSION['locID']=getLocationId($_POST['LocationChange']);
	$oreon->user->set_status(get_user_status_location($oreon->user,$_SESSION['locID']));
	$oreon->generalopt=$oreon->database->getoptgen('1');
	$oreon->phpmyprepaid=$oreon->database->getphpmyprepaid($_SESSION['locID']);
	if ($oreon->phpmyprepaid['client_name']=='') $_SESSION['error']="Error : No configuration have been set for this location go in \n Configuration -> General Configuration";
	$oreon->pdfprint=$oreon->database->getpdfprintconfiguration($_SESSION['locID']);
unset($_POST['LocationChange']);
}


if (isset($_SESSION['button']) and $_SESSION['button']=='location_selected') {
if ($_POST['locID']!='') {
	$_SESSION['locID']=$_POST['locID'];
	$_SESSION['LocName']=$_POST['LocationName'];
    $oreon->generalopt=$oreon->database->getoptgen('1');
	$oreon->user->set_status(get_user_status_location($oreon->user, $_SESSION['locID']));
	$oreon->phpmyprepaid=$oreon->database->getphpmyprepaid($_SESSION['locID']);
	if ($oreon->phpmyprepaid['client_name']=='') $_SESSION['error']="Error : No configuration have been set for this location go in \n Configuration -> General Configuration";
	$oreon->pdfprint=$oreon->database->getpdfprintconfiguration($_SESSION['locID']);

}
}

//DEFAULT CONFIGURATION
$_SESSION['gatewayType']=$oreon->phpmyprepaid['gateway_type'];
if ( $_SESSION['gatewayType']=='') $_SESSION['gatewayType']=$default_gateway;
include ("include/configuration/".$_SESSION['gatewayType'].".attr");

$hname=$oreon->phpmyprepaid['client_name'];
$oreon->images_path=$images_path;
$dateFormat=$oreon->phpmyprepaid['display_date_format'];
$octet_type=$oreon->phpmyprepaid['octet_type'];
if ($octet_type=='')  { 
	if ($debug) print " OCTET TYPE NOT SET ";
	$octet_type=$default_octet_type;
	$oreon->phpmyprepaid['octet_type']=$octet_type;
}
if ($debug) print ' IMAGES PATH '.$_SESSION['oreon']->images_path;

	if ($debug and isset($oreon->generalopt)) print "<br> PHPMYPREPAID PATH  ".$oreon->generalopt['phpmyprepaid_path'];

if ($debug) print ' <br> USER NAME'.$oreon->user->get_status().'LOC ID '.$_SESSION['locID'].' USER STATUS '.get_user_status_location($oreon->user,$_SESSION['locID']);
echo("<tr><td><a href=\"phpmyprepaid?site=main\"><img src=\"$Banner\" title=\"Return to PhpMyPrepaid\" ALT=\"Phpmyprepaid main page\"></a>");
echo "</td><td><h2><big style=\"font-family: Aircut; color: #58637d\">Welcome user ".$oreon->user->get_alias()."</big>";
if ($oreon->user->get_status() == 1)
	$ustat="Normal User";
else if ($oreon->user->get_status() == 2)
	$ustat="Administrator";	
else if ($oreon->user->get_status() == 3)
	$ustat="Super Administrator";
else 
	echo "<p class=\"error\">User haven't any status, this should not happen</p>";
echo " <small style=\"font-family: Aircut; color: #58637d\">($ustat)</small></h2></td><td style=\"text-align: right;\"><small>".date($dateFormat)."</small></td>";
	echo('<td style="text-align: right;"><form action="index.php" method="get">');
	echo('<p><input type="hidden" name="disconnect" value="1"></p>');
    	printf('<p><input class="image"  type="image" value="submit" name="submit" alt="Logout" title="Logout" src="images/logout.png"></p>');
	echo('</form></td></tr></table>');
	echo "";

	echo '<table class="ins_header"
		style="width: 362px; text-align: left; margin-left: auto; margin-right: 0px;"
		border="0" cellpadding="2" cellspacing="2">
		<tbody>
		<tr>
		<td>
		<div ID="bloc">'.$hname.'
		</b></div></td>
		<td>'.$projectName;
	include ("include/version/version.php");
	echo '</small>';
	echo '</td>
		</tr>
		</tbody>
		</table>';
	
$result = getLocationNameHeader($oreon->user);
$numr=mysql_num_rows($result);
if ($numr==0 AND $_SESSION['button']!='add_loc_process')
 $_SESSION['button']="addLoc";
echo '<form action="phpmyprepaid.php" method="post">';
echo '<table ><tr><td>Choose your Locations : </td><td>';
echo ('<select name="LocationChange">');

while ($row = $oreon->database->database->fetch_object($result)) {
	 if($_SESSION['locID']==$row->ID)
		echo ("<option selected=\"selected\" value=\"".$row->LocationName."\">".$row->LocationName);
	else
		echo ("<option  value=\"".$row->LocationName."\">".$row->LocationName);
}
echo "</select></td><td>";
echo '<input type="hidden" name="buttonID" value="change_location">';
echo("<span class=\"button\" ><button type=\"submit\" name=\"submit\" value=\"Change\">Change</button></span>");
echo('</td></tr></table></form>');
echo '</div>';
echo "<script type=\"text/JavaScript\">document.getElementById(\"bloc\").innerHTML = \"<b>$hname</b>\";</script>";

?>
Return current item: phpMyPrepaid