|
@@ -31,7 +31,7 @@ if (empty($action)) { |
|
|
$name = dede_htmlspecialchars($name); |
|
|
$name = dede_htmlspecialchars($name); |
|
|
$row = $dsql->GetOne("SELECT * FROM `#@__diyforms` WHERE diyid='$diyid' OR `table` LIKE '$table' OR name LIKE '$name'"); |
|
|
$row = $dsql->GetOne("SELECT * FROM `#@__diyforms` WHERE diyid='$diyid' OR `table` LIKE '$table' OR name LIKE '$name'"); |
|
|
if (is_array($row)) { |
|
|
if (is_array($row)) { |
|
|
ShowMsg("自定义表单diyid或名称在数据库中重复", "-1"); |
|
|
|
|
|
|
|
|
ShowMsg("自定义表单diyid和自定义表单表名称数据库已存在,请重新填写", "-1"); |
|
|
exit(); |
|
|
exit(); |
|
|
} |
|
|
} |
|
|
if ($cfg_dbtype=="sqlite") { |
|
|
if ($cfg_dbtype=="sqlite") { |
|
@@ -44,7 +44,7 @@ if (empty($action)) { |
|
|
while ($row = $dsql->GetArray("biz")) { |
|
|
while ($row = $dsql->GetArray("biz")) { |
|
|
if (empty($row[0])) $row[0] = ''; |
|
|
if (empty($row[0])) $row[0] = ''; |
|
|
if ($table == $row[0]) { |
|
|
if ($table == $row[0]) { |
|
|
showmsg('指定的自定义表单在数据库中重复', '-1'); |
|
|
|
|
|
|
|
|
showmsg('指定的自定义表单称数据库已存在,请重新填写', '-1'); |
|
|
exit(); |
|
|
exit(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@@ -60,9 +60,9 @@ if (empty($action)) { |
|
|
if ($dsql->ExecuteNoneQuery($sql)) { |
|
|
if ($dsql->ExecuteNoneQuery($sql)) { |
|
|
$query = "INSERT INTO `#@__diyforms` (`diyid`,`name`,`table`,`info`,`listtemplate`,`viewtemplate`,`posttemplate`,`public` ) VALUES ('$diyid','$name','$table','','$listtemplate','$viewtemplate','$posttemplate','$public')"; |
|
|
$query = "INSERT INTO `#@__diyforms` (`diyid`,`name`,`table`,`info`,`listtemplate`,`viewtemplate`,`posttemplate`,`public` ) VALUES ('$diyid','$name','$table','','$listtemplate','$viewtemplate','$posttemplate','$public')"; |
|
|
$dsql->ExecuteNoneQuery($query); |
|
|
$dsql->ExecuteNoneQuery($query); |
|
|
showmsg('自定义表单创建成功,请添加字段', 'diy_main.php'); |
|
|
|
|
|
|
|
|
showmsg('成功创建一个自定义表单', 'diy_main.php'); |
|
|
} else { |
|
|
} else { |
|
|
showmsg('自定义表单创建失败', '-1'); |
|
|
|
|
|
|
|
|
showmsg('创建自定义表单失败', '-1'); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
?> |
|
|
?> |