<?php session_start(); ?>
<?php session_cache_limiter('private-no-expire'); ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>Gradinite</title>

<link rel="stylesheet" type="text/css" href="A21_stiluri1.css">

<link rel="stylesheet" type="text/css" href="jquery-ui.css">

<script type="text/javascript" src="jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="jquery-ui.min.js"></script>

<style type="text/css">

.style1 {
	font-size: 12pt;
}
</style>

<script language="JavaScript" type="text/javascript">

var w1;
function target_popup1(form) {
		w1=window.open('', 'win01', '');
		form.target = 'win01';
}

var w5;
function target_popup5(form) {
		w5=window.open('', 'win05','width=800,height=170,top=300,left=250,toolbar=no, location=no,status=no,menubar=no,scrollbars=no,resizable=no');
		form.target = 'win05';
}

var w11;
function target_popup11(form) {
		w11=window.open('', 'win11','width=800,height=770,top=100,left=400,resizeable,scrollbars');
		form.target = 'win11';
}

var w12;
function target_popup12(form) {
		w12=window.open('', 'win12','width=550,height=250,top=300,left=400,resizeable,scrollbars');
		form.target = 'win12';
}

var w13;
function target_popup13(form) {
		w13=window.open('', 'win13','width=500,height=250,top=300,left=400,resizeable,scrollbars');
		form.target = 'win13';
}

var w16;
function target_popup16(form) {
		w16=window.open('', 'win16','width=700,height=350,top=200,left=300,resizeable,scrollbars');
		form.target = 'win16';
}

if (!document.all) 
{
	document.captureEvents (Event.CLICK);
}
document.onclick = function() 
{
	if (w5 != null && !w5.closed) 
	{
		w5.focus();
	}
	if (w11 != null && !w11.closed) 
	{
		w11.focus();
	}	
	if (w12 != null && !w12.closed) 
	{
		w12.focus();
	}
	if (w13 != null && !w13.closed) 
	{
		w13.focus();
	}
	if (w16 != null && !w16.closed) 
	{
		w16.focus();
	}	

}

function buttonClick(theButton){
    document.getElementById('grupa_sel').value = document.getElementById('grp_sel').value;
    return true;
	}
	
function buttonClick2(theButton){
    document.getElementById('grupa_sel2').value = document.getElementById('grp_sel').value;
    return true;
	}	

function buttonClick4(theButton){
    document.getElementById('luna_sel_prez').value = document.getElementById('luna_sel').value;
    return true;
	}		
	
function check1() {
	
	var t = document.getElementById("grp_sel");
	document.getElementById("grupa_sel1").value = t.options[t.selectedIndex].text;
	
	var v = document.getElementById("grp_sel");
	document.getElementById("dengrupa_sel1").value = v.options[v.selectedIndex].value;

}

function check2() {
	
	var t = document.getElementById("luna_sel");
	document.getElementById("luna_sel2").value = t.options[t.selectedIndex].text;
	
	var v = document.getElementById("luna_sel");
	document.getElementById("denluna_sel2").value = v.options[v.selectedIndex].value;

}	

function check3() {
	
	var t = document.getElementById("grp_sel");
	document.getElementById("grupa_sel22").value = t.options[t.selectedIndex].text;
	
	var v = document.getElementById("grp_sel");
	document.getElementById("dengrupa_sel22").value = v.options[v.selectedIndex].value;

}

function check4() {
	
	var t = document.getElementById("luna_sel");
	document.getElementById("luna_sel22").value = t.options[t.selectedIndex].text;
	
	var v = document.getElementById("luna_sel");
	document.getElementById("denluna_sel22").value = v.options[v.selectedIndex].value;

}	

function showTR(dropdown){

	var v = dropdown.options[dropdown.selectedIndex].value;
	var codgrp ="99";
	var index = v.indexOf(codgrp);
	
	//if ( v == '99-ALTE DIVERSE VENITURI')
	if (index != -1)
	{
      document.getElementById('hidden_tr1').style.display = "none";
	  document.getElementById('hidden_tr2').style.display = "block";
	  document.getElementById('hidden_tr3').style.display = "none";
	}
	else
	{
      document.getElementById('hidden_tr1').style.display = "block";
	  document.getElementById('hidden_tr2').style.display = "none";
	  document.getElementById('hidden_tr3').style.display = "block";
	}
	
}

</script>

</head>

<body>

<?php
include 'javascripts.php';
include 'conectare.php';

//echo "SERVER = ".$_SERVER['PHP_SELF']; // arata calea de unde se executa PHP-ul: "SERVER = /gpp8/A21_MAIN.php"
//echo "SERVER = ".$_SERVER['SCRIPT_NAME']; // arata calea de unde se executa PHP-ul: "SERVER = /gpp8/A21_MAIN.php"

	$connection=mysql_connect("$host","$username","$password") or die("Nu aveti acces la server");
	$baza='apponlin_users';
	$db=mysql_select_db($baza,$connection) or die("Nu puteti selecta Baza de date ".$baza);
/*			
	$sql="SELECT substr(unit,1,3) as grup FROM login WHERE aplic=\"".$_POST["aplic"]."\" group by substr(unit,1,3)";
	$result=mysql_query($sql) or die("Interogare esuata: ".mysql_error());
	$i=0;
	while($row=mysql_fetch_array($result))
	{
		$w_gr[$i]=$row["grup"];
		$i++;
	}
	$ng=$i;
*/
	$myusername=$_POST['myusername']; 
	$mypassword=$_POST['mypassword']; 
// Protectie impotriva MySql Injection
	$myusername = stripslashes($myusername);
	$mypassword = stripslashes($mypassword);
	$myusername = mysql_real_escape_string($myusername);
	$mypassword = mysql_real_escape_string($mypassword);

// Memorez utilizatorul care acceseaza aplicatia
include 'accese.php';
	
	$sql="SELECT * FROM login WHERE user=\"".$myusername."\" and pw=\"".$mypassword."\" and aplic=\"".$_POST["aplic"]."\"";
	$result=mysql_query($sql) or die("Interogare esuata: ".mysql_error()); 
	$row=mysql_fetch_array($result);	

	echo "<input type=\"hidden\" name=\"aplic\" value=\"".$_POST["aplic"]."\">";
	echo "<INPUT TYPE=\"HIDDEN\" NAME=\"den_aplic\" VALUE=\"".$_POST["den_aplic"]."\">";
	
	$count=mysql_num_rows($result);	

	if($count<>1 or $_POST["aplic"]<>$row["aplic"] and $row["aplic"]<>"Axx" or $_POST["aplic"]==="A21" and !isset($_POST["actiune"]))
	{
		echo "<meta http-equiv=\"refresh\" content=\"2.5;url=login.php\">";
		echo "<body style=\"background-color:white\">";	
		echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\">";
		echo "<tr>";
		echo "<td colspan=\"3\" style=\"text-align:center; padding:5px; font-size:25pt;background-color:cornflowerblue;font-weight: bold; color:white\">APLICATII &nbsp ONLINE</td>";
		echo "</tr>";
		echo "<tr>";
		echo "<td colspan=\"3\" style=\" padding:5px; font-size:12pt;background-color:cornflowerblue;font-weight: bold; color:white;\">SC EXCEL INF SRL e-mail: excelinf@yahoo.com  |  Telefon: 0238 / 711.844</td>";
		echo "</tr>";

		echo "<TR><TD height=\"5px\">&nbsp</TD></TR>";

		echo "<TR>";
		echo "<td width=\"1%\">";
		echo "<form name=\"form1\" method=\"post\" action=\"login.php\">";
		echo "<INPUT type=\"HIDDEN\" name=\"aplic\"  VALUE=\"A21\">";
		echo "<INPUT TYPE=\"HIDDEN\" NAME=\"den_aplic\" VALUE=\"GRADINITE\">";
		echo "<button type=\"submit\" class=\"buton5_1\" align=\"left\">A21 GRD</button>";
		echo "</td>";
		echo "<td width=\"1%\">&nbsp</td>";
		echo "<td width=\"100%\">";
		echo "<button type=\"submit\" class=\"buton5_2\" align=\"center\">A21 GRADINITE</button>";
		echo "</td>";
		echo "</tr>";
		echo "</FORM>";
		
		echo "<TR><TD height=\"5px\">&nbsp</TD></TR>";
		
		echo "<TR>";
		echo "<td width=\"1%\">";
		echo "<form name=\"form1\" method=\"post\" action=\"login.php\">";
		echo "<INPUT type=\"HIDDEN\" name=\"aplic\"  VALUE=\"\">";
		echo "<INPUT type=\"HIDDEN\" name=\"den_aplic\"  VALUE=\"\">";
		echo "<button type=\"submit\" DISABLED class=\"buton2_1\" align=\"left\"></button>";
		echo "</td>";
		echo "<td width=\"1%\">&nbsp</td>";
		echo "<td width=\"100%\">";
		echo "<button type=\"submit\" DISABLED class=\"buton2_2\" align=\"left\"></button>";
		echo "</td>";
		echo "</TR>";
		echo "</FORM>";
		
		echo "<TR><TD height=\"5px\">&nbsp</TD></TR>";
		
		echo "<TR>";
		echo "<td width=\"1%\">";
		echo "<form name=\"form1\" method=\"post\" action=\"login.php\">";
		echo "<INPUT type=\"HIDDEN\" name=\"aplic\"  VALUE=\"\">";
		echo "<INPUT TYPE=\"HIDDEN\" NAME=\"den_aplic\" VALUE=\"\">";
		echo "<button type=\"submit\" DISABLED class=\"buton3_1\" align=\"left\"></button>";
		echo "</td>";
		echo "<td width=\"1%\">&nbsp</td>";
		echo "<td width=\"100%\">";
		echo "<button type=\"submit\" DISABLED class=\"buton3_2\" align=\"left\"></button>";
		echo "</td>";
		echo "</TR>";
		echo "</FORM>";
		
		echo "<TR><TD height=\"5px\">&nbsp</TD></TR>";

		echo "<TR>";
		echo "<td width=\"1%\">";
		echo "<form name=\"form1\" method=\"post\" action=\"login.php\">";
		echo "<INPUT type=\"HIDDEN\" name=\"aplic\"  VALUE=\"\">";
		echo "<INPUT TYPE=\"HIDDEN\" NAME=\"den_aplic\" VALUE=\"\">";
		echo "<button type=\"submit\" DISABLED class=\"buton4_1\" align=\"left\"></button>";
		echo "</td>";
		echo "<td width=\"1%\">&nbsp</td>";
		echo "<td width=\"100%\">";
		echo "<button type=\"submit\" DISABLED class=\"buton4_2\" align=\"left\"></button>";
		echo "</td>";
		echo "</TR>";
		echo "</FORM>";

		echo "</table>";

		echo "<form name=\"form10\" method=\"post\" action=\"A21_MAIN.php\" onsubmit=\"target_popup1(this);\">";
		
		echo "<div class=\"login\">";
		
		echo "<INPUT type=\"HIDDEN\" name=\"acces\"  VALUE=\"0\">";
		echo "<input type=\"hidden\" name=\"aplic\" value=\"".$_POST["aplic"]."\">";
		echo "<INPUT TYPE=\"HIDDEN\" NAME=\"den_aplic\" VALUE=\"".$_POST["den_aplic"]."\">";
		echo "<table width=\"400\" height=\"70\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#f5dea3\">";
		echo "<tr>";
		echo "<td>";
		echo "<table width=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\">";
		echo "</td>";
		echo "<td style=\"text-align:center; padding:4px; font-size:15pt;background-image:url('img/bg_menu.png');font-weight: bold; color:white\">Autentificare pentru: ".$_POST["aplic"]."</td>";
		echo "</tr>";
		echo "</table>";
		echo "<table  style=\"width:100%\"  height=\"70\" cellpadding=\"2\" cellspacing=\"2\">";
		echo "<tr> <td rowspan=\"2\"> </td> </tr>";
		echo "<tr> <td rowspan=\"2\"> </td> </tr>";
		echo "<tr>";
		echo "<td style=\"width:70;font-weight:bold;font-size:10pt\">Utilizator</td>";
		echo "<td style = \"width:100; \"><span class=\"user\"><input DISABLED name=\"myusername\" type=\"text\" id=\"myusername\" placeholder=\"Introduceti nume utilizator\" size=\"25\"></span></td>";
		echo "</tr>";
		echo "<tr> <td rowspan=\"2\"> </td> </tr>";
		echo "<tr> <td rowspan=\"2\"> </td> </tr>";
		echo "<tr>";
		echo "<td style=\"width:70;font-weight:bold;font-size:10pt\">Parola</td>";
		echo "<td><span class=\"pass\"><input DISABLED name=\"mypassword\" type=\"password\" id=\"mypassword\" placeholder=\"Introduceti parola utilizator\" size=\"25\"></span></td>";
		echo "</tr>";
		echo "<tr> <td rowspan=\"2\"> </td> </tr>";
		echo "<tr> <td rowspan=\"3\"> </td> </tr>";
		echo "<tr>";
		echo "<TD colspan=\"4\" align=\"center\">";
		echo "<input type=\"submit\" class=\"buton10\" disabled=\"disabled\" name=\"actiune\" value=\"OK\">";
		echo "</td>";
		echo "</tr>";
		echo "<TR>";
		echo "<TD colspan=\"4\"  style=\"font-size:12pt;text-align:center;font-family:Times New Roman;font-style:italic\">utilizator si parola incorecte</TD>";
		echo "</TR>";
		echo "<tr> <td rowspan=\"2\"> </td> </tr>";
		echo "<tr> <td rowspan=\"2\"> </td> </tr>";
		echo "</table>";
		echo "</table>";
		echo "</div>";
		echo "</form>";		
	}
	else
	{	
/*
$last_modified = filemtime(__FILE__);
$last_modified = date("d-m-Y H:i", $last_modified);

//$last_modified2 = filemtime(__FILE__);
//$last_modified2 = date("d-m-Y H:i", $last_modified2);
$last_modified2 = '08-12-2017 15:08';

echo "LAST = ".$last_modified;

IF ($last_modified == '08-12-2017 15:08')
{
	ECHO "AICI";
}
*/
		$wunit=$row["unit"];
		$wunit_ut=$wunit;
		$wgrup=$row["grup"];
		echo "<input type=\"hidden\" name=\"unitate\" value=\"".$wunit."\">";
		echo "<input type=\"hidden\" name=\"unitate_ut\" value=\"".$wunit_ut."\">";
		echo "<input type=\"hidden\" name=\"grup\" value=\"".$wgrup."\">";
		
		// Actualizez tabela accese cu numele unitatii si operatorului
		$wnume=$row["nume"]." ".$row["prenume"];
		$query1="SELECT id FROM accese order by id DESC LIMIT 1";
		$result1=mysql_query($query1) or die("Interogare esuata: ".mysql_error());
		$row1=mysql_fetch_array($result1);

		$query="UPDATE accese set unit=\"".$wunit."\",nume=\"".$wnume."\" where id=\"".$row1["id"]."\"";
		$result=mysql_query($query) or die("Nu puteti actualiza tabela Accese");
		// am actualizat tabela accese	
		
			$sql2="SELECT user,pw,aplic,nume,prenume FROM login WHERE user='$myusername' and pw='$mypassword' and aplic=\"".$_POST["aplic"]."\"";
			$result2=mysql_query($sql2) or die("Interogare esuata: ".mysql_error()); 
			$row2=mysql_fetch_array($result2);
			$wnume_log=$row2["nume"];
			$wprenume_log=$row2["prenume"];
		
			mysql_close($connection);	
		
			$db_name="apponlin_".$_POST["aplic"]."_".$wunit;  
			$tbl_name="unitate"; 

			$connection=mysql_connect("$host","$username","$password") or die("Nu aveti acces la server");
			$baza="apponlin_".$_POST["aplic"]."_".$wunit;
			$db=mysql_select_db($baza,$connection) or die("Nu puteti selecta Baza de date ".$baza);
			
			$sql="SELECT * FROM $tbl_name";
			$result=mysql_query($sql) or die("Interogare esuata: ".mysql_error()); 
			$row=mysql_fetch_array($result);
			$waplic=$_POST["aplic"];
			$wunit=$row["unit"];
			$wdenunit=$row["denunit"];
			$wden_aplic=$_POST["den_aplic"];
			$wcf=$row["cf"];
			$wfunc1=$row["func1"];
			$wnume1=$row["nume1"];
			$wfunc2=$row["func2"];
			$wnume2=$row["nume2"];
			$wan=$row["an"];
			$wan2=$row["an"]+1;
			$wln=$row["ln"];
			$wadresa=$row["adresa"];
			$wjudet=$row["judet"];
			$wprez=$row['prez'];
/*			
		class FlxZipArchive extends ZipArchive 
		{
			public function addDir($location, $name) 
			{
				$this->addEmptyDir($name);
				$this->addDirDo($location, $name);
			} 
			
			private function addDirDo($location, $name) 
			{
				$name .= '/';
				$location .= '/';
				 
				$dir = opendir ($location);
				while ($file = readdir($dir))
				{
					if ($file == '.' || $file == '..') continue;
				 
					$do = (filetype( $location . $file) == 'dir') ? 'addDir' : 'addFile';
					$this->$do($location . $file, $name . $file);
				}
			} 
		}

			$datac = date("d-m-Y");
			$baza_d = $baza.'_'.$datac;
			
			function recurse_copy($src,$dst) 
			{
				$dir = opendir($src);
				@mkdir($dst);
				while(false !== ( $file = readdir($dir)) ) 
				{
					if (( $file != '.' ) && ( $file != '..' )) 
					{
						if ( is_dir($src . '/' . $file) ) 
						{
							recurse_copy($src . '/' . $file,$dst . '/' . $file);
						}
						else 
						{
							copy($src . '/' . $file,$dst . '/' . $file);
						}
					}
				}
				closedir($dir);
			}
				
			$baza_arh = $baza.'_arhive';
				
			$src = "/xampp/mysql/data/$baza/";		
			$dst = "/xampp/mysql/data/$baza_d/";
			$arh = "/xampp/mysql/data/$baza_arh/";	
			
			if (!file_exists($arh)) 
			{
				mkdir($arh, 0777, true);
			}
			
			$zip_file_name = ''.$arh.'/'.$baza_d.'.zip';
	
			IF (!file_exists($zip_file_name))
			{
			
				$za = new FlxZipArchive;
				 
				$res = $za->open($zip_file_name, ZipArchive::CREATE);
				 
				if($res === TRUE) 
				{
					$za->addDir($src, basename($dst));
					$za->close();
				}
			}							
*/			
			echo "<TABLE class=\"table2\" cellSpacing=0 cellPadding=0 width=\"100%\" border=0>";
			echo "<tr>";
			echo "<td bgcolor=\"white\" colspan=\"20\" height=\"1px\"></td>";
			echo "</tr>";
			echo "<TR BGCOLOR=\"#4EAEF2\">";
			echo "<TD colspan=\"11\" class=\"style1\" height=\"25\" align=\"center\">";
			echo "<B> ".$_POST["den_aplic"]."</B>";
			echo "</TD>";
			echo "</TR>";
			echo "<tr>";
			echo "<td bgcolor=\"white\" colspan=\"20\" height=\"1px\"></td>";
			echo "</tr>";
			echo "<TR BGCOLOR=\"#A3D9FF\">";
			echo "<TD width=\"250\" class=\"style1\" colspan=\"2\" height=\"25\" align=\"left\"><B>Unitatea: &nbsp".$wdenunit."</B>";
			echo "</TD>";
			echo "<TD width=\"170\" class=\"style1\"  height=\"25\" align=\"left\"><B>An scolar: ".$wan." - ".$wan2."</B>";
			echo "</TD>";
			echo "</tr>";
			echo "<tr>";
			echo "<td bgcolor=\"white\" colspan=\"20\" height=\"1px\"></td>";
			echo "</tr>";

			echo "<FORM NAME=\"copii\" method=\"post\" action=\"A21_copii.php\">";
			include "A21_param.php";

			echo "<tr>";					
			echo "<TD bgcolor=\"#CDE6F9\" colspan=\"25\" height=\"35\" align=\"right\">";
			//echo "<INPUT TYPE=\"button\" onClick=\"window.location='login.php'\" id=\"button3\" VALUE=\"IESIRE\">"; 
			echo "<input type=\"button\" onclick=\"javascript:window.close()\" id=\"button3\" value=\"IESIRE\">";				
			echo "</td>";
			echo "</tr>";
			echo "</table>";
				
			echo "<table class=\"table1\" cellpadding=\"0\" cellspacing=\"0\">"; 		
			echo "<tr>";
			echo "<div style= \"margin-top:0px;\">";
			echo "</td>";
			echo "</tr>";
			echo "<tr>";
			echo "</tr>";
		
			$query="SELECT codgrp,dengrp FROM grupe order by codgrp";
			$result=mysql_query($query) or die("Interogare esuata: ".mysql_error());
			
			echo "<tr>";
			echo "<div style= \"margin-top:0px;\">";
			echo "<TD class=\"td1\" align=\"left\">GRUPA:&nbsp</TD>";
			echo "</tr>";
			echo "<tr>";
			echo "<TD colspan=\"15\" align=\"center\">";
			echo "<SELECT onfocus=\"onfocus_camp(this)\" onblur=\"onblur_text(this)\" NAME=\"grp_sel\" id=\"grp_sel\" onchange=\"showTR(this);\">"; 			
			$i=0;
			while($row=mysql_fetch_array($result))
			{	
				if($i===0 and !isset($_POST["grp_sel"]))
				{
					echo "<OPTION SELECTED value=\"".$row["codgrp"]."-".$row["dengrp"]."\">".$row["dengrp"]."</OPTION>";
				}
				else
				{
					if(isset($_POST["grp_sel"]) and $row["codgrp"]===substr($_POST["grp_sel"],0,2))
					{
						echo "<OPTION SELECTED value=\"".$row["codgrp"]."-".$row["dengrp"]."\">".$row["dengrp"]."</OPTION>";
					}
					else
					{
						echo "<OPTION value=\"".$row["codgrp"]."-".$row["dengrp"]."\">".$row["dengrp"]."</OPTION>";
					}
				}
				$i++;
			}
			echo "</select>";
			echo "</TD>";
			echo "</tr>";
			echo "</div>";
	
			$query="SELECT id,luna,denluna FROM luni order by id";
			$result=mysql_query($query) or die("Interogare esuata: ".mysql_error());
			
			echo "<tr>";
			echo "<div style= \"margin-top:0px;\">";
			echo "<TD class=\"td1\" align=\"left\">LUNA:&nbsp</TD>";
			echo "</td>";
			echo "</tr>";
			echo "<tr>";
			echo "<TD colspan=\"15\" align=\"center\">";
			$i=0;
			echo "<SELECT onfocus=\"onfocus_camp(this)\" onblur=\"onblur_text(this)\" NAME=\"luna_sel\" id=\"luna_sel\">";
			while($row=mysql_fetch_array($result))
			{		
				if($i===0 and !isset($_POST["luna_sel"]))
				{
					echo "<OPTION SELECTED value=\"".$row["luna"]."-".$row["denluna"]."\">".$row["denluna"]."</OPTION>";
				}
				else
				{
					if(isset($_POST["luna_sel"]) and $row["luna"]===substr($_POST["luna_sel"],0,2))
					{
						echo "<OPTION SELECTED value=\"".$row["luna"]."-".$row["denluna"]."\">".$row["denluna"]."</OPTION>";
					}
					else
					{
						echo "<OPTION value=\"".$row["luna"]."-".$row["denluna"]."\">".$row["denluna"]."</OPTION>";
					}
				}
				$i++;
			}
			echo "</select>";
			echo "</TD>";
			echo "</tr>";
			echo "</div>";

//			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"luna_sel\" id=\"luna_sel\">";
//			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"denluna_sel\" id=\"denluna_sel\">";
//			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"grp_sel\" id=\"grp_sel\">";
//			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"dengrp_sel\" id=\"dengrp_sel\">";
			
			echo "<tr>";
			echo "<div style= \"margin-top:0px;\">";
			echo "<TD class=\"td1\">EDITARE:&nbsp</TD>";
			echo "</td>";
			echo "</tr>";
			echo "<tr id=\"hidden_tr1\">";
			echo "<td height=\"25px\"><input type=\"submit\" id=\"button1\" name=\"actiune\" value=\"EVIDENTA PRESCOLARI\"></td>";   
			echo "</tr>";
			echo "<tr id=\"hidden_tr3\">";
			echo "<td height=\"25px\"><input type=\"submit\" id=\"button1\" name=\"actiune\" value=\"EVIDENTA PRESCOLARI - TOATE GRUPELE\"></td>";   
			echo "</tr>";				
			echo "<tr id=\"hidden_tr2\" style=\"display:none;\">";
			echo "<td height=\"25px\"><input type=\"submit\" id=\"button1\" name=\"actiune\" value=\"EVIDENTA ALTE DIVERSE VENITURI\"></td>";   
			echo "</tr>";;		
			echo "</div>";

			IF ($wprez == 1)
			{							
				echo "<tr>";		
				echo "<td height=\"25px\"><input type=\"submit\" id=\"button1_3\" name=\"actiune\" value=\"PREZENTA PRESCOLARI\" onclick=\"return buttonClick2(this)\"></td>"; 
				echo "<INPUT TYPE=\"HIDDEN\" NAME=\"grupa_sel2\" id=\"grupa_sel2\">"; 
				echo "</tr>";  				
			}
					
			echo "<tr>";
			echo "<div style= \"margin-top:0px;\">";
			echo "<TD class=\"td1\"> REZULTATE:</TD>";
			echo "</tr>";

			echo "<tr>";
			echo "<td height=\"25px\"><input type=\"submit\" id=\"button1_1\" name=\"actiune\" value=\"BORDEROU DEBITE SI PLATI\"></td>";   
			echo "</tr>";  
			echo "<tr>";
			echo "<td height=\"25px\"><input type=\"submit\" id=\"button1_2\" name=\"actiune\" value=\"BORDEROU INCASARI\"></td>";   
			echo "</tr>";  
			echo "<tr>";
			echo "<td height=\"25px\"><input type=\"submit\" id=\"button1_3\" name=\"actiune\" value=\"RECAPITULATIE\" ></td>";   
			echo "</tr>";
			echo "<tr>";
			echo "<td height=\"25px\"><input type=\"submit\" id=\"button1_3\" name=\"actiune\" value=\"REZUMAT INCASARI\"></td>";   
			echo "</tr>";
			
			IF ($wprez == 1)
			{							
				echo "<tr>";		
				echo "<td height=\"25px\"><input type=\"submit\" id=\"button1_3\" name=\"actiune\" value=\"PREZENTA GRUPE\" onclick=\"return buttonClick2(this)\"></td>"; 
				echo "<INPUT TYPE=\"HIDDEN\" NAME=\"grupa_sel2\" id=\"grupa_sel2\">"; 
				echo "</tr>";  				
			}
			
			echo "</FORM>";
			
			echo "<FORM name=\"form41\" ACTION=\"A21_sel_data.php\" METHOD=\"POST\" onsubmit=\"target_popup13(this)\">";
			include "A21_param.php";
			
			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"luna_sel\" id=\"luna_sel2\">";
			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"denluna_sel\" id=\"denluna_sel2\">";
			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"grp_sel\" id=\"grupa_sel1\">";
			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"dengrp_sel\" id=\"dengrupa_sel1\">";
			
			echo "<tr>";
			echo "<td height=\"25px\"><input type=\"submit\" id=\"button1_3\" name=\"actiune\" value=\"REGISTRU DE CASA\" onclick=\"return buttonClick(this)\"></td>";   
			echo "</tr>"; 
			echo "</FORM>";
			
			IF ($wprez == 1)
			{	
				echo "<FORM name=\"form41\" method=\"POST\" action=\"A21_prezenta_grp.php\">";
				include "A21_param.php";	
				
				echo "<tr>";
				echo "<td height=\"25px\"><input type=\"submit\" id=\"button1_3\" name=\"actiune\" value=\"PREZENTA GRUPE\" onclick=\"return buttonClick4(this)\"></td>";
				echo "<INPUT TYPE=\"HIDDEN\" NAME=\"luna_sel_prez\" id=\"luna_sel_prez\">";
				echo "</tr>";	
				echo "</FORM>";
			}	

			echo "<tr>";
			echo "<TD class=\"td1\"> UTILITARE:</TD>";
			echo "</tr>";
			
			echo "<tr>";
			echo "<TD colspan=\"10\" align=\"left\">";
			echo "</td>";
			echo "</tr>";

			echo "<FORM name=\"form41\" ACTION=\"A21_tarife.php\" METHOD=\"POST\" onsubmit=\"target_popup5(this)\">";
			include "A21_param.php";
			
			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"luna_sel\" id=\"luna_sel2\">";
			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"denluna_sel\" id=\"denluna_sel2\">";
			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"grp_sel\" id=\"grupa_sel1\">";
			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"dengrp_sel\" id=\"dengrupa_sel1\">";
			
			echo "<tr>";
			echo "<td height=\"25px\"><input type=\"submit\" id=\"button\" name=\"actiune\" value=\"STABILIRE TARIFE\" onclick=\"return buttonClick(this)\"></td>";
			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"grupa_sel\" id=\"grupa_sel\">";		
			echo "</tr>";  
			echo "</form>";

			echo "<tr>";
			echo "<TD colspan=\"10\" align=\"left\">";
			echo "</td>";
			echo "</tr>";

			echo "<FORM name=\"form41\" ACTION=\"A21_utilitare.php\" METHOD=\"POST\" onsubmit=\"target_popup16(this)\">";	
			include "A21_param.php";

			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"luna_sel\" id=\"luna_sel2\">";
			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"denluna_sel\" id=\"denluna_sel2\">";
			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"grp_sel\" id=\"grupa_sel1\">";
			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"dengrp_sel\" id=\"dengrupa_sel1\">";
			
			echo "<tr>";
			echo "<td height=\"25px\"><input type=\"submit\" id=\"button1\" name=\"actiune\" value=\"DEFINIRE DATE UNITATE\" onClick=\"check1(this);\" onMouseUp=\"check2(this);\"></td>";   
			echo "</tr>";  			
	
			echo "<tr>";
			echo "<td height=\"25px\"><input type=\"submit\" id=\"button1\" name=\"actiune\" value=\"GRUPE PRESCOLARI\" onClick=\"check1(this);\" onMouseUp=\"check2(this);\" ></td>";   
			echo "</tr>";  
			
			// echo "<tr>";
			// echo "<td height=\"25px\"><input type=\"submit\" id=\"button1\" name=\"actiune\" value=\"STABILIRE ZILE LIBERE\" onClick=\"check1(this);\" onMouseUp=\"check2(this);\" ></td>";   
			// echo "</tr>";  			
			echo "</form>";

			echo "<tr>";
			echo "<TD colspan=\"10\" align=\"left\">";
			echo "</td>";
			echo "</tr>";

			echo "<FORM name=\"form41\" ACTION=\"A21_utilitare.php\" METHOD=\"POST\" onsubmit=\"target_popup12(this)\">";	
			include "A21_param.php";

			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"luna_sel\" id=\"luna_sel2\">";
			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"denluna_sel\" id=\"denluna_sel2\">";
			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"grp_sel\" id=\"grupa_sel1\">";
			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"dengrp_sel\" id=\"dengrupa_sel1\">";
			
			echo "<tr>";
			echo "<td height=\"25px\"><input type=\"submit\" id=\"button1\" name=\"actiune\" value=\"SCHIMBARE PAROLA\" onClick=\"check1(this);\" onMouseUp=\"check2(this);\"></td>";   
			echo "</tr>";  
			
//			echo "<tr>";
//			echo "<td height=\"25px\"><input type=\"submit\" id=\"button1\" name=\"actiune\" value=\"PRELUARE SOLDURI INITIALE\" onClick=\"check1(this);\" onMouseUp=\"check2(this);\"></td>";   
// 		
			echo "</form>";

			echo "<FORM name=\"form41\" ACTION=\"A21_instruct.php\" METHOD=\"POST\" onsubmit=\"target_popup11(this)\">";	
			include "A21_param.php";
			
			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"luna_sel\" id=\"luna_sel2\">";
			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"denluna_sel\" id=\"denluna_sel2\">";
			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"grp_sel\" id=\"grupa_sel1\">";
			echo "<INPUT TYPE=\"HIDDEN\" NAME=\"dengrp_sel\" id=\"dengrupa_sel1\">";
			
			echo "<tr>";
			echo "<td height=\"25px\"><input type=\"submit\" id=\"button1\" name=\"actiune\" value=\"INSTRUCTIUNI DE UTILIZARE\" onClick=\"check1(this);\" onMouseUp=\"check2(this);\"></td>";  
			echo "</tr>";  
			
			echo "<tr>";
			echo "<td>&nbsp</td>";  
			echo "</tr>";
			echo "<tr>";
			echo "<td>&nbsp</td>";  			
			echo "</tr>";

		echo "</div>";
		echo "</table>";
		echo "</form>";
		
		mysql_close($connection);
	}

?>
</body>
</html>