div class panel-heading Добавить новую спецальности div -- panel-headi

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<div class="panel-heading">
Добавить новую спецальности
</div>
<!-- /.panel-heading -->
<div class="panel-body">
<div class="">
<form method="POST">
<div class="form-group">
<input class="form-control" name="name_specialty" type="text" autofocus>
</div>
<?
$spec = "<select class='form-control' id='group' name='group' size='1'>
<option value='all'>Выберите раздел</option>";
$query = mysql_query("SELECT * FROM specialty_group ORDER BY id_specialty_group");
$result = mysql_fetch_array($query);
do
{
$spec .= "<option value='".$result['id_specialty_group']."'>".$result['name_specialty_group']."</option>";
}
while($result = mysql_fetch_array($query));
$specialty_group_forms = $result['name_specialty_group'];
$spec .= "</select>";
echo $spec."<br>"."<br>";
echo " <input type='submit' value='Добавить' id='submit' name='submit' class='submit_btn left' /> </br>";
echo " </form>";
$name_specialty = $_POST['name_specialty'];
if (isset($_POST['submit'])){
$sql = "INSERT INTO specialty (`name_specialty`,`parent`) VALUES('$name_specialty','$specialty_group_forms')";
// проверка
if(!mysql_query($sql))
{echo '<center><p><b>Ошибка при добавлении данных!</b></p></center>';}
else
{echo '<center><p><b>Данные успешно добавлены!</b></p></center>';}
}