Пример #1
0
     $mb1 = $data_array[$k];
     if ($mb1 > 0 && $mb1 != " ") {
         $allbet = $allbet + $mb1;
     }
 }
 mysql_query("update users set cash=cash-'{$allbet}' where login='******'");
 mysql_query("update game_bank set bank=bank+'{$allbet}' where name='ttuz'");
 $ams = 0;
 while ($ams < 10000000) {
     $dig = rnd1();
     $win = 0;
     $win2 = 0;
     for ($k = 0; $k <= 162; $k++) {
         $mb = $data_array[$k];
         if ($mb > 0 && $mb != " ") {
             $aa = rnd2($k, $dig);
             if ($aa == true) {
                 if ($k >= 0 && $k <= 36) {
                     $win = $win + $mb * 36 + $mb;
                     $win2 = $win2 + $mb * 36;
                 }
                 if ($k >= 37 && $k <= 93) {
                     $win = $win + $mb * 18 + $mb;
                     $win2 = $win2 + $mb * 18;
                 }
                 if ($k >= 94 && $k <= 105) {
                     $win = $win + $mb * 12 + $mb;
                     $win2 = $win2 + $mb * 12;
                 }
                 if ($k >= 106 && $k <= 128) {
                     $win = $win + $mb * 9 + $mb;
Пример #2
0
 function show_month()
 {
     global $year, $month;
     $stat = $this->get_month($year, $month);
     // susirandam auksciausia ir prilyginam 100%
     $hits = 0;
     for ($i = 0; isset($stat[$i]); $i++) {
         $hits += $stat[$i]['visitors'];
     }
     // pereinam per visa menesi
     $list = array();
     $index = 0;
     for ($d = 0; $d < 31; $d++) {
         $day = $d + 1;
         $format = "{$year}.{$month}.{$day}";
         if (isset($stat[$d]) && $stat[$d]['visitors'] > 0) {
             $list[$d] = $stat[$d];
             $list[$d]['day'] = $day;
             $list[$d]['percent'] = rnd2(300 * $list[$d]['visitors'] / $hits);
             $list[$d]['height'] = round($list[$d]['percent'] * 2);
             $index++;
         } else {
             $list[$d]['visitors'] = 0;
             $list[$d]['day'] = $day;
             $list[$d]['percent'] = 0;
             $list[$d]['height'] = 0;
         }
     }
     $this->tpl->set_var('stat_year', $year);
     $this->tpl->set_var('stat_month', $month);
     $this->tpl->set_var('total_hits', $hits);
     $this->tpl->set_loop('stat', $list);
     $this->tpl->set_loop('header', 'Lankomumas');
     $this->tpl->set_loop('stat_day', $list);
     if ($month - 1 < 1) {
         $prev_month = 12;
     } else {
         $prev_month = $month - 1;
     }
     if ($month - 1 < 1) {
         $prev_year = $year - 1;
     } else {
         $prev_year = $year;
     }
     $this->tpl->set_var('prev_month', $prev_month);
     $this->tpl->set_var('prev_year', $prev_year);
     if ($month + 1 > 12) {
         $next_month = 1;
     } else {
         $next_month = $month + 1;
     }
     if ($month + 1 > 12) {
         $next_year = $year + 1;
     } else {
         $next_year = $year;
     }
     $this->tpl->set_var('next_month', $next_month);
     $this->tpl->set_var('next_year', $next_year);
     $this->tpl->set_file('month_tpl', 'control/usage/tpl/month_stat.html', 1);
     return $this->tpl->process('temp', 'month_tpl', 1);
 }