KaLu17

[pawno.pl] -> #28772

Oct 20th, 2014
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.19 KB | None | 0 0
  1. <?php
  2. class public_game_test_test extends ipsCommand
  3. {
  4.     public function doExecute( ipsRegistry $registry )
  5.     {    
  6.      
  7.         if(!$this->memberData['member_id'])
  8.         {
  9.             $this->registry->output->showError('nie jesteś zalogowany.',0);
  10.         }
  11.        
  12.         switch( $this->request['do'] )
  13.         {
  14.             case 'przyklad':
  15.                 $success = $this->wykonajPrzyklad($success);
  16.                 break;
  17.         }
  18.        
  19.         $template = $this->registry->output->getTemplate('game')->test($success);
  20.             $this->registry->output->addContent($template);
  21.             $this->registry->output->setTitle('Konto premium');
  22.             $this->registry->output->addNavigation('Konto Premium', 'app=panel&module=test&section=test', 'false', 'test', 'public');
  23.             $this->registry->output->sendOutput();
  24.     }
  25.    
  26.     public function wykonajPrzyklad($execution)
  27.     {
  28.             if(!$this->memberData['member_id'])
  29.         {
  30.             $this->registry->output->showError('nie jestes zalogowany.',0);
  31.         }
  32.         if($this->memberData['points'] < 100)
  33.         {
  34.             $execution = 1;
  35.         }
  36.         else
  37.         {
  38.             //Twój kod, zwracamy $return
  39.             $this->registry->output->redirectScreen('Operacja przebiegła pomyślnie.', $this->settings['base_url'] . 'index.php');
  40.         }
  41.         $return $execution;
  42.     }
  43. }
  44. ?>
Advertisement
Add Comment
Please, Sign In to add comment