Example #1
0
<html>
<body>
<?php 
include "DAO/AlbumDAO.php";
$sent = isset($_GET['send']) ? True : False;
$id = isset($_GET['id']) ? $_GET['id'] : '';
$title = isset($_GET['title']) ? $_GET['title'] : '';
$description = isset($_GET['description']) ? $_GET['description'] : '';
$message = "";
if ($sent) {
    $album = new Album($id, $title, $description, null);
    $daoAlbum = new AlbumDao();
    if ($daoAlbum->update($album) > 0) {
        $message = "Updated";
        $sent = False;
    } else {
        $message = "";
        $sent = False;
    }
}
?>
<a href="index.php">Back</a>

<?php 
echo $message;
?>

  <form method="get" action="<?php 
$_SERVER["REQUEST_URI"];
?>
">
Example #2
0
 public function deleteLogicAction()
 {
     $id = $this->params("id");
     $albumDao = new AlbumDao($this->_serviceLocator);
     $album = $albumDao->getById($id);
     $res = $albumDao->deleteLogic($album);
     var_dump($res);
     exit;
 }
Example #3
0
">
			<input type="text" name="description" value="<?php 
echo $description;
?>
">
			<input type="text" name="user" value="<?php 
echo $user;
?>
">
			<input type="submit" name="send" value="Consult">
    	</form>
    </body>
    
    <?php 
$markupFields = "<table><tr>";
$daoAlbum = new AlbumDao();
$fields = $daoAlbum->getFields();
foreach ($fields as $field) {
    $markupFields .= "<th>" . $field . "</th>";
}
$markupFields .= "</tr></table>";
echo $markupFields;
$albuns = $daoAlbum->getAll();
$markup = "<table>\n\t\t<tr>";
$markup .= "</tr>";
foreach ($albuns as $album) {
    $r = "<tr>";
    $r .= "<td>" . $album->getID() . "</td><td>" . $album->getTitle() . "</td><td>" . $album->getDescription() . "</td><td>" . $album->getUserId();
    $r .= "<td><a href='update.php?id=" . $album->getID() . "'>Modify</a>";
    $r .= "</td></tr>";
    $markup .= $r;