Exemplo n.º 1
0
function autoSavePostData($id, $tableName, $fieldNameList)
{
    $sql = '';
    $sql = getPostSql($id, $tableName, $fieldNameList);
    //检测SQL
    if (checkSql($sql) == false) {
        errorLog('出错提示:<hr>sql=' . $sql . '<br>');
        return '';
    }
    //conn.execute(sql)			'checksql这一步就已经执行了不需要再执行了20160410
}
Exemplo n.º 2
0
function saveAddEdit($actionName, $lableTitle, $fieldNameList)
{
    $tableName = '';
    $url = '';
    $listUrl = '';
    $id = '';
    $addOrEdit = '';
    $sql = '';
    $id = @$_REQUEST['id'];
    $addOrEdit = IIF($id == '', '添加', '修改');
    handlePower($addOrEdit . $lableTitle);
    //管理权限处理
    $GLOBALS['conn='] = OpenConn();
    $fieldNameList = ',' . specialStrReplace($fieldNameList) . ',';
    //特殊字符处理 自定义字段列表
    $tableName = lCase($actionName);
    //表名称
    $sql = getPostSql($id, $tableName, $fieldNameList);
    //call eerr("sql",sql)												'调试用
    //检测SQL
    if (checkSql($sql) == false) {
        errorLog('出错提示:<hr>sql=' . $sql . '<br>');
        return '';
    }
    //conn.Execute(sql)                 '检测SQL时已经处理了,不需要再执行了
    //对网站配置单独处理,为动态运行时删除,index.html     动,静,切换20160216
    if (lCase($actionName) == 'website') {
        if (inStr(@$_REQUEST['flags'], 'htmlrun') == false) {
            DeleteFile('../index.html');
        }
    }
    $listUrl = getUrlAddToParam(getThisUrl(), '?act=dispalyManageHandle', 'replace');
    $listUrl = getUrlAddToParam($listUrl, '?focusid=' . $id, 'replace');
    //添加
    if ($id == '') {
        $url = getUrlAddToParam(getThisUrl(), '?act=addEditHandle', 'replace');
        $url = getUrlAddToParam($url, '?focusid=' . $id, 'replace');
        Rw(getMsg1('数据添加成功,返回继续添加' . $lableTitle . '...<br><a href=\'' . $listUrl . '\'>返回' . $lableTitle . '列表</a>', $url));
    } else {
        $url = getUrlAddToParam(getThisUrl(), '?act=addEditHandle&switchId=' . @$_POST['switchId'], 'replace');
        $url = getUrlAddToParam($url, '?focusid=' . $id, 'replace');
        //没有返回列表管理设置
        if (inStr('|WebSite|', '|' . $actionName . '|') > 0) {
            Rw(getMsg1('数据修改成功', $url));
        } else {
            Rw(getMsg1('数据修改成功,正在进入' . $lableTitle . '列表...<br><a href=\'' . $url . '\'>继续编辑</a>', $listUrl));
        }
    }
    writeSystemLog($tableName, $addOrEdit . $lableTitle);
    //系统日志
}