Example #1
0
function selfURL()
{
    return moveURL(long(), lat(), zoom(), maptype());
}
function selfURL() {
  return moveURL(x_off(), y_off(), zoom());
}
include_once 'ressources/class.artica.inc';
include_once 'ressources/class.ini.inc';
include_once 'ressources/class.amavis.inc';
$user = new usersMenus();
if ($user->AsPostfixAdministrator == false) {
    $tpl = new templates();
    echo "alert('" . $tpl->javascript_parse_text("{ERROR_NO_PRIVS}") . "');";
    die;
    exit;
}
if (isset($_GET["table-list"])) {
    events_list();
    exit;
}
if (isset($_GET["zoom"])) {
    zoom();
    exit;
}
if (isset($_GET["loglevel"])) {
    loglevel();
    exit;
}
if (isset($_POST["AmavisDebugSpamassassin"])) {
    log_level_save();
    exit;
}
page();
function page()
{
    $t = time();
    $page = CurrentPageName();
Example #4
0
 /**
  * Method getZoomLevel
  * @access private
  * @param mixed $min_latitude
  * @param mixed $max_latitude
  * @param mixed $min_longitude
  * @param mixed $max_longitude
  * @param mixed $map_width
  * @param mixed $map_height
  * @return mixed
  * @since 1.2.7
  */
 private function getZoomLevel($min_latitude, $max_latitude, $min_longitude, $max_longitude, $map_width, $map_height)
 {
     $WORLD_DIM = array("height" => 256, "width" => 256);
     $ZOOM_MAX = 21;
     function latRad($lat)
     {
         $sin = sin($lat * pi() / 180);
         $radX2 = log((1 + $sin) / (1 - $sin)) / 2;
         return max(min($radX2, pi()), -pi()) / 2;
     }
     function zoom($mapPx, $worldPx, $fraction)
     {
         return floor(log($mapPx / $worldPx / $fraction) / 0.6931471805599453);
     }
     $latFraction = (latRad($max_latitude) - latRad($min_latitude)) / pi();
     $lngDiff = $max_longitude - $min_longitude;
     $lngFraction = ($lngDiff < 0 ? $lngDiff + 360 : $lngDiff) / 360;
     $latZoom = zoom($map_height, $WORLD_DIM["height"], $latFraction);
     $lngZoom = zoom($map_width, $WORLD_DIM["width"], $lngFraction);
     return min($latZoom, $lngZoom, $ZOOM_MAX);
 }
<?php

$maxIterations = 50;
$step = 1 / 20;
$topLeft = array(-1.5, 1);
$bottomRight = array(0.5, -1);
if (isset($_GET['zoom'])) {
    $zoom = (double) $_GET['zoom'];
    $topLeft = zoom($topLeft, $zoom);
    $topLeft = panLeft($topLeft, $zoom * 0.25);
    $bottomRight = zoom($bottomRight, $zoom);
    $bottomRight = panLeft($bottomRight, $zoom * 0.25);
    $step = $step / $zoom;
    echo '<head><META
     HTTP-EQUIV="Refresh"
     CONTENT="1; URL=mandlebrot_terminal.php?zoom=' . ($zoom + 0.1) . '" > </head>';
    echo '<body>';
}
if ('cli' != php_sapi_name()) {
    echo "<pre><center>";
}
for ($imaginary = $topLeft[1]; $imaginary > $bottomRight[1]; $imaginary = $imaginary - $step) {
    for ($real = $topLeft[0]; $real < $bottomRight[0]; $real = $real + $step) {
        $z = new ComplexNumber(0, 0);
        $c = new ComplexNumber($real, $imaginary);
        $iterationCount = 0;
        while ($z->lessThanTwo() && $iterationCount < $maxIterations) {
            $z->square();
            $z->add($c);
            ++$iterationCount;
        }
Example #6
0
     $miaoshu = $_POST['miaoshu'];
     $image = $_FILES['pic']['tmp_name'];
     $addtime = time();
     //验证用户数据
     if (empty($name)) {
         exit('用户名不能为空');
     }
     if (empty($cate_id)) {
         exit('请选择类别');
     }
     //拼接sql语句
     if (!empty($image)) {
         $path = PATH . 'upload/goods/';
         $filename = upload('pic', $path);
         $path = PATH . 'upload/goods/' . $filename;
         $newname = zoom($path, 200, 200);
         unlink($path);
         $sql = "update goods set name='{$name}',price={$price},cate_id={$cate_id},store={$store},is_up={$is_up},is_new={$is_new},is_hot={$is_hot},miaoshu='{$miaoshu}',image='{$newname}',addtime={$addtime} where id={$id}";
     } else {
         $sql = "update goods set name='{$name}',price={$price},cate_id={$cate_id},store={$store},is_up={$is_up},is_new={$is_new},is_hot={$is_hot},miaoshu='{$miaoshu}',addtime={$addtime} where id={$id}";
     }
     //执行sql语句
     $result = execute($sql);
     if ($result) {
         jump('修改成功', './index.php');
     } else {
         jump('修改失败', './add.php');
     }
     break;
 case 'updown':
     $id = $_GET['id'];
Example #7
0
             exit(jump('密码输入不一致', $_SERVER['HTTP_REFERER']));
         }
         $pwd = md5($pwd);
         $pwdname = "password='******',";
     } else {
         $pwdname = '';
     }
     $id = $_GET['id'];
     mysql_connect(HOST, USER, PWD) or die('数据库连接失败');
     mysql_select_db(DB);
     mysql_set_charset('utf8');
     if ($_FILES['pic']['error'] == 0 || !empty($_FILES['pic']['tmp_name'])) {
         $path = PATH . 'upload/user/';
         $filename = upload('pic', $path);
         $path = PATH . 'upload/user/' . $filename;
         $newname = zoom($path);
         $sql = "update user set name='{$name}',{$pwdname}sex={$sex},age={$age},level='{$level}',pic='{$newname}' where id={$id}";
     } else {
         $sql = "update user set name='{$name}',sex={$sex},age={$age},{$pwdname}level='{$level}' where id={$id}";
     }
     if (!mysql_query($sql)) {
         exit('更新失败!');
     }
     jump('更新成功', './index.php');
     break;
 case 'userdisplay':
     $id = $_GET['id'];
     $display = $_GET['display'];
     if ($display == 'yes') {
         $sql = "update user set display=0 where id={$id}";
     } else {
Example #8
0
function playerHTML()
{
    global $player, $players, $pcards, $table;
    foreach ($players as $pid => $p) {
        $thishand = '';
        $actionhtml = array('none' => '', 'sb' => 'small blind ', 'bb' => 'big blind ', 'fold' => '<b>fold</b> ', 'call' => '<b>call</b> ', 'check' => 'check ', 'allin' => '<b>all-in</b> ', 'bet' => '<b>bet</b> ', 'raise' => '<b>raise</b> ');
        if ($p['tablestatus'] == "out") {
            $thishand = '<b>out</b> ' . $thishand;
        } else {
            if ($table['onturn'] == $pid) {
                $thishand = $actionhtml[$p['action']] . $thishand;
            }
        }
        $html[$pid] = ' ';
        if ($table['onturn'] == $pid) {
            $html[$pid] .= '<span style="background-color:#FFFF00">';
        }
        $html[$pid] .= $p['name'];
        if ($pid == $table['dealer']) {
            $html[$pid] .= ' (D)';
        }
        $html[$pid] .= ' [' . intval($p['tablemoney']) . ' DM]';
        if ($table['onturn'] == $pid) {
            $html[$pid] .= '</span>';
        }
        $html[$pid] .= '<table><tr><td><pre>';
        if ($p['showcards']) {
            $html[$pid] .= cardimgs($pcards['down'][$pid] . $pcards['up'][$pid], $pid == $player['id'] ? 100 : 70);
        } else {
            if ($pid == $player['id']) {
                $html[$pid] .= cardimgs($pcards['down'][$pid] . $pcards['up'][$pid], 100);
            } else {
                $html[$pid] .= cardimgs(str_repeat('x', strlen($pcards['down'][$pid])) . $pcards['up'][$pid], $pid == $player['id'] ? 100 : 70);
            }
        }
        $html[$pid] .= ' </pre></td>';
        $html[$pid] .= '<td valign="bottom" align="right" style="' . $GLOBALS['font2'] . '">';
        $html[$pid] .= moneyimgs(intval($p['betmoney']));
        $html[$pid] .= '</td>';
        $html[$pid] .= '<td width="' . zoom(25) . '"></td></tr></table>';
        $html[$pid] .= ' ' . $thishand;
    }
    return $html;
}