@@ -1,14 +1,14 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | class Autoloader { |
| 3 | - static public function loader($className) { |
|
| 4 | - $filename = str_replace("\\", '/', $className) . ".php"; |
|
| 5 | - if (file_exists($filename)) { |
|
| 6 | - include($filename); |
|
| 7 | - if (class_exists($className)) { |
|
| 8 | - return TRUE; |
|
| 9 | - } |
|
| 10 | - } |
|
| 11 | - return FALSE; |
|
| 12 | - } |
|
| 3 | + static public function loader($className) { |
|
| 4 | + $filename = str_replace("\\", '/', $className) . ".php"; |
|
| 5 | + if (file_exists($filename)) { |
|
| 6 | + include($filename); |
|
| 7 | + if (class_exists($className)) { |
|
| 8 | + return TRUE; |
|
| 9 | + } |
|
| 10 | + } |
|
| 11 | + return FALSE; |
|
| 12 | + } |
|
| 13 | 13 | } |
| 14 | 14 | spl_autoload_register('Autoloader::loader'); |
| 15 | 15 | \ No newline at end of file |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | class Autoloader { |
| 3 | 3 | static public function loader($className) { |
| 4 | - $filename = str_replace("\\", '/', $className) . ".php"; |
|
| 4 | + $filename = str_replace("\\", '/', $className).".php"; |
|
| 5 | 5 | if (file_exists($filename)) { |
| 6 | 6 | include($filename); |
| 7 | 7 | if (class_exists($className)) { |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | class Roulete { |
| 9 | 9 | |
| 10 | - public function spin($items){ |
|
| 10 | + public function spin($items) { |
|
| 11 | 11 | |
| 12 | 12 | $max = 0; |
| 13 | 13 | foreach ($items as $key => $value) { |
@@ -15,11 +15,11 @@ discard block |
||
| 15 | 15 | $items[$key] = $max; |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | - $random = mt_rand(1,$max); |
|
| 18 | + $random = mt_rand(1, $max); |
|
| 19 | 19 | |
| 20 | 20 | foreach ($items as $item => $max) |
| 21 | 21 | { |
| 22 | - if ($random <= $max){ |
|
| 22 | + if ($random <= $max) { |
|
| 23 | 23 | break; |
| 24 | 24 | } |
| 25 | 25 | } |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | <div class="row"> |
| 3 | 3 | <div class="col-md-5"> |
| 4 | 4 | <div class="alert alert-primary"> |
| 5 | - <?= "<h2>kamu mendapatkan </h2><h2>". Roll::spin()."</h2>" ?> |
|
| 5 | + <?= "<h2>kamu mendapatkan </h2><h2>".Roll::spin()."</h2>" ?> |
|
| 6 | 6 | </div> |
| 7 | 7 | </div> |
| 8 | 8 | </div> |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | <div class="row"> |
| 12 | 12 | <div class="col-md-12" align="center"> |
| 13 | 13 | <div class="alert alert-primary"> |
| 14 | - <?= "<h2>Selamat Kamu mendapatkan </h2><h2>". Roll::spin(['SSR ITEM' => 0.1, |
|
| 14 | + <?= "<h2>Selamat Kamu mendapatkan </h2><h2>".Roll::spin(['SSR ITEM' => 0.1, |
|
| 15 | 15 | 'SSR ITEM 2' => 0.2, |
| 16 | 16 | 'SSR ITEM 3' => 0.3, |
| 17 | 17 | 'SSR ITEM 4' => 0.4, |