Example #1
0
function IsExist($table, $col, $val, $attr = '')
{
    $where = "where `{$col}`='" . Encode($val) . "' ";
    if (!empty($attr)) {
        $where .= " and {$attr}";
    }
    $sql = "select `{$col}` from `{$table}` {$where} ";
    $rp = Query($sql);
    if (Num($rp) > 0) {
        return true;
    }
    return false;
}
Example #2
0

<p>This box plot shows <em>how many times slower</em>, the fastest benchmark programs for programming language implementations were, compared to the fastest programs written in <em>any of the programming languages</em>.</p>


<p><img src="<?php 
echo $chart;
?>
?<?php 
echo 's=' . Encode($stats1);
?>
&amp;<?php 
echo 'm=' . Encode($Mark);
?>
&amp;<?php 
echo 'w=' . Encode($labels1);
?>
"
   alt=""
   title=""
   width="480" height="300"
 /></p>

<p>Please don't obsess about which programming language implementation is shown 10<sup>th</sup> and which is shown 11<sup>th</sup>. You can see that the order would be different if it was based on the median scores instead of <a href="http://portal.acm.org/citation.cfm?id=5666.5673" title="How not to lie with statistics: the correct way to summarize benchmark results">the geometric mean</a> scores.</p>


<h3><a href="<?php 
echo $pageUrl;
?>
#about" name="about">&nbsp;</a></h3>
<?php 
Example #3
0
function greaterthanRows($from, $where = '', $select = '*', $sort_order = '', $join = '', $group_by = '', $do_paging = "N", $record_per_page = '20', $rewrite_url = false)
{
    $order_by = "";
    $sqlWhere = "";
    $joinSql = "";
    if (is_array($select)) {
        $select = implode(",", $select);
    }
    $sqlWhere2 = array();
    if (is_array($where) && count($where) > 0) {
        foreach ($where as $col => $val) {
            $sqlWhere2[] = $col . " >= '" . Encode($val) . "'";
        }
    } else {
        if (!empty($where)) {
            $sqlWhere = $where;
        }
    }
    if ($sort_order != "") {
        $order_by = "ORDER BY {$sort_order}";
    }
    if ($group_by != "") {
        $group_by = "GROUP BY {$group_by}";
    }
    if (count($sqlWhere2)) {
        $sqlWhere = " WHERE " . implode(' AND ', $sqlWhere2);
    }
    if (is_array($join) && !empty($join)) {
        foreach ($join as $tbl => $con) {
            $tmp = explode("|", $tbl);
            if (isset($tmp[1])) {
                $joinSql .= ' ' . strtoupper($tmp[0]) . ' JOIN ' . $tmp[1] . ' ON ' . $con;
            } else {
                $joinSql .= ' JOIN ' . $tbl . ' ON ' . $con;
            }
        }
    } else {
        if (!empty($join)) {
            $joinSql = $join;
        }
    }
    $sql = "SELECT " . $select . " FROM `" . $from . '` ' . $joinSql . " {$sqlWhere} {$group_by} {$order_by}";
    //echo $sql; //exit;
    if ($do_paging == "Y") {
        return customPaging($sql, $record_per_page, $rewrite_url);
    } else {
        $r = Query($sql);
        $num_rows = Num($r);
        $data = array();
        if ($num_rows > 0) {
            while ($o = GetArr($r)) {
                array_push($data, $o);
            }
        }
        mysql_data_seek($r, 0);
        return array('data' => $data, 'result' => $r, 'total_recs' => $num_rows);
    }
}
Example #4
0
</b></a> program used, compared to the benchmark program that used least Time or the program that used least Memory or the program that used least Code.</p>

<p><img src="chart.php?<?php 
echo 'r=' . Encode($Ratios);
?>
&amp;<?php 
echo 'm=' . Encode($Mark);
?>
&amp;<?php 
echo 'w=' . Encode($Labels);
?>
&amp;<?php 
echo 'ww=' . Encode($TestLink);
?>
&amp;<?php 
echo 'so=' . Encode($Sort);
?>
"
   alt=""
   title=""
   width="480" height="300"
 /></p>
 

<h2><a href="#table" name="table">&nbsp;<?php 
echo $TestName;
?>
&nbsp;<strong>benchmark</strong></a>&nbsp;<a href="<?php 
echo CORE_SITE;
?>
help.php#inputvalue"><?php 
Example #5
0
?>
 program.</p>

<p>(Memory use is only compared <a href="<?php 
echo CORE_SITE;
?>
play.php#whymemory" title="">for tasks that require memory to be allocated</a>.)</p>

<p><br/><img src="chartvs.php?<?php 
echo 'r=' . Encode($ratios);
?>
&amp;<?php 
echo 'm=' . Encode($Mark . ' n');
?>
&amp;<?php 
echo 'w=' . Encode($SelectedLang . 'O' . $SelectedLang2);
?>
"
   alt=""
   title=""
   width="480" height="300"
 /></p>
<p>These are not the only compilers and interpreters. These are not the only programs that could be written. These are not the only tasks that could be solved. <a href="<?php 
echo CORE_SITE;
?>
dont-jump-to-conclusions.php"><strong>These are just 10 tiny examples.</strong></a></p>

<h2><a href="#faster-programs-approximately" name="faster-programs-approximately">&nbsp;2&nbsp;:&nbsp;Are the <strong><?php 
echo $LangName;
?>
 programs faster</strong>?</a> <i>Approximately.</i></h2>
Example #6
0
<?php

include_once '../inc/config.inc.php';
require_once '../inc/admin_secure.inc.php';
$msg = deQueueMsg();
$var_clear = true;
if (!empty($_POST)) {
    extract($_POST);
    $slugWhere = array();
    $slugWhere[] = "is_deleted = 'N'";
    $slugWhere[] = "slug = '" . Encode($slug) . "'";
    if ($id == 0) {
        $dated = ',dated';
        $_POST['dated'] = date("Y-m-d H:i:s");
    } else {
        $slugWhere[] = "id != '" . Encode($id) . "'";
        $dated = ',last_updated';
        $_POST['last_updated'] = date("Y-m-d H:i:s");
    }
    if (isset($_POST['is_active'])) {
        $_POST['is_active'] = 'Y';
    } else {
        $_POST['is_active'] = 'N';
    }
    if (isset($_POST['is_feature'])) {
        $_POST['is_feature'] = 'Y';
    } else {
        $_POST['is_feature'] = 'N';
    }
    $_POST['Language'] = implode(',', $Language);
    //	if ($id == 0) {
Example #7
0
    }
    if ($type == 'w') {
        return str_replace($conv['utf'], $conv['win'], $str);
    } elseif ($type == 'u') {
        return str_replace($conv['win'], $conv['utf'], $str);
    } else {
        return $str;
    }
}
if (isset($_POST["act"])) {
    require_once 'excel_reader2.php';
    $data = new Spreadsheet_Excel_Reader($_FILES['fname']["tmp_name"]);
    if ($_POST["clearall"] == 'clearall') {
        print "<script>importexcelDialog.clear()</script>";
    }
    print "<script>importexcelDialog.insert('<p>" . str_replace("\\'", "\\\\'", str_replace("\n", "", Encode($data->dump(false, false, 0, 'price'), 'w'))) . "</p>')</script>";
}
?>
 
 
 Загрузите файл для вставки в код:
 <input type="file" name="fname">
 <input type="hidden" name="act" value="send"><br>
 <input type="checkbox" name="clearall" checked=checked value="clearall" id="clearall"><label for="clearall">Очистить содержимое перед вставкой</label>
 </br>
	<div class="mceActionPanel">
		<div style="float: left">
			<input type="submit" id="insert" name="insert" value="Вставить" onclick="" />
		</div>

		<div style="float: right">
    $index_middle = array(17, -1, 18, 19, -1, 20, -1, 21, 22, -1, 23, 24, 25, 26, 27);
}
if ($IsFirstLast) {
    foreach ($index_firstlast as $i) {
        $l[] = $i > -1 ? $labels[$i] : $marker_label;
        $s[] = $i > -1 ? $stats[$i] : $marker;
    }
} else {
    foreach ($index_middle as $i) {
        $l[] = $i > -1 ? $labels[$i] : $marker_label;
        $s[] = $i > -1 ? $stats[$i] : $marker;
    }
}
unset($labels);
unset($stats);
$chart = 'chartboxSVG.php';
?>
<img src="<?php 
echo $chart;
?>
?<?php 
echo 's=' . Encode($s);
?>
&amp;<?php 
echo 'm=' . Encode($Mark);
?>
&amp;<?php 
echo 'w=' . Encode($l);
?>
">
Example #9
0
    }
    unset($url);
    $url = parse_url($tmp_url);
    $page = geturl($url['host'], 80, $url['path'] . "?" . $url["query"], "http://ifolder.ru/", 0, 0, 0, "");
    is_page($page);
    if (preg_match('/sys_msg/', $page)) {
        $error = cut_str($page, 'sys_msg>', '<');
        $error = Encode($error, "w");
        html_error("Error Upload, vozmozhno na vash ip ban!<br>" . $error);
    }
    //print_r($page);
    $desc_id = "descr_" . cut_str($page, "descr_", '"');
    $pass_id = "password_" . cut_str($page, "password_", ' ');
    $img_link = "/random/images/" . cut_str($page, "/random/images/", '"');
    $session_id = cut_str($page, 'session" value=', '>');
    $page = Encode($page, "w");
    ?>
          
<form action="<?php 
    echo $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING'];
    ?>
" method="POST">
    <input type="hidden" name="desc_id" value=<?php 
    echo $desc_id;
    ?>
>
    <input type="hidden" name="pass_id" value=<?php 
    echo $pass_id;
    ?>
>
    <input type="hidden" name="session_id" value=<?php 
Example #10
0
function getVideoSrc($obj, $data, $type, $fileId, $user_sid, $user_token)
{
    $hd = array('flv' => '0', 'flvhd' => '0', 'mp4' => '1', 'hd2' => '2', '3gphd' => '1', '3gp' => '0', 'hd3' => '3');
    $hd = $hd[$type];
    $stremtype = array('flv' => 'flv', 'mp4' => 'mp4', 'hd2' => 'flv', '3gphd' => 'mp4', '3gp' => 'flv', 'hd3' => 'flv');
    $stremtype = $stremtype[$type];
    $show = '';
    if (@$data->show) {
        $show = $data->show->show_paid ? "&amp;ypremium=1" : "&amp;ymovie=1";
    }
    $c = "http://k.youku.com/player/getFlvPath/sid/" . $user_sid . "_" . $obj->no . "/st/" . $stremtype . "/fileid/" . $fileId . "?K=" . $obj->k . "&amp;hd=" . $hd . "&amp;myp=0&amp;ts=" . $obj->seconds . "&amp;ypp=0" . $show . "&amp;ep=";
    $c .= urlencode(Decode(Encode('bf7e5f01', $user_sid . "_" . $fileId . "_" . $user_token)));
    $c .= "&amp;ctype=12&amp;ev=1&amp;token=" . $user_token;
    $c .= "&amp;oip=" . $data->ip;
    return $c;
}
Example #11
0
for ($row = 0; $row < $n; $row++) {
    printf('<tr>');
    for ($col = 0; $col < NCOLS; $col++) {
        printf('<td>&nbsp;');
        if (isset($cols[$col][$row])) {
            $k = $cols[$col][$row];
            // hard-code a shortest programs example
            if ($k == 'shortest') {
                printf('<a href="#shortest" name="shortest"><img src="chartshape.php?w=%s&amp;s=%s&amp;c=%s"  alt="Shortest C++ programs" title="Shortest C++ programs" width="150" height="120" /></a>', Encode($k), Encode($Shapes[$k]), Encode($Centers[$k]));
            } else {
                if (isset($Langs[$k][LANG_SPECIALURL]) && !empty($Langs[$k][LANG_SPECIALURL])) {
                    printf('<a href="%s.php" title="Is %s the fastest programming language?">', $Langs[$k][LANG_SPECIALURL], $Langs[$k][LANG_FULL]);
                } else {
                    printf('<a href="compare.php?lang=%s" title="Is %s the fastest programming language?">', $k, $Langs[$k][LANG_FULL]);
                }
                printf('<img src="chartshape.php?w=%s&amp;s=%s&amp;c=%s" alt="source code size versus speed of %s benchmark programs" title="Compare %s program size and speed against other programs" width="150" height="120" />', Encode($k), Encode($Shapes[$k]), Encode($Centers[$k]), $Langs[$k][LANG_FULL], $Langs[$k][LANG_FULL]);
                printf('</a>');
            }
        } else {
            printf('&nbsp;');
        }
        printf('</td>');
    }
    printf('</tr>');
}
printf('</table>');
?>

<h3><a href="#about" name="about">&nbsp;about <?php 
echo $Title;
?>
Example #12
0
        } else {
            if (empty($name)) {
                enqueueMsg("Enter your name");
            } else {
                Query("UPDATE admin_user SET full_name = '" . Encode($name) . "', email = '" . Encode($email) . "' WHERE id = '" . Encode($_SESSION['S_ID']) . "'");
                enqueueMsg("Profile has been updated successfully!", "success");
            }
        }
    } else {
        if (isset($new_password) && isset($password_confirm)) {
            $r = Query("SELECT * FROM admin_user WHERE id = '" . Encode($_SESSION['S_ID']) . "' AND password = '******'");
            if (Num($r) > 0) {
                if ($new_password != $password_confirm) {
                    enqueueMsg("Password and confirm password does not match!");
                } else {
                    Query("UPDATE admin_user SET password = '******' WHERE id = '" . Encode($_SESSION['S_ID']) . "'");
                    enqueueMsg("Your password has been updated successfully!", "success");
                }
            } else {
                enqueueMsg("Invalid old Password!");
            }
        }
    }
}
include 'header.php';
?>
<div>
    <ul class="breadcrumb">
        <li><a href="dashboard.php">Home</a> <span class="divider">/</span></li>
        <li>Profile</li>
    </ul>
Example #13
0
function BackupDatabaseFileSize($t, $s, $p, $mypath, $alltotal, $thenof, $fnum, $stime = 0)
{
    global $db, $bakpath, $limittype, $fun_r, $db_config, $config, $adminDir;
    header('Content-Type: text/html; charset=' . $db_config['charset']);
    //设定编码
    ob_start();
    if (empty($mypath)) {
    }
    $b_dbname = $db_config['dbname'];
    $path = PLUS_PATH . '/bdata/' . $mypath;
    @(include $path . "/config.php");
    if (empty($b_table)) {
    }
    $waitbaktime = (int) $_GET['waitbaktime'];
    if (empty($stime)) {
        $stime = time();
    }
    $header = "<?php\r\nrequire(dirname(dirname(dirname(dirname(dirname(__FILE__))))).\"/app/include/dbbackup/inc/header.php\");\r\n";
    $footer = "\r\nrequire(dirname(dirname(dirname(dirname(dirname(__FILE__))))).\"/app/include/dbbackup/inc/footer.php\");\r\n?>";
    $btb = explode(",", $b_table);
    $count = count($btb);
    $t = (int) $t;
    $s = (int) $s;
    $p = (int) $p;
    if ($t >= $count) {
        echo Encode("<script>alert('备份成功!\\n\\n整个过程耗时:" . ToChangeUseTime($stime) . "');self.location.href='index.php?m=database';</script>", 'gbk');
        die;
    }
    $u = $db->query("use `{$b_dbname}`");
    SetCharset($b_dbchar);
    if ($s == 0) {
        if ($limittype) {
            $num = -1;
        } else {
            $status_r = GetTableRows($b_dbname, $btb[$t]);
            $num = $status_r['Rows'];
        }
    } else {
        $num = (int) $alltotal;
    }
    $dumpsql .= GetTableStructSql($btb[$t], $b_strufour);
    $sql = $db->select_only($btb[$t], '1 limit ' . $s . ',' . $num);
    if (empty($fnum)) {
        $return_fr = GetTableFields($b_dbname, $btb[$t], $b_autofield);
        $fieldnum = $return_fr['num'];
        $noautof = $return_fr['autof'];
    } else {
        $fieldnum = $fnum;
        $noautof = $thenof;
    }
    $inf = '';
    if ($b_beover == 1) {
        $inf = '(' . GetTableInsertFields($b_dbname, $btb[$t]) . ')';
    }
    $hexf = '';
    if ($b_bakdatatype == 1) {
        $hexf = GetTableStringFields($b_dbname, $btb[$t]);
    }
    $b = 0;
    foreach ($sql as $k => $r) {
        echo Encode('<script>document.write("正在备份' . $btb[$t] . '的第' . ($k + 1) . '条记录<br/>");if(document.documentElement.scrollTop){document.documentElement.scrollTop=' . $k * 30 . ';}else{document.body.scrollTop=' . $k * 30 . ';}</script>', 'gbk');
        ob_flush();
        flush();
        $b = 1;
        $s++;
        $dumpsql .= "ExcuteSQL(\"insert into `" . $btb[$t] . "`" . $inf . " values(";
        $first = 1;
        for ($i = 0; $i < $fieldnum; $i++) {
            if (empty($first)) {
                $dumpsql .= ',';
            } else {
                $first = 0;
            }
            $myi = $i + 1;
            if (!isset($r[$i]) || strstr($noautof, ',' . $myi . ',')) {
                $dumpsql .= 'NULL';
            } else {
                $dumpsql .= GetFieldContent($r[$i], $b_bakdatatype, $myi, $hexf);
            }
        }
        $dumpsql .= ");\");\r\n";
        if (strlen($dumpsql) >= $b_filesize * 1024) {
            $p++;
            $sfile = $path . "/" . $btb[$t] . "_" . $p . ".php";
            $dumpsql = $header . $dumpsql . $footer;
            WriteString2File($sfile, $dumpsql);
            $db->free($sql);
            echo Encode("<meta http-equiv=\"refresh\" content=\"" . $waitbaktime . ";url=" . $config['sy_weburl'] . "/" . $adminDir . "/index.php?m=database&c=BackupDatabaseFileSize&phome=BakExe&s={$s}&p={$p}&t={$t}&mypath={$mypath}&alltotal={$num}&thenof={$noautof}&fieldnum={$fieldnum}&stime={$stime}&waitbaktime={$waitbaktime}&collation={$collation}\">" . $fun_r['BakOneDataSuccess'], 'gbk') . EchoBackupProcesser($btb[$t], $count, $t, $num, $s);
            exit;
        }
    }
    if (empty($p) || $b == 1) {
        $p++;
        $sfile = $path . "/" . $btb[$t] . "_" . $p . ".php";
        $dumpsql = $header . $dumpsql . $footer;
        WriteString2File($sfile, $dumpsql);
    }
    FetchFileNumber($p, $btb[$t], $path);
    $t++;
    $db->free($sql);
    echo "<meta http-equiv=\"refresh\" content=\"" . $waitbaktime . ";url=" . $config['sy_weburl'] . "/" . $adminDir . "/index.php?m=database&c=BackupDatabaseFileSize&phome=BakExe&s=0&p=0&t={$t}&mypath={$mypath}&stime={$stime}&waitbaktime={$waitbaktime}\">" . $fun_r['OneTableBakSuccOne'] . $btb[$t - 1] . $fun_r['OneTableBakSuccTwo'];
    exit;
}
Example #14
0
File: index.php Project: Khum/SDFU
<?php

include_once '../inc/config.inc.php';
$page_title = 'Login';
$msg = deQueueMsg();
if (!empty($_POST)) {
    extract($_POST);
    if (empty($username)) {
        enqueueMsg("Enter Username", "error");
    } else {
        $res = Query("SELECT * FROM admin_user WHERE user_name = '" . Encode($username) . "' AND password = '******' AND is_deleted = 'N'");
        if (Num($res) > 0) {
            $o = GetObj($res);
            if ($o->is_active == 'N') {
                enqueueMsg("This is not an  active user, please contact system administrator to activate!", "error");
            } else {
                $_SESSION["S_login"] = "******";
                $_SESSION["S_ID"] = $o->id;
                $_SESSION["S_username"] = $o->user_name;
                $_SESSION["S_full_name"] = $o->full_name;
                $_SESSION["S_email"] = $o->email;
                header("location:dashboard.php");
                exit;
            }
        } else {
            enqueueMsg("Invalid User Name/Password!", "error");
        }
    }
}
if ($msg == '') {
    //$msg = displayMsg('Please login with your Username and Password.');
Example #15
0
echo CORE_SITE;
?>
dont-jump-to-conclusions.html"><strong>These are just 10 tiny examples.</strong></a></p>
<p>Please don't obsess over tiny differences in median values from such a small number of examples.</p>

<p><img src="<?php 
echo $chart;
?>
?<?php 
echo 's=' . Encode($stats2);
?>
&amp;<?php 
echo 'm=' . Encode($Mark);
?>
&amp;<?php 
echo 'w=' . Encode($labels2);
?>
"
   alt=""
   title=""
   width="480" height="300"
 /></p>

<p>Please don't obsess about which programming language implementation is shown 10<sup>th</sup> and which is shown 11<sup>th</sup>. You can see that the order would be different if it was based on the median scores instead of <a href="http://portal.acm.org/citation.cfm?id=5666.5673" title="How not to lie with statistics: the correct way to summarize benchmark results">the geometric mean</a> scores.</p>



<h3><a href="<?php 
echo $pageUrl;
?>
#about" name="about">&nbsp;</a></h3>