include_once $_SERVER['DOCUMENT_ROOT'] . '/topicos2/settings.php'; include_once _URL . 'controller/core.php'; include_once _URL . 'controller/cityDAO.php'; $privilege = isLogged(); if ($privilege != 0) { header("location: ../../login.php?ms=2"); } if (isset($_GET['page']) && $_GET['qty']) { $page = $_GET['page']; $qty = $_GET['qty']; } else { $page = 0; $qty = 30; } $controller = new cityDAO(); $cities = $controller->getCities($page, $qty); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="../../style/admin.css" rel="stylesheet" type="text/css" /> <title>Aoba's Tur - Admin</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body class="admin"> <div id="menu"> <?php getMenuAdmin($privilege); ?> </div>
<table id="packages"> <thead> <th> </th> <th>Nome</th> <th>Preço</th> <th>Preço promocional</th> <th>Data início</th> <th>Data final</th> <th>Cidade</th> </thead> <tbody> <?php $controller = new packageDAO(); $packages = $controller->getPackages($page, $qty); foreach ($packages as $key => $value) { $controller2 = new cityDAO(); $city = $controller2->getCityById($packages[$key]->getIdCity()); ?> <tr> <td><input type="radio" name="update_id" value="<?php echo $packages[$key]->getIdPackage(); ?> " /></td> <td><?php echo $packages[$key]->getName(); ?> </td> <td><?php echo $packages[$key]->getPrice(); ?> </td>
$controller2 = new cityDAO(); $city = $controller2->getCityById($package->getIdCity()); ?> <td><?php echo $city->getName(); ?> <input type="hidden" name="id_city" value="<?php echo $package->getIdCity(); ?> " /></td> <?php } else { ?> <td><select name="id_city"> <?php $controller2 = new cityDAO(); $cities = $controller2->listCities(); foreach ($cities as $city) { echo '<option value="' . $city->getIdCity() . '">' . $city->getName() . '</option>'; } ?> </select></td> <?php } ?> </tr> <tr> <td>Preço: </td> <td><input type="text" name="price" value="<?php if ($id != -1) { echo $package->getPrice();
<?php getMenuAdmin($privilege); ?> </div> <div id="sidebar"> <ul> <li> </li> </ul> </div> <div id="content"> <?php $controller = new formDAO(); $form = $controller->getForm($_GET['form']); $controller2 = new packageDAO(); $package = $controller2->getPackageById($form->getIdPackage()); $controller3 = new cityDAO(); $city = $controller3->getCityById($package->getIdCity()); ?> <table id="reserve"> <tbody> <tr> <td width="200px">Pacote: </td> <td><?php echo $package->getName(); ?> </td> </tr> <tr> <td>Cidade: </td> <td><?php echo $city->getName();
<?php include_once $_SERVER['DOCUMENT_ROOT'] . '/topicos2/settings.php'; include_once _URL . 'controller/cityDAO.php'; include_once _URL . 'model/city.php'; if ($_POST['name']) { if (isset($_FILES) && ($_FILES["file"]["type"] == "image/gif" || $_FILES["file"]["type"] == "image/jpeg" || $_FILES["file"]["type"] == "image/pjpeg")) { if ($_FILES["file"]["error"] > 0) { echo "Não foi possível enviar o aquivo. Erro #" . $_FILES["file"]["error"] . "<br />"; die; } else { $url_image = $_SERVER['DOCUMENT_ROOT'] . '/topicos2/images/' . $_FILES["file"]["name"]; if (file_exists($url_image)) { echo "O " . $_FILES["file"]["name"] . " já existe! "; die; } else { move_uploaded_file($_FILES["file"]["tmp_name"], $url_image); } } $thumbnail = $_FILES["file"]["name"]; } else { $thumbnail = ''; } $city = new city(0, $_POST['name'], $_POST['state'], $_POST['country'], $_POST['description'], $thumbnail, 1, 1); $controller = new cityDAO(); $controller->insert($city); header('Location: city.php?ms=1'); }