mb_substr的應該用
[
2008/05/25 23:08 | by Else ]
2008/05/25 23:08 | by Else ]
utf-8下,php對長度的截取
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
mb_internal_encoding("UTF-8"); //這個一定要設,要不然就顯示"我們",你可以測試一下
$string = "我們還好了什麼和什麼";
$mystring = mb_substr($string,0,6);
echo $mystring;
?><br />
<?php
echo $string;
?>
<?php
mb_internal_encoding("UTF-8"); //這個一定要設,要不然就顯示"我們",你可以測試一下
$string = "我們還好了什麼和什麼";
$mystring = mb_substr($string,0,6);
echo $mystring;
?><br />
<?php
echo $string;
?>
jq更新到1.2.5
[
2008/05/23 14:05 | by Else ]
2008/05/23 14:05 | by Else ]
前几天刚更新到1.2.4 我更新了,没有想到这次又这么快更新了!
详细:jquery.com
详细:jquery.com
引用
Ticket Summary Owner Component Type
#2897
Widget factory doesn't allow passing parameters to plugin methods
None core bug
#2865
Opera 9.5 (at least this version) doesn't like null username being sent into XMLHttpRequest, this creates a login prompt in Opera, so jQuery should circumvent this
None ajax bug
#2852
jQuery 1.2.4a - Safari 2.0.4 Mac - hide() is broken
None core bug
#2842
missing url in $.ajax fails (instead of using the current url)
flesler ajax bug
#2820
$.extend not deep copying arrays
flesler core bug
#2819
$.fn.load is being overwritten
flesler event bug
#2816
erroneous behavior with IE when re-ajaxifying links in an ajax-loaded div
None ajax bug
#2811
2 bugs on jQuery.fn.add
flesler core bug
#2806
$.ajax: support for dynamic data arguments
joern ajax feature
#2803
Faster Map
flesler core enhancement
#2802
jQuery.curCSS failes in Safari 2.x
None core bug
#2787
Attribute filter ignores elements not appended to DOM tree
core bug
#2771
jQuery.index cannot index the jQuery object
flesler core bug
#2743
Potpourri of small improvements to code size and perfomance
None core enhancement
#2709
globalEval works incorrectly in IE6 if the current page has tag in the HEAD
None core bug
#2708
Cross Browser event object
None core enhancement
#2705
eval scripts in AJAX response does not work well in IE
None core bug
#2688
beforeSend should be able to cancel the Ajax call
yehuda ajax enhancement
#2662
attr "action" of form and Selectors' attribute filter
None core bug
#2655
jQuery.event module optimizations
None event enhancement
#2619
Extend makeArray
None core enhancement
#2613
bind() breaks event.preventDefault()
event bug
#2605
data should accept null values
core bug
#2600
jQuery.extend() should not ignore properties with null values
core bug
#2570
Opera 9.2.6 AJAX requiring authentication
None ajax bug
#2567
$.ajax should allow filtering JS and JSON responses to remove security measures
flesler ajax feature
#2565
event.fix performance tweaks patch
None event enhancement
#2558
$(...).attr returns different values in IE7 and Firefox
None core bug
#2548
.attr() proposal
None core enhancement
#2543
Useless variable (re)declarations
flesler event bug
#2537
attr() can return undefined instead of 0
None core bug
#2522
Remove isFunction from jQuery.event.trigger
None event enhancement
#2521
Internet Explorer doesn't seem to like attributes
None core bug
#2510
Optimizations for the merge() method
None core enhancement
#2486
jQuery.map() string as callback parameter is broken
None core bug
#2453
attr(...) function returns undefined when value is 0
None core bug
#2416
setting a form field's value to empty string fails
None core bug
#2378
Events toggle( fn, fn )
None event enhancement
#2352
Simulated click event on anchors in IE6 does not work
brandon core bug
#2249
Addition of "once" event handler
None event enhancement
#2181
JQuery fails to execute search in pages containing applets.
None core bug
#2170
attr() fails to get/set value for maxlength attribute on textarea elements
None core bug
#2119
attr('value') confusion
core bug
#2056
performance enhancements
None core enhancement
#1871
fix() in event propagation is slow
None event bug
#1802
"mousemove" consumes lots of CPU time in Firefox
None event bug
#1675
expando related problem on removeData()
None core bug
#1591
IE "Invalid Argument" $('table').attr('non-existent')
None core bug
#1562
$.extend is not working properly when using deep extension
flesler core bug
#1480
isFunction fails in certain cases
flesler core bug
#1362
$.ajax(): pass 'settings' object to 'success' callback
None ajax feature
#1318
save some bytes in grep
None core enhancement
#1170
attr("style","...") doesn't work in IE7
john core bug
#2897
Widget factory doesn't allow passing parameters to plugin methods
None core bug
#2865
Opera 9.5 (at least this version) doesn't like null username being sent into XMLHttpRequest, this creates a login prompt in Opera, so jQuery should circumvent this
None ajax bug
#2852
jQuery 1.2.4a - Safari 2.0.4 Mac - hide() is broken
None core bug
#2842
missing url in $.ajax fails (instead of using the current url)
flesler ajax bug
#2820
$.extend not deep copying arrays
flesler core bug
#2819
$.fn.load is being overwritten
flesler event bug
#2816
erroneous behavior with IE when re-ajaxifying links in an ajax-loaded div
None ajax bug
#2811
2 bugs on jQuery.fn.add
flesler core bug
#2806
$.ajax: support for dynamic data arguments
joern ajax feature
#2803
Faster Map
flesler core enhancement
#2802
jQuery.curCSS failes in Safari 2.x
None core bug
#2787
Attribute filter ignores elements not appended to DOM tree
core bug
#2771
jQuery.index cannot index the jQuery object
flesler core bug
#2743
Potpourri of small improvements to code size and perfomance
None core enhancement
#2709
globalEval works incorrectly in IE6 if the current page has
None core bug
#2708
Cross Browser event object
None core enhancement
#2705
eval scripts in AJAX response does not work well in IE
None core bug
#2688
beforeSend should be able to cancel the Ajax call
yehuda ajax enhancement
#2662
attr "action" of form and Selectors' attribute filter
None core bug
#2655
jQuery.event module optimizations
None event enhancement
#2619
Extend makeArray
None core enhancement
#2613
bind() breaks event.preventDefault()
event bug
#2605
data should accept null values
core bug
#2600
jQuery.extend() should not ignore properties with null values
core bug
#2570
Opera 9.2.6 AJAX requiring authentication
None ajax bug
#2567
$.ajax should allow filtering JS and JSON responses to remove security measures
flesler ajax feature
#2565
event.fix performance tweaks patch
None event enhancement
#2558
$(...).attr returns different values in IE7 and Firefox
None core bug
#2548
.attr() proposal
None core enhancement
#2543
Useless variable (re)declarations
flesler event bug
#2537
attr() can return undefined instead of 0
None core bug
#2522
Remove isFunction from jQuery.event.trigger
None event enhancement
#2521
Internet Explorer doesn't seem to like attributes
None core bug
#2510
Optimizations for the merge() method
None core enhancement
#2486
jQuery.map() string as callback parameter is broken
None core bug
#2453
attr(...) function returns undefined when value is 0
None core bug
#2416
setting a form field's value to empty string fails
None core bug
#2378
Events toggle( fn, fn )
None event enhancement
#2352
Simulated click event on anchors in IE6 does not work
brandon core bug
#2249
Addition of "once" event handler
None event enhancement
#2181
JQuery fails to execute search in pages containing applets.
None core bug
#2170
attr() fails to get/set value for maxlength attribute on textarea elements
None core bug
#2119
attr('value') confusion
core bug
#2056
performance enhancements
None core enhancement
#1871
fix() in event propagation is slow
None event bug
#1802
"mousemove" consumes lots of CPU time in Firefox
None event bug
#1675
expando related problem on removeData()
None core bug
#1591
IE "Invalid Argument" $('table').attr('non-existent')
None core bug
#1562
$.extend is not working properly when using deep extension
flesler core bug
#1480
isFunction fails in certain cases
flesler core bug
#1362
$.ajax(): pass 'settings' object to 'success' callback
None ajax feature
#1318
save some bytes in grep
None core enhancement
#1170
attr("style","...") doesn't work in IE7
john core bug
C#的商品分类,商品修 改删除
[
2008/05/21 18:08 | by Else ]
2008/05/21 18:08 | by Else ]
<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="utf-8"%>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>
<MM:Insert
runat="server"
CommandText='<%# "INSERT INTO dbo.cuku_cat (catname, catlist, catcont) VALUES (?, ?, ?)" %>'
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_conn"] %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_conn"] %>'
Expression='<%# Request.Form["MM_insert"] == "form2" && Request.Form["id"]=="" && Request.Form["catname"]!="" %>'
CreateDataSet="false"
SuccessURL='<%# "adminproducts.aspx?act=class" %>'
FailureURL='<%# "adminproducts.aspx?act=class" %>'
Debug="true"
>
<Parameters>
<Parameter Name="@catname" Value='<%# ((Request.Form["catname"] != null) && (Request.Form["catname"].Length > 0)) ? Request.Form["catname"] : "" %>' Type="VarChar" />
<Parameter Name="@catlist" Value='<%# ((Request.Form["catlist"] != null) && (Request.Form["catlist"].Length > 0)) ? Request.Form["catlist"] : "" %>' Type="Integer" />
<Parameter Name="@catcont" Value='<%# ((Request.Form["catcont"] != null) && (Request.Form["catcont"].Length > 0)) ? Request.Form["catcont"] : "" %>' Type="VarChar" />
</Parameters>
</MM:Insert>
<MM:Update
runat="server"
CommandText='<%# "UPDATE dbo.cuku_cat SET catcont=?, catlist=?, catname=? WHERE id=?" %>'
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_conn"] %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_conn"] %>'
Expression='<%# Request.Form["MM_update"] == "form2" && Request.Form["id"]!="" %>'
CreateDataSet="false"
SuccessURL='<%# "adminproducts.aspx?act=class" %>'
Debug="true"
>
<Parameters>
<Parameter Name="@catcont" Value='<%# ((Request.Form["catcont"] != null) && (Request.Form["catcont"].Length > 0)) ? Request.Form["catcont"] : "" %>' Type="VarChar" />
<Parameter Name="@catlist" Value='<%# ((Request.Form["catlist"] != null) && (Request.Form["catlist"].Length > 0)) ? Request.Form["catlist"] : "" %>' Type="Integer" />
<Parameter Name="@catname" Value='<%# ((Request.Form["catname"] != null) && (Request.Form["catname"].Length > 0)) ? Request.Form["catname"] : "" %>' Type="VarChar" />
<Parameter Name="@id" Value='<%# ((Request.Form["id"] != null) && (Request.Form["id"].Length > 0)) ? Request.Form["id"] : "" %>' Type="Integer" />
</Parameters>
</MM:Update>
<MM:Delete
runat="server"
CommandText='<%# "DELETE FROM dbo.cuku_cat WHERE id=?" %>'
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_conn"] %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_conn"] %>'
Expression='<%# ((Request.QueryString["act"] == "del") && (Request.QueryString["do"]=="class")) %>'
CreateDataSet="false"
SuccessURL='<%# "adminproducts.aspx?act=class" %>'
FailureURL='<%# "adminproducts.aspx?act=class" %>'
Debug="true"
><Parameters>
<Parameter Name="@id" Value='<%# ((Request.QueryString["id"] != null) && (Request.QueryString["id"].Length > 0)) ? Request.QueryString["id"] : "" %>' Type="Integer" />
</Parameters>
</MM:Delete>
<!--插入产品-->
<MM:Insert
runat="server"
CommandText='<%# "INSERT INTO dbo.cuku_products (prodoucts, catid, content, recom, uptop, isnew, cont, pic) VALUES (?, ?, ?, ?, ?, ?, ?, ?)" %>'
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_conn"] %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_conn"] %>'
Expression='<%# Request.Form["MM_insert"] == "form1" && Request.Form["id"].Trim()=="" %>'
CreateDataSet="false"
SuccessURL='<%# "adminproducts.aspx" %>'
FailureURL='<%# "adminproducts.aspx?act=add" %>'
Debug="true"
><Parameters>
<Parameter Name="@prodoucts" Value='<%# ((Request.Form["prodoucts"] != null) && (Request.Form["prodoucts"].Length > 0)) ? Request.Form["prodoucts"] : "" %>' Type="VarChar" />
<Parameter Name="@catid" Value='<%# ((Request.Form["catid"] != null) && (Request.Form["catid"].Length > 0)) ? Request.Form["catid"] : "" %>' Type="Integer" />
<Parameter Name="@content" Value='<%# ((Request.Form["content"] != null) && (Request.Form["content"].Length > 0)) ? Request.Form["content"] : "" %>' Type="VarChar" />
<Parameter Name="@recom" Value='<%# ((Request.Form["recom"] != null) && (Request.Form["recom"].Length > 0)) ? Request.Form["recom"] : "" %>' Type="Boolean" />
<Parameter Name="@uptop" Value='<%# ((Request.Form["uptop"] != null) && (Request.Form["uptop"].Length > 0)) ? Request.Form["uptop"] : "" %>' Type="Boolean" />
<Parameter Name="@isnew" Value='<%# ((Request.Form["isnew"] != null) && (Request.Form["isnew"].Length > 0)) ? Request.Form["isnew"] : "" %>' Type="Boolean" />
<Parameter Name="@cont" Value='<%# ((Request.Form["cont"] != null) && (Request.Form["cont"].Length > 0)) ? Request.Form["cont"] : "" %>' Type="VarChar" />
<Parameter Name="@pic" Value='<%# ((Request.Form["pic"] != null) && (Request.Form["pic"].Length > 0)) ? Request.Form["pic"] : "" %>' Type="VarChar" />
</Parameters>
</MM:Insert>
<MM:Update
runat="server"
CommandText='<%# "UPDATE dbo.cuku_products SET cont=?, content=?, isnew=?, recom=?, catid=?, pic=?, prodoucts=?, uptop=? WHERE id=?" %>'
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_conn"] %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_conn"] %>'
Expression='<%# Request.Form["MM_update"] == "form1" && Request.Form["id"].Trim()!="" %>'
CreateDataSet="false"
SuccessURL='<%# "adminproducts.aspx" %>'
Debug="true"
>
<Parameters>
<Parameter Name="@cont" Value='<%# ((Request.Form["cont"] != null) && (Request.Form["cont"].Length > 0)) ? Request.Form["cont"] : "" %>' Type="VarChar" />
<Parameter Name="@content" Value='<%# ((Request.Form["content"] != null) && (Request.Form["content"].Length > 0)) ? Request.Form["content"] : "" %>' Type="VarChar" />
<Parameter Name="@isnew" Value='<%# ((Request.Form["isnew"] != null) && (Request.Form["isnew"].Length > 0)) ? Request.Form["isnew"] : "" %>' Type="Boolean" />
<Parameter Name="@recom" Value='<%# ((Request.Form["recom"] != null) && (Request.Form["recom"].Length > 0)) ? Request.Form["recom"] : "" %>' Type="Boolean" />
<Parameter Name="@catid" Value='<%# ((Request.Form["catid"] != null) && (Request.Form["catid"].Length > 0)) ? Request.Form["catid"] : "" %>' Type="Integer" />
<Parameter Name="@pic" Value='<%# ((Request.Form["pic"] != null) && (Request.Form["pic"].Length > 0)) ? Request.Form["pic"] : "" %>' Type="VarChar" />
<Parameter Name="@prodoucts" Value='<%# ((Request.Form["prodoucts"] != null) && (Request.Form["prodoucts"].Length > 0)) ? Request.Form["prodoucts"] : "" %>' Type="VarChar" />
<Parameter Name="@uptop" Value='<%# ((Request.Form["uptop"] != null) && (Request.Form["uptop"].Length > 0)) ? Request.Form["uptop"] : "" %>' Type="Boolean" />
<Parameter Name="@id" Value='<%# ((Request.Form["id"] != null) && (Request.Form["id"].Length > 0)) ? Request.Form["id"] : "" %>' Type="Integer" />
</Parameters>
</MM:Update>
<MM:DataSet
id="rs"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_conn"] %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_conn"] %>'
CommandText='<%# "SELECT * FROM dbo.cuku_cat ORDER BY id DESC" %>'
Debug="true"
></MM:DataSet>
<MM:DataSet
id="editrs"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_conn"] %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_conn"] %>'
CommandText='<%# "SELECT * FROM dbo.cuku_cat WHERE id = ?" %>'
Debug="true"
>
<Parameters>
<Parameter Name="@id" Value='<%# ((Request.QueryString["id"] != null) && (Request.QueryString["id"].Length > 0)) ? Request.QueryString["id"] : "" %>' Type="Integer" />
</Parameters>
</MM:DataSet>
<MM:DataSet
id="pds"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_conn"] %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_conn"] %>'
CommandText='<%# "SELECT * FROM dbo.cuku_products,dbo.cuku_cat WHERE dbo.cuku_cat.id = dbo.cuku_products.catid ORDER BY dbo.cuku_products.id desc" %>'
CurrentPage='<%# ((Request.QueryString["pds_CurrentPage"] != null) && (Request.QueryString["pds_CurrentPage"].Length > 0)) ? Int32.Parse(Request.QueryString["pds_CurrentPage"]) : 0 %>'
PageSize="20"
Debug="true"
></MM:DataSet>
<MM:DataSet
id="editpds"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_conn"] %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_conn"] %>'
CommandText='<%# "SELECT * FROM dbo.cuku_products WHERE id = ?" %>'
Expression='<%# Myac=="add" %>'
Debug="true"
>
<Parameters>
<Parameter Name="@id" Value='<%# ((Request.QueryString["id"] != null) && (Request.QueryString["id"].Length > 0)) ? Request.QueryString["id"] : "" %>' Type="Integer" /> </Parameters>
</MM:DataSet>
<MM:PageBind runat="server" PostBackBind="true" />
<!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=utf-8" />
<title>产品管理</title>
<link href="images/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<script>
function del(ids,what)
{
if(confirm("你确定要删除吗?")){
window.location.href="?act=del&do="+what+"&id="+ids;
}else{
return
}
}
</script>
<script runat="server">
private string myac;
public string Myac
{
get { return this.myac; }
set { this.myac = value; }
}
public string Checked(string chkstr)
{
return chkstr=="True" ? "checked=\"checked\"":"";
}
public void Page_Load(Object Src, EventArgs E)
{
if (Request.QueryString["act"]== null)
{
Myac="go";
}
else
{
Myac=Request.QueryString["act"].Trim();
}
}
</script>
<mm:if runat="server" expression='<%# Myac=="go" %>'>
<contentstemplate>
<table width="600" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td height="25" colspan="5" background="images/bg_lead.png"> 产品管理</td>
</tr>
<tr>
<td width="6%" align="center" bgcolor="#CCEAFA">编号</td>
<td width="25%" align="center" bgcolor="#CCEAFA">产品名称</td>
<td width="23%" align="center" bgcolor="#CCEAFA">分类</td>
<td width="23%" align="center" bgcolor="#CCEAFA">属性</td>
<td width="23%" align="center" bgcolor="#CCEAFA">管理</td>
</tr>
<ASP:Repeater runat="server" DataSource='<%# pds.DefaultView %>'>
<ItemTemplate>
<tr>
<td height="21" align="center" bgcolor="#CCEAFA"><%# pds.FieldValue("id", Container) %></td>
<td bgcolor="#CCEAFA"><%# pds.FieldValue("prodoucts", Container) %></td>
<td bgcolor="#CCEAFA"><%# pds.FieldValue("catname", Container) %></td>
<td bgcolor="#CCEAFA"><%# pds.FieldValue("isnew", Container) %><%# pds.FieldValue("recom", Container) %><%# pds.FieldValue("isnew", Container) %></td>
<td align="center" bgcolor="#CCEAFA"><a href="?act=add&id=<%# pds.FieldValue("id", Container) %>">修改</a> <a href="javascript:del('<%# pds.FieldValue("id", Container) %>','pro')">删除</a></td>
</tr>
</ItemTemplate>
</ASP:Repeater>
<tr>
<td colspan="5" align="center" bgcolor="#CCEAFA">首页 上一页 下一页 末页</td>
</tr>
</table>
</contentstemplate>
</mm:if>
<mm:if runat="server" expression='<%# Myac=="add" %>' >
<contentstemplate>
<form action="" method='POST' enctype="multipart/form-data" name='form1' id="form1" runat='server'>
<table width="600" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td height="27" colspan="2" background="images/bg_lead.png" bgcolor="#EFF9FE"> 修改/添加商品</td>
</tr>
<tr>
<td width="121" height="23" align="center" bgcolor="#CCEAFA">产品名称</td>
<td width="479" bgcolor="#CCEAFA"><label>
<input name="prodoucts" type="text" id="prodoucts" value="<%# editpds.FieldValue("prodoucts", Container) %>" />
<input name="id" type="hidden" id="id" value="<%# editpds.FieldValue("id", Container) %>" />
</label></td>
</tr>
<tr>
<td height="23" align="center" bgcolor="#CCEAFA">产品分类</td>
<td bgcolor="#CCEAFA">
<select name="catid" id="catid">
<ASP:Repeater runat="server" DataSource='<%# rs.DefaultView %>'>
<ItemTemplate>
<option value="<%# rs.FieldValue("id", Container) %>"><%# rs.FieldValue("catname", Container) %></option>
</ItemTemplate>
</ASP:Repeater>
</select>
</td>
</tr>
<tr>
<td height="23" align="center" bgcolor="#CCEAFA">商品图片</td>
<td bgcolor="#CCEAFA"><label>
<input name="pic" type="text" id="pic" value="<%# editpds.FieldValue("pic", Container) %>" />
</label></td>
</tr>
<tr>
<td height="23" align="center" bgcolor="#CCEAFA">上传图片</td>
<td bgcolor="#CCEAFA"><label>
<input type="file" name="fileField" id="fileField" />
</label></td>
</tr>
<tr>
<td height="23" align="center" bgcolor="#CCEAFA">说 明</td>
<td bgcolor="#CCEAFA"><input name="cont" type="text" id="cont" value="<%# editpds.FieldValue("cont", Container) %>" /></td>
</tr>
<tr>
<td height="23" align="center" bgcolor="#CCEAFA">商品属性</td>
<td bgcolor="#CCEAFA"><label>
<input name="isnew" type="checkbox" id="isnew" value="true" <%# Checked(editpds.FieldValue("isnew", Container))%> />
新商品
<input name="recom" type="checkbox" id="recom" value="true" <%# Checked(editpds.FieldValue("recom", Container))%>/>
推荐
<input name="uptop" type="checkbox" id="uptop" value="true" <%# Checked(editpds.FieldValue("uptop", Container))%>/>
置顶
</label></td>
</tr>
<tr>
<td height="23" align="center" bgcolor="#CCEAFA">介 绍</td>
<td bgcolor="#CCEAFA"><label>
<textarea name="content" id="content" cols="45" rows="5"><%# editpds.FieldValue("content", Container) %></textarea>
</label></td>
</tr>
<tr>
<td height="23" align="center" bgcolor="#CCEAFA"> </td>
<td bgcolor="#CCEAFA"><label for="button"></label>
<input type="submit" name="button" id="button" value="提交" />
<label>
<input type="reset" name="button2" id="button2" value="重设" />
<input name="button3" type="button" id="button3" onclick="history.go(-1)" value="返回" />
</label></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
<input type="hidden" name="MM_update" value="form1" />
</form>
</contentstemplate>
</mm:if>
<mm:if runat="server" expression='<%# Myac=="class" %>' >
<contentstemplate>
<table width="387" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td height="25" colspan="5" align="center" background="images/bg_lead.png"> 分类列表</td>
</tr>
<tr>
<td width="27" height="23" align="center" bgcolor="#CCEAFA">编号</td>
<td width="79" align="center" bgcolor="#CCEAFA">分类名称</td>
<td width="30" align="center" bgcolor="#CCEAFA">顺序</td>
<td width="175" align="center" bgcolor="#CCEAFA">说明</td>
<td width="60" align="center" bgcolor="#CCEAFA">管理</td>
</tr>
<ASP:Repeater runat="server" DataSource='<%# rs.DefaultView %>'>
<ItemTemplate>
<tr>
<td height="23" align="center" bgcolor="#CCEAFA"> <%# rs.FieldValue("id", Container) %></td>
<td align="center" bgcolor="#CCEAFA"><%# rs.FieldValue("catname", Container) %></td>
<td align="center" bgcolor="#CCEAFA"><%# rs.FieldValue("catlist", Container) %></td>
<td bgcolor="#CCEAFA"><%# rs.FieldValue("catcont", Container) %></td>
<td bgcolor="#CCEAFA"><a href="?act=class&id=<%# rs.FieldValue("id", Container) %>">修改</a> <a href="javascript:del('<%# rs.FieldValue("id", Container) %>','class');">删除</a></td>
</tr>
</ItemTemplate>
</ASP:Repeater>
</table>
<form runat='server' id="form2" name='form2' method='POST' action="">
<table width="387" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td height="25" colspan="2" background="images/bg_lead.png"> 产品分类添加</td>
</tr>
<tr>
<td width="100" align="center">分类名称</td>
<td width="272"><label>
<input name="catname" type="text" id="catname" value="<%# editrs.FieldValue("catname", Container) %>" />
<input name="id" type="hidden" id="id" value="<%# editrs.FieldValue("id", Container) %>" />
</label></td>
</tr>
<tr>
<td align="center">分类顺序</td>
<td><input name="catlist" type="text" id="catlist" value="<%# editrs.FieldValue("catlist", Container) %>" /></td>
</tr>
<tr>
<td align="center">分类说明</td>
<td><input name="catcont" type="text" id="catcont" value="<%# editrs.FieldValue("catcont", Container) %>" /></td>
</tr>
<tr>
<td align="center"> </td>
<td><label>
<input type="submit" name="button4" id="button4" value="提交" />
<input type="reset" name="button5" id="button5" value="重置" />
<input type="button" name="button6" id="button6" value="返回" />
</label></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form2" />
<input type="hidden" name="MM_update" value="form2" />
</form>
</contentstemplate>
</mm:if>
</body>
</html>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %>
<MM:Insert
runat="server"
CommandText='<%# "INSERT INTO dbo.cuku_cat (catname, catlist, catcont) VALUES (?, ?, ?)" %>'
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_conn"] %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_conn"] %>'
Expression='<%# Request.Form["MM_insert"] == "form2" && Request.Form["id"]=="" && Request.Form["catname"]!="" %>'
CreateDataSet="false"
SuccessURL='<%# "adminproducts.aspx?act=class" %>'
FailureURL='<%# "adminproducts.aspx?act=class" %>'
Debug="true"
>
<Parameters>
<Parameter Name="@catname" Value='<%# ((Request.Form["catname"] != null) && (Request.Form["catname"].Length > 0)) ? Request.Form["catname"] : "" %>' Type="VarChar" />
<Parameter Name="@catlist" Value='<%# ((Request.Form["catlist"] != null) && (Request.Form["catlist"].Length > 0)) ? Request.Form["catlist"] : "" %>' Type="Integer" />
<Parameter Name="@catcont" Value='<%# ((Request.Form["catcont"] != null) && (Request.Form["catcont"].Length > 0)) ? Request.Form["catcont"] : "" %>' Type="VarChar" />
</Parameters>
</MM:Insert>
<MM:Update
runat="server"
CommandText='<%# "UPDATE dbo.cuku_cat SET catcont=?, catlist=?, catname=? WHERE id=?" %>'
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_conn"] %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_conn"] %>'
Expression='<%# Request.Form["MM_update"] == "form2" && Request.Form["id"]!="" %>'
CreateDataSet="false"
SuccessURL='<%# "adminproducts.aspx?act=class" %>'
Debug="true"
>
<Parameters>
<Parameter Name="@catcont" Value='<%# ((Request.Form["catcont"] != null) && (Request.Form["catcont"].Length > 0)) ? Request.Form["catcont"] : "" %>' Type="VarChar" />
<Parameter Name="@catlist" Value='<%# ((Request.Form["catlist"] != null) && (Request.Form["catlist"].Length > 0)) ? Request.Form["catlist"] : "" %>' Type="Integer" />
<Parameter Name="@catname" Value='<%# ((Request.Form["catname"] != null) && (Request.Form["catname"].Length > 0)) ? Request.Form["catname"] : "" %>' Type="VarChar" />
<Parameter Name="@id" Value='<%# ((Request.Form["id"] != null) && (Request.Form["id"].Length > 0)) ? Request.Form["id"] : "" %>' Type="Integer" />
</Parameters>
</MM:Update>
<MM:Delete
runat="server"
CommandText='<%# "DELETE FROM dbo.cuku_cat WHERE id=?" %>'
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_conn"] %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_conn"] %>'
Expression='<%# ((Request.QueryString["act"] == "del") && (Request.QueryString["do"]=="class")) %>'
CreateDataSet="false"
SuccessURL='<%# "adminproducts.aspx?act=class" %>'
FailureURL='<%# "adminproducts.aspx?act=class" %>'
Debug="true"
><Parameters>
<Parameter Name="@id" Value='<%# ((Request.QueryString["id"] != null) && (Request.QueryString["id"].Length > 0)) ? Request.QueryString["id"] : "" %>' Type="Integer" />
</Parameters>
</MM:Delete>
<!--插入产品-->
<MM:Insert
runat="server"
CommandText='<%# "INSERT INTO dbo.cuku_products (prodoucts, catid, content, recom, uptop, isnew, cont, pic) VALUES (?, ?, ?, ?, ?, ?, ?, ?)" %>'
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_conn"] %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_conn"] %>'
Expression='<%# Request.Form["MM_insert"] == "form1" && Request.Form["id"].Trim()=="" %>'
CreateDataSet="false"
SuccessURL='<%# "adminproducts.aspx" %>'
FailureURL='<%# "adminproducts.aspx?act=add" %>'
Debug="true"
><Parameters>
<Parameter Name="@prodoucts" Value='<%# ((Request.Form["prodoucts"] != null) && (Request.Form["prodoucts"].Length > 0)) ? Request.Form["prodoucts"] : "" %>' Type="VarChar" />
<Parameter Name="@catid" Value='<%# ((Request.Form["catid"] != null) && (Request.Form["catid"].Length > 0)) ? Request.Form["catid"] : "" %>' Type="Integer" />
<Parameter Name="@content" Value='<%# ((Request.Form["content"] != null) && (Request.Form["content"].Length > 0)) ? Request.Form["content"] : "" %>' Type="VarChar" />
<Parameter Name="@recom" Value='<%# ((Request.Form["recom"] != null) && (Request.Form["recom"].Length > 0)) ? Request.Form["recom"] : "" %>' Type="Boolean" />
<Parameter Name="@uptop" Value='<%# ((Request.Form["uptop"] != null) && (Request.Form["uptop"].Length > 0)) ? Request.Form["uptop"] : "" %>' Type="Boolean" />
<Parameter Name="@isnew" Value='<%# ((Request.Form["isnew"] != null) && (Request.Form["isnew"].Length > 0)) ? Request.Form["isnew"] : "" %>' Type="Boolean" />
<Parameter Name="@cont" Value='<%# ((Request.Form["cont"] != null) && (Request.Form["cont"].Length > 0)) ? Request.Form["cont"] : "" %>' Type="VarChar" />
<Parameter Name="@pic" Value='<%# ((Request.Form["pic"] != null) && (Request.Form["pic"].Length > 0)) ? Request.Form["pic"] : "" %>' Type="VarChar" />
</Parameters>
</MM:Insert>
<MM:Update
runat="server"
CommandText='<%# "UPDATE dbo.cuku_products SET cont=?, content=?, isnew=?, recom=?, catid=?, pic=?, prodoucts=?, uptop=? WHERE id=?" %>'
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_conn"] %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_conn"] %>'
Expression='<%# Request.Form["MM_update"] == "form1" && Request.Form["id"].Trim()!="" %>'
CreateDataSet="false"
SuccessURL='<%# "adminproducts.aspx" %>'
Debug="true"
>
<Parameters>
<Parameter Name="@cont" Value='<%# ((Request.Form["cont"] != null) && (Request.Form["cont"].Length > 0)) ? Request.Form["cont"] : "" %>' Type="VarChar" />
<Parameter Name="@content" Value='<%# ((Request.Form["content"] != null) && (Request.Form["content"].Length > 0)) ? Request.Form["content"] : "" %>' Type="VarChar" />
<Parameter Name="@isnew" Value='<%# ((Request.Form["isnew"] != null) && (Request.Form["isnew"].Length > 0)) ? Request.Form["isnew"] : "" %>' Type="Boolean" />
<Parameter Name="@recom" Value='<%# ((Request.Form["recom"] != null) && (Request.Form["recom"].Length > 0)) ? Request.Form["recom"] : "" %>' Type="Boolean" />
<Parameter Name="@catid" Value='<%# ((Request.Form["catid"] != null) && (Request.Form["catid"].Length > 0)) ? Request.Form["catid"] : "" %>' Type="Integer" />
<Parameter Name="@pic" Value='<%# ((Request.Form["pic"] != null) && (Request.Form["pic"].Length > 0)) ? Request.Form["pic"] : "" %>' Type="VarChar" />
<Parameter Name="@prodoucts" Value='<%# ((Request.Form["prodoucts"] != null) && (Request.Form["prodoucts"].Length > 0)) ? Request.Form["prodoucts"] : "" %>' Type="VarChar" />
<Parameter Name="@uptop" Value='<%# ((Request.Form["uptop"] != null) && (Request.Form["uptop"].Length > 0)) ? Request.Form["uptop"] : "" %>' Type="Boolean" />
<Parameter Name="@id" Value='<%# ((Request.Form["id"] != null) && (Request.Form["id"].Length > 0)) ? Request.Form["id"] : "" %>' Type="Integer" />
</Parameters>
</MM:Update>
<MM:DataSet
id="rs"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_conn"] %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_conn"] %>'
CommandText='<%# "SELECT * FROM dbo.cuku_cat ORDER BY id DESC" %>'
Debug="true"
></MM:DataSet>
<MM:DataSet
id="editrs"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_conn"] %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_conn"] %>'
CommandText='<%# "SELECT * FROM dbo.cuku_cat WHERE id = ?" %>'
Debug="true"
>
<Parameters>
<Parameter Name="@id" Value='<%# ((Request.QueryString["id"] != null) && (Request.QueryString["id"].Length > 0)) ? Request.QueryString["id"] : "" %>' Type="Integer" />
</Parameters>
</MM:DataSet>
<MM:DataSet
id="pds"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_conn"] %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_conn"] %>'
CommandText='<%# "SELECT * FROM dbo.cuku_products,dbo.cuku_cat WHERE dbo.cuku_cat.id = dbo.cuku_products.catid ORDER BY dbo.cuku_products.id desc" %>'
CurrentPage='<%# ((Request.QueryString["pds_CurrentPage"] != null) && (Request.QueryString["pds_CurrentPage"].Length > 0)) ? Int32.Parse(Request.QueryString["pds_CurrentPage"]) : 0 %>'
PageSize="20"
Debug="true"
></MM:DataSet>
<MM:DataSet
id="editpds"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_STRING_conn"] %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings["MM_CONNECTION_DATABASETYPE_conn"] %>'
CommandText='<%# "SELECT * FROM dbo.cuku_products WHERE id = ?" %>'
Expression='<%# Myac=="add" %>'
Debug="true"
>
<Parameters>
<Parameter Name="@id" Value='<%# ((Request.QueryString["id"] != null) && (Request.QueryString["id"].Length > 0)) ? Request.QueryString["id"] : "" %>' Type="Integer" /> </Parameters>
</MM:DataSet>
<MM:PageBind runat="server" PostBackBind="true" />
<!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=utf-8" />
<title>产品管理</title>
<link href="images/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<script>
function del(ids,what)
{
if(confirm("你确定要删除吗?")){
window.location.href="?act=del&do="+what+"&id="+ids;
}else{
return
}
}
</script>
<script runat="server">
private string myac;
public string Myac
{
get { return this.myac; }
set { this.myac = value; }
}
public string Checked(string chkstr)
{
return chkstr=="True" ? "checked=\"checked\"":"";
}
public void Page_Load(Object Src, EventArgs E)
{
if (Request.QueryString["act"]== null)
{
Myac="go";
}
else
{
Myac=Request.QueryString["act"].Trim();
}
}
</script>
<mm:if runat="server" expression='<%# Myac=="go" %>'>
<contentstemplate>
<table width="600" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td height="25" colspan="5" background="images/bg_lead.png"> 产品管理</td>
</tr>
<tr>
<td width="6%" align="center" bgcolor="#CCEAFA">编号</td>
<td width="25%" align="center" bgcolor="#CCEAFA">产品名称</td>
<td width="23%" align="center" bgcolor="#CCEAFA">分类</td>
<td width="23%" align="center" bgcolor="#CCEAFA">属性</td>
<td width="23%" align="center" bgcolor="#CCEAFA">管理</td>
</tr>
<ASP:Repeater runat="server" DataSource='<%# pds.DefaultView %>'>
<ItemTemplate>
<tr>
<td height="21" align="center" bgcolor="#CCEAFA"><%# pds.FieldValue("id", Container) %></td>
<td bgcolor="#CCEAFA"><%# pds.FieldValue("prodoucts", Container) %></td>
<td bgcolor="#CCEAFA"><%# pds.FieldValue("catname", Container) %></td>
<td bgcolor="#CCEAFA"><%# pds.FieldValue("isnew", Container) %><%# pds.FieldValue("recom", Container) %><%# pds.FieldValue("isnew", Container) %></td>
<td align="center" bgcolor="#CCEAFA"><a href="?act=add&id=<%# pds.FieldValue("id", Container) %>">修改</a> <a href="javascript:del('<%# pds.FieldValue("id", Container) %>','pro')">删除</a></td>
</tr>
</ItemTemplate>
</ASP:Repeater>
<tr>
<td colspan="5" align="center" bgcolor="#CCEAFA">首页 上一页 下一页 末页</td>
</tr>
</table>
</contentstemplate>
</mm:if>
<mm:if runat="server" expression='<%# Myac=="add" %>' >
<contentstemplate>
<form action="" method='POST' enctype="multipart/form-data" name='form1' id="form1" runat='server'>
<table width="600" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td height="27" colspan="2" background="images/bg_lead.png" bgcolor="#EFF9FE"> 修改/添加商品</td>
</tr>
<tr>
<td width="121" height="23" align="center" bgcolor="#CCEAFA">产品名称</td>
<td width="479" bgcolor="#CCEAFA"><label>
<input name="prodoucts" type="text" id="prodoucts" value="<%# editpds.FieldValue("prodoucts", Container) %>" />
<input name="id" type="hidden" id="id" value="<%# editpds.FieldValue("id", Container) %>" />
</label></td>
</tr>
<tr>
<td height="23" align="center" bgcolor="#CCEAFA">产品分类</td>
<td bgcolor="#CCEAFA">
<select name="catid" id="catid">
<ASP:Repeater runat="server" DataSource='<%# rs.DefaultView %>'>
<ItemTemplate>
<option value="<%# rs.FieldValue("id", Container) %>"><%# rs.FieldValue("catname", Container) %></option>
</ItemTemplate>
</ASP:Repeater>
</select>
</td>
</tr>
<tr>
<td height="23" align="center" bgcolor="#CCEAFA">商品图片</td>
<td bgcolor="#CCEAFA"><label>
<input name="pic" type="text" id="pic" value="<%# editpds.FieldValue("pic", Container) %>" />
</label></td>
</tr>
<tr>
<td height="23" align="center" bgcolor="#CCEAFA">上传图片</td>
<td bgcolor="#CCEAFA"><label>
<input type="file" name="fileField" id="fileField" />
</label></td>
</tr>
<tr>
<td height="23" align="center" bgcolor="#CCEAFA">说 明</td>
<td bgcolor="#CCEAFA"><input name="cont" type="text" id="cont" value="<%# editpds.FieldValue("cont", Container) %>" /></td>
</tr>
<tr>
<td height="23" align="center" bgcolor="#CCEAFA">商品属性</td>
<td bgcolor="#CCEAFA"><label>
<input name="isnew" type="checkbox" id="isnew" value="true" <%# Checked(editpds.FieldValue("isnew", Container))%> />
新商品
<input name="recom" type="checkbox" id="recom" value="true" <%# Checked(editpds.FieldValue("recom", Container))%>/>
推荐
<input name="uptop" type="checkbox" id="uptop" value="true" <%# Checked(editpds.FieldValue("uptop", Container))%>/>
置顶
</label></td>
</tr>
<tr>
<td height="23" align="center" bgcolor="#CCEAFA">介 绍</td>
<td bgcolor="#CCEAFA"><label>
<textarea name="content" id="content" cols="45" rows="5"><%# editpds.FieldValue("content", Container) %></textarea>
</label></td>
</tr>
<tr>
<td height="23" align="center" bgcolor="#CCEAFA"> </td>
<td bgcolor="#CCEAFA"><label for="button"></label>
<input type="submit" name="button" id="button" value="提交" />
<label>
<input type="reset" name="button2" id="button2" value="重设" />
<input name="button3" type="button" id="button3" onclick="history.go(-1)" value="返回" />
</label></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
<input type="hidden" name="MM_update" value="form1" />
</form>
</contentstemplate>
</mm:if>
<mm:if runat="server" expression='<%# Myac=="class" %>' >
<contentstemplate>
<table width="387" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td height="25" colspan="5" align="center" background="images/bg_lead.png"> 分类列表</td>
</tr>
<tr>
<td width="27" height="23" align="center" bgcolor="#CCEAFA">编号</td>
<td width="79" align="center" bgcolor="#CCEAFA">分类名称</td>
<td width="30" align="center" bgcolor="#CCEAFA">顺序</td>
<td width="175" align="center" bgcolor="#CCEAFA">说明</td>
<td width="60" align="center" bgcolor="#CCEAFA">管理</td>
</tr>
<ASP:Repeater runat="server" DataSource='<%# rs.DefaultView %>'>
<ItemTemplate>
<tr>
<td height="23" align="center" bgcolor="#CCEAFA"> <%# rs.FieldValue("id", Container) %></td>
<td align="center" bgcolor="#CCEAFA"><%# rs.FieldValue("catname", Container) %></td>
<td align="center" bgcolor="#CCEAFA"><%# rs.FieldValue("catlist", Container) %></td>
<td bgcolor="#CCEAFA"><%# rs.FieldValue("catcont", Container) %></td>
<td bgcolor="#CCEAFA"><a href="?act=class&id=<%# rs.FieldValue("id", Container) %>">修改</a> <a href="javascript:del('<%# rs.FieldValue("id", Container) %>','class');">删除</a></td>
</tr>
</ItemTemplate>
</ASP:Repeater>
</table>
<form runat='server' id="form2" name='form2' method='POST' action="">
<table width="387" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td height="25" colspan="2" background="images/bg_lead.png"> 产品分类添加</td>
</tr>
<tr>
<td width="100" align="center">分类名称</td>
<td width="272"><label>
<input name="catname" type="text" id="catname" value="<%# editrs.FieldValue("catname", Container) %>" />
<input name="id" type="hidden" id="id" value="<%# editrs.FieldValue("id", Container) %>" />
</label></td>
</tr>
<tr>
<td align="center">分类顺序</td>
<td><input name="catlist" type="text" id="catlist" value="<%# editrs.FieldValue("catlist", Container) %>" /></td>
</tr>
<tr>
<td align="center">分类说明</td>
<td><input name="catcont" type="text" id="catcont" value="<%# editrs.FieldValue("catcont", Container) %>" /></td>
</tr>
<tr>
<td align="center"> </td>
<td><label>
<input type="submit" name="button4" id="button4" value="提交" />
<input type="reset" name="button5" id="button5" value="重置" />
<input type="button" name="button6" id="button6" value="返回" />
</label></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form2" />
<input type="hidden" name="MM_update" value="form2" />
</form>
</contentstemplate>
</mm:if>
</body>
</html>
關於網站灰色的css
[
2008/05/19 13:02 | by Else ]
2008/05/19 13:02 | by Else ]
原來用的
這個css在打開之後占客戶的cpu比較高
這個css只是占用一下,就下來了!所以推薦你用第二個
<style type="text/css">
<!--
*{filter:Gray;}
-->
</style>
<!--
*{filter:Gray;}
-->
</style>
這個css在打開之後占客戶的cpu比較高
<style>
html { filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); }
</style>
html { filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); }
</style>
這個css只是占用一下,就下來了!所以推薦你用第二個
好多事务,唉!
数组的操作
關於二維數組的刪除修改或是對比,我是通過foreach然後找到相同的key的值去修改裡面的值
数组的操作
<?php
$arr=array('name'=>'test','price'=>'33','count'=>'333');
//print_r($arr);
$_SESSION['products']=array(
array('name'=>'echo','price'=>'2','count'=>'3'),
array('name'=>'name','price'=>'100','count'=>'1'),
array('name'=>'else','price'=>'200','count'=>'2'),
);
//向数组的开头写入值,测试成功
array_push($_SESSION['products'],$arr);
$_SESSION['products'][0]['name']='edit echo';
unset($_SESSION['products'][0]);
print_r($_SESSION['products']);
//echo $_SESSION['products'][0]['name'];
?>
$arr=array('name'=>'test','price'=>'33','count'=>'333');
//print_r($arr);
$_SESSION['products']=array(
array('name'=>'echo','price'=>'2','count'=>'3'),
array('name'=>'name','price'=>'100','count'=>'1'),
array('name'=>'else','price'=>'200','count'=>'2'),
);
//向数组的开头写入值,测试成功
array_push($_SESSION['products'],$arr);
$_SESSION['products'][0]['name']='edit echo';
unset($_SESSION['products'][0]);
print_r($_SESSION['products']);
//echo $_SESSION['products'][0]['name'];
?>
關於二維數組的刪除修改或是對比,我是通過foreach然後找到相同的key的值去修改裡面的值
foreach ($_SESSION['products'] as $kkk)
{
if ($kkk['proid']==$_POST['oid'] && $kkk['produts']=="裝備")
{
$kkey=array_search($kkk,$_SESSION['products']);
$_SESSION['products'][$kkey]['count']++;
die("這個商品已經添加到購物車這個".$kkey);
}
}
{
if ($kkk['proid']==$_POST['oid'] && $kkk['produts']=="裝備")
{
$kkey=array_search($kkk,$_SESSION['products']);
$_SESSION['products'][$kkey]['count']++;
die("這個商品已經添加到購物車這個".$kkey);
}
}
PQuery - PHP 加 JQuery
[
2008/04/23 18:02 | by Else ]
2008/04/23 18:02 | by Else ]
原文地址:http://www.ngcoders.com/php/pquery-php-and-jquery/
PQuery - PHP and JQuery
PQuery是一组jQuery写成的辅助对象Javascript库。这个库让你可以简单地在自己的PHP代码中嵌入AJAX,特效及其他jQuery提供的功能特性。目前正在编写项目文档,代码兼容于PHP4和PHP5。
Download pquery :PQuery 下载.
PQuery Demos : PQuery 演示.
Documentation : PQuery 文档 .
当前版本为: v0.1
VS.PHP 在Visual Studio 下的 PHP 开发 IDE 工具
[
2008/04/23 16:47 | by Else ]
2008/04/23 16:47 | by Else ]
是的,没错.
有一个叫 VS.PHP for Visual Studio 的软件,就可以让你的vs支持php代码高亮显示了.
它的官方下载页面是 http://www.jcxsoftware.com/download.php 可以选择for 2005 还是 for 2005.
安装后目录下自带了 apache2 和 php 4 php 5.
如图↓

启动速度真是嗖快啊,比zendstudio这些需要java虚拟机的ide快多了(在windows环境下).

哈,花花绿绿多好看啊.这是一位达人给的配色方案,在此基础上我改了几个php相关的.因为涉及到知识产权问题,所以就不共享此配色方案了.
VS.php最新版的破解补丁↓
替换同名文件就行
vsphpforvisualstudio2008v2444494cracked-invisible.rar
忘了说了,支持debug调试,就是开个apache进程,apache和php的配置文件生成在工程目录下了,是隐藏文件.
有一个叫 VS.PHP for Visual Studio 的软件,就可以让你的vs支持php代码高亮显示了.
它的官方下载页面是 http://www.jcxsoftware.com/download.php 可以选择for 2005 还是 for 2005.
安装后目录下自带了 apache2 和 php 4 php 5.
如图↓

启动速度真是嗖快啊,比zendstudio这些需要java虚拟机的ide快多了(在windows环境下).

哈,花花绿绿多好看啊.这是一位达人给的配色方案,在此基础上我改了几个php相关的.因为涉及到知识产权问题,所以就不共享此配色方案了.
VS.php最新版的破解补丁↓
替换同名文件就行
vsphpforvisualstudio2008v2444494cracked-invisible.rar
忘了说了,支持debug调试,就是开个apache进程,apache和php的配置文件生成在工程目录下了,是隐藏文件.
jmail的認證方式
[
2008/04/21 15:28 | by Else ]
2008/04/21 15:28 | by Else ]
[codes=vb] set mymail=server.CreateObject("jmail.message")
mymail.MailServerPassWord ="pass" '发信授权邮件密码
mymail.MailServerUserName ="who@qq.com" '发信授权邮件名称
mymail.ContentType = "text/html" '(是否支持html,如不要就去掉此行)
mymail.Charset="utf-8" '使用字符集,不用改的
mymail.AddRecipient "to@qq.com" '收件人邮箱
mymail.Body= "您好86,...." '邮件正文
mymail.From="from@test.com" '发件人邮箱
mymail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
mymail.Subject="你好吗?" '邮件标题
mymail.Send "mail.qq.com",false '邮件发送服务器
set mymail = nothing [/codes]
mymail.MailServerPassWord ="pass" '发信授权邮件密码
mymail.MailServerUserName ="who@qq.com" '发信授权邮件名称
mymail.ContentType = "text/html" '(是否支持html,如不要就去掉此行)
mymail.Charset="utf-8" '使用字符集,不用改的
mymail.AddRecipient "to@qq.com" '收件人邮箱
mymail.Body= "您好86,...." '邮件正文
mymail.From="from@test.com" '发件人邮箱
mymail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
mymail.Subject="你好吗?" '邮件标题
mymail.Send "mail.qq.com",false '邮件发送服务器
set mymail = nothing [/codes]
在php5.2.5和4.39之间我选择了bob
[
2008/04/14 21:08 | by Else ]
2008/04/14 21:08 | by Else ]
[codes=php]function admin_convert ($str) {
get_magic_quotes_gpc();
$str=stripslashes($str);
$str=str_replace("\r", '', $str);
$str=str_replace("\n", '', $str);
$str=str_replace("'", "\'", $str);
return $str;
}[/codes]
好惨,我的是5.2.5开发的,传到空间上错了很多,把空间的下回来,这里又错了,想起来bob的这个怎么改都没有错于是找呀找,找到这个了
get_magic_quotes_gpc();
$str=stripslashes($str);
$str=str_replace("\r", '', $str);
$str=str_replace("\n", '', $str);
$str=str_replace("'", "\'", $str);
return $str;
}[/codes]
好惨,我的是5.2.5开发的,传到空间上错了很多,把空间的下回来,这里又错了,想起来bob的这个怎么改都没有错于是找呀找,找到这个了
清除浮动“clear:both;”的应用
[
2008/04/13 20:47 | by Else ]
2008/04/13 20:47 | by Else ]
在CSS中我们会经常要用到“清除浮动”Clear,比较典型的就是clear:both;
CSS手册上是这样说明的:该属性的值指出了不允许有浮动对象的边。这个属性是用来控制float属性在文档流的物理位置的。
当属性设置float(浮动)时,其所在的物理位置已经脱离文档流了,但是大多时候我们希望文档流能识别float(浮动),或者是希望float(浮动)后面的元素不被float(浮动)所影响,这个时候我们就需要用clear:both;来清除。比如:
如果不用清除浮动,那么第3列文字就会和第1、2列文字在一起 ,所以我们在第3个这列加一个清除浮动 clear:both;
CSS手册上是这样说明的:该属性的值指出了不允许有浮动对象的边。这个属性是用来控制float属性在文档流的物理位置的。
当属性设置float(浮动)时,其所在的物理位置已经脱离文档流了,但是大多时候我们希望文档流能识别float(浮动),或者是希望float(浮动)后面的元素不被float(浮动)所影响,这个时候我们就需要用clear:both;来清除。比如:
代码:
复制代码 | 运行代码 | 另存代码
<p style="float:left;width:200px;">这个是第1列,</p>
<p style="float:left;width:400px;">这个是第2列,</p>
<p>这个是第3列。</p>
<p style="float:left;width:400px;">这个是第2列,</p>
<p>这个是第3列。</p>
如果不用清除浮动,那么第3列文字就会和第1、2列文字在一起 ,所以我们在第3个这列加一个清除浮动 clear:both;
代码:
复制代码 | 运行代码 | 另存代码
<p style="float:left;width:200px;">这个是第1列,</p>
<p style="float:left;width:400px;">这个是第2列,</p>
<p style="clear:both;">这个是第3列。</p>
<p style="float:left;width:400px;">这个是第2列,</p>
<p style="clear:both;">这个是第3列。</p>














