Exemplo n.º 1
0
function save_data($SIDU, $txt, $eng)
{
    $txt = @trim($txt);
    if (@substr($txt, -1) == ')') {
        $txt = @trim(@substr($txt, 0, -1));
        if (@substr($txt, -1) == ',') {
            $txt = @substr($txt, 0, -1);
        }
        $txt .= ')';
    }
    $res = @tm("SQL", $txt);
    $err = @sidu_err(1);
    if ($err) {
        return $err;
    }
    echo @html_js("Goto('menu','menu.php?id={$SIDU['0']}',1);Goto('main','db.php?id={$SIDU['0']},{$SIDU['1']},{$SIDU['2']},{$SIDU['3']},{$SIDU['4']},{$SIDU['5']},{$SIDU['6']}',1);self.close()");
    exit;
}
Exemplo n.º 2
0
function html_header()
{
    global $title;
    $strtitle = '';
    if ($title != '') {
        $strtitle = ': ' . $title;
    }
    $css = html_css();
    $js = html_js();
    return <<<HERE
<!DOCTYPE HTML>

<html>
\t<head><title>git webcommit{$strtitle}</title><style>{$css}</style><script>{$js}</script></head>
\t<body>
HERE;
}
Exemplo n.º 3
0
function save_data($SIDU, $eng, $cmd)
{
    foreach ($_POST as $k => $v) {
        if (@substr($k, 0, 5) == 'data_' || @substr($k, 0, 10) == 'cbox_data_') {
            $arr = @explode('_', $k, 3);
            $data[$arr[0]][$arr[1]][$arr[2]] = $v;
        }
    }
    foreach ($SIDU['col'] as $i => $v) {
        $col[] = $eng == 'pg' ? '"' . $v[0] . '"' : $v[0];
    }
    $tab = $eng == 'pg' ? '"' . $SIDU[2] . '"."' . $SIDU[4] . '"' : ($eng == 'my' ? "`{$SIDU['1']}`.`{$SIDU['4']}`" : $SIDU[4]);
    foreach ($data['cbox']['data'] as $i => $v) {
        //only need i
        unset($COL);
        unset($VAL);
        $where = '';
        $is_new = @substr($i, 0, 3) === 'new';
        if (!$is_new || $cmd == 'data_del') {
            foreach ($_POST['pkV'][$i] as $j => $v) {
                $where .= " and " . $col[$j] . (@strtoupper($v) === 'NULL' ? " IS NULL" : "='{$v}'");
            }
            $where = "WHERE " . @substr($where, 5);
        }
        if ($cmd == 'data_save') {
            foreach ($data['data'][$i] as $j => $v) {
                $v = @strip($v, 1, 0, 1);
                if (!$is_new || $eng != 'pg' || $v != '' || @substr($SIDU['col'][$j][3], 0, 8) != 'nextval(') {
                    if ($eng == 'pg' && $SIDU['page']['dataEasy']) {
                        if ($SIDU['col'][$j][1] == "smallint" || $SIDU['col'][$j][1] == "int") {
                            $v = @ceil($v);
                        } elseif ((@substr($SIDU['col'][$j][1], 0, 8) == "varchar(" || @substr($SIDU['col'][$j][1], 0, 5) == "char(") && @strtoupper($v) != 'NULL') {
                            $v = @trim(@substr($v, 0, $SIDU['col'][$j][4] - 4));
                        }
                    }
                    $COL[] = $col[$j];
                    $VAL[] = $v;
                }
                //above logic too complex - even myself forgot :D
            }
            if ($is_new && isset($COL)) {
                $res = @tm("insert", $tab, $COL, $VAL);
            } elseif (!$is_new) {
                $res = @tm("update", $tab, $COL, $VAL, $where);
            }
        } elseif ($cmd == 'data_del') {
            $res = @tm("delete", $tab, null, null, $where);
        }
        $errno = @sidu_err(1);
        if ($errno) {
            $err .= ($eng == 'pg' ? $errno : "Err {$errno}") . "\\n";
        } elseif ($cmd == "data_save") {
            echo @html_js("parent.document.dataTab.cbox_data_{$i}.checked=''");
        } elseif ($cmd == "data_del") {
            echo @html_js("parent.document.getElementById('tr_{$i}').style.display='none'");
        }
    }
    if ($err) {
        echo @html_js("alert('" . @strtr($err, @array("'" => "\\'", "\"" => "\\\"", "\n" => "\\n")) . "')");
    }
}
Exemplo n.º 4
0
function check_sidu_conn($SIDU)
{
    if ($SIDU[0] && isset($SIDU['conn'][$SIDU[0]])) {
        return;
    }
    //ok
    if (@substr($_SERVER['SCRIPT_NAME'], -8) != 'conn.php') {
        echo @html_js("top.location='./conn.php'");
        exit;
        //no connection
    }
}
Exemplo n.º 5
0
            $url->result = mb_convert_encoding($url->result, "Windows-1251", "UTF-8");
        } else {
            $url->result = mb_convert_encoding($url->result, "UTF-8", "Windows-1251");
        }
    }
    if (isset($_GET['js'])) {
        $url->js($_GET['js']);
    }
    echo $url->result;
}
?>
    
</div>
<?php 
if ($loadSt) {
    foreach ($url->load_all_css() as $filename => $style) {
        $css->parseString($style, $filename);
    }
    @file_put_contents(ROOT_DIR . '/cache/' . $is_logged . '/style.array.data', serialize($css->allCss));
    if (!strpos($url->result, 'jquery')) {
        print html_js('../lib/js', array('jquery'));
    }
    ?>
    <script>
    $('#loadCssFiles').fadeOut(150);
    $('#bgload').css({background: 'none'});
    </script>
<?php 
}
?>
</html>
Exemplo n.º 6
0
    unset($_SESSION['open_prj']);
}
$dataPrj = unserialize(@file_get_contents(ROOT_DIR . '/userData/userProject/' . $is_logged . '/' . $openPrj . '/data'));
?>
<!DOCTYPE HTML>
<head>
<title>RAID - Copyright © 2012 SL-CMS.COM Designed by QWARP</title>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="RAID - Визуальный редактор шаблонов , A visual template editor" />
<meta name="keywords" content="визуальный,редактор" />
<link rel="shortcut icon" href="lib/images/favicon.ico" />
<?php 
print html_css('lib/css', array('style', 'contextmenu', 'widget', 'loading', 'tools', 'interface', 'tooltip'));
print html_css('system', array('form', 'system'));
print html_js('lib/js', array('jquery', 'jquery-ui-1.8.16.custom.min', 'layer', 'ready', 'function', 'contextmenu', 'scroll', 'image', 'widget', 'swfupload', 'upload', 'iframe', 'file', 'libraly', 'interface', 'api', 'tooltip'));
if (!$is_logged) {
    header("Location: ../index.php");
}
?>
<script src="class/godata.js.php?login=<?php 
echo $is_logged;
?>
" id="libraly_script" type="text/javascript"></script>
<script>
var user_name_var = '<?php 
echo $is_logged;
?>
';
image.LastDir = '';
iframe.last_url = '<?php