Exemplo n.º 1
0
 public function indexAction()
 {
     // read in a yml file containing the images and captions
     $config = new FileLocator(__DIR__ . '/../Resources/config');
     $images = Yaml::parse($config->locate('avatars.yml'));
     // generate a random number between 0 and [array_size]
     $random = mt_Rand(0, count($images) - 1);
     // set random
     $avatar = $images[$random];
     return $this->render('DdnetUserBundle:Profile:index.html.twig', array('avatar' => $avatar));
 }
Exemplo n.º 2
0
function GetGenerator($G)
{
    global $G, $Get1, $Get2, $MaxGetal;
    if ($G == 4) {
        $Get1 = mt_Rand(1, 10);
        $Get2 = mt_rand(1, 10);
        // Groep 4 1 tot 10
        $MaxGetal = 10;
    } elseif ($G == 5) {
        $Get1 = mt_rand(1, 20);
        $Get2 = mt_rand(1, 20);
        // Groep 5 1 tot 20
        $MaxGetal = 20;
    } elseif ($G == 6) {
        $Get1 = mt_rand(1, 100);
        $Get2 = mt_rand(1, 100);
        // Groep 6 1 tot 100
        $MaxGetal = 100;
    }
}
Exemplo n.º 3
0
if ($timer <= time()) {
    $is_time = mysql_fetch_array(mysql_query("SELECT * FROM roul_time WHERE shouldstart<" . time()));
    if ($is_time) {
        mysql_query("UPDATE roul_time SET shouldstart=" . (time() + $roundtime));
        $timer = time() + $roundtime;
        /*if(sum_betto(0)>0)
        		{	
        			$rand=mt_Rand(0,1);
        			$winner=array();
        			$winner = $win_stone[$rand];
        			shuffle($winner);
        			$num = $winner[0];
        		}
        		else $num=0;*/
        //$num=winner_bet();
        $num = mt_Rand(0, 36);
        if (!$num) {
            $strnum = "Zero";
        } else {
            if (in_array($num, $red)) {
                $strnum = "{$num}, красное";
            } else {
                $strnum = "{$num}, черное";
            }
        }
        $text = "Ставки сделаны... Запускаем... Выпало <b>{$strnum}</b>. ";
        $bets = mysql_query("SELECT * FROM roul_bets");
        if (mysql_num_rows($bets)) {
            while ($cbet = mysql_fetch_array($bets)) {
                $all_summer += $cbet['bet'];
                if ($roul_wins[$num][$cbet['betto']]) {
Exemplo n.º 4
0
$kvest_text[7] = "Для бесчеловечных экспериментов лекарей города, Вам следует набраться храбрости и доставить";
$kvest_text[8] = "Мы уже видели вашу силу..вас ждет новая тяжка..борьба за лучшое место..не боясь Монстров одалея их силы от вас требуется  доставить";
$kvest_text[9] = "Продолжается Борьба за ценные камни... от вас требуется храбрости сразиться с монстрами и добыть";
$items = array(118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 120, 131, 132);
$items_count = array(10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60);
#$add_naqrada=array(100, 200, 300, 400, 500, 600, 700, 800, 900, 1000);
$add_naqrada[1] = array(100, 150, 200, 250, 300, 350);
$add_naqrada[2] = array(400, 450, 500, 550, 600, 650);
$add_naqrada[3] = array(700, 750, 800, 850, 900, 950);
##==============================================================================
if ($_GET["action"] == "get_qwest") {
    if ($db["kwest"] >= 60) {
        $have_qwest = mysql_fetch_Array(mysql_query("SELECT * FROM qwest WHERE owner='" . $db["id"] . "' and status=0"));
        if (!$have_qwest) {
            shuffle($items);
            $count_items = mt_Rand(1, 3);
            for ($i = 0; $i < $count_items; $i++) {
                $r = mt_rand(0, sizeof($items) - 1);
                // generate random key
                if (isset($trio)) {
                    if (in_array($items["{$r}"], $trio)) {
                        --$i;
                    } else {
                        $trio[] = $items["{$r}"];
                    }
                } else {
                    $trio[] = $items["{$r}"];
                }
            }
            $item1 = (int) $trio[0];
            $col1 = (int) $items_count[rand(0, count($items_count) - 1)];
Exemplo n.º 5
0
}
?>

<html>
	<head>
		<!-- HEAD HIER -->
		<title>Rekenwebsite</title>
	</head>
	<body>
		<div>
		
		<?php 
$G = $_SESSION['g'];
$sommen = array("nvt", " + ", " - ", " &#215; ", " : ");
if ($G == 4) {
    $Get1 = mt_Rand(1, 10);
    $Get2 = mt_rand(1, 10);
} elseif ($G == 5) {
    $Get1 = mt_rand(1, 20);
    $Get2 = mt_rand(1, 20);
} elseif ($G == 6) {
    $Get1 = mt_rand(1, 100);
    $Get2 = mt_rand(1, 100);
}
if (isset($_GET['m'])) {
    $Som = $_GET['m'];
} else {
    $Som = mt_rand(1, 4);
}
echo $Get1 . $sommen[$Som] . $Get2;
echo "<br />" . $Get1 . " Get1<br />";