<?php
//jump_to
function akey($key,$title=null){
if ($key==",") $str = "<";
elseif ($key==".") $str = ">";
elseif ($key=="=") $str = "+";
else $str = $key;
return "accesskey='$key' title='$title - Fn+$str'";
}
function coutfn($fn){return "<span class='fn'>Fn+$fn</span>";}
function html8($str=null){return @htmlspecialchars($str,ENT_QUOTES,"UTF-8");}
/*texta name val x y style -
select name val size sql style arr |select: sql+arr: arr=[0,1]
radio name val sepa sql - arr |select: !sql arr:arr[k->v,...]
cbox name val sepa sql - arr |cbox|radio: sql or arr
text name val size max style -
pass name val size max style -
submit name val size - style -
hidden name val - - - - */
function html_form($type,$name,$val=null,$size=null,$sql=null,$style=null,$arr=null)
{
if ($val && !@is_array($val)) $val = @html8($val);
$style = ($style ? " $style" : "");
$style_arr = @explode("style='",$style,2);
if ($type=="textarea"){
if ($size || $sql){
if ($size) $str = "width:$size"."px;";
if ($sql) $str .= "height:$sql"."px;";
if ($style_arr[1]) $style = $style_arr[0]."style='$str".$style_arr[1];
else $style = " style='$str'".$style;
}
return "<textarea name='$name'$style>$val</textarea>";
}
if ($size && $type<>"radio" && $type<>"checkbox"){
if ($style_arr[1]) $style = $style_arr[0]."style='width:$size"."px;$style_arr[1]";
else $style = " style='width:$size"."px'$style";
}
$style = "name='$name'$style";
if ($sql && ($type=="select" || $type=="radio" || $type=="checkbox")) $res = @mysql_query($sql);
if ($type=="select"){
$str = "<select size='1' $style>";
if (isset($res)){
if (isset($arr[0]))
$str .= "<option value='$arr[0]'".(@in_array($arr[0],$val) || $arr[0]==$val ? " selected='selected'" : "").">$arr[1]</option>";
while ($row = @mysql_fetch_row($res))
$str .= "<option value='$row[0]'".(@in_array($row[0],$val) || $row[0]==$val ? " selected='selected'" : "").">$row[1]</option>";
}else{
foreach ($arr as $k=>$v)
$str .= "<option value='$k'".(@in_array($k,$val) || $k==$val ? " selected='selected'" : "").">$v</option>";
}
$str .= "</select>";
return $str;
}
if ($type=="radio" || $type=="checkbox"){
if (!$size) $size = " ";//sepa
if (isset($res)){
while ($row = @mysql_fetch_row($res))
$str .= "<input type='$type' $style value='$row[0]'".($row[0]==$val || @in_array($row[0],$val) ? " checked='checked'" : "")." /> $row[1]$size";
}else{
foreach ($arr as $k=>$v)
$str .= "<input type='$type' $style value='$k'".($k==$val || @in_array($k,$val) ? " checked='checked'" : "")." /> $v$size";
}
return @substr($str,0,0-@strlen($size));
}
return "<input type='$type' $style value='$val'".(@is_numeric($sql) ? " maxlength='$sql'" : "")." />";
}
function html_img($url,$t=null,$style=null,$w=16,$h=16,$b=0,$alt="")
{
if (!@strpos($url,".")) $url .= ".png";
return "<img src='img/$url'".($w ? " width='$w'" : "").($h ? " height='$h'" : "")." border='$b'".($t ? " title='$t'" : "")." alt='$alt'".($style ? " $style" : "")." />";
}
function html_js($str){return "<script type='text/javascript'>$str</script>";}
//arr function
function cout_arr($arr,$mode="html",$SIDU)
{
$hold_mode = ($mode=="data" ? "data" : "");
if ($mode<>"html" && $SIDU['mode'][2]==-1) $mode = "html";//grid off
echo "<table class='dataTab bb br mt32' id='dataTable'>";
$select = @cout_arr_head($arr[1],$mode,$SIDU,$hold_mode);
if ($hold_mode=="data"){//grid off mode:also can delete
foreach ($SIDU[7][1] as $v) $col[] = $v->name;
if (isset($SIDU[7][1][0]->pk)) $pk = $SIDU[7][1][0]->pk;
else{foreach ($col as $k=>$v){
if (!$SIDU[7][1][$k]->blob) $pk[] = $k;
}}
}
foreach ($arr[2] as $r=>$row){
echo "<tr id='tr_$r'><td class='cbox br'><input type='checkbox' name='data_cbox_$r' /></td>";
foreach ($arr[1] as $k=>$v){
$V = $row[$k]; $V8 = @html8($V);
if ($SIDU[8][0][$k]<>-1){
$align = ($v->numeric ? " class='aright'" : "");
$name = "data_$r"."_$k";
$onchange = "onchange=\"document.dataTab.data_cbox_$r.checked='checked'\"";
if ($mode=="data" || $mode=="sql"){
if ($v->blob) echo "<td><input type='hidden' name='$name' value='$V8' /><input type='button' name='bt$name' size='1' value='".@html8(@substr($V,0,20))."' onclick=\"document.dataTab.data_cbox_$r.checked='checked';xwin('tab.php?blob=$SIDU[0],$r"."_$k')\" /></td>";
elseif (isset($select[$k])){
echo "<td>".@html_form("select",$name,$V,"","",$onchange,$select[$k][1])."</td>";
}else echo "<td><input type='text' size='1' name='$name' value='$V8'$align $onchange /></td>";
}else echo "<td$align>".@nl2br($V8)."</td>";
}
if ($hold_mode=="data" && @in_array($k,$pk)) echo @html_form("hidden","pk[$r][$k]",$V8);
}
echo "</tr>";
}
echo "</table>";
if ($mode=="data") return $select;
}
function cout_arr_head($col,$mode,$SIDU=null,$hold_mode)
{
echo "<tr><th class='cbox br'><input type='checkbox' onclick='checkedAll()' /></th>";
$cookie = ($mode=="data" ? "data_$SIDU[1]_$SIDU[2]" : "sql_grid");
if ($mode=="data" || $mode=="sql") $gridW = @explode(".",$_COOKIE[$cookie]);
foreach ($col as $k=>$v){
if ($SIDU[8][0][$k]<>-1){
$name = $v->name;
if ($hold_mode=="data"){
$sort_css = @get_sort_css($name,$SIDU[3],$SIDU[6]);
$header = "<a href='#' onclick=\"dataForm(5,document.getElementById('limitto').value,7,'$name')\">$name</a>";
}else $header = $name;
if ($mode=="data" || $mode=="sql"){
$grid_size = " id='gd$k' style='width:{$gridW[$k]}px'";
$grid_resize = "<div class='gridr' onclick=\"resizeGrid($k,1,'$cookie')\"></div><div class='gridl' onclick=\"resizeGrid($k,0,'$cookie')\"></div>";
if ($mode=="data"){
if (@substr($SIDU[10][2][$k][1],0,5)=="enum("){//Type
$select[$k][2] = @explode("','",@substr($SIDU[10][2][$k][1],6,-2));
$select[$k][0] = $SIDU[10][2][$k][4];//Default
foreach ($select[$k][2] as $sele) $select[$k][1][$sele] = $sele;
}
}
}
echo "<th$sort_css title='$name'$grid_size>$grid_resize$header</th>";
}
}
echo "</tr>";
return $select;
}
function init_tab_head($res,$mode="name",$cookie=null)//name|data|sql, grid: 3char=1unit*25px
{
while ($row = @mysql_fetch_field($res)) $col[] = $row;
if ($mode=="name") return $col;
$num = count($col);
$setTabCook = ($mode<>"data" || !isset($_COOKIE[$cookie]));
for ($i=0;$i<$num;$i++){
if ($setTabCook){
$w = $col[$i]->max_length;
$w = ($w<7 ? 40 : ($w<11 ? 70 : ($w<21 ? 140 : 230)));
$col[$i]->grid_w = $w;
$W += $w;
}
if ($mode=="data"){
if ($col[$i]->primary_key) $col[0]->pk[] = $i;
if (!isset($col[0]->pk) && $col[$i]->unique_key) $col[uk][] = $i;
}
}
if ($mode=="data"){
if (!isset($col[0]->pk) && isset($col[uk])) $col[0]->pk = $col[uk];//used for updating
unset($col[uk]);
}
if (!$setTabCook) return $col;
$W = 740 - $W;
while ($W>0){
$holdW = $W;
for ($i=0;$i<$num && $W>0;$i++){
if (($col[$i]->grid_w <70 || $col[$i]->max_length > 21) && $col[$i]->grid_w < 350){
$col[$i]->grid_w += 40; $W -= 40;
}
}
if ($W==$holdW) $W=0;
}
for($i=0;$i<$num;$i++) $grid .= ".".$col[$i]->grid_w;
$_COOKIE[$cookie] = @substr($grid,1);
@setcookie($cookie,$_COOKIE[$cookie]);
return $col;
}
function strip($val,$trim=0,$tag=0,$slash=0)//tag==1,0 or <p><b>
{
if (@is_array($val)){
foreach ($val as $k=>$v)
$val[$k] = @strip($v,$trim,$tag,$slash);
}else{
if ($tag) $val = @strip_tags($val,($tag==1 ? "" : $tag));
if ($slash)$val = @stripslashes($val);
if ($trim) $val = @trim($val);
}
return $val;
}
//sort function
function get_sort_css($name,$sort1,$sort2=null)
{
if ($name==$sort1) return " clas
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
[文件数据]MySQL Sidu 2.3 多国语言_sidu23.zip源码PHP项目源代码下载[文件数据]MySQL Sidu 2.3 多国语言_sidu23.zip源码PHP项目源代码下载 1.适合个人搭建网站项目参考 2.适合学生毕业设计搭建网站参考 3.适合小公司搭建网站项目参考
资源推荐
资源详情
资源评论
收起资源包目录
[文件数据]MySQL Sidu 2.3 多国语言_sidu23.zip源码PHP项目源代码下载 (112个子文件)
css.css 4KB
nav.css 1KB
arrr.gif 832B
arrl.gif 829B
arrup2.gif 828B
arrdw.gif 828B
arrup.gif 828B
arrdw2.gif 828B
tab-light.gif 541B
fopen.gif 376B
f.gif 372B
user.gif 238B
tr.gif 89B
trlast.gif 88B
tropen.gif 86B
tropenlast.gif 85B
filter.gif 75B
join.gif 69B
arr-up.gif 69B
arr-dw.gif 67B
line.gif 66B
joinlast.gif 66B
linelast.gif 62B
arr1f.gif 62B
arr1l.gif 62B
arr2b.gif 60B
arr2n.gif 59B
common.js 3KB
inc.func.php 25KB
mysql-user.php 12KB
export.php 11KB
tab.php 10KB
sqls.php 9KB
conn.php 8KB
import.php 7KB
sidu-user.php 5KB
table_new.php 3KB
menu.php 3KB
option.php 3KB
sql.php 3KB
table.php 3KB
db.php 2KB
mysql-user.php 2KB
mysql-user.php 2KB
sqls.php 2KB
sqls.php 2KB
import.php 2KB
000-all.php 2KB
import.php 1KB
000-all.php 1KB
help.php 1KB
help.php 1KB
export.php 1KB
exit.php 1KB
export.php 1KB
his.php 1KB
sidu-user.php 1KB
sidu-user.php 1KB
index.php 1KB
sidu-ip.php 1KB
inc.page.php 987B
option.php 666B
option.php 664B
temp.php 649B
root_a47729e3.php 581B
sidu-ip.php 420B
inc.default.profile.php 414B
sidu-ip.php 404B
inc.sidu.gk.ip.php 297B
inc.sidu.user.php 292B
exit.php 235B
help.php 187B
exit.php 186B
table.php 148B
table.php 135B
css.php 106B
js.php 80B
ff.png 1KB
tab-find.png 1KB
tool-sys.png 1001B
tool-option.png 947B
email.png 939B
help.png 929B
tab-info.png 922B
tool-refresh.png 912B
tool-his.png 897B
exit.png 872B
menu-pc.png 808B
tool-flush.png 773B
lock.png 757B
menuclose.png 743B
toolopen.png 730B
tool-open.png 721B
tab-down.png 720B
del.png 709B
menuopen.png 684B
folder.png 674B
tool-next.png 662B
run.png 654B
toolclose.png 642B
共 112 条
- 1
- 2
资源评论
yxkfw
- 粉丝: 76
- 资源: 2万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功