You are on page 1of 4

<!

DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="CSS/stil.css">
<audio src="Imagini_Video/Kalimba.mp3" autoplay="1"> Kalimba </audio>
</head>
<body id="body">
<header id="header">
</header>
<nav id="nav">
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="index.php?p=1">Adauga Produse</a></li>
<li><a href="index.php?p=2">Vizualizeaza Produse</a></li>
<li><a href="index.php?p=3">Contact</a></li>
</ul>
</nav>
<section id="section">
<?php
if (isset($_GET['p'])) {
$val = $_GET['p'];
switch ($val) {
case 1:
require_once '/Pagini/Adauga.php';
break;
case 2:
require_once '/Pagini/Vizualizeaza.php';
break;
case 3:
require_once '/Pagini/Contact.php';
break;
default:
require_once 'Pagini/Eroare.php';
}
} else {
require_once 'Pagini/Home.php';
}
?>
</section>
<footer id="footer">
&COPY;Ioana Timar 2014
</footer>
</body>
</html>
<h1>Adaugare Produse</h1>
<form method="post" action="index.php?p=1">
<table>
<tr>
<td>Nume Produs</td>
<td>
<input type="text" name="nume" placeholder="Numele Produsului">
</td>
</tr>
<tr>
<td>Pret Produs</td>
<td>
<input type="number" name="pret">
</td>
</tr>
<tr>
<td>
<input type="submit" name="Adauga" value="Adauga Produs">
</td>
</tr>
</table>
</form>
<?php
if(isset($_POST['Adauga'])){
$nume = $_POST['nume'];
$pret =$_POST['pret'];
if(strlen($nume)<1||strlen($pret)<1)
print "Introduceti cel putin 1 caracter pentru fiecare dintre campur
i";
else{
if(strlen($nume)>=1&&strlen($pret)>=1)
print "Produs Adaugat";
else
print "Eroare la adaugare";
}
}
?>
<article class="article">
<header class="article_header">
<h1> TEST </h1>
</header>
<p>Cursurile CCNA reprezinta primul pas pe care un initiat in IT
ar trebui sa-l faca in domeniul retelelor.
Cursurile CCNA sunt create special pentru cei ce pornesc
de la zero, adica nu au nicio idee despre retele
(in schimb trebuie sa aiba cunostinte minime IT),
aducand cursantii la nivelul apropiat profesionistilor in
retele. </p>
<img src="./Imagini_Video/Desert.jpg" id='img' align="center">
</article>
<h1>Formular de contact</h1>
<form method="post" action="index.php?p=3">
<table>
<tr>
<td>Mail Destinatar:</td>
<td>
<input type="email" name="destinatar">
</td>
</tr>
<tr>
<td>Subiect:</td>
<td><input type="text" name="subiect"></td>
</tr>
<tr>
<td>Mesaj:</td>
<td>
<textarea id="mesaj" name="mesaj"></textarea>
</td>
</tr>
<tr>
<td>
<input type="submit" name="send" value="Trimite mail">
</td>
</tr>
</table>
</form>
<?php
if(isset($_POST['send'])){
$to = $_POST['destinatar'];
$subject = $_POST['subiect'];
$content = $_POST['mesaj'];
$rez = mail($to, $subject, $content);
if($rez)
print "<h2>Mail-ul a fost trimis cu succes</h2>";
else
print "<h2>Mail-ul nu a putut fi trimis</h2>";
}
?>
*{
padding: 0;
margin: 0;
}
header,nav,section,footer,article,hgroup,aside {
display: block;
}
#body {
margin-left: auto;
margin-right: auto;
width: 900px;
}
#header{
background-image: url('../Imagini_Video/Desert.jpg');
height: 60px;
border-bottom-style: solid;

}
#nav {
width: 20%;
float: left;
position: relative;
border-right: solid;
height: 400px;
}
#nav ul {
list-style-type: none;
}
#nav ul li a{
text-decoration-style: none;
}
#section{
width: 75%;
height: 400px;
position: relative;
float: left;

}
#footer{
clear: both;
text-align: center;
border-style: 1px dotted;
}
#mesaj{
width: 120px;
height: 30px;
}
.article{
margin-bottom: 30px;
}
.article_footer{
font-weight: bold;
color:darkolivegreen;
}
.article p{
text-align: justify;
}
#img{
width: 300px;
height: 300px;
}
.article_header{
margin-bottom: 8px;
color:red;
}

You might also like