Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
fenzhan_zsb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esf
fenzhan_zsb
Commits
7b5f75df
Commit
7b5f75df
authored
Jun 29, 2020
by
zhangkuanguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
53c62360
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
150 additions
and
149 deletions
+150
-149
func_tony.bak.php
...cp/vendor/house365/esfadmin/core/common/func_tony.bak.php
+75
-74
func_tony.php
...dmincp/vendor/house365/esfadmin/core/common/func_tony.php
+75
-75
No files found.
new_admincp/vendor/house365/esfadmin/core/common/func_tony.bak.php
View file @
7b5f75df
<?php
//
函数集合
//
��������
if
(
!
function_exists
(
'log_broker_credit'
))
{
function
log_broker_credit
(
$uid
,
$operation
,
$kind
)
{
GLOBAL
$db
;
...
...
@@ -29,7 +29,7 @@ function log_agent_credit($uid, $operation, $kind) {
$db
->
Execute
(
$q
);
}
}
//写
日
志
//д
��־
function
actionlog
(
$tbl
,
$rowid
,
$msg
)
{
GLOBAL
$db
,
$web_auth
;
...
...
@@ -46,9 +46,9 @@ function actionlog($tbl, $rowid, $msg) {
}
/**
*
经纪人账号操作日志记
录
*
�������˺Ų�����־��¼
*
* @param array
经纪人信
息
* @param array
��������Ϣ
*/
function
brokeroperatorlog
(
$data
)
{
GLOBAL
$db
,
$web_auth
;
...
...
@@ -62,7 +62,7 @@ function brokeroperatorlog($data) {
$db
->
Execute
(
$q
);
}
//
获
取IP
//
��ȡ
IP
if
(
!
function_exists
(
'GetIP'
))
{
function
GetIP
()
{
...
...
@@ -95,7 +95,7 @@ function tonyForm($tag, $name, $option_arr, $value = '', $td_num = 1, $validate
$td_width
=
"width="
.
floor
(
100
/
$td_num
)
.
"%"
;
$blank_i
=
ceil
(
count
(
$option_arr
)
/
$td_num
)
*
$td_num
-
count
(
$option_arr
);
for
(
$i
=
0
;
$i
<
$blank_i
;
$i
++
)
$option_arr
[]
=
""
;
//
补全使之成为整数
$option_arr
[]
=
""
;
//
��ȫʹ֮��Ϊ����
$str
=
"<table align=center border=0 cellspacing=0 width=100%>
\n
"
;
$i
=
1
;
...
...
@@ -119,7 +119,7 @@ function tonyForm($tag, $name, $option_arr, $value = '', $td_num = 1, $validate
$td_width
=
"width="
.
floor
(
100
/
$td_num
)
.
"%"
;
$blank_i
=
ceil
(
count
(
$option_arr
)
/
$td_num
)
*
$td_num
-
count
(
$option_arr
);
for
(
$i
=
0
;
$i
<
$blank_i
;
$i
++
)
$option_arr
[]
=
""
;
//
补全使之成为整数
$option_arr
[]
=
""
;
//
��ȫʹ֮��Ϊ����
$str
=
"<table align=center border=0 cellspacing=0 width=100%>
\n
"
;
$i
=
1
;
...
...
@@ -142,7 +142,7 @@ function tonyForm($tag, $name, $option_arr, $value = '', $td_num = 1, $validate
$td_width
=
"width="
.
floor
(
100
/
$td_num
)
.
"%"
;
$blank_i
=
ceil
(
count
(
$option_arr
)
/
$td_num
)
*
$td_num
-
count
(
$option_arr
);
for
(
$i
=
0
;
$i
<
$blank_i
;
$i
++
)
$option_arr
[]
=
""
;
//
补全使之成为整数
$option_arr
[]
=
""
;
//
��ȫʹ֮��Ϊ����
$str
=
"<table align=center border=0 cellspacing=0 width=100%>
\n
"
;
$i
=
1
;
...
...
@@ -164,14 +164,14 @@ function tonyForm($tag, $name, $option_arr, $value = '', $td_num = 1, $validate
}
}
if
(
!
function_exists
(
'create_htmlable'
))
{
function
create_htmlable
(
$name
,
$label
,
$value
=
''
,
$val
=
''
,
$class
=
''
,
$style
=
''
,
$js
=
''
){
//
创建html标
签
//name
标签名称|label标签类型|value标签的值(当为checkbox时为数组)|val主要用于radio和
checkbox
function
create_htmlable
(
$name
,
$label
,
$value
=
''
,
$val
=
''
,
$class
=
''
,
$style
=
''
,
$js
=
''
){
//
����html��ǩ
//name
��ǩ����|label��ǩ����|value��ǩ��ֵ(��ΪcheckboxʱΪ����)|val��Ҫ����radio��checkbox
$html
=
''
;
if
(
$class
)
$cls
=
'class="'
.
$class
.
'"'
;
if
(
$style
)
$sty
=
'style="'
.
$style
.
'"'
;
if
(
$name
)
$nam
=
'name="'
.
$name
.
'"'
;
if
(
$label
==
'text'
||
$label
==
'password'
){
//
文本框
if
(
$label
==
'text'
||
$label
==
'password'
){
//
�ı���
if
(
$name
)
$id
=
'id="'
.
$name
.
'"'
;
$html
=
'<input '
.
$cls
.
' type="'
.
$label
.
'" '
.
$nam
.
' '
.
$id
.
' value="'
.
$value
.
'" '
.
$sty
.
' '
.
$js
.
'>'
;
}
elseif
(
$label
==
'radio'
){
//radio
...
...
@@ -188,7 +188,7 @@ function create_htmlable($name,$label,$value='',$val='',$class='',$style='',$js=
$html
.=
' <input type="'
.
$label
.
'" '
.
$nam
.
' '
.
$checked
.
' value="'
.
$key
.
'" '
.
$sty
.
' '
.
$js
.
'>'
.
$item
;
}
}
}
elseif
(
$label
==
'select'
){
//
下拉框
}
elseif
(
$label
==
'select'
){
//
������
if
(
is_array
(
$val
)){
if
(
$name
)
$id
=
'id="'
.
$name
.
'"'
;
$html
.=
'<select '
.
$nam
.
' '
.
$id
.
' '
.
$sty
.
' '
.
$js
.
'>'
;
...
...
@@ -206,17 +206,17 @@ function create_htmlable($name,$label,$value='',$val='',$class='',$style='',$js=
if
(
!
function_exists
(
'ctrl_select'
))
{
function
ctrl_select
(
$opt_para
,
$ctrl_name
,
$ctrl_value
,
$style_ext
=
"class=flat1"
)
{
/** 2002.03.05
ctrl_select
函数参数说明
@param [opt_para] : opt_para
是一个数组,元素含义如下
[opt_arr]
下拉框选项的数组,可以是简单数组,也可以是关联数组
[field_key]
如果是关联数组,field_key表示, 下拉框的key 出自关联数组的哪一个field,为空表示出自简单数组的k
ey
[field_value]
如果是关联数组,field_value表示,下拉框的value出自关联数组的哪一个field,为空表示出自简单数组的v
alue
@param [ctrl_name] : select
控件的名称
@param [ctrl_value] : select
控件选择的值
@param [style_ext] :
扩充的样式,可以是样式或j
s
返回select的
string
ctrl_select
��������˵��
@param [opt_para] : opt_para
��һ�����飬Ԫ�غ�������
[opt_arr]
������ѡ������飬�����Ǽ����飬Ҳ�����ǹ�������
[field_key]
����ǹ������飬field_key��ʾ�� �������key ���Թ����������һ��field��Ϊ�ձ�ʾ���Լ������key
[field_value]
����ǹ������飬field_value��ʾ���������value���Թ����������һ��field��Ϊ�ձ�ʾ���Լ������value
@param [ctrl_name] : select
�ؼ�������
@param [ctrl_value] : select
�ؼ�ѡ���ֵ
@param [style_ext] :
�������ʽ����������ʽ��js
����select��str
ing
* */
// 1.
重新构建数组,将关联数组化为简单数组
// 1.
���¹������飬���������黯Ϊ������
$old_opt_arr
=
(
is_array
(
$opt_para
[
opt_arr
]))
?
(
$opt_para
[
opt_arr
])
:
(
array
());
FOR
(
$opt_arr
=
array
(),
reset
(
$old_opt_arr
),
$i
=
0
;
$i
<
count
(
$old_opt_arr
);
$i
++
)
{
$key
=
key
(
$old_opt_arr
);
...
...
@@ -226,7 +226,7 @@ function ctrl_select($opt_para, $ctrl_name, $ctrl_value, $style_ext = "class=fla
next
(
$old_opt_arr
);
}
// 2.
生成
// 2.
����
$ss
=
"<select name=
\"
"
.
$ctrl_name
.
"
\"
"
.
$style_ext
.
">
\n
"
;
for
(
reset
(
$opt_arr
),
$i
=
1
;
$i
<=
count
(
$opt_arr
);
$i
++
)
{
$key
=
key
(
$opt_arr
);
...
...
@@ -279,13 +279,13 @@ function telnotelist($telno) {
$rs
=
$db
->
SelectLimit
(
$q
,
10
);
$ss
=
"<div align='left'>
$remark_add
</div>"
;
$ss
=
"<table width=700 border=0 cellspacing=0 cellpadding=0 align=center height=0><tr><td ><font color='#990000'>
电话备注记录(
$telno
) </font></td></tr></table><table "
.
LIST_TBL_STYLE
.
"><tr align=center bgcolor=#F7F4E8><td width=5%>类型</td><td width=10%>房源编号</td><td width=10%>房源地址</td><td width=10%>联系人</td><td width=10%>当时状态</td><td width=25%>电话备注</td><td width=15%>更新时间</td><td width=10%>操作员</td><td >操作
</td></tr>"
;
$ss
=
"<table width=700 border=0 cellspacing=0 cellpadding=0 align=center height=0><tr><td ><font color='#990000'>
�绰��ע��¼(
$telno
) </font></td></tr></table><table "
.
LIST_TBL_STYLE
.
"><tr align=center bgcolor=#F7F4E8><td width=5%>����</td><td width=10%>��Դ���</td><td width=10%>��Դ��ַ</td><td width=10%>��ϵ��</td><td width=10%>��ʱ״̬</td><td width=25%>�绰��ע</td><td width=15%>����ʱ��</td><td width=10%>����Ա</td><td >����</td></tr>"
;
while
(
$row
=
$rs
->
FetchRow
())
{
$updatetime
=
date
(
"Ymd H:i"
,
$row
[
"updatetime"
]);
//
登记时间
$esta
=
tony_flag2name
(
$row
[
"esta"
],
$house
[
'esta'
]);
//
当
前状态
$updatetime
=
date
(
"Ymd H:i"
,
$row
[
"updatetime"
]);
//
�Ǽ�ʱ��
$esta
=
tony_flag2name
(
$row
[
"esta"
],
$house
[
'esta'
]);
//
��ǰ
״̬
$address
=
csubstr2
(
$row
[
address
],
20
);
$act
=
"<a href='telno_note.php?tbl=
$row[tbl]&rowid=$row[rowid]&telno=$row[telno]&esta=$row[esta]
' target='_blank'>
改</a> <a href='telno_note.php?action=del&id=
$row[id]
' target='_blank' onclick='if (!confirm(
\\\"
确定要删除该记录吗?
\\\"
))return false;'>删</a>"
;
$act
=
"<a href='telno_note.php?tbl=
$row[tbl]&rowid=$row[rowid]&telno=$row[telno]&esta=$row[esta]
' target='_blank'>
��</a> <a href='telno_note.php?action=del&id=
$row[id]
' target='_blank' onclick='if (!confirm(
\\\"
ȷ��Ҫɾ���ü�¼��
\\\"
)
)return false;'>ɾ</a>"
;
$ss
.=
"<tr><td>
$row[tbl]</td><td>$row[rowid]
</td><td align=left><span title='
$row[address]'>$address</span></td><td>$row[contactor]
</td><td>
$esta
</td><td><font color=blue>"
.
addslashes
(
$row
[
note
])
.
"</font></td><td>
$updatetime
</td><td>
$row[operator]
</td><td>
$act
</td></tr>"
;
}
...
...
@@ -296,7 +296,8 @@ function telnotelist($telno) {
return
$ss
;
}
function
broker_sync_refresh
()
{
//同步刷新规则
function
broker_sync_refresh
()
{
//ͬ��ˢ�¹���
return
false
;
GLOBAL
$db
;
$q
=
"select uid,postlimit,refresh from broker where valid_flag=1 order by uid asc"
;
...
...
@@ -338,7 +339,7 @@ function ischecked($args) {
}
}
//
中间层刷新房源 2011-12-9上
//
�м��ˢ�·�Դ 2011-12-9��
function
refresh_housebymid
(
$uid
,
$tpl
,
$id
)
{
global
$midwork_refreshurl
,
$conf_city
;
$bd
=
@
file_get_contents
(
$midwork_refreshurl
.
"&app="
.
$tpl
.
"&uid="
.
$uid
.
"&hid="
.
$id
);
...
...
@@ -351,7 +352,7 @@ function tony_view2($pic, $picPath, $picid = '', $blockid = '') {
GLOBAL
$db
;
$url
=
$picPath
;
$ss
=
$picPath
?
"<a href='
$url
' title='<img src=
$url
width=200 height=200 />'>
查看</a> <a href=
$url
onclick=
\"
return delpic('
$pic
');
\"
>删除
</a> "
.
$block
.
""
:
""
;
$ss
=
$picPath
?
"<a href='
$url
' title='<img src=
$url
width=200 height=200 />'>
�鿴</a> <a href=
$url
onclick=
\"
return delpic('
$pic
');
\"
>ɾ��</
a> "
.
$block
.
""
:
""
;
return
$ss
;
}
}
...
...
@@ -359,7 +360,7 @@ if(!function_exists('tony_view')) {
function
tony_view
(
$pic
,
$picPath
)
{
//$url=PUBURL.$picPath;
$url
=
$picPath
;
$ss
=
$picPath
?
"<a href='
$url
' target='_blank' title='<img src=
$url
width=200 height=200 />' >
查看</a> <a href=
$url
onclick=
\"
return delpic('
$pic
');
\"
>删除
</a>"
:
""
;
$ss
=
$picPath
?
"<a href='
$url
' target='_blank' title='<img src=
$url
width=200 height=200 />' >
�鿴</a> <a href=
$url
onclick=
\"
return delpic('
$pic
');
\"
>ɾ��</
a>"
:
""
;
return
$ss
;
}
}
...
...
@@ -410,7 +411,7 @@ function agent_actionlog($tbl, $rowid, $msg) {
$ss
[
"uid"
]
=
$_SESSION
[
$web_auth
][
"uid"
];
$ss
[
"infotype"
]
=
$infotype
;
$ss
[
"tbl"
]
=
$tbl
;
$ss
[
"msg"
]
=
$msg
;
//0:删
除 1:增加 2:刷新
$ss
[
"msg"
]
=
$msg
;
//0:ɾ
�� 1:���� 2:ˢ��
$ss
[
"y"
]
=
date
(
'Y'
);
$ss
[
"m"
]
=
date
(
'm'
);
$ss
[
"d"
]
=
date
(
'd'
);
...
...
@@ -422,7 +423,7 @@ function agent_actionlog($tbl, $rowid, $msg) {
$q
=
insert_sql
(
'log_agent'
,
$ss
);
$db
->
Execute
(
$q
);
//
新版统计
2011-10-55
//
�°�ͳ��20
11-10-55
if
(
$_SESSION
[
$web_auth
][
"agentcode"
]
==
'B000'
&&
$msg
==
2
)
{
$ymd
=
date
(
"Y-m-d"
);
...
...
@@ -462,7 +463,7 @@ function tony_str_replace($arr, $str) {
}
if
(
!
function_exists
(
'tony_fileupload_add'
))
{
function
tony_fileupload_add
(
$position
)
{
$ss
=
"<input type=file name='
$position
'> 图片
描述
:<input type='text' size=20 name='
{
$position
}
_title' id='
{
$position
}
_title'>"
;
$ss
=
"<input type=file name='
$position
'> ͼƬ
����:<
input type='text' size=20 name='
{
$position
}
_title' id='
{
$position
}
_title'>"
;
return
$ss
;
}
}
...
...
@@ -474,7 +475,7 @@ function tony_fileupload_modify($tbl, $rowid, $position) {
$row
=
$db
->
GetRow
(
"select * from
$uploadtbl
where tbl='
$tbl
' and rowid='
$rowid
' and position='
$position
'"
);
$ss
=
"<input type=file name='
$position
'> 图片
描述
:<input type='text' size=20 name='
{
$position
}
_title' id='
{
$position
}
_title' value='
$row[title]
'> <span id='
{
$position
}
_control'>"
.
tony_view
(
$position
,
$row
[
filename
])
.
"</span>"
;
$ss
=
"<input type=file name='
$position
'> ͼƬ
����:<
input type='text' size=20 name='
{
$position
}
_title' id='
{
$position
}
_title' value='
$row[title]
'> <span id='
{
$position
}
_control'>"
.
tony_view
(
$position
,
$row
[
filename
])
.
"</span>"
;
return
$ss
;
}
...
...
@@ -563,24 +564,24 @@ function csubstr($str_cut, $length = 30, $p = 0) {
if
(
!
function_exists
(
'qstr'
))
{
function
qstr
(
$ss
,
$db_type
=
"mysql"
,
$slash_flag
=
true
)
{
/*
stripslashes
是用于去掉多余的slash,大多是form提交时产生的,他们不能存入数据库
)
无论是那种数据库,存进去的数据都是没有slash的。例如
abc'def"fff\hhh
查询条件
为'
mssql
:则查询语句需要写成
select * from test where col_1 like '%''%'
mysql
:则查询语句需要写成
select * from test where col_1 like '%\'%'
查询条件
为"
mssql
:则查询语句需要写成
select * from test where col_1 like '%"%'
mysql
:则查询语句需要写成
select * from test where col_1 like '%\"%'
也
就是说mysql查询时需要addslashes,mssql需要将'转化
为''
如果 是post过来的数据,会自动加上slash,因此无论mssql或是mysql都需要先
stripslashes
如果不是post过来的数据,不会加上slash ,因此无需s
tripslashes
这也就是$slash_flag开关的用途:post过来的数据$slashes_flag=true,其他
=false
(mysql
的addslashes和mssql的''都是为了查询不出错
)
stripslashes
������ȥ�������slash�������form�ύʱ�����ģ����Dz��ܴ������ݿ�)
�������������ݿ⣬���ȥ�����ݶ���û��slash�ġ����� abc'def"fff\hhh
��ѯ����Ϊ'
mssql
�����ѯ�����Ҫд��select
* from test where col_1 like '%''%'
mysql
�����ѯ�����Ҫд��select
* from test where col_1 like '%\'%'
��ѯ����Ϊ"
mssql
�����ѯ�����Ҫд��select
* from test where col_1 like '%"%'
mysql
�����ѯ�����Ҫд��select
* from test where col_1 like '%\"%'
Ҳ
����˵mysql��ѯʱ��Ҫaddslashes��mssql��Ҫ��'ת��Ϊ''
��� ��post���������ݣ����Զ�����slash���������mssql����mysql����Ҫ��stripslashes
�������post���������ݣ��������slash ���������stripslashes
��Ҳ����$slash_flag���ص���;:post����������$slashes_flag=true,����=false
(mysql
��addslashes��mssql��''����Ϊ�˲�ѯ������)
2001.8.1
slash_flag
参数已经去掉,
because of stripslash_vars()
stripslash_vars()
将所有post,get过来的变量做了stripslashes处理,所以此处无需再
strip
slash_flag
�����Ѿ�ȥ����becau
se of stripslash_vars()
stripslash_vars()
������post,get�����ı�������stripslashes�������Դ˴�������strip
*/
$replaceQuote
[
"mssql"
]
=
"''"
;
$replaceQuote
[
"ibase"
]
=
"\'"
;
...
...
@@ -591,24 +592,24 @@ function qstr($ss, $db_type = "mysql", $slash_flag = true) {
if
(
$db_type
==
"mssql"
)
return
str_replace
(
"'"
,
$replaceQuote
[
$db_type
],
$ss
);
if
(
$db_type
==
"mysql"
)
//
针对mysql数据库,addslashes是用于sql查询不出错,相当于replaceQuote的操作
if
(
$db_type
==
"mysql"
)
//
���mysql���ݿ⣬addslashes������sql��ѯ�������൱��replaceQuote�IJ���
return
addslashes
(
$ss
);
}
}
if
(
!
function_exists
(
'no_html_str'
))
{
function
no_html_str
(
$str
)
{
//
用于数据库中读出(此时是没有slash),显
示
function
no_html_str
(
$str
)
{
//
�������ݿ��ж���(��ʱ��û��slash)����ʾ
$str
=
nl2br
(
htmlspecialchars
(
$str
));
return
$str
;
}
}
//format_str_1("abc",4)
返回
abc
//format_str_1("a",4)
返回
a
//format_str_1("abc",4)
���� &
nbsp;abc
//format_str_1("a",4)
���� &
nbsp; a
if
(
!
function_exists
(
'fmt_str_1'
))
{
function
fmt_str_1
(
$str
,
$strlen_total
=
2
,
$fill_in
=
" "
,
$direction
=
"before"
)
{
$str
=
strval
(
trim
(
$str
));
for
(
$i
=
strlen
(
$str
);
$i
<
$strlen_total
;
$i
++
)
if
(
$direction
==
"before"
)
//确
定是在前面(before)加,还是在后面(after)加 //2001.10.9修改
if
(
$direction
==
"before"
)
//ȷ
������ǰ��(before)�ӣ������ں���(after)�� //2001.10.9��
$str
=
$fill_in
.
$str
;
else
$str
=
$str
.
$fill_in
;
...
...
@@ -661,7 +662,7 @@ function arraytosql($array) {
}
/**
* getFeatureArr
获取房源特色数组
* getFeatureArr
��ȡ��Դ��ɫ����
*
* @param str $tbl
* @return array
...
...
@@ -702,7 +703,7 @@ function getFeatureArr($tbl = 'sell')
}
/**
* getHouseFeature
获取房源特
色
* getHouseFeature
��ȡ��Դ��ɫ
*
* @param str $feature
* @param str $tbl
...
...
@@ -744,7 +745,7 @@ function getHouseFeature($feature, $tbl = 'sell')
}
}
if
(
!
function_exists
(
'insert_sql'
))
{
function
insert_sql
(
$tablename
,
$field
,
$db_type
=
"mysql"
)
{
//2001.12.27
修改 (加了$db_type参数
)
function
insert_sql
(
$tablename
,
$field
,
$db_type
=
"mysql"
)
{
//2001.12.27
�� (����$db_type����)
for
(
$i
=
1
;
$i
<=
count
(
$field
);
$i
++
)
{
if
(
$i
==
1
)
$ss1
=
key
(
$field
)
;
else
$ss1
.=
","
.
key
(
$field
)
;
...
...
@@ -763,13 +764,13 @@ if(!function_exists('insert_sql')) {
}
}
/*
数据库操作函数集合
by zain
文件名:
func_sql.php
创建日期:
2011.3.7
更改日期:
2011.3.7
���ݿ������������ by zai
n
�����fun
c_sql.php
�������ڣ�2011
.3.7
�������ڣ�2011
.3.7
*/
if
(
!
function_exists
(
'update_sql'
))
{
function
update_sql
(
$tablename
,
$field
,
$sswhere
=
""
,
$db_type
=
"mysql"
)
{
//2001.12.27
修改 (加了$db_type参数
)
function
update_sql
(
$tablename
,
$field
,
$sswhere
=
""
,
$db_type
=
"mysql"
)
{
//2001.12.27
�� (����$db_type����)
for
(
$i
=
1
;
$i
<=
count
(
$field
);
$i
++
)
{
if
(
$i
==
1
)
$ss
=
" "
.
key
(
$field
)
.
"='"
.
qstr
(
$field
[
key
(
$field
)],
$db_type
)
.
"' "
;
else
$ss
.=
","
.
key
(
$field
)
.
"='"
.
qstr
(
$field
[
key
(
$field
)],
$db_type
)
.
"' "
;
...
...
@@ -782,7 +783,7 @@ if(!function_exists('insert_sql')) {
}
//图片
上传
//ͼƬ
�ϴ�
if
(
!
function_exists
(
'common_file_upload'
))
{
function
common_file_upload
(
$fileName
,
$watermark
=
false
,
$resize
=
false
,
$width
=
640
,
$height
=
480
,
$swidth
=
120
,
$sheight
=
90
,
$maxsize
=
"2048"
)
{
...
...
@@ -814,7 +815,7 @@ function common_file_upload($fileName, $watermark = false, $resize = false, $wid
}
if
(
$uf
->
upload
()
==
"success"
)
{
return
$resize
?
$uf
->
getResizeImageURL
()
:
$uf
->
getSaveFileURL
();
//图片
地
址
return
$resize
?
$uf
->
getResizeImageURL
()
:
$uf
->
getSaveFileURL
();
//ͼƬ
��ַ
}
else
{
return
false
;
}
...
...
@@ -836,9 +837,9 @@ if(!function_exists('curl_get_contents'))
}
}
/**
*
发送短消
息
* @param string $mobile
电话号码
* @param string $msg
消息内容
*
���Ͷ���Ϣ
* @param string $mobile
�绰����
* @param string $msg
��Ϣ����
* @return $msg
*/
if
(
!
function_exists
(
'sendsms'
))
...
...
@@ -849,7 +850,7 @@ if(!function_exists('sendsms'))
}
}
//
产生随机数函数
//
�������������
if
(
!
function_exists
(
'random'
))
{
function
random
(
$length
)
{
...
...
@@ -880,10 +881,10 @@ if(!function_exists('curl_get_contents'))
}
}
/**
* js
弹窗函数
* @param string $tip
弹窗消
息
* @param int $sty
返回类型
* @param string $href
返回地
址
* js
��������
* @param string $tip
������Ϣ
* @param int $sty
��������
* @param string $href
���ص�ַ
* @return $msg
*/
if
(
!
function_exists
(
'js_alert'
))
...
...
new_admincp/vendor/house365/esfadmin/core/common/func_tony.php
View file @
7b5f75df
<?php
//
函数集合
//
��������
if
(
!
function_exists
(
'log_broker_credit'
))
{
function
log_broker_credit
(
$uid
,
$operation
,
$kind
)
{
GLOBAL
$db
;
...
...
@@ -29,7 +29,7 @@ function log_agent_credit($uid, $operation, $kind) {
$db
->
Execute
(
$q
);
}
}
//写
日
志
//д
��־
if
(
!
function_exists
(
'actionlog'
))
{
function
actionlog
(
$tbl
,
$rowid
,
$msg
)
{
GLOBAL
$db
,
$web_auth
;
...
...
@@ -48,9 +48,9 @@ function actionlog($tbl, $rowid, $msg) {
}
/**
*
经纪人账号操作日志记
录
*
�������˺Ų�����־��¼
*
* @param array
经纪人信
息
* @param array
��������Ϣ
*/
if
(
!
function_exists
(
'brokeroperatorlog'
))
{
function
brokeroperatorlog
(
$data
)
{
...
...
@@ -65,7 +65,7 @@ function brokeroperatorlog($data) {
$db
->
Execute
(
$q
);
}
}
//
获
取IP
//
��ȡ
IP
if
(
!
function_exists
(
'GetIP'
))
{
function
GetIP
()
{
...
...
@@ -98,7 +98,7 @@ function tonyForm($tag, $name, $option_arr, $value = '', $td_num = 1, $validate
$td_width
=
"width="
.
floor
(
100
/
$td_num
)
.
"%"
;
$blank_i
=
ceil
(
count
(
$option_arr
)
/
$td_num
)
*
$td_num
-
count
(
$option_arr
);
for
(
$i
=
0
;
$i
<
$blank_i
;
$i
++
)
$option_arr
[]
=
""
;
//
补全使之成为整数
$option_arr
[]
=
""
;
//
��ȫʹ֮��Ϊ����
$str
=
"<table align=center border=0 cellspacing=0 width=100%>
\n
"
;
$i
=
1
;
...
...
@@ -122,7 +122,7 @@ function tonyForm($tag, $name, $option_arr, $value = '', $td_num = 1, $validate
$td_width
=
"width="
.
floor
(
100
/
$td_num
)
.
"%"
;
$blank_i
=
ceil
(
count
(
$option_arr
)
/
$td_num
)
*
$td_num
-
count
(
$option_arr
);
for
(
$i
=
0
;
$i
<
$blank_i
;
$i
++
)
$option_arr
[]
=
""
;
//
补全使之成为整数
$option_arr
[]
=
""
;
//
��ȫʹ֮��Ϊ����
$str
=
"<table align=center border=0 cellspacing=0 width=100%>
\n
"
;
$i
=
1
;
...
...
@@ -145,7 +145,7 @@ function tonyForm($tag, $name, $option_arr, $value = '', $td_num = 1, $validate
$td_width
=
"width="
.
floor
(
100
/
$td_num
)
.
"%"
;
$blank_i
=
ceil
(
count
(
$option_arr
)
/
$td_num
)
*
$td_num
-
count
(
$option_arr
);
for
(
$i
=
0
;
$i
<
$blank_i
;
$i
++
)
$option_arr
[]
=
""
;
//
补全使之成为整数
$option_arr
[]
=
""
;
//
��ȫʹ֮��Ϊ����
$str
=
"<table align=center border=0 cellspacing=0 width=100%>
\n
"
;
$i
=
1
;
...
...
@@ -167,14 +167,14 @@ function tonyForm($tag, $name, $option_arr, $value = '', $td_num = 1, $validate
}
}
if
(
!
function_exists
(
'create_htmlable'
))
{
function
create_htmlable
(
$name
,
$label
,
$value
=
''
,
$val
=
''
,
$class
=
''
,
$style
=
''
,
$js
=
''
){
//
创建html标
签
//name
标签名称|label标签类型|value标签的值(当为checkbox时为数组)|val主要用于radio和
checkbox
function
create_htmlable
(
$name
,
$label
,
$value
=
''
,
$val
=
''
,
$class
=
''
,
$style
=
''
,
$js
=
''
){
//
����html��ǩ
//name
��ǩ����|label��ǩ����|value��ǩ��ֵ(��ΪcheckboxʱΪ����)|val��Ҫ����radio��checkbox
$html
=
''
;
if
(
$class
)
$cls
=
'class="'
.
$class
.
'"'
;
if
(
$style
)
$sty
=
'style="'
.
$style
.
'"'
;
if
(
$name
)
$nam
=
'name="'
.
$name
.
'"'
;
if
(
$label
==
'text'
||
$label
==
'password'
){
//
文本框
if
(
$label
==
'text'
||
$label
==
'password'
){
//
�ı���
if
(
$name
)
$id
=
'id="'
.
$name
.
'"'
;
$html
=
'<input '
.
$cls
.
' type="'
.
$label
.
'" '
.
$nam
.
' '
.
$id
.
' value="'
.
$value
.
'" '
.
$sty
.
' '
.
$js
.
'>'
;
}
elseif
(
$label
==
'radio'
){
//radio
...
...
@@ -191,7 +191,7 @@ function create_htmlable($name,$label,$value='',$val='',$class='',$style='',$js=
$html
.=
' <input type="'
.
$label
.
'" '
.
$nam
.
' '
.
$checked
.
' value="'
.
$key
.
'" '
.
$sty
.
' '
.
$js
.
'>'
.
$item
;
}
}
}
elseif
(
$label
==
'select'
){
//
下拉框
}
elseif
(
$label
==
'select'
){
//
������
if
(
is_array
(
$val
)){
if
(
$name
)
$id
=
'id="'
.
$name
.
'"'
;
$html
.=
'<select '
.
$nam
.
' '
.
$id
.
' '
.
$sty
.
' '
.
$js
.
'>'
;
...
...
@@ -209,17 +209,17 @@ function create_htmlable($name,$label,$value='',$val='',$class='',$style='',$js=
if
(
!
function_exists
(
'ctrl_select'
))
{
function
ctrl_select
(
$opt_para
,
$ctrl_name
,
$ctrl_value
,
$style_ext
=
"class=flat1"
)
{
/** 2002.03.05
ctrl_select
函数参数说明
@param [opt_para] : opt_para
是一个数组,元素含义如下
[opt_arr]
下拉框选项的数组,可以是简单数组,也可以是关联数组
[field_key]
如果是关联数组,field_key表示, 下拉框的key 出自关联数组的哪一个field,为空表示出自简单数组的k
ey
[field_value]
如果是关联数组,field_value表示,下拉框的value出自关联数组的哪一个field,为空表示出自简单数组的v
alue
@param [ctrl_name] : select
控件的名称
@param [ctrl_value] : select
控件选择的值
@param [style_ext] :
扩充的样式,可以是样式或j
s
返回select的
string
ctrl_select
��������˵��
@param [opt_para] : opt_para
��һ�����飬Ԫ�غ�������
[opt_arr]
������ѡ������飬�����Ǽ����飬Ҳ�����ǹ�������
[field_key]
����ǹ������飬field_key��ʾ�� �������key ���Թ����������һ��field��Ϊ�ձ�ʾ���Լ������key
[field_value]
����ǹ������飬field_value��ʾ���������value���Թ����������һ��field��Ϊ�ձ�ʾ���Լ������value
@param [ctrl_name] : select
�ؼ�������
@param [ctrl_value] : select
�ؼ�ѡ���ֵ
@param [style_ext] :
�������ʽ����������ʽ��js
����select��str
ing
* */
// 1.
重新构建数组,将关联数组化为简单数组
// 1.
���¹������飬���������黯Ϊ������
$old_opt_arr
=
(
is_array
(
$opt_para
[
opt_arr
]))
?
(
$opt_para
[
opt_arr
])
:
(
array
());
FOR
(
$opt_arr
=
array
(),
reset
(
$old_opt_arr
),
$i
=
0
;
$i
<
count
(
$old_opt_arr
);
$i
++
)
{
$key
=
key
(
$old_opt_arr
);
...
...
@@ -229,7 +229,7 @@ function ctrl_select($opt_para, $ctrl_name, $ctrl_value, $style_ext = "class=fla
next
(
$old_opt_arr
);
}
// 2.
生成
// 2.
����
$ss
=
"<select name=
\"
"
.
$ctrl_name
.
"
\"
"
.
$style_ext
.
">
\n
"
;
for
(
reset
(
$opt_arr
),
$i
=
1
;
$i
<=
count
(
$opt_arr
);
$i
++
)
{
$key
=
key
(
$opt_arr
);
...
...
@@ -285,13 +285,13 @@ function telnotelist($telno) {
$rs
=
$db
->
SelectLimit
(
$q
,
10
);
$ss
=
"<div align='left'>
$remark_add
</div>"
;
$ss
=
"<table width=700 border=0 cellspacing=0 cellpadding=0 align=center height=0><tr><td ><font color='#990000'>
电话备注记录(
$telno
) </font></td></tr></table><table "
.
LIST_TBL_STYLE
.
"><tr align=center bgcolor=#F7F4E8><td width=5%>类型</td><td width=10%>房源编号</td><td width=10%>房源地址</td><td width=10%>联系人</td><td width=10%>当时状态</td><td width=25%>电话备注</td><td width=15%>更新时间</td><td width=10%>操作员</td><td >操作
</td></tr>"
;
$ss
=
"<table width=700 border=0 cellspacing=0 cellpadding=0 align=center height=0><tr><td ><font color='#990000'>
�绰��ע��¼(
$telno
) </font></td></tr></table><table "
.
LIST_TBL_STYLE
.
"><tr align=center bgcolor=#F7F4E8><td width=5%>����</td><td width=10%>��Դ���</td><td width=10%>��Դ��ַ</td><td width=10%>��ϵ��</td><td width=10%>��ʱ״̬</td><td width=25%>�绰��ע</td><td width=15%>����ʱ��</td><td width=10%>����Ա</td><td >����</td></tr>"
;
while
(
$row
=
$rs
->
FetchRow
())
{
$updatetime
=
date
(
"Ymd H:i"
,
$row
[
"updatetime"
]);
//
登记时间
$esta
=
tony_flag2name
(
$row
[
"esta"
],
$house
[
'esta'
]);
//
当
前状态
$updatetime
=
date
(
"Ymd H:i"
,
$row
[
"updatetime"
]);
//
�Ǽ�ʱ��
$esta
=
tony_flag2name
(
$row
[
"esta"
],
$house
[
'esta'
]);
//
��ǰ
״̬
$address
=
csubstr2
(
$row
[
address
],
20
);
$act
=
"<a href='telno_note.php?tbl=
$row[tbl]&rowid=$row[rowid]&telno=$row[telno]&esta=$row[esta]
' target='_blank'>
改</a> <a href='telno_note.php?action=del&id=
$row[id]
' target='_blank' onclick='if (!confirm(
\\\"
确定要删除该记录吗?
\\\"
))return false;'>删</a>"
;
$act
=
"<a href='telno_note.php?tbl=
$row[tbl]&rowid=$row[rowid]&telno=$row[telno]&esta=$row[esta]
' target='_blank'>
��</a> <a href='telno_note.php?action=del&id=
$row[id]
' target='_blank' onclick='if (!confirm(
\\\"
ȷ��Ҫɾ���ü�¼��
\\\"
)
)return false;'>ɾ</a>"
;
$ss
.=
"<tr><td>
$row[tbl]</td><td>$row[rowid]
</td><td align=left><span title='
$row[address]'>$address</span></td><td>$row[contactor]
</td><td>
$esta
</td><td><font color=blue>"
.
addslashes
(
$row
[
note
])
.
"</font></td><td>
$updatetime
</td><td>
$row[operator]
</td><td>
$act
</td></tr>"
;
}
...
...
@@ -304,9 +304,9 @@ function telnotelist($telno) {
}
if
(
!
function_exists
(
'broker_sync_refresh'
))
{
function
broker_sync_refresh
()
{
//同
步刷新规则
function
broker_sync_refresh
()
{
//ͬ
��ˢ�¹���
GLOBAL
$db
;
return
false
;
$q
=
"select uid,postlimit,refresh from broker where valid_flag=1 order by uid asc"
;
$broker
=
$db
->
GetAll
(
$q
);
...
...
@@ -349,7 +349,7 @@ function ischecked($args) {
}
}
//
中间层刷新房源 2011-12-9上
//
�м��ˢ�·�Դ 2011-12-9��
if
(
!
function_exists
(
'refresh_housebymid'
))
{
function
refresh_housebymid
(
$uid
,
$tpl
,
$id
)
{
global
$midwork_refreshurl
,
$conf_city
;
...
...
@@ -363,7 +363,7 @@ function tony_view2($pic, $picPath, $picid = '', $blockid = '') {
GLOBAL
$db
;
$url
=
$picPath
;
$ss
=
$picPath
?
"<a href='
$url
' title='<img src=
$url
width=200 height=200 />'>
查看</a> <a href=
$url
onclick=
\"
return delpic('
$pic
');
\"
>删除
</a> "
.
$block
.
""
:
""
;
$ss
=
$picPath
?
"<a href='
$url
' title='<img src=
$url
width=200 height=200 />'>
�鿴</a> <a href=
$url
onclick=
\"
return delpic('
$pic
');
\"
>ɾ��</
a> "
.
$block
.
""
:
""
;
return
$ss
;
}
}
...
...
@@ -371,7 +371,7 @@ if(!function_exists('tony_view')) {
function
tony_view
(
$pic
,
$picPath
)
{
//$url=PUBURL.$picPath;
$url
=
$picPath
;
$ss
=
$picPath
?
"<a href='
$url
' target='_blank' title='<img src=
$url
width=200 height=200 />' >
查看</a> <a href=
$url
onclick=
\"
return delpic('
$pic
');
\"
>删除
</a>"
:
""
;
$ss
=
$picPath
?
"<a href='
$url
' target='_blank' title='<img src=
$url
width=200 height=200 />' >
�鿴</a> <a href=
$url
onclick=
\"
return delpic('
$pic
');
\"
>ɾ��</
a>"
:
""
;
return
$ss
;
}
}
...
...
@@ -422,7 +422,7 @@ function agent_actionlog($tbl, $rowid, $msg) {
$ss
[
"uid"
]
=
$_SESSION
[
$web_auth
][
"uid"
];
$ss
[
"infotype"
]
=
$infotype
;
$ss
[
"tbl"
]
=
$tbl
;
$ss
[
"msg"
]
=
$msg
;
//0:删
除 1:增加 2:刷新
$ss
[
"msg"
]
=
$msg
;
//0:ɾ
�� 1:���� 2:ˢ��
$ss
[
"y"
]
=
date
(
'Y'
);
$ss
[
"m"
]
=
date
(
'm'
);
$ss
[
"d"
]
=
date
(
'd'
);
...
...
@@ -434,7 +434,7 @@ function agent_actionlog($tbl, $rowid, $msg) {
$q
=
insert_sql
(
'log_agent'
,
$ss
);
$db
->
Execute
(
$q
);
//
新版统计
2011-10-55
//
�°�ͳ��20
11-10-55
if
(
$_SESSION
[
$web_auth
][
"agentcode"
]
==
'B000'
&&
$msg
==
2
)
{
$ymd
=
date
(
"Y-m-d"
);
...
...
@@ -474,7 +474,7 @@ function tony_str_replace($arr, $str) {
}
if
(
!
function_exists
(
'tony_fileupload_add'
))
{
function
tony_fileupload_add
(
$position
)
{
$ss
=
"<input type=file name='
$position
'> 图片
描述
:<input type='text' size=20 name='
{
$position
}
_title' id='
{
$position
}
_title'>"
;
$ss
=
"<input type=file name='
$position
'> ͼƬ
����:<
input type='text' size=20 name='
{
$position
}
_title' id='
{
$position
}
_title'>"
;
return
$ss
;
}
}
...
...
@@ -486,7 +486,7 @@ function tony_fileupload_modify($tbl, $rowid, $position) {
$row
=
$db
->
GetRow
(
"select * from
$uploadtbl
where tbl='
$tbl
' and rowid='
$rowid
' and position='
$position
'"
);
$ss
=
"<input type=file name='
$position
'> 图片
描述
:<input type='text' size=20 name='
{
$position
}
_title' id='
{
$position
}
_title' value='
$row[title]
'> <span id='
{
$position
}
_control'>"
.
tony_view
(
$position
,
$row
[
filename
])
.
"</span>"
;
$ss
=
"<input type=file name='
$position
'> ͼƬ
����:<
input type='text' size=20 name='
{
$position
}
_title' id='
{
$position
}
_title' value='
$row[title]
'> <span id='
{
$position
}
_control'>"
.
tony_view
(
$position
,
$row
[
filename
])
.
"</span>"
;
return
$ss
;
}
...
...
@@ -578,24 +578,24 @@ function csubstr($str_cut, $length = 30, $p = 0) {
if
(
!
function_exists
(
'qstr'
))
{
function
qstr
(
$ss
,
$db_type
=
"mysql"
,
$slash_flag
=
true
)
{
/*
stripslashes
是用于去掉多余的slash,大多是form提交时产生的,他们不能存入数据库
)
无论是那种数据库,存进去的数据都是没有slash的。例如
abc'def"fff\hhh
查询条件
为'
mssql
:则查询语句需要写成
select * from test where col_1 like '%''%'
mysql
:则查询语句需要写成
select * from test where col_1 like '%\'%'
查询条件
为"
mssql
:则查询语句需要写成
select * from test where col_1 like '%"%'
mysql
:则查询语句需要写成
select * from test where col_1 like '%\"%'
也
就是说mysql查询时需要addslashes,mssql需要将'转化
为''
如果 是post过来的数据,会自动加上slash,因此无论mssql或是mysql都需要先
stripslashes
如果不是post过来的数据,不会加上slash ,因此无需s
tripslashes
这也就是$slash_flag开关的用途:post过来的数据$slashes_flag=true,其他
=false
(mysql
的addslashes和mssql的''都是为了查询不出错
)
stripslashes
������ȥ�������slash�������form�ύʱ�����ģ����Dz��ܴ������ݿ�)
�������������ݿ⣬���ȥ�����ݶ���û��slash�ġ����� abc'def"fff\hhh
��ѯ����Ϊ'
mssql
�����ѯ�����Ҫд��select
* from test where col_1 like '%''%'
mysql
�����ѯ�����Ҫд��select
* from test where col_1 like '%\'%'
��ѯ����Ϊ"
mssql
�����ѯ�����Ҫд��select
* from test where col_1 like '%"%'
mysql
�����ѯ�����Ҫд��select
* from test where col_1 like '%\"%'
Ҳ
����˵mysql��ѯʱ��Ҫaddslashes��mssql��Ҫ��'ת��Ϊ''
��� ��post���������ݣ����Զ�����slash���������mssql����mysql����Ҫ��stripslashes
�������post���������ݣ��������slash ���������stripslashes
��Ҳ����$slash_flag���ص���;:post����������$slashes_flag=true,����=false
(mysql
��addslashes��mssql��''����Ϊ�˲�ѯ������)
2001.8.1
slash_flag
参数已经去掉,
because of stripslash_vars()
stripslash_vars()
将所有post,get过来的变量做了stripslashes处理,所以此处无需再
strip
slash_flag
�����Ѿ�ȥ����becau
se of stripslash_vars()
stripslash_vars()
������post,get�����ı�������stripslashes�������Դ˴�������strip
*/
$replaceQuote
[
"mssql"
]
=
"''"
;
$replaceQuote
[
"ibase"
]
=
"\'"
;
...
...
@@ -606,24 +606,24 @@ function qstr($ss, $db_type = "mysql", $slash_flag = true) {
if
(
$db_type
==
"mssql"
)
return
str_replace
(
"'"
,
$replaceQuote
[
$db_type
],
$ss
);
if
(
$db_type
==
"mysql"
)
//
针对mysql数据库,addslashes是用于sql查询不出错,相当于replaceQuote的操作
if
(
$db_type
==
"mysql"
)
//
���mysql���ݿ⣬addslashes������sql��ѯ�������൱��replaceQuote�IJ���
return
addslashes
(
$ss
);
}
}
if
(
!
function_exists
(
'no_html_str'
))
{
function
no_html_str
(
$str
)
{
//
用于数据库中读出(此时是没有slash),显
示
function
no_html_str
(
$str
)
{
//
�������ݿ��ж���(��ʱ��û��slash)����ʾ
$str
=
nl2br
(
htmlspecialchars
(
$str
));
return
$str
;
}
}
//format_str_1("abc",4)
返回
abc
//format_str_1("a",4)
返回
a
//format_str_1("abc",4)
���� &
nbsp;abc
//format_str_1("a",4)
���� &
nbsp; a
if
(
!
function_exists
(
'fmt_str_1'
))
{
function
fmt_str_1
(
$str
,
$strlen_total
=
2
,
$fill_in
=
" "
,
$direction
=
"before"
)
{
$str
=
strval
(
trim
(
$str
));
for
(
$i
=
strlen
(
$str
);
$i
<
$strlen_total
;
$i
++
)
if
(
$direction
==
"before"
)
//确
定是在前面(before)加,还是在后面(after)加 //2001.10.9修改
if
(
$direction
==
"before"
)
//ȷ
������ǰ��(before)�ӣ������ں���(after)�� //2001.10.9��
$str
=
$fill_in
.
$str
;
else
$str
=
$str
.
$fill_in
;
...
...
@@ -676,7 +676,7 @@ function arraytosql($array) {
}
/**
* getFeatureArr
获取房源特色数组
* getFeatureArr
��ȡ��Դ��ɫ����
*
* @param str $tbl
* @return array
...
...
@@ -717,7 +717,7 @@ function getFeatureArr($tbl = 'sell')
}
/**
* getHouseFeature
获取房源特
色
* getHouseFeature
��ȡ��Դ��ɫ
*
* @param str $feature
* @param str $tbl
...
...
@@ -759,7 +759,7 @@ function getHouseFeature($feature, $tbl = 'sell')
}
}
if
(
!
function_exists
(
'insert_sql'
))
{
function
insert_sql
(
$tablename
,
$field
,
$db_type
=
"mysql"
)
{
//2001.12.27
修改 (加了$db_type参数
)
function
insert_sql
(
$tablename
,
$field
,
$db_type
=
"mysql"
)
{
//2001.12.27
�� (����$db_type����)
for
(
$i
=
1
;
$i
<=
count
(
$field
);
$i
++
)
{
if
(
$i
==
1
)
$ss1
=
key
(
$field
)
;
else
$ss1
.=
","
.
key
(
$field
)
;
...
...
@@ -778,13 +778,13 @@ if(!function_exists('insert_sql')) {
}
}
/*
数据库操作函数集合
by zain
文件名:
func_sql.php
创建日期:
2011.3.7
更改日期:
2011.3.7
���ݿ������������ by zai
n
�����fun
c_sql.php
�������ڣ�2011
.3.7
�������ڣ�2011
.3.7
*/
if
(
!
function_exists
(
'update_sql'
))
{
function
update_sql
(
$tablename
,
$field
,
$sswhere
=
""
,
$db_type
=
"mysql"
)
{
//2001.12.27
修改 (加了$db_type参数
)
function
update_sql
(
$tablename
,
$field
,
$sswhere
=
""
,
$db_type
=
"mysql"
)
{
//2001.12.27
�� (����$db_type����)
for
(
$i
=
1
;
$i
<=
count
(
$field
);
$i
++
)
{
if
(
$i
==
1
)
$ss
=
" "
.
key
(
$field
)
.
"='"
.
qstr
(
$field
[
key
(
$field
)],
$db_type
)
.
"' "
;
else
$ss
.=
","
.
key
(
$field
)
.
"='"
.
qstr
(
$field
[
key
(
$field
)],
$db_type
)
.
"' "
;
...
...
@@ -797,7 +797,7 @@ if(!function_exists('insert_sql')) {
}
//图片
上传
//ͼƬ
�ϴ�
if
(
!
function_exists
(
'common_file_upload'
))
{
function
common_file_upload
(
$fileName
,
$watermark
=
false
,
$resize
=
false
,
$width
=
640
,
$height
=
480
,
$swidth
=
120
,
$sheight
=
90
,
$maxsize
=
"2048"
)
{
...
...
@@ -829,7 +829,7 @@ function common_file_upload($fileName, $watermark = false, $resize = false, $wid
}
if
(
$uf
->
upload
()
==
"success"
)
{
return
$resize
?
$uf
->
getResizeImageURL
()
:
$uf
->
getSaveFileURL
();
//图片
地
址
return
$resize
?
$uf
->
getResizeImageURL
()
:
$uf
->
getSaveFileURL
();
//ͼƬ
��ַ
}
else
{
return
false
;
}
...
...
@@ -851,9 +851,9 @@ if(!function_exists('curl_get_contents'))
}
}
/**
*
发送短消
息
* @param string $mobile
电话号码
* @param string $msg
消息内容
*
���Ͷ���Ϣ
* @param string $mobile
�绰����
* @param string $msg
��Ϣ����
* @return $msg
*/
if
(
!
function_exists
(
'sendsms'
))
...
...
@@ -864,7 +864,7 @@ if(!function_exists('sendsms'))
}
}
//
产生随机数函数
//
�������������
if
(
!
function_exists
(
'random'
))
{
function
random
(
$length
)
{
...
...
@@ -895,10 +895,10 @@ if(!function_exists('curl_get_contents'))
}
}
/**
* js
弹窗函数
* @param string $tip
弹窗消
息
* @param int $sty
返回类型
* @param string $href
返回地
址
* js
��������
* @param string $tip
������Ϣ
* @param int $sty
��������
* @param string $href
���ص�ַ
* @return $msg
*/
if
(
!
function_exists
(
'js_alert'
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment