Пример #1
0
 public function index()
 {
     parent::__construct();
     //parent->motor();
     //global $PERMS;
     $args = array('perm' => 'r');
     if ($this->PERMS->mtrc_bool_chkPermission($args)) {
         print '>>> Ok, you can go...';
     } else {
         print 'No go...';
     }
     print 'YES!!!, This got called!!!';
 }
Пример #2
0
<?php

include "config.php";
include "conexao.php";
include "classes/motor.class.php";
$OOMotor = new Motor();
$OOMotor->Gira($conexao);
/* ******************************************************************************** */
/* !Importante: #### Ranking */
$sql = $conexao->query("SELECT * FROM feudos ORDER BY prata DESC");
while ($linha = $sql->fetch_array()) {
    if (!isset($posicao) or $posicao == 0) {
        $posicao = 1;
    }
    $id_feudo = $linha['id'];
    $sqlx = $conexao->prepare("UPDATE feudos SET posicao = ? WHERE id = ?");
    $sqlx->bind_param('ii', $posicao, $id_feudo);
    $sqlx->execute();
    $posicao++;
}
/* ******************************************************************************** */
/* Atualiza producao de todos usuarios */
$sql = $conexao->query("SELECT * FROM feudos");
while ($linha = $sql->fetch_array()) {
    $feudo_id = $linha['id'];
    $feudo_prata = $linha['prata'];
    $feudo_madeira = $linha['madeira'];
    $feudo_sushi = $linha['sushi'];
    $peao_prata = $linha['peao_prata'];
    $peao_madeira = $linha['peao_madeira'];
    $peao_sushi = $linha['peao_sushi'];
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = Motor::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }