<?php

echo '<div id="titlupagina">
		<b>Administreaza produse</b>
	</div>';
echo '<a href="index.php?pag=logat&meniu=produse&task=add">
		<div id="butonmeniu">Adauga produs</div>
	</a>';
echo '<a href="index.php?pag=logat&meniu=produse&task=cat">
		<div id="butonmeniu">Adauga categorie</div>
	</a>';
echo '<a href="index.php?pag=logat&meniu=produse">
		<div id="butonmeniu">Arata produse</div>
	</a>';
//start adauga produs nou 	
if ($_GET['task'] == 'add' ){
	echo'<form action="" method="post">';
		echo'<fieldset id="fieldsetdreapta2">
				<legend id="legenddreapta2" align="left">Denumire</legend>
					<input id="input" name="denumire" type="text" value="'.$_SESSION['denumire'].'">
			</fieldset>';
		echo'<fieldset id="fieldsetdreapta2">
				<legend id="legenddreapta2" align="left">Cod produs</legend>
					<input id="input" name="cod_produs" type="number" min="0" value="'.$_SESSION['cod_produs'].'" >
			</fieldset>';
			echo '<hr width="50%" height="1px" color="#ffffff" align="left">';
		echo'<fieldset id="fieldsetdreapta2">
				<legend id="legenddreapta2" align="left">Pret (fara TVA)</legend>
					<input id="input2" name="pret" type="number" min="0" value="'.$_SESSION['pret'].'" >
			</fieldset>';
		echo'<fieldset id="fieldsetdreapta2">
				<legend id="legenddreapta2" align="left">TVA</legend>
					<input id="input2" name="tva" type="number" min="0" value="'.$_SESSION['tva'].'" >
			</fieldset>';
		echo'<fieldset id="fieldsetdreapta3">
				<legend id="legenddreapta3" align="left">Descriere</legend>
					<textarea id="input_textarea" name="descriere">'.$_SESSION['descriere'].'</textarea> 
			</fieldset>';
		//echo '<hr width="90%" height="1px" color="blue">';
		echo'<fieldset id="fieldsetdreapta2">
				<legend id="legenddreapta2" align="left">Categorie</legend>
					<input id="input1" name="categorie" type="text" value="'.$_SESSION['categorie'].'" >
			</fieldset>';
		echo'<fieldset id="fieldsetdreapta2">
				<legend id="legenddreapta2" align="left">Unitati cantitate</legend>
					<input id="input1" name="unitati_cantitate" type="text" value="'.$_SESSION['unitati_cantitate'].'" >
			</fieldset>';
			
		echo'<fieldset id="fieldsetdreapta2">
				<legend id="legenddreapta2" align="left">Status stoc</legend>
					<input id="input1" name="status_stoc" type="text" value="'.$_SESSION['status_stoc'].'" >
			</fieldset>';
		
if($_SESSION['loc_preluare'] == 'Activ'){$checkbox1 = 'checked'; $checkbox2 = '';}
if($_SESSION['loc_preluare'] == 'Inactiv'){$checkbox1 = ''; $checkbox2 = 'checked';}		
		echo'<fieldset id="fieldsetdreapta2">
				<legend id="legenddreapta2" align="left">Status produs</legend>
					<table style="width:214px; margin: 20px;" border="0">
						<tr>
							<td style="text-align: right;">Activ </td>
							<td style="text-align: left;">
								<input id="radio" '.$checkbox1.' name="status" type="radio" value="Activ">
							</td>
							<td style="text-align: right;">Inactiv </td>
							<td style="text-align: left;">
								<input id="radio" '.$checkbox2.' name="status" type="radio" value="Inactiv">
							</td>
						</tr>
					</table>
			</fieldset>';
		echo'<fieldset id="fieldsetdreapta2">
				<legend id="legenddreapta2" align="left">Data start promotie</legend>
					<input id="input1" name="start_promotie" type="date" value="'.$_SESSION['start_promotie'].'" >
			</fieldset>';
		echo'<fieldset id="fieldsetdreapta2">
				<legend id="legenddreapta2" align="left">Data end promotie</legend>
					<input id="input1" name="end_promotie" type="date" value="'.$_SESSION['end_promotie'].'" >
			</fieldset>';
		echo'</form>';
	}
//end adauga produs nou 	
//===============================
//start adauga categorie 	
if ($_GET['task'] == 'cat' ){
		echo '<div style="text-align: center; color: blue;">
				<b>Adauga categorie</b>
			</div>';
	}
//end adauga categorie
//===============================	
?>