$game = new Game(null, $gameType, $name, $rating, $year, $company);
                $game->save();
            } catch (PDOException $exception) {
                $return = false;
            }
            break;
        case ActionType::ACTION_DELETE:
            $id = $_POST['id'];
            try {
                $game = new Game($id, null, null, null, null, null);
                $game->delete();
            } catch (PDOException $exception) {
                $return = false;
            }
            break;
        case ActionType::ACTION_MODIFY:
            $name = $_POST['name'];
            $gameType = $_POST['gameType'];
            $year = $_POST['year'];
            $rating = $_POST['rating'];
            $company = $_POST['company'];
            $gameTable = new GameTable();
            $game = $gameTable->getById($_POST['id']);
            $game->modify($gameType, $name, $rating, $year, $company);
            $game->save();
            break;
        default:
            return false;
    }
    echo json_encode($return);
}
Example #2
0
 * User: Proyecto Nahual
 * Date: 30/10/12
 * Time: 13:46
 *
 * Cualquier inquietud, enviar un mail a sumate@nahual.com.ar
 *
 */
error_reporting(E_ALL);
ini_set('display_errors', '1');
include_once "includes.php";
include_once "classes/GameType.php";
include_once "classes/GameTable.php";
include_once "classes/ActionType.php";
$gameTypes = GameType::getValues();
if (isset($_GET['id'])) {
    $gameTable = new GameTable();
    $game = $gameTable->getById($_GET['id']);
}
?>

<html>
<head>
  <?php 
include_once "common_head.php";
?>
    <script type="text/javascript">
        $(function () {

            jQuery.fn.reset = function () {
                $(this).each(function () {
                    this.reset();
Example #3
0
 * User: Proyecto Nahual
 * Date: 30/10/12
 * Time: 13:46
 *
 * Cualquier inquietud, enviar un mail a sumate@nahual.com.ar
 *
 */
include_once "includes.php";
include_once "version_addendum.php";
include_once "classes/GameType.php";
include_once "classes/GameTable.php";
include_once "classes/ActionType.php";
error_reporting(E_ALL);
ini_set('display_errors', '1');
$gameTypes = GameType::getValues();
$gameTable = new GameTable();
$visibleFilters = false;
$onlyImportantColumns = false;
if (isset($_POST) && isset($_POST['aplicarFiltros'])) {
    $visibleFilters = true;
    if (isset($_POST['checkProyeccion'])) {
        $onlyImportantColumns = true;
    }
    $gameTypeFilter = $_POST['gameTypeFilter'];
    $games = $gameTable->getGames($onlyImportantColumns, $gameTypeFilter);
} else {
    $games = $gameTable->getAllGames();
}
function getIcon($game)
{
    echo "<img src='resources/img/iconos/" . $game->getGameType() . ".png' class='console-icon'  title='" . $game->getGameType() . "' alt='" . $game->getGameType() . "' />";
Example #4
0
 public function executeList()
 {
     $this->games = GameTable::getInstance()->findAll();
 }