Exemple #1
0
 public function InsertAndSendMail()
 {
     $quotedAuthor = trim($_POST['mail']);
     $quotedTitle = trim($_POST['title']);
     $isbn = Isbn::stringFromPost();
     $year = (int) trim($_POST['year']);
     $price = (double) str_replace(',', '.', $_POST['price']);
     $quotedDescription = $_POST['desc'];
     $key = KeyGenerator::genKey();
     $query = 'insert into books' . ' (author, title, year, price, isbn, description, mail, auth_key' . ', created,expires)' . ' values (' . '"' . $quotedAuthor . '"' . ', "' . $quotedTitle . '"' . ', "' . $year . '"' . ', "' . $price . '"' . ', "' . $isbn . '"' . ', "' . $quotedDescription . '"' . ', "' . $this->getMail() . '"' . ', "' . $key . '"' . ', now()' . ', date_add(now(), interval 45 day)' . ')';
     mysql_query($query);
     $book_id = mysql_insert_id();
     $this->selectableCategories->setBookId($book_id);
     $this->selectableCategories->update();
     $subject = '';
     $message = 'Mit deiner E-Mailadresse wurde das unten stehende Buch angeboten. Hebe diese E-Mail auf, um das Angebot später ändern und löschen zu können.';
     Mailer::send($book_id, $subject, $message);
     $searches = new Searches();
     if ($searches->areActivated()) {
         $author = stripslashes($quotedAuthor);
         $title = stripslashes($quotedTitle);
         $description = stripslashes($quotedDescription);
         $searches->bookAdded($book_id, $author, $title, $description);
     }
     header('Location: book.php?id=' . $book_id . '&key=' . $key . '&new=1');
     exit;
 }
Exemple #2
0
 private function createSaveLink()
 {
     if (isset($_GET['searchSaved'])) {
         return;
     }
     $searches = new Searches();
     if (!$searches->areActivated()) {
         return;
     }
     $this->tmpl->addSubtemplate('saveSearch');
 }
Exemple #3
0
 * MySQL-Setup, Bücher betrachten, Kategorien verändern, Serveraustausch aktivieren, Mail verschicken.
 */
require 'header.php';
?>
<h2>uBook läuft</h2>
<table align="center">
<tr><td>Buchangebote</td><td><?php 
echo $numberOfBooks;
?>
</td><td><a href="admin_view.php">alle einsehen</a></td></tr>
<tr><td>Kategorien</td><td><?php 
echo $numberOfCategories;
?>
</td><td><a href="admin_categories.php">verwalten</a></td></tr>
<?php 
if ($searches->areActivated()) {
    ?>
<tr><td>Gespeicherte Suchen</td><td><?php 
    echo $numberOfSearches;
    ?>
</td><td><a href="admin_notification.php?deactivate=1">alle löschen</a></td></tr>
<?php 
} else {
    ?>
<tr><td colspan="3"><a href="admin_notification.php?activate=1">Suchbenachrichtigungen aktivieren</a></td></tr>
<?php 
}
if ($serverName->isEmpty()) {
    ?>
<tr><td colspan="3"><a href="admin_servers.php">Suche an anderen Standorten aktivieren</a></td></tr>
<?php