<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Склад - ФГ ПРЕСТИЖ АГРОЛЮКС</title>
<link rel="stylesheet" href="css/style_add.css" media="screen" type="text/css" />
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
</head>
<body>
<script type="text/javascript">
function go(i_page)
{
var val_i_page = i_page.value;
document.getElementById('i_page1').style.display=(val_i_page==1) ? "" : "none";
document.getElementById('i_page2').style.display=(val_i_page==2) ? "" : "none";
}
</script>
<!-- Фильтр - ВВОДИМ только цифры -->
<script>
function filter_input(e,regexp)
{
e=e || window.event;
var target=e.target || e.srcElement;
var isIE=document.all;
if (target.tagName.toUpperCase()=='INPUT')
{
var code=isIE ? e.keyCode : e.which;
if (code<32 || e.ctrlKey || e.altKey) return true;
var char=String.fromCharCode(code);
if (!regexp.test(char)) return false;
}
return true;
}
</script>
<!-- Фильтр - ВВОДИМ только цифры -->
<div id="login">
<div class="flip">
<div class="form-signup">
<h1>Приход продукта</h1>
<fieldset>
<p class="login-msg"></p>
<form action="save_profit.php" method="post">
<select onChange="javascript: go(this);">
<option value="1">ЗЕРНО</option>
<option value="2">ХИМИЯ</option>
</select>
<div id="i_page1">
<?php
include ("sklad_db.php");
$res = mysql_query("SELECT productname FROM product WHERE category='corn' ORDER BY productname",$sklad_db);
echo"
<select name='productname' required>
<option value='' disabled selected>ПРОДУКТ</option>";
while($row = mysql_fetch_assoc($res)){
?>
<option value="<?=$row['productname']?>"><?=$row['productname']?></option>
<?
} echo "</select>"; ?>
</div>
<div id="i_page2" style="display: none">
<?php
include ("sklad_db.php");
$res = mysql_query("SELECT productname FROM product WHERE category='chemicals' ORDER BY productname",$sklad_db);
echo"
<select name='productname' required>
<option value='' disabled selected>ПРОДУКТ</option>";
while($row = mysql_fetch_assoc($res)){
?>
<option value="<?=$row['productname']?>"><?=$row['productname']?></option>
<?
} echo "</select>"; ?>
</div>
<input type="text" name="amount" placeholder="КІЛЬКІСТЬ" maxlength="50" onkeypress="return filter_input(event,/^[\d.]+$/)" required />
<?php
include ("sklad_db.php");
$res = mysql_query("SELECT contractorname FROM contractor ORDER BY contractorname",$sklad_db);
echo"
<select name='contractorname1' required>
<option value='' disabled selected>ОТКУДА ПРИШЛО</option>";
while($row = mysql_fetch_assoc($res)){
?>
<option value="<?=$row['contractorname']?>"><?=$row['contractorname']?></option>
<?
} echo "</select>"; ?>
<?php
include ("sklad_db.php");
$res = mysql_query("SELECT contractorname FROM contractor ORDER BY contractorname",$sklad_db);
echo"
<select name='contractorname2' required>
<option value='' disabled selected>КУДА ПРИШЛО</option>";
while($row = mysql_fetch_assoc($res)){
?>
<option value="<?=$row['contractorname']?>"><?=$row['contractorname']?></option>
<?
} echo "</select>"; ?>
<input type="submit" value="ДОБАВИТЬ" />
</form>
</fieldset>
</div>
</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="js/index.js"></script>
</body>
</html>