コード例 #1
0
ファイル: options.php プロジェクト: aricent123/cadbis
<?php

if ($BILLEVEL < 5) {
    return;
}
$BILL = new CBilling($GV["dbhost"], $GV["dbname"], $GV["dblogin"], $GV["dbpassword"]);
$BILL->KillInactiveUsers();
$list = $BILL->GetOnlineUsersData();
if (!isset($action)) {
    $action = "";
}
if ($action == "save") {
    $error = "";
    $GV['max_month_traffic'] = mb2bytes($max_month_traffic);
    $GV['start_year'] = $start_year;
    $res = "<?php\r\n";
    $res .= "\$GV['start_year']=" . $GV['start_year'] . ";\r\n";
    $res .= "\$GV['max_month_traffic']=" . $GV['max_month_traffic'] . ";\r\n";
    $res .= "\$GV['max_month_time']=" . $GV['max_month_time'] . ";\r\n";
    $res .= "?>";
    $fp = fopen($GV["modules_conf_dir"] . "/smadbisext.conf.php", "w+");
    if (!$fp) {
        $error .= "<b>Ошибка:</b> Невозможно открыть файл!";
    }
    if (!$error) {
        fwrite($fp, $res);
        fclose($fp);
    }
    if (!$error) {
        OUT("<div align=center>Сохранено!</div><br><div align=center><a href=\"?p={$p}&act={$act}\">назад</a></div>");
    } else {