function delete_array_newai($element, $fields)
{
    global $right_etc, $html_etc, $common_html;
    global $_POST, $_GET, $db;
    global $primarykey_index;
    global $delete_attribute, $delete_attribute;
    global $columns, $tablename;
    DoReferer();
    $_GET[$primarykey_index] = $element;
    $return_sql_line = return_sql_line($fields);
    if (isset($delete_attribute) && $delete_attribute != '') {
        //$delete_attribute_array=explode(':',$delete_attribute);
        //$index_temp=$delete_attribute_array[0];print $index_temp;
        //$fieldvalue=gettablefield($tablename,$primarykey_index,$columns[$index_temp],$element);print $fieldvalue;
        //if($fieldvalue)
        //	$SQL=$return_sql_line['delete_sql'];
        //else
        $SQL = $return_sql_line['update_fixed_field_sql'];
    } else {
        $SQL = $return_sql_line['delete_sql'];
    }
    //print $SQL;exit;
    //如果有附件,删除附件
    for ($i = 0; $i < sizeof($fields['null']); $i++) {
        if ($fields['null'][$i]['inputfilter'] == 'tdoafile') {
            $fujianValue = returntablefield($tablename, $primarykey_index, $element, $fields['name'][$i]);
            $fujianValueArray = explode('||', $fujianValue);
            require_once 'lib/utility_file.php';
            delete_attach($fujianValueArray[1], $fujianValueArray[0]);
        }
        if ($fields['null'][$i]['inputfilter'] == 'picturefile') {
            $fujianValue = returntablefield($tablename, $primarykey_index, $element, $fields['name'][$i]);
            require_once 'lib/utility_file.php';
            delete_single_attach($fujianValue);
        }
    }
    //得到要删除的表的记录的值;
    $sql = "select * from {$tablename} where {$primarykey_index}='{$element}'";
    $rs = $db->Execute($sql);
    $rs_a = $rs->GetArray();
    $KEYS = @array_keys($rs_a[0]);
    $SQLTEXT = '';
    for ($i = 0; $i < sizeof($KEYS); $i++) {
        $KEY = $KEYS[$i];
        $SQLTEXT .= "{$KEY}:" . $rs_a[0][$KEY] . " ";
    }
    //print_R();
    global $db, $html_etc, $tablename;
    $排除记录日志的页面 = array("/general/EDU/Interface/EDU/system_log_newai.php", "/general/EDU/Interface/CRM/system_log_newai.php", "/general/EDU/Interface/JIAOYUJU/system_log_newai.php");
    if (!in_array($_SERVER['SCRIPT_NAME'], $排除记录日志的页面)) {
        system_log_input("删除" . $html_etc[$tablename][$tablename], $SQLTEXT . "  <BR>" . $SQL);
    }
    $result = $db->Execute($SQL);
    if ($result->EOF) {
        return false;
    } else {
        return true;
    }
}
Esempio n. 2
0
    $rs_u = $db->Execute($sql);
    $PRIV_NAME = $rs_u->fields['PRIV_NAME'];
    $_SESSION['LOGIN_DEPT_NAME'] = $DEPT_NAME;
    $_SESSION[$SUNSHINE_USER_DEPT_NAME_VAR] = $DEPT_NAME;
    $_SESSION[$SUNSHINE_USER_PRIV_NAME_VAR] = $PRIV_NAME;
    //print $SUNSHINE_USER_AVATAR_VAR;
    $goalfile = "../Interface/Framework/global_config.ini";
    @($ini_file = @parse_ini_file($goalfile));
    $_SESSION['SmsServerIP'] = $ini_file[SmsServerIP];
    $_SESSION['SmsLoginID'] = $ini_file[SmsLoginID];
    $_SESSION['SmsLoginPWD'] = $ini_file[SmsLoginPWD];
    $_SESSION['limitEditDel'] = $ini_file[limitEditDel];
    //精度
    $_SESSION['deptid'] = 1;
    $sql = "select * from " . $表前缀 . "unit where id=" . $_SESSION['deptid'];
    //print $sql;
    $rs_d = $db->Execute($sql);
    $_SESSION['numzero'] = $rs_d->fields['numzero'];
    $_SESSION['UNIT_NAME'] = $rs_d->fields['UNIT_NAME'];
    $_SESSION['TEL_NO'] = $rs_d->fields['TEL_NO'];
    $_SESSION['ADDRESS'] = $rs_d->fields['ADDRESS'];
    //print_R($_SESSION);print_R($_GET);exit;
    $MENU_TYPE = 0;
    //日志记录
    system_log_input('登录成功', $_SESSION['LOGIN_USER_ID']);
    echo "<META HTTP-EQUIV=REFRESH CONTENT='0;URL=../Framework/index.php'>\n";
    //echo "<META HTTP-EQUIV=REFRESH CONTENT='0;URL=Framework/index.php'>\n";
} else {
    system_log_input('登录失败', $_SESSION['LOGIN_USER_ID']);
    echo "<META HTTP-EQUIV=REFRESH CONTENT='0;URL=notchecked.php'>\n";
}