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

<!DOCTYPE html>
<meta charset="utf-8">
<html lang="en">
<HEAD>
<TITLE>Instructiuni / Observatii / Intrebari</TITLE>

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

<style type="text/css">

body
{
	*background-color: #CDE6F9;
	background-size: 100% 100%;
	min-height: 670px;
	background-size: fixed;
	font-size: 10pt;
	font-family: Times New Roman;
}

#button10 
{
	font-family: Times New Roman;
	width:100px;
	cursor:pointer;
}


#button10:hover
{
	font-family: Times New Roman;
	border-width:3px;
	border-color:coral;
	border-style:solid;
	/*border-style:solid;*/
	cursor:pointer;
}

</style>

<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>

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

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

var w13;
function target_popup13(form) {
		w13=window.open('', 'win13','width=800,height=600,top=200,left=400,resizeable,scrollbars');
		form.target = 'win13';
}
</script>
</HEAD>
<BODY>
<CENTER>
		
<?php
ob_start();
include 'javascripts.php';
include 'conectare.php';

if ($_POST["actiune"]=="INSTRUCTIUNI DE UTILIZARE")		
{	

	echo "<body bgcolor=\"white\">";

	echo "<FORM name=\"form41\" ACTION=\"A21_instruct.php\" METHOD=\"POST\" onSubmit=\"target_popup13(this)\">";
	include 'A21_param1.php';
	
echo "<p align=\"center\">INSTRUCTIUNI DE UTILIZARE</p>";
echo "<p align=\"left\">";

include 'Instructiuni.txt';
echo "</P>";	
		


echo "</center>";	
		
		echo "<TABLE cellSpacing=0 cellPadding=0 width=\"90%; height:100%;\" border=0>";
		echo "<tr>";
		echo "<td height=\"35\" align=\"right\">";
		//echo "<input type=\"submit\" name=\"actiune\" id=\"button10\" value=\"OBSERVATII / INTREBARI\">";
		//echo "<input type=\"submit\" name=\"actiune\" id=\"button13\" value=\"OBSERVATII SI INTREBARI\">";
		echo "<input type=\"button\" onclick=\"javascript:window.close()\" id=\"button10\" value=\"RENUNT\">";
		echo "</td>";
		echo "</tr>";	
		echo "</TABLE>";	
}

if ($_POST["actiune"]=="OBSERVATII SI INTREBARI")		
{
			$connection=mysql_connect("$host","$username","$password") or die("Nu aveti acces la server");
			$baza="apponlin_".$_POST["aplic"]."_".substr($_POST["unitate"],0,3)."_999";
			$db=mysql_select_db($baza,$connection) or die("Nu puteti selecta Baza de date ".$baza);	
			
			//echo "<INPUT TYPE=\"HIDDEN\" NAME=\"unit_sel\" VALUE=\"".$_POST["unit_sel"]."\">";
			//echo "<INPUT TYPE=\"HIDDEN\" NAME=\"acces\" VALUE=\"1\">"; 
			
			echo "<TR>";
			echo "<TD width=\"100%\" align=\"center\">";
			echo "<B>OBSERVATII SI INTREBARI</B>";
			echo "<BR>";
			//echo "<B>DE LA: ".$_POST["data_incep"]." &nbsp PANA LA: ".$_POST["data_fin"]."</B>";
			echo "</TD>";
			echo "</TR>";
	
			echo "</TABLE>";
			echo "</table>";
			
			echo "<FORM NAME=\"form1\" ACTION=\"A21_instruct_adaug.php\" METHOD=\"POST\">";
			include 'A21_param1.php';
		/*	
				echo "<TABLE  cellSpacing=0 cellPadding=0 width=\"90%\" border=0>";
				echo "<TR BGCOLOR=\"white\">";
				echo "<TH align=\"center\" width=\"3%\" class=\"td12\">Nr. crt.</TH>";			
				echo "<TH align=\"center\" width=\"10%\" class=\"td12\">Data / Ora</TH>";
				echo "<TH align=\"center\" width=\"50%\" class=\"td12\">Observatii / Intrebari</TH>";
				echo "<TH align=\"center\" width=\"40%\" class=\"td14\">Raspunsuri</TH>";		
				echo "</TR>";
		*/		
		
			echo "<BR><BR>";
			echo "<TABLE  cellSpacing=0 cellPadding=0 width=\"100%\" border=0>";
			echo "<TR BGCOLOR=\"white\">";
			echo "<TH align=\"center\" width=\"100%\" class=\"td14\">Observatii / Intrebari anterioare</TH>";		
			echo "</TR>";
		
			$query="SELECT * FROM obs_intreb WHERE unit=\"".$_POST["unitate"]."\" order by data_ora ASC";
			$result=mysql_query($query) or die("Interogare esuata: ".mysql_error());	
		
			$i=0;
			while($row = mysql_fetch_array($result)) 
			{ 
				echo "<TR>";
				echo"<TD align=\"left\">";
				echo "".$row["obs_int"]."";
				echo "</TD>";
				echo "</TR>";
				$i++;
			}
			echo "</table>";
			
			echo "<BR><BR>";
			
				echo "<TABLE  cellSpacing=0 cellPadding=0 width=\"100%\"align=\"center\" border=0>";
				echo "<TR BGCOLOR=\"white\">";
				echo "<TH align=\"center\" width=\"100%\" class=\"td14\">Introduceti observatii / intrebari</TH>";	
				echo "</TR>";
				echo "<TR BGCOLOR=\"white\">";
				echo"<TD width=\"100%\" align=\"left\">";
				echo "<textarea name=\"obs_int\" rows = \"10\" cols = \"93\" id=\"obs_int\" autofocus=\"autofocus\" wrap=\"hard\" align=\"left\"></textarea>";
				//echo "<input type=\"submit\" value=\"\" name=\"actiune\">";
				echo "</TD>";
				echo "</TR>";
				echo "</TABLE>";
	
				echo "<TABLE cellSpacing=0 cellPadding=0 width=\"90%; height:100%;\" border=0>";
				echo "<TD colspan=\"7\" align=\"right\" height=\"35\">";
				echo "<INPUT TYPE=\"SUBMIT\" id=\"button10\" NAME=\"actiune\" VALUE=\"ADAUGARE\">";		
				echo "<input type=\"button\" onclick=\"javascript:window.close()\" id=\"button10\" value=\"RENUNT\">";
				echo "</TR>";
				echo "</TABLE>";	
			
	mysql_close($connection);	
			
}
	
?>
</FORM>
</body>
</html>	