<?php
include ("mysql.php");
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>Главная - Для администраторов сайта! - Добавление Каталога.</title>
<link href="img/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<link rel="stylesheet" href="../../css/style.css" type="text/css" />
</head>
<script>
function hideDiv(input, num1, num2) {
if (input.value) {
alert('Выберите, пожалуйста, следующее изображение для загрузки.');
document.getElementById('img'+num2).style.display = '';
} else
return false;
}
function AddImg() {
var inputs = document.getElementById('form').getElementsByTagName('input');
var count = 0;
for (var i = 0; i < inputs.length; i++)
if (inputs[i].type == 'file' && inputs[i].value)
count++;
if (count == 3)
document.getElementById('form').submit();
}
</script>
<body marginheight="0" marginwidth="0">
<div id="corner_l"></div>
<div id="corner_l1"></div>
<div id="corner_r"></div>
<div id="corner_r1"></div>
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" id="table">
<tr>
<td width="8%" height="52"> </td>
<td colspan="2"> </td>
<td width="3%"> </td>
</tr>
<tr>
<td height="66"> </td>
<td colspan="2" align="center" id="avto"><h1 align="center" style=" color:#900; font-family: Times New Roman, Times, serif;">Для администраторов!</h1></td>
<td> </td>
</tr>
<tr>
<td height="249"> </td>
<td colspan="2" align="center" valign="middle">
<h1 align="center" style=" color:#900; font-family: Times New Roman, Times, serif;">Добавление машины в каталог:</h1><br>
<form id="form" action="add.php" method="post" ENCTYPE="multipart/form-data">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" id="table">
<tr>
<td height="249" rowspan="16"> </td>
<td align="justify" valign="top" width="15%">Модель машины: <b><font color="red">*</font></b></td>
<td align="justify" valign="top" width="21%">
<input type="text" name="model" value="<? echo $_SESSION['model'];?>"/><br>
</td>
<td rowspan="16"> </td>
</tr>
<tr>
<td align="justify" valign="top">Год выпуска: <b><font color="red">*</font></b></td>
<td align="justify" valign="top">
<input type="text" name="year" value="<? echo $_SESSION['year'];?>"/> г.
</td>
</tr>
<tr>
<td height="22" align="justify" valign="top">Место стоянки: <b><font color="red">*</font></b></td>
<td align="justify" valign="top">
<input type="text" name="mesto" value="<? echo $_SESSION['mesto'];?>"/>
</td>
</tr>
<tr>
<td align="justify" valign="top">Контактный телефон: <b><font color="red">*</font></b></td>
<td align="justify" valign="top">
<input type="text" name="phone" value="<? echo $_SESSION['phone'];?>"/>
</td>
<tr>
<td align="justify" valign="top">Пробег: <b><font color="red">*</font></b></td>
<td align="justify" valign="top">
<input type="text" name="probeg" value="<? echo $_SESSION['probeg'];?>"/> км
</td>
</tr>
<tr>
<td align="justify" valign="top">КПП (для выбора): <b><font color="red">*</font></b></td>
<td align="justify" valign="top">
<select name="kpp" id="kpp" ><option selected value="<? echo $_SESSION['kpp'];?>"></option><option value="Автомат">Автомат</option><option value="Ручная">Ручная</option></select>
</td>
</tr>
<tr>
<td align="justify" valign="top">КПП (для информации): <b><font color="red">*</font></b></td>
<td align="justify" valign="top">
<input type="text" value="<? echo $_SESSION['kpp'];?>" readonly>
</td>
</tr>
<tr>
<td align="justify" valign="top">Мощность: <b><font color="red">*</font></b></td>
<td align="justify" valign="top">
<input type="text" name="moschnost" value="<? echo $_SESSION['moschnost'];?>"/> см<sup>3</sup>
</td>
</tr>
<tr>
<td align="justify" valign="top">Цена: <b><font color="red">*</font></b></td>
<td align="justify" valign="top">
<input type="text" name="money" value="<? echo $_SESSION['money'];?>"/> руб.
</td>
</tr>
</table>
<div id="img1">Файл изображения : <b><font color="red">*</font></b> <input type="file" name="file[]" onchange="hideDiv(this, 1, 2);"></div>
<div id="img2" style="display: none;">Файл изображения <b><font color="red">*</font></b> <input type="file" name="file[]" onchange="hideDiv(this, 2, 3);"></div>
<div id="img3" style="display: none;">Файл изображения <b><font color="red">*</font></b><input type="file" name="file[]"></div>
<input type="submit" value="Добавить" name="add" onclick="AddImg();"/> <input type="reset" value="Очистить"/>
</form>
<form action="index.php"><label><input type="submit" value="Назад"></label></form>
</td>
<td> </td>
</tr>
<tr>
<td height="60"> </td>
<td colspan="2" align="center"> </td>
<td> </td>
</tr>
</table>
</body>
</html>