Location: PHPKode > projects > HuMo-gen > admin/include/index_inc.php
<?php
// *** Safety line ***
if (!defined('ADMIN_PAGE')){ exit; }

echo '<h1 align=center>'.$language["index_name"].'</h1>';

// *** Installeren van een database op een lokale pc ***
if (isset($_POST['install_database'])){
	$installeren="CREATE DATABASE IF NOT EXISTS `".DATABASE_NAME."`";
	mysql_query($installeren) or die (mysql_error());
	$controle_database=mysql_select_db("humo-php",$db);
}

// *** Status HuMo-php weergeven ***
echo '<table class="humo">';
	echo '<tr class="tabel_kop"><th colspan="2">'.$language["index_status"].'</th></tr>';

// *** Check if database and tables are ok ***
$install_status=true;

	// *** Controleren database, eventueel lokale database installeren ***
	echo '<tr><td>';
	if ($controle_database){
		echo $language["index_database1"].'</td>';
		if ($controle_database_db=='oud db_login bestand'){
			echo '<td style="background-color:#FF6600">';
			echo $language["index_database_oldlogin"];
		}
		else{
			echo '<td style="background-color:#00FF00">OK';
		}
	}
	else{
		echo $language["index_database1"].'</td><td style="background-color:#FF0000">';
		echo $language["index_database2"];
		echo ' <form method="post" action="index.php" style="display : inline;">';
		echo '<input type="hidden" name="page" value="'.$page.'">';
		echo '<input type="Submit" name="install_database" value="'.$language["index_database_install"].'">';
		echo '</form>';
		$install_status=false;
	}
	if (isset($_POST['install_database'])){
		if (!$controle_database){
			echo '<p><b>'.$language["index_databasenotmade"].'</b>';
			$install_status=false;
		}
	}
	echo '</td></tr>';

// *** Only show table status if database is checked ***
if ($install_status==true){
	// *** Tabellen controleren ***
	if (isset($controle_tabellen) AND $controle_tabellen){
		if ($controle_tabellen_db=='oud db_login bestand'){
			echo '<tr><td>'.$language["index_database_tables"].'</td><td style="background-color:#FF6600">';
			echo $language["index_database_oldlogin"].'</td></tr>';
		}
		else{
			echo '<tr><td>'.$language["index_database_tables"].
				'</td><td style="background-color:#00FF00">OK</td></tr>';
		}
	}
	else{
		echo '<tr><td>'.$language["index_database_tables"].'</td><td style="background-color:#FF0000">'.$language["admin_fault"];
		echo ' <form method="post" action="index.php" style="display : inline;">';
		echo '<input type="hidden" name="page" value="install">';
		echo '<input type="Submit" name="submit" value="'.$language["menu_install"].'">';
		echo '</form>';
		echo '</td></tr>';
		$install_status=false;
	}

}

// *** Only show table status if database AND tables are checked ***
if ($install_status==true){

	// *** Update script ***
	//include ('update.php');

	// *** Inlog controle ***
	$inlogcontrole='<td style="background-color:#FF0000"><b>'.$language["index_unsafe"].'</b>';
	if (isset($_SERVER["PHP_AUTH_USER"])){
		$inlogcontrole='<td style="background-color:#00FF00">'.$language["index_htaccess"];
	}
	if (isset($_SESSION["gebruikersnaam_admin"]) AND $_SESSION["gebruikersnaam_admin"]=="beheer") {
		$inlogcontrole='<td style="background-color:#FF6600">'.$language["index_phpmysql"];
	}
	echo '<tr><td>'.$language["index_login"].'</td>'.$inlogcontrole;

	if ($cms['cms_name']=='Joomla'){
		$path_tmp='index.php?option=com_humo-gen&amp;task=admin';
	}
	else{
		$path_tmp=$_SERVER['PHP_SELF'];
	}
	print '<form method="POST" action="'.$path_tmp.'" style="display : inline;">';
	echo '<input type="hidden" name="page" value="'.$page.'">';
	print ' <input type="Submit" name="login_info" value="INFO">';
	print '</form>';
	if (isset($_POST['login_info'])){
		echo '<div id="opmerking">';
			echo $language["index_security"];
			echo '<p>AuthType Basic<br>
				AuthName "'.$language["index_security2"].'"<br>';
				echo 'AuthUserFile '.$_SERVER['DOCUMENT_ROOT'].'/humo-gen/admin/.htpasswd<br>';
				echo '&lt;LIMIT GET POST&gt;<br>
				require valid-user<br>
				&lt;/LIMIT&gt;';
			echo '<p>'.$language["index_security3"];
			echo '<p>Huub:mmb95Tozzk3a2';
		echo '</div>';
	}
	echo '</td></tr>';

	// *** Register global LET OP: niet meer nodig in PHP 6.0! ***
	if (!ini_get('register_globals')){
		echo '<tr><td>register_globals</td><td style="background-color:#00FF00">'.$language["index_register_ok"].'</td></tr>';
	}
	else{
		echo '<tr><td>register_globals</td><td style="background-color:#FF6600">'.$language["index_register_unsafe"].'</td></tr>';
	}

	// *** Magic_quotes_gpc LET OP: niet meer nodig in PHP 6.0! ***
	if (ini_get('magic_quotes_gpc')){
		echo '<tr><td>magic_quotes_gpc</td><td style="background-color:#00FF00">'.$language["index_magic_ok"].'</td></tr>';
	}
	else{
		echo '<tr><td>magic_quotes_gpc</td><td style="background-color:#FF6600">'.$language["index_magic_unsafe"].'</td></tr>';
	}

	// *** display_errors ***
	if (!ini_get('display_errors')){
		echo '<tr><td>display_errors</td><td style="background-color:#00FF00">'.$language["index_error_ok"].'</td></tr>';
	}
	else{
		echo '<tr><td>display_errors</td><td style="background-color:#FF6600">'.$language["index_error_unsafe"].'</td></tr>';
	}

	// *** Stambomen ***
	@$datasql = mysql_query("SELECT * FROM humo_trees LEFT JOIN humo_tree_texts
		ON humo_trees.tree_id=humo_tree_texts.treetext_tree_id
		AND humo_tree_texts.treetext_language='talen/taal-nederlands.php'
		ORDER BY tree_order",$db);
	if ($datasql){
		echo '<tr><td>'.$language["index_trees"].'</td><td style="background-color:#00FF00">OK</td></tr>';
		// *** Aantal regels in querie ***
		//$aantal=mysql_num_rows($datasql);
		$teller=0;
		while ($dataDb=mysql_fetch_object($datasql)){

			// *** Voor lege regels (moet op deze manier, lukt niet in de querie...) ***
			if ($dataDb->tree_prefix!='LEEG'){
				//echo '<tr><td><br></td>';
				$teller++;
				echo '<tr><td><b>'.$language["index_tree"].' '.$teller.'</b></td>';

				if ($dataDb->tree_persons){
				  echo '<td style="background-color:#00FF00">';
				}
				else{
				  echo '<td style="background-color:#FF0000">';
				}
				//echo '<b>'.$language["trees_name"].': </b>'.$dataDb->treetext_name;
				echo $dataDb->treetext_name;
				if ($dataDb->tree_persons>0){
				print ' <font size=-1>('.$dataDb->tree_persons.$language["main_nr_persons"].', '.$dataDb->tree_families.$language["main_nr_fams"].')</font>';
				}
				else{
					echo ' <b>'.$language["trees_nodata"].'</b><br>';
						if ($cms['cms_name']=='Joomla'){
							$path_tmp='index.php?option=com_humo-gen&amp;task=admin';
						}
						else{
							$path_tmp='index.php';
						}
		 				echo ' <form method="post" action="'.$path_tmp.'" style="display : inline;">';
						echo '<input type="hidden" name="page" value="gedcom">';
						echo '<input type="hidden" name="tree_prefix" value="'.$dataDb->tree_prefix.'">';
						echo '<input type="Submit" name="stap1" value="'.$language["trees_readgedcom"].'">';
						echo '</form>';
				}
				echo '</td></tr>';
			}
		}
	}
	else{
		echo '<tr><td>'.$language["index_trees"].'</td><td style="background-color:#FF0000">FOUT</td></tr>';
	}

	// *** End of check database and table status ***
	}

echo '</table>';

// *** Only show if database AND tables are checked ***
if ($install_status==true){
	echo '<p>TIPS:<br>';
	echo $language["index_tip"];
}
?>
Return current item: HuMo-gen