: | . ʲ-09-2 㳿 |
: | .. |
2012
˲
HTTP . HyperText Transfer Prtocl .
PHP . PHP: Hypertext Preprocessor PHP: .
CSS . Cascading Style Sheets .
HTML . HyperText Markup Language .
WWW . World Wide Web .
.
̲
. 4
1 . 5
2 . 6
3 . 8
4 . 10
4.1 . 10
4.2 . 10
. 12
. 13
. 14
. 16
㳿 . , . , . , ' , . 㳿 . web-, , -, .
SamorodokArt. , , (-) .
1
ᒺ SamorodokArt, , .
, . . , .
:
;
;
;
;
.
:
;
.
2
. ³ , , , .
ֳ , , ( ) , .
|
|
(.1).
.1
7 : , , , , , .
, .
, , .
, .
, .
.
, .
, .
4 : , , (.2).
.2
style.css ( ).
.
3
samorodok_art, 3 : example, orders users.
: , 3.
.3
orders 9 .
id ;
id_user _ ;
date ;
format , ;
material ;
photo , ;
text ;
status ;
add_date .
users 7 .
id ;
fname ;
lname ;
email ;
login ;
password ;
phone .
example 4 .
id ;
image ;
thumb ;
desc .
4
4.1
php-: database.php, login.php, logout.php, orders.php registration.php.
:
$login ;
$passw ;
$date ;
$format ;
$material ;
$text ;
$db ᒺ 璺 ;
$query ᒺ ;
$dir ;
$new_name ;
$first_name ;
$last_name ;
$mail . ;
$login ;
$password ;
$tel ..
$_SESSION , ;
$_POST , HTTP POST.
4.2
php-: image_proc.php, change_status.php, addimage.php.
|
|
:
$width ;
$height ;
$id , ;
$status , ;
$db ᒺ 璺 ;
$query ᒺ ;
$dir ;
$new_name ;
$_SESSION , ;
$_POST , HTTP POST.
SamorodokArt. , . ϳ . samorodok_art, 3 : example, orders users. , , .
. , .
( ), .
: .
ί ˲
1. . HTML. .: , 2002. 240 .
2. .. . .: , 2004. 10 .
3. http://htmlbook.ru/.
4. , JavaScript 5- . , 2006 452.
5. HTML, CSS, : . -, 2006. 412.
6. .. MySQL. ⳻. , 2005 378.
. .1
. .2
. .3
. .4
. .5
Style.css
body{
width:100%;
margin: 0 auto;
background-image: url("images/body2.png");
background-repeat: no-repeat;
}
#header{
width: 1024px;
height: 250px;
background-image: url("images/header.png");
background-repeat: no-repeat;
}
#reg{
position:relative;
top:110px;
left:1130px;
width:240px;
height:90px;
font-family:Segoe Script;
font-size: 16px;
color: #7a531c;
}
#header #reg form {
text-align:left;
height:90px;
}
#header #reg form table{
border-bottom: 2px solid #582515;
border-right: 1px solid #582515;
text-align:left;
font-weight:bolder;
}
#header #reg form table tr td{
height: 30px;
width:100px;
}
#header #reg form table a{
background-image: url("images/header_.png");
background-repeat: no-repeat;
color: #853b25;
text-decoration: none;
}
#header #reg form table a:active{
color: #c06217;
}
#menu_adm{
width: 1024px;
font-family:Segoe Script;
font-size: 20px;
height:5px;
margin: 0 auto;
}
#menu_adm ul{
list-style:none;
width:1024px;
height: inherit;
padding: 0;
margin: 3px;
}
#menu_adm ul li{
float:left;
width:33%;
text-align:center;
height:30px;
}
#menu_adm ul li a{
border-bottom: 2px solid #582515;
|
|
display:block;
background-color: none;
text-decoration:none;
color: #7a531c;
}
#menu_adm ul li a:hover{
background-image: url("images/link_adm.png");
}
#menu{
width: 1024px;
font-family:Segoe Script;
font-size: 20px;
height:5px;
margin: 0 auto;
}
#menu ul{
list-style:none;
width:1024px;
height: inherit;
padding: 0;
margin: 3px;
}
#menu ul li{
float:left;
width:25%;
text-align:center;
height:30px;
}
#menu ul li a{
border-bottom: 2px solid #582515;
display:block;
background-color: none;
text-decoration:none;
color: #7a531c;
}
#menu ul li a:hover{
background-image: url("images/link.png");
}
#content{
min-height:370px;
width: 1024px;
margin: 20px auto;
height: auto;
color: #582515;
text-decoration: none;
font-weight:bolder;
font-family:Segoe Script;
font-size: 18px;
}
#content form{
width: 1024px;
margin: 20px auto;
height: auto;
color: #582515;
text-align:center;
text-decoration: none;
font-weight:lighter;
font-family:Segoe Script;
font-size: 18px;
}
.description{
margin: 0 auto;
background-image: url("images/content_.png");
background-repeat: no-repeat;
font-family:Segoe Script;
font-size: 15px;
font-weight:bolder;
}
#content a{
background-image: url("images/header_.png");
background-repeat: no-repeat;
font-family:Segoe Script;
font-size: 23px;
color: #853b25;
font-weight:bolder;
text-decoration: none;
}
#content a:active{
color: #c06217;
}
#content table {
text-align:left;
margin: 0 auto;
background-image: url("images/content.png");
background-repeat: no-repeat;
font-weight:bolder;
}
#content table tr td{
height: 50px;
padding-right: 20px;
}
#content #form_order{
text-align:left;
}
.form_error{
color:red;
}
#footer{
margin: auto auto 0;
position: relative;
width: 1024px;
color: #582515;
height: 30px;
text-align:center;
}
change_status.php
<?php
if(!isset($_POST['change']))
{
header('Location:../');
exit();
}
$id = $_POST['id'];
$status = $_POST['status'];
include_once('../actions/database.php');
$db = db_connection();
$query = $db->prepare("UPDATE orders
SET status =?
WHERE id =?");
$query->execute(array($status, $id));
header('Location:./orders.php?id='.$id);
?>
database.php
<?php
define('DB_DRIVER','mysql');
define('DB_HOST','localhost');
define('DB_NAME','samorodok_art');
define('DB_USER','root');
define('DB_PASS','');
function db_connection()
{
try
{ $db = new PDO
(DB_DRIVER.':host='.DB_HOST.';dbname='.DB_NAME,DB_USER,DB_PASS);
$db->query("SET NAMES 'cp1251'");
return $db;
}
catch(PDOException $e)
{
die($e->getMessage());
}
}
?>
<?php
session_start();
?>
index.php
<!DOCTYPE html>
<html lang="ru">
<head>
<title>SamorodokArt</title>
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="./style.css"/>
<script type="text/javascript" src="./scripts.js"></script>
</head>
<body>
<div id="header">
<div id="reg">
<?php
if(isset($_SESSION['id_user']))
{
include_once('form_greetings.php');
}
else
{
include_once('form_login.php');
|
|
}
?>
</div>
</div>
<center>
<div id="menu">
<ul>
<li><a href="index.php"></a></li>
<li><a href="examples.php"> </a></li>
<li><a href="zakaz.php"> </a></li>
<li><a href="tech.php"> </a></li>
</ul>
</div>
<div id="content" >
<table style="text-align:center;">
<td style="font-size: 20px;">
³ <b style="font-size: 27px; color: #a4320f;">SamorodokArt</b>
</td>
<tr>
<td>
<div>
<p align="justifi"> , .
<br> .
<br> . -.
2 .
<br> .
</p>
</div>
<tr>
<td>
<p align="justifi"> ,
, - .
<br><p align="justifi"> <font size=5; color=#a4320f; ></font> <font size=5; color=#a4320f;> </font>
- : , .
</p>
<p align="justifi">
<font size=5; color=#a4320f; >[email protected]</font>.
</p>
</td>
</tr>
</td>
</tr>
</table>
</div>
<div id="footer">
<p>©samorodok 2012</p>
</div>
</body>
</html>
<?php
session_start();
?>
zakaz.php
<!DOCTYPE html>
<html lang="ua">
<head>
<title>SamorodokArt</title>
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="./style.css"/>
<script type="text/javascript" src="./scripts.js"></script>
</head>
<body>
<div id="header">
<div id="reg">
<?php
if(isset($_SESSION['id_user']))
{
include_once('form_greetings.php');
}
else
{
include_once('form_login.php');
}
?>
</div>
</div>
<div id="menu">
<ul>
<li><a href="index.php"></a></li>
<li><a href="examples.php"> </a></li>
<li><a href="zakaz.php"> </a></li>
<li><a href="tech.php"> </a></li>
</ul>
</div>
<div id="content" style="text-align:center;">
<?php
if(isset($_SESSION['id_user']))
{
include_once('form_order.php');
}
else
{
echo '<span style="color:red;"> , </span>';
}
?>
</div>
<div id="footer">
<p>©samorodok 2012</p>
</div>
</body>
</html>