Файл: Как писать концепцию.pdf

Добавлен: 23.10.2018

Просмотров: 2620

Скачиваний: 11

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.
background image

 

 


.red { 
width: 15px; 
height: 15px; 
display: inline-block; 
vertical-align: top; 
margin-top: 2px; 
background: transparent url(../image/r.ico); 

</style> 
<body> 
<form align="center" method="GET"> 
 

<input type="text" name="ng" placeholder="номер группы"> 

 

<input type="text" name="n" placeholder="имя группы"> 

 

<input type='submit' name="d" value='добавить'></form> 

<table border="1" align="center"> 
<tr> 
 

<th>№ группы</th> 

 

<th>Группа</th> 

 

<th><div class="action_remove"></div></th> 

 

<th><div class="red"></div></th> 

</tr> 
<?php 
$ng=$_GET["ng"]; 
$n=$_GET["n"]; 
$udal=$_GET["udal"]; 
$connection = mysql_connect("localhost","root"); 
if(!$connection) die("Ошибка доступа к базе данных"); 
if(!mysql_select_db("грицина")) 
die("База данных отсутствует. Приносим свои извинения"); 
 if (isset($_GET['d'])){ 
 

$dob=mysql_query("INSERT INTO группы_техники(номер_группы, 

группа) VALUES ('".$ng."','".$n."')"); 

 

$ud=mysql_query("delete from группы_техники where 

номер_группы='$udal'"); 
 

 

 

$q = mysql_query("SELECT * FROM группы_техники");  

if(!$q) die("Ошибка доступа к базе данных. 
Приносим свои извинения"); 
while ($p=mysql_fetch_assoc($q)) 

$j=$p["номер_группы"]; 
$gr=$p["группа"]; 
print "<form method='GET'\n<tr align='center'> 


background image

 

 

 

<td>{$p["номер_группы"]}</td> 

 

<td>{$p["группа"]}</td> 

 

<td><a href='gruppi.php?udal=$j &nt=$nt' target='sklad' 

title='удалить'><div class='action_remove'></td></div> 
 

<td><a href='grup_izm.php?red=$j &ggr=$gr' target='sklad' 

title='изменить'><div class='red'></td></div> 

 

 

</tr>\n</form>"; 


?> 
</table><br> 
</body> 
</html> 
 

Листинг table/grup_izm.php 

<html> 
<head> 
<title>Изменение группы товаров</title> 
</head> 
<body> 
<table border="1" align="center"> 
<tr> 
 

<th>№ группы</th> 

 

<th>Группа</th> 

</tr> 
<?php 
print"<form method='POST'>"; 
$gr=$_GET["red"]; 
$ggr=$_GET["ggr"]; 
$g=$_POST["gruppa"]; 
$connection = mysql_connect("localhost","root"); 
if(!$connection) die("Ошибка доступа к базе данных"); 
if(!mysql_select_db("грицина")) 
die("База данных отсутствует. Приносим свои извинения"); 
 
if($_POST["gruppa"]) 
 

{$r = mysql_query("update группы_техники set группа='$g' where 

группа='$ggr'"); } 
 

 

 

$q = mysql_query("SELECT * FROM группы_техники where 

номер_группы='$gr'");  
if(!$q) die("Ошибка доступа к базе данных. 
Приносим свои извинения"); 
while ($p=mysql_fetch_assoc($q)) 

print "\n<tr> 


background image

 

 

 

<td align='center'>{$p["номер_группы"]}</td> 

 

<td align='center'>{$p["группа"]}<br><input type='text' size='8' 

name='gruppa' value=''></td> 
 

</tr>\n"; 


?> 
</table><br> 
<p><input type='submit' name='ok' value='ОК'></form> 
 
</form> 
</body> 
</html> 
 
 

Листинг table/proizvodileli.php 

<html> 
<head> 
<title>Производители</title> 
</head> 
<style> 
 
.action_remove { 
width: 11px; 
height: 11px; 
display: inline-block; 
vertical-align: top; 
margin-top: 2px; 
background: transparent url(../image/catalog.png) -30px -29px no-repeat; 

.red { 
width: 15px; 
height: 15px; 
display: inline-block; 
vertical-align: top; 
margin-top: 2px; 
background: transparent url(../image/r.ico); 

</style> 
<body> 
<form align="center" method="GET"> 
 

<input type="text" name="np" placeholder="номер производителя"> 

 

<input type="text" name="npr" placeholder="производитель"> 

 

<input type='submit' name="d" value='добавить'> 

 

</form> 

<table border="1" align="center"> 


background image

 

 

<tr> 
 

<th>№ производителя </th> 

 

<th>Производитель</th> 

 

<th><div class="action_remove"></div></th> 

 

<th><div class="red"></div></th> 

</tr> 
<?php 
$nomer=$_GET["np"]; 
$name=$_GET["npr"]; 
$udal=$_GET["udal"]; 
$red=$_GET["red"]; 
$connection = mysql_connect("localhost","root"); 
if(!$connection) die("Ошибка доступа к базе данных"); 
if(!mysql_select_db("грицина")) 
die("База данных отсутствует. Приносим свои извинения"); 
 if (isset($_GET['d'])){ 
 

$dob=mysql_query("INSERT INTO производители 

(номер_производителя, название_производителя)  
 

VALUES ('".$nomer."','".$name."')"); 


 

$ud=mysql_query("delete from производители where 

номер_производителя='$udal'"); 
 

 

 

$qresult = mysql_query("SELECT * FROM производители");  

if(!$qresult) die("Ошибка доступа к базе данных. 
Приносим свои извинения"); 
 
while ($p=mysql_fetch_assoc($qresult)) 

$j=$p["номер_производителя"]; 
$m=$p["название_производителя"]; 
print "\n<form method='GET'><tr align='center'> 
 

<td>{$p["номер_производителя"]}</td> 

 

<td>{$p["название_производителя"]}</td> 

 

<td><a href='proizvoditeli.php?udal=$j' target='sklad' title='удалить'><div 

class='action_remove'></td></div> 
 

<td><a href='proiz_izm.php?np=$j &m=$m' target='sklad' 

title='изменить'><div class='red'></td></div> 
 

</tr>\n</form>"; 


?> 
</table><br> 
</body> 
</html> 
 


background image

 

 

Листинг table/proiz_izm.php 

<html> 
<head> 
<title>Изменение производителей</title> 
</head> 
<body> 
<table border="1" align="center"> 
<tr> 
 

<th>№ производителя </th> 

 

<th>Производитель</th> 

</tr> 
<?php 
print"<form align='center' method='POST'>"; 
$np=$_GET["np"]; 
$n=$_GET["m"]; 
$na=$_POST["name"]; 
$connection = mysql_connect("localhost","root"); 
if(!$connection) die("Ошибка доступа к базе данных"); 
if(!mysql_select_db("грицина")) 
die("База данных отсутствует. Приносим свои извинения"); 
 
if($_POST["name"]) 
 

{$r = mysql_query("update производители set 

название_производителя='$na' where название_производителя='$n' and 
номер_производителя='$np'"); } 
 
$qresult = mysql_query("SELECT * FROM производители where 
номер_производителя='$np'");  
 

if(!$qresult) die("Ошибка доступа к базе данных.Приносим свои 

извинения"); 
while ($p=mysql_fetch_assoc($qresult)) 

$j=$p["номер_производителя"]; 
print "\n<tr align='center'> 
 

<td>{$p["номер_производителя"]}</td> 

 

<td>{$p["название_производителя"]}<br><input type='text' size='8' 

name='name' value=''></td> 
 

</tr>\n"; 


?> 
</table><br> 
<p align='center'><input type="submit" value="ok"></form> 
</body> 
</html>