Example #1
0
<?php 
function __autoload($name)
{
    $str = "class." . $name . ".php";
    if (!(include $str)) {
        echo "НЕ получилось";
    }
}
$db = new DB();
$marksArr = $db->ShowMarks();
$typesArr = $db->ShowTypes();
$charsArr = $db->ShowChars();
?>

<html>
<head>
	<title>AddGoods page!</title>
	<meta charset="utf-8">
	<link rel="stylesheet" type="text/css" href="css/index.css">
</head>
<script language="javascript">
<?php 
if (isset($charsArr)) {
    echo "var arr=new Array(2);\n";
    echo "arr[0]=new Array(" . count($charsArr) . ");\n";
    echo "arr[1]=new Array(" . count($charsArr) . ");\n";
    $i = 0;
    foreach ($charsArr as $val) {
        echo "arr[0][" . $i . "]='<option value=" . $val["id"] . ">'\n";
        echo "arr[1][" . $i . "]='" . $val["name"] . "</option>'\n";
        $i++;
Example #2
0
<?php 
function __autoload($name)
{
    $str = "class." . $name . ".php";
    if (!(include $str)) {
        echo "Неудача";
    }
}
$db = new DB();
$arr = $db->ShowMarks();
if (isset($_POST["name"])) {
    $db->AddMarks($_POST["name"]);
}
?>

<html>
<head>
	<title>AddGoods page!</title>
	<meta charset="utf-8">
	<link rel="stylesheet" type="text/css" href="css/index.css">
</head>
<body>
<div id="content">
	<div id="menu">
			<ul>
				<li><a href="addGoods.php">ДОБАВИТЬ ТОВАР</a></li>
				<li><a href="addMarks.php">ДОБАВИТЬ МАРКИ</a></li>
				<li><a href="addChars.php">ДОБАВИТЬ ХАРАКТЕРИСТИКИ</a></li>
				<li><a href="addTypes.php">ДОБАВИТЬ ТИПЫ</a></li>
			</ul>
	</div>