PDA       
        -
   
!
 
 :     
  
 

>  !,
  
[x]   




Unregistered









, Shop script Free , , products.php () ( Front Page) description,
PHP
<?php echo str_replace("<","&lt;",$row[2]); 
work_brified.tpl {$work_info[2]}, SSwork description ( ).
:
1. brief_description
2.
PHP
<?php echo str_replace("<","&lt;",$row[18]); 

3. product_detailed.tpl {$work_info[18]},
4. SSwork brief_description description( )

3 , , , , ? , :)

P.S
PHP
<?php echo str_replace("<","&lt;",$row[18]); 
?smile.gif



23 , 19 (23.04.2009 - 22:45) waldicom ():
Shop Script - ... , ?
? .
, .

16 , 53 , 14 (24.04.2009 - 15:38) ():
, - product.php work.php , :) , , , ?

1 , 41 (24.04.2009 - 15:40) ():
www.konstaspb.ru " " :)
,
!

13 , 24 (24.04.2009 - 15:53) waldicom ():
, , , ?
? , , brief_description , .
, .

3 , 13 , 16 (24.04.2009 - 19:07) ():
?smile.gif php MySQL

7 , 53 (24.04.2009 - 19:14) ():
?
PHP
<?php echo str_replace("<","&lt;",$row[18]);  
// 
{$work_info[18]}

//  


1 , 18 , 29 (24.04.2009 - 20:33) ():
:)))))
PHP
<?php echo str_replace("<","&lt;",$row[4])  {$work_info[4]}
, :)) http://localhost/shop/index.php?workID= brief_description smile.gif))

8 , 49 (24.04.2009 - 20:42) ():

PHP
<class=pod href="index.php?workID={$work_info[4]}">
{
$smarty.const.MORE_INFO_ON_PRODUCT}</a>

{$work_info[4]} brief_description workID workID {$work_info[4]} brief_description {$work_info[8]} ???? smile.gif)) :)))

1 , 14 , 26 , 36 (26.04.2009 - 11:08) ():
waldicom ?

1 , 29 , 19 (26.04.2009 - 12:38) waldicom ():
. SQL-, . , ([4],[8]) - .
: :
SQL
SELECT a,b,c,d,e,f,g,h,i FROM blabla

:
a - [0]
b - [1]
c - [2]
d - [3]
e - [4]
f - [5]
g - [6]
h - [7]
i - [8]

- ,

4 , 25 , 57 (26.04.2009 - 17:04) ():
(brief_description ),
PHP
<?php echo str_replace("<","&lt;",$row[4])

work_brief {$work_info[4]} :))
brief_description workID {$work_info[4]} brief_description {$work_info[8]} workID {$work_info[4]} ????
??smile.gif)

1 , 19 , 1 , 32 (28.04.2009 - 12:05) ():
waldicom ? ?smile.gif

1 , 13 , 17 (28.04.2009 - 13:18) waldicom ():
( @ 28.04.2009 - 10:05)
waldicom ? ?smile.gif7

, ... .. , , , , , .

, . ( , )...

6 , 47 , 55 (28.04.2009 - 20:06) ():
:) local, 2 - :))

3 , 38 , 16 (28.04.2009 - 23:45) waldicom ():
, ,

8 , 16 , 34 (29.04.2009 - 08:01) ():
html, {$work_info[4]}?, , 8 {$work_info[8]}, :)
&nbsp; {* work brief view (from a category or search) *}

{if $work_info ne NULL}

HTML
<p><table width="100%" cellspacing="0" cellpadding="0" id="table16">
<tr>
<td width="12" align="left" valign="top" height="12">
<img src="images/verxleft.bmp" border="0"></td>
<td background="images/12verx.bmp" valign="top" width="12" height="12" align="left">
<img border="0" src="images/12verx.bmp"></td>
<td width="12" align="left" valign="top" height="12">
<img src="images/verxprav.bmp" border="0"></td>
</tr>
<tr>
<td align="left" width="12" height="12" valign="top" background="images/12letf.bmp">
<img border="0" src="images/12letf.bmp"></td>
<td valign="top" align="left">
<table border="0" width="100%" cellspacing="0" cellpadding="0" id="table17">
<tr>
<td width="160" rowspan="2" valign="top">{if $work_info[3]}<table border="0" width="180" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" id="table18">
<tr>
<td>
<p style="margin-left: 3px; margin-right: 3px">


<a href="index.php?workID={$work_info[4]}">
<img src="products_pictures/{$work_info[3]}" alt="{$work_info[1]}" border=0 width="150"></a></td>
</tr>
</table>
<p>{/if}</p>

</td>
<td align="left" valign="top">
<p style="margin-left: 3px; margin-right: 3px"><font size="4">
<b>{$work_info[1]}<br>
</b></font>{$work_info[4]}</p></td>
</tr>
<tr>
<td align="left" valign="bottom">
<a class=pod href="index.php?workID={$work_info[4]}">
{$smarty.const.MORE_INFO_ON_PRODUCT}</a></td>
</tr>
</table>
</td>
<td width="12" height="12" align="left" valign="top" background="images/12prav.bmp">
<img border="0" src="images/12prav.bmp"></td>
</tr>
<tr>
<td width="12" align="left" valign="top" height="12">
<img src="images/nizleft.bmp" border="0"></td>
<td valign="top" width="12" height="12" align="left" background="images/12niz.bmp">
<img border="0" src="images/12niz.bmp"></td>
<td width="12" align="left" valign="top" height="12">
<img src="images/nizprav.bmp" border="0"></td>
</tr>
</table>
<p>{/if}</p>

work.php,
PHP
<?php


//ADMIN::productsmanagment

ini_set("display_errors","1");

include("./cfg/connect.inc.php");
include("./includes/database/mysql.php");
include("./cfg/category_functions.php");
include("./cfg/general.inc.php");

//connect2database
db_connect(DB_HOST,DB_USER,DB_PASS)ordie(db_error());
db_select_db(DB_NAME)ordie(db_error());

session_start();
include("./checklogin.php");
if(!isset($_SESSION["log"])||strcmp($_SESSION["log"],ADMIN_LOGIN))//unauthorized
{
die("Youarenotauthorizedtoviewthispage");
}

//getcurrencyISO3code
$currency_iso_3=(defined('CONF_CURRENCY_ISO3'))?CONF_CURRENCY_ISO3:"USD";

//currentlanguage
include("./cfg/language_list.php");
if(!isset($_SESSION["current_language"])||
$_SESSION["current_language"]<0||$_SESSION["current_language"]>count($lang_list))
$_SESSION["current_language"]=0;//setdefaultlanguage

if(isset($lang_list[$_SESSION["current_language"]])&&file_exists("./languages/".$lang_list[$_SESSION["current_language"]]->filename))
include("./languages/".$lang_list[$_SESSION["current_language"]]->filename);//includecurrentlanguagefile
else
{
die("<fontcolor=red><b>ERROR:Couldn'tfindlanguagefile!</b></font>");
}

if(!isset($_GET["workID"]))$_GET["workID"]=0;

if(isset($_POST["save_work"]))//saveitemtothedatabase
{



if
(!isset($_POST["name"])||trim($_POST["name"])=="")$_POST["name"]="notdefined";



if
($_POST["save_work"]){//if$_POST["save_work"]!=0thenupdateitem

//deleteoldproductphotosifthey'rebeingreplaced
$q=db_query("SELECTpicture
FROM"
.WORKS_TABLE."
WHEREworkID='"
.$_POST["save_work"]."'")
ordie
(db_error());

$row
=db_fetch_row($q);

//generatingquery

$s="UPDATE".WORKS_TABLE."
SETwcategoryID='"
.$_POST["wcategoryID"]."',
name='"
.$_POST["name"]."',
description='"
.$_POST["description"]."',
brief_description='"
.$_POST["brief_description"]."'";

$s1
="";

//oldpictures?
if(isset($_FILES["picture"])&&$_FILES["picture"]["name"])
{
//deleteoldpicture
if($row[0]&&file_exists("./products_pictures/".$row[0]))
unlink("./products_pictures/".$row[0]);
}


$pid
=$_POST["save_work"];

}
else
{
//addnewproduct
db_query("INSERTINTO".WORKS_TABLE."(wcategoryID,name,picture,description,brief_description,active)
VALUES('"
.$_POST["wcategoryID"]."','".$_POST["name"]."','','".$_POST["description"]."','".$_POST["brief_description"]."',1);")
ordie(db_error());

$pid
=db_insert_id();

$dont_update=1;//don'tupdateproduct

$s="";
$s1="UPDATE".WORKS_TABLE."
SETwcategoryID=wcategoryID"
;
}

//addpictures?
//regularphoto
if(isset($_FILES["picture"])&&$_FILES["picture"]["name"]&&preg_match('/\.(jpg|jpeg|gif|jpe|pcx|bmp)$/i',$_FILES["picture"]["name"]))
//upload
{
$_FILES["picture"]["name"]=str_replace("","_",$_FILES["picture"]["name"]);
$r=move_uploaded_file($_FILES["picture"]["tmp_name"],"./products_pictures/".$_FILES["picture"]["name"]);
if(!$r)//failed2upload
{
echo"<center><fontcolor=red>".ERROR_FAILED_TO_UPLOAD_FILE."</font>\n<br><br>\n";
echo"<ahref=\"javascript:window.close();\">".CLOSE_BUTTON."</a></center></body>\n</html>";
exit;
}

SetRightsToUploadedFile("./products_pictures/".$_FILES["picture"]["name"]);

$s.=",picture='".$_FILES["picture"]["name"]."'";
$s1.=",picture='".$_FILES["picture"]["name"]."'";
}




if
(!isset($dont_update))//updateproductinfo
{
$s.="WHEREworkID='".$_POST["save_work"]."'";
db_query($s)ordie(db_error());
$workID=$_POST["save_work"];
}
else//don'tupdate(insertqueryisalreadycompleted)
{
$s1.="WHEREworkID=$pid";
db_query($s1)ordie(db_error());
$workID=$pid;
}

update_works_Count_Value_For_wcategories(0);

//closewindow
echo"<script>\n";
echo"window.opener.location.reload();\n";
echo"window.close();\n";
echo"</script>\n</body>\n</html>";
exit;
}
else//getworkfromdb
{
if($_GET["workID"])
{

$q=db_query("SELECTwcategoryID,name,picture,description,brief_description
FROM"
.WORKS_TABLE."
WHEREworkID='"
.$_GET["workID"]."'")ordie(db_error());
$row=db_fetch_row($q);
if(!$row)//productwasn'tfound
{
echo"<center><fontcolor=red>".ERROR_CANT_FIND_REQUIRED_PAGE."</font>\n<br><br>\n";
echo"<ahref=\"javascript:window.close();\">".CLOSE_BUTTON."</a></center></body>\n</html>";
exit;
}

if(isset($_GET["picture_remove"]))//deleteitemspicturefromserverifrequested
{
if($_GET["picture_remove"]&&file_exists("./products_pictures/".$row[$_GET["picture_remove"]]))
unlink("./products_pictures/".$row[$_GET["picture_remove"]]);
$picture="none";
}

if(isset($_GET["delete"]))//deleteproduct
{
//atfirstphotos...
if($row[2]!="none"&&$row[2]!=""&&file_exists("./products_pictures/".$row[2]))
unlink("./products_pictures/".$row[2]);


$q
=db_query("DELETEFROM".WORKS_TABLE."
WHEREworkID='"
.$_GET["workID"]."'")ordie(db_error());

//closewindow
echo"<script>\n";
echo"window.opener.location.reload();\n";
echo"window.close();\n";
echo"</script>\n</body>\n</html>";
exit;
}

$title=$row[1];

}
else//creatingnewitem
{
$title=ADMIN_NEWS_NEW;
$wcat=isset($_GET["wcategoryID"])?$_GET["wcategoryID"]:0;
$row=array($wcat,"","","");
}
}


HTML
<html>

<head>
<link rel=STYLESHEET href="style1.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo DEFAULT_CHARSET;?>">
<title><?php echo ADMIN_NEWS_TITLE;?></title>
<script>
function confirmDelete(question, where)
{
temp = window.confirm(question);
if (temp) //delete
{
window.location=where;
}
}
function open_window(link,w,h) //opens new window
{
var win = "width="+w+",height="+h+",menubar=no,location=no,resizable=yes,scrollbars=yes";
wishWin = window.open(link,'wishWin',win);
}
</script>
</head>

<body bgcolor=#FFFFE2>
<center>
<p>
<b><?php echo $title; ?></b>

<form enctype="multipart/form-data" action="work.php" method=post>

<table width=100% border=0 cellpadding=3 cellspacing=0>
<tr>
<td align=right><?php echo ADMIN_CATEGORY_PARENT;?></td>
<td>
<select name="wcategoryID">
<option value="0"><?php echo ADMIN_CATEGORY_ROOT;?></option>
<?php
//show categories select element
$wcats = fillThewcList(0,0);
for ($i=0; $i<count($wcats); $i++)
{
echo "<option value=\"".$wcats[$i][0]."\"";
if ($row[0] == $wcats[$i][0]) //select category
echo " selected";
echo ">";
for ($j=0;$j<$wcats[$i][5];$j++) echo "&nbsp;&nbsp;";
echo $wcats[$i][1];
echo "</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td align=right><?php echo ADMIN_NEWS_NAME;?></td>
<td><input type="text" name="name" value="<?php echo str_replace("\"","&quot;",$row[1]); ?>"></td>
</tr>
<tr><td>&nbsp;</td></tr>

<tr>
<td align=right><?php echo ADMIN_PRODUCT_PICTURE;?></td>
<td><input type="file" name="picture"></td>
<tr><td></td><td>
<?php
if ($row[2]!="</span>" && file_exists("./products_pictures/".$row[2]))
{
echo "<a class=small href=\"products_pictures/".$row[2]."\">$row[2]</a>\n";
echo "<br><a href=\"javascript:confirmDelete('".QUESTION_DELETE_PICTURE."','work.php?workID=".$_GET["workID"]."&picture_remove=2');\">".DELETE_BUTTON."</a>\n";
}
else echo "<font class=average color=brown>".ADMIN_PICTURE_NOT_UPLOADED."</font>";
?>
</td>
</tr>



<tr>
<td align=right><?php echo ADMIN_PRODUCT_DESC;?><br>(HTML):</td>
<td><textarea name="description" rows=15 cols=40><?php echo str_replace("<","&lt;",$row[3]); ?></textarea></td>
</tr>



<tr>
<td align=right><?php echo ADMIN_PRODUCT_BRIEF_DESC;?><br>(HTML):</td>
<td><textarea name="brief_description" rows=7 cols=40><?php echo str_replace("<","&lt;",$row[4]); ?></textarea></td>
</tr>



</table>


<p><center>
<input type="submit" value="<[color=blue]?php echo SAVE_BUTTON;?>" width=5>
<input type="hidden" name="save_work" value=<?php echo $_GET["workID"]; ?>>
<input type="button" value="<?php echo CANCEL_BUTTON;?>" onClick="window.close();">
<?php if ($_GET["workID"]) echo "<input type=button value=\"".DELETE_BUTTON."\" onClick=\"confirmDelete('".QUESTION_DELETE_CONFIRMATION."','work.php?workID=".$_GET["workID"]."&delete=1');\">"; ?>
</center></p>
</form>


</center>
</body>

</html>


BBCODE

1 , 11 , 8 , 32 (30.04.2009 - 19:10) ():
waldicom ?smile.gif

1 , 18 , 32 (30.04.2009 - 20:28) kirik ():
( @ 26.04.2009 - 03:08)
waldicom ?

( @ 28.04.2009 - 04:05)
waldicom ?

( @ 30.04.2009 - 11:10)
waldicom ?

biggrin.gif biggrin.gif

18 , 20 , 47 (1.05.2009 - 14:49) ():
?
    0         1-2
1 (1 0 )
0 :
« | PHP | »