예제 #1
0
 /**
  * @param Request $request
  * @return string
  * @throws Exception
  */
 public function showAction(Request $request)
 {
     $id = $request->get('id');
     $model = new BookModel();
     $book = $model->getById($id);
     $args = array('book' => $book);
     return $this->render('show', $args);
 }
 public function testCreateTables()
 {
     $book = new BookModel(null, array('name' => 'Moinruich', 'isbn' => 'Iäsbe-ähn'));
     echo "<pre>";
     var_dump($book->getData());
     $book->update();
     var_dump($book->getData());
     return 'Created Table Only_table and with_arguments';
 }
예제 #3
0
 function getBookTable($title, $author)
 {
     $link = '';
     $bookModel = new BookModel();
     $userModel = new UserModel();
     $book = $bookModel->getBook($title, $author);
     $reviews = array();
     $reviews = $bookModel->getBookReview($book->idBook);
     //echo $reviews[0]->description;
     $result = '';
     $reviews_res = "";
     $r = null;
     $price = $book->price;
     require "testdb.php";
     if (isset($_SESSION['login_user'])) {
         $username = $_SESSION['login_user'];
         $query = "SELECT idUser FROM users WHERE username LIKE '{$username}'";
         $result = mysql_query($query) or die(mysql_error());
         while ($row = mysql_fetch_array($result)) {
             $idUser = $row[0];
             $query2 = "SELECT * FROM reading WHERE idUser = {$idUser} AND idBook = {$book->idBook}";
             $result2 = mysql_query($query2) or die(mysql_error());
             while ($row = mysql_fetch_array($result2)) {
                 $date = date('Y-m-d');
                 $end_date = date("Y-m-d", strtotime($row['enddate']));
                 if ($end_date > $date) {
                     $price = 0;
                 }
             }
         }
     }
     mysql_close();
     if (isset($_SESSION['login_user'])) {
         if ($price == 0) {
             $link = $book->location;
         } else {
             $link = "payment.php";
         }
     }
     if ($book != null) {
         $_SESSION['current_book'] = $book->idBook;
         $grade = 0;
         if ($book->noGrades > 0) {
             $grade = $book->grades / $book->noGrades;
         }
         $result = "\n\t\t\t\t\t<div class='row popular'>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<h3>{$book->title} &#8211 {$book->author}</h3>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t<div class='row produs'>\n\t\t\t\t\t\t\t\t<div class='produs_sus' style=''>\n\t\t\t\t\t\t\t\t\t<div class='large-4 column poza_produs'>\n\t\t\t\t\t\t\t\t\t\t<img src='{$book->cover}' width='250' height='375' alt=''>\n\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t<div class='large-4 column produs_centru'>\n\t\t\t\t\t\t\t\t\t\t<p><span>Publish year : </span>{$book->rYear}<br></p>\n\t\t\t\t\t\t\t\t\t\t<p><span>Author : </span> <span class='al'>{$book->author}</span></a><br></p>\n\t\t\t\t\t\t\t\t\t\t<p><span>Category : </span> {$book->category}<br></p>\n\t\t\t\t\t\t\t\t\t\t<p><span>Publisher : </span> <span class='al'>{$book->publisher}</span></a><br></p>\n\t\t\t\t\t\t\t\t\t\t<p><span>Grade : </span> <span class='al'>{$grade}</span></a><br></p>\n\t\t\t\t\t\t\t\t\t\t<form action='' method='post'>\n\t\t\t\t\t\t\t\t\t\t\t<fieldset class='rating'>\n\t\t\t\t\t\t\t\t\t\t\t\t<legend>Please rate:</legend>\n\t\t\t\t\t\t\t\t\t\t\t\t<input type='submit' id='star5' name='star5' value='5' /><label for='star5' title='Rocks!'>5 stars</label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input type='submit' id='star4' name='star4' value='4' /><label for='star4' title='Pretty good'>4 stars</label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input type='submit' id='star3' name='star3' value='3' /><label for='star3' title='Meh'>3 stars</label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input type='submit' id='star2' name='star2' value='2' /><label for='star2' title='Kinda bad'>2 stars</label>\n\t\t\t\t\t\t\t\t\t\t\t\t<input type='submit' id='star1' name='star1' value='1' /><label for='star1' title='Sucks big time'>1 star</label>\n\t\t\t\t\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t\t\t</div>\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<script>\n\t\t\t\t\t\t\t\t\t\$(function() {\n\t\t\t\t\t\t\t\t\t\tc_rate('ratem',19.4,17);\t\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t</script>\n\t\t\t\t\t\t\t\t</div><!--end of produs_centru-->\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\t\t<form action='' method='post'>\n\t\t\t\t\t\t\t\t<div class='large-4 column column produs_right'>\n\t\t\t\t\t\t\t\t\t<p class='pret'>\n\t\t\t\t\t\t\t\t\t\tPrice : {$price}&nbsp; Lei\n\t\t\t\t\t\t\t\t\t</p><br>\n\n\t\t\t\t\t\t\t\t\t<a href = '{$link}?title={$book->title}&author={$book->author}&current_book={$book->idBook}&link_book={$book->location}' class='button info'>Read me</a>\n\t\t\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t</div>\n\t\t\t\n\n\t\n\t\t\t\t\t\t<div class='large-12 column'>\t\n\t\t\t\t\t\t\t<h3>Description</h3>\n\t\t\t\t\t\t\t<div class='descriere_produs'>\t\t\n\t\t\t\t\t\t\t\t<p>{$book->description}</p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\t\n\n\t\t\t\t\t";
         $reviews_res = "<div class = 'large-12 column'>\n\t\t\t\t\t\t\t<h3>Reviews</h3>\n\t\t\t\t\t\t\t <div class='comentarii_utilizatori'> ";
         foreach ($reviews as $r) {
             if ($r->approved == 1) {
                 $reviews_res = $reviews_res . " <div class='row'>\n\t\t\t\t\t\t<div class='large-12 column user'>" . $userModel->getUsernameById($r->idUser) . " : </div>\n\t\t\t\t\t\t<div class='large-12 column continut_comentariu'>" . $r->description . "</div><br></div>";
             }
         }
         $reviews_res = $reviews_res . "\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\n\t\n\t\t\t\t\t\t<div class='clear'></div> \n\t\t\t\t\t\t \n\t\t\t\t\t\t<div class='large-12 column'>             \n\t\t\t\t\t\t\t<h3>Add a review</h3>\n\t\t\t\t\t\t\t\t <form name='comentariiprodus1' action='' method='post'>          \n\t\t\t\t\t\t\t\t   \n\t\t\t\t\t\t\t\t  <div class='textar'>\n\t\t\t\t\t\t\t\t\t<div>Your review : </div>\n\t\t\t\t\t\t\t\t\t<textarea name='comment' cols='47' rows='10' class='contact_input' style='height:100px'></textarea>  \n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class='rand_jos'>\n\t\t\t\t\t\t\t\t\t<!--<a href = '#' class = 'button info'>SEND </a>-->\n\t\t\t\t\t\t\t\t\t<input class = 'button info' name='addreview' type='submit' value=' Send '>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t </form>     \n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>";
     }
     return $result . $reviews_res;
 }
예제 #4
0
 function CreateBookTables($types)
 {
     $bookModel = new BookModel();
     $bookArray = $bookModel->GetBookByType($types);
     $result = "";
     foreach ($bookArray as $key => $book) {
         $result = $result . "<table class = 'bookTable'>\n                        <tr>\n                            <th rowspan='8' width = '200px' ><img runat = 'server' src = '{$book->BookImg}' /></th>\n                            \n                            \n                            <th width = '75px' >BookId : </th>\n                            <td>{$book->BookId}</td>\n                        </tr>\n                          \n                        <tr>\n                            <th width = '75px' >Book Name : </th>\n                            <td>{$book->BookName}</td>\n                        </tr>\n                        \n                        <tr>\n                            <th>Author name : </th>\n                            <td>{$book->AuthorName}</td>\n                        </tr>\n                        \n\n                        <tr>\n                            <th>Category : </th>\n                            <td>{$book->Category}</td>\n                        </tr>\n                        \n\n                        <tr>\n                            <th>Price : </th>\n                            <td>{$book->Price}</td>\n                        </tr>\n                        \n\n                        \n                        \n\n                         <tr>\n                            <th>Published Year : </th>\n                            <td>{$book->PublishedYear}</td>\n                        </tr>\n                        \n\n                         <tr>\n                            <th>Edition : </th>\n                            <td>{$book->Edition}</td>\n                        </tr>\n                        \n\n                         <tr>\n                            <th>Availability : </th>\n                            <td>{$book->Availability}</td>\n                        </tr>\n                        \n                    \n                        \n                                         \n                     </table>";
     }
     return $result;
 }
 public function getPagination()
 {
     $request = new Request();
     $bookModel = new BookModel();
     $itemsCount = $bookModel->getBooksCount();
     $itemsPerPage = BOOKS_PER_PAGE;
     $currentPage = $request->get('page') ? (int) $request->get('page') : 1;
     if ($currentPage < 0) {
         throw new Exception('Bad request', 400);
     }
     $pagination = new Pagination($currentPage, $itemsCount, $itemsPerPage);
     $args['pagination'] = $pagination->buttons;
     return $this->render('pagination', $args);
     //Debugger::PrintR($args);
 }
 /**
  * Returns books of e certain genre
  *
  * @param int $genre - the genre of the books
  * @param int $page - the page idx
  * @param int $size - the size of the page
  */
 public function booksByGenre($genre, $page = 0, $size = 10)
 {
     $query = 'SELECT {%columns%} FROM {%table%} as b' . '  LEFT JOIN {%table_book_genre%} as bg ON (b.id = bg.book_id)' . '  {%conditions%} {%orders%} {%limit%}';
     $args = $this->_prepareArgs(BookModel::table(), array('bg.genre_id' => $genre), null, 'name ASC', array($page, $size));
     $args['table_book_genre'] = BookGenreModel::table();
     $args['table_genre'] = GenreModel::table();
     $query = $this->_queryTemplate($query, $args);
     $result = $this->query($query);
     return $this->_assocRows($result);
 }
 public function searchBooks($str, $cat = null, $page = 0, $size = 10)
 {
     $conditions = '(name LIKE "%{%str%}%" OR isbn LIKE "%{%str%}%") {%cond_genre%}';
     $query = 'SELECT {%columns%} FROM {%table%} as b' . '  LEFT JOIN {%table_book_genre%} as bg ON (b.id = bg.book_id)' . '  LEFT JOIN {%table_genre%} as g ON (bg.genre_key = g.id)' . 'WHERE {%conditions%} {%orders%} {%limit%}';
     $args = $this->_prepareArgs(BookModel::table(), null, null, 'name ASC', array($page, $size));
     $args['table_book_genre'] = BookGenreModel::table();
     $args['table_genre'] = GenreModel::table();
     $args['conditions'] = $conditions;
     $args['str'] = $this->_esc($str);
     $args['cond_genre'] = is_null($cat) ? '' : ' AND c.key = "' . $this->_esc($cat) . '" ';
     $query = $this->_queryTemplate($query, $args);
     die($query);
     $result = $this->query($query);
     return $this->_assocRows($result);
 }
예제 #8
0
 /**
  * 打印书籍
  * @method POST_printAction
  * @todo 计价
  * @param  integer          $id [description]
  * @author NewFuture
  */
 public function POST_printAction($id = 0)
 {
     $uid = $this->auth();
     $response['status'] = 0;
     if (!($Book = BookModel::find($id))) {
         $response['info'] = '无效书籍';
     } else {
         $task = ['use_id' => $uid, 'url' => 'book/' . $id];
         $task['pri_id'] = $Book['pri_id'];
         $task['name'] = $Book['name'];
         if ($tid = TaskModel::insert($task)) {
             $Book->inc('count');
             $response['info'] = ['id' => $tid, 'msg' => '保存成功'];
         } else {
             $response['info'] = '保存出错';
         }
     }
     $this->response = $response;
 }
 public function render()
 {
     // Here comes the rendering process
     $htmlContent = "";
     //Main Content
     $bookList = BookModel::findList(null, null);
     //id und class Bezeichnungen der HTML Elementen
     $idContent = "content";
     $classProduct = "product";
     $classImage = "img-preview";
     $classDescription = "description";
     $classDescriptionText = "description-text";
     $label1 = "label1";
     //local configs, path are saved in book db table
     $maxDescriptionCharlenght = 300;
     $imagePath = "/src/theme/images/";
     //translations
     $label_prefix = ": ";
     $lang_title = i("Title") . $label_prefix;
     $lang_author = i("Author") . $label_prefix;
     $lang_description = i("Description") . $label_prefix;
     $lang_price = i("Price") . $label_prefix;
     $lang_available = i("Available") . $label_prefix;
     $lang_pageTitel = i("Home");
     $lang_isbn_nr = i("isbn");
     //detail link
     $detailProductLink = "index.php?view=productdetail";
     $textDetails = i('To the details');
     $products = $bookList;
     // Array aus DB holen und verifizieren
     foreach ($products as $book) {
         //too long text?
         $modDescription = Utilities::cutText($book['description'], $maxDescriptionCharlenght);
         $book['author'] = trim($book['author']);
         $htmlContent .= "\n        <div class=\"{$classProduct}\">\n          <div class=\"col col_3_12\"><img class=\"{$classImage}\" src=\"" . $book['cover'] . "\"  /></div>\n          <div class=\"{$classDescription} col col_9_12\">\n           <p><div class=\"{$label1}\">{$lang_title}</div>{$book['title']}</p>\n           <p><div class=\"{$label1}\">{$lang_author}</div><span data-wiki=\"{$book['author']}\">{$book['author']}</span></p>\n           <div class=\"{$classDescriptionText}\"><div class=\"{$label1}\">{$lang_description}</div>{$modDescription}</div>\n           <p><div class=\"{$label1}\">{$lang_price}</div> {$book['currency']} {$book['price']}</p>\n           <p><div class=\"{$label1}\">{$lang_available}</div>{$book['available']}</p>\n           <a href=\"{$detailProductLink}&id={$book['isbn']}\" class=\"button button-primary clearfix\">{$textDetails}</a>\n          </div>\n        </div>";
     }
     $htmlContentBody = "\n          <h1> {$lang_pageTitel}</h1>\n           {$htmlContent}\n  ";
     return $htmlContentBody;
 }
 public function displayCart()
 {
     $TID = 0;
     if (sizeof($this->items) == 0) {
         return i("Your shopping cart is empty.");
     }
     $table = "";
     //Erstellen des HTML Contents, der von der displayCart() Funktion dann zurückgegeben wird
     $table = "<p>" . i('Your shoppingcart contains') . ": " . sizeof($this->items) . " " . i('product(s)') . "</p>" . "<table id='shoppingTable'>" . "<tr id='tableTopics'>\n\t\t<td>" . i('isbn') . "</td>\n\t\t<td>" . i('Amount') . "</td>\n\t\t<td>" . i('Title') . "</td>\n\t\t<td></td>\n\t\t<td></td>\n\t\t<td>" . i('Price') . "</td>\n\t\t<td></td>";
     /* Die Tabelle zur Anzeige der in den Korb gelegten Items wird aufbereitet. Der Remove Button wird hinter jeden Zeileneintrag mit der entsprechenden Post Variable
      * gesetzt und die + und - Buttons werden angehängt
      * Update 30.12: Anstatt meiner Lösung unten hätte ich besser die +/- Buttons auch schon bei der Generierung mit den Actions belegen sollen.
      */
     foreach ($this->items as $index) {
         $ID2del = $index->ID;
         $list = BookModel::findList(array('isbn' => array($index->ID)), null);
         $title = $list[0]['title'];
         $price = $list[0]['price'];
         $totPrice = $price * $index->amount;
         $table = $table . "<tr id={$TID} onclick=''><td>{$index->ID}</td>\n\t\t\t<td>{$title}</td>\n\t\t\t<td name='amount'>{$index->amount}</td>\n\t \t \t<td>\n\t \t \t<input type='button' id='plusButton' value='+'></input></td>\n\t \t \t<td><input type='button' id='minusButton' value='-'></input></td>\n\t \t \t<td>{$totPrice}</td>\n\t \t \t<td><form action='" . Controller::instance()->getViewUrl('shoppingcart') . "&remove={$ID2del}' method='post'><input type='submit' value='" . i('Remove') . "'></input></form></td>\n\t \t \t</tr>";
         $TID++;
         $this->subTotal += $totPrice;
     }
     /*
      * Totaler Wert des Warenkorbs
      */
     $table = $table . "\n\t\t\t\t<tr>\n\t\t<td></td><td></td><td></td><td></td>\n\t\t<td></td>\n\t\t<td></td>\n\t\t<td></td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td></td><td></td><td></td><td></td>\n\t\t<td>Sub Total:</td>\n\t\t<td>{$this->subTotal}</td>\n\t\t<td></td>\n\t\t</tr>";
     /*
      *
      */
     $table = $table . "</table>\n\t \t\t\t<div class='action-wrapper'><form action='index.php?view=shoppingcart' method='post' class='clear-form'>\n\t \t\t\t<input type='submit' value='" . i('Empty cart') . "' class='button button-primary'></input>\n\t \t\t\t<input type='hidden' name='clearCart'></input></form>";
     //Add Button go to payment
     $table = $table . "\n\t\t\t\t<a href='index.php?view=payment' class='next'>\n                  <input class='button button-primary' type='button' value='" . i('Go to payment') . "'></input>\n                </a></div>\n\t\t\t";
     // Hier den JavascriptCode rein: Erhöhen liest Anzahl aus, zählt eins dazu und reloaded the page mit dem GET Paramter: &update=ID&Amount=NEUER AMOUNT
     $table = $table . "\n\t \t\t\t<script type='text/javascript'>\n\n\t \t\t\tvar theTbl = document.getElementById('shoppingTable');\n\t \t\t\tvar rows = theTbl.rows;\n\n\t\t\t\tconsole.log(rows.length);\n\n\t\t\t\tfor(var i=0;i<rows.length;i++) {\n\n   \t\t\t\t \t\t\tfor(var j=0;j<rows[i].cells.length;j++)\t{\n\t \t\t\t\t\t\tconsole.log('set');\n      \t\t\t  \t\t\t\trows[i].cells[j].onclick = alertInnerHTML;\n\t \t\t\t\t\t\t}\n\t\t\t\t}\n\n\t \t\t\trowIndex = 0;\n\n\t \t\t\tfunction myFunction(x) {\n\t \t\t\trowIndex = x.rowIndex\n\t \t\t\twindow.alert(rowIndex)\n\t\t\t\t}\n\n\n\n\t \t\t\tfunction alertInnerHTML(e) {\n   \t\t\t\t\t e = e || window.event;//IE\n\t \t\t\t\trownumber = this.parentNode.id;\n\t \t\t\t\tcellNumber = this.cellIndex;\n\n\t \t\t\t\tconsole.log('Zeilennummer: '+rownumber + ' Spalte:' +cellNumber);\n\n\t \t\t\t\tif(cellNumber==3) {\n\t \t\t\t\tconsole.log('increase');\n\t \t\t\t\tincrease(rownumber);\n\t \t\t\t\t}\n\n\t \t\t\t\tif(cellNumber==4) {\n\t \t\t\t\tdecrease(rownumber);\n\t \t\t\t\t}\n\n\t \t\t\t\t}\n\n\t \t\t \tfunction increase(rownumber) {\n\t\t\t\trownumber++;\n\t \t\t\tvar table = document.getElementById('shoppingTable');\n\t\t\t\tproductID = table.rows[rownumber].cells[0].innerHTML;\n\t \t\t\twindow.open('index.php?view=shoppingcart&action=mod&id2Change='+productID+'&change=up','_self')\n\n\t \t\t\t}\n\n\t \t\t\tfunction decrease(rownumber) {\n\t\t\t\trownumber++;\n\t \t\t\tvar table = document.getElementById('shoppingTable');\n\t\t\t\tproductID = table.rows[rownumber].cells[0].innerHTML;\n\n\t\t\t\twindow.open('index.php?view=shoppingcart&action=mod&id2Change='+productID+'&change=down','_self')\n\t \t\t\treturn false;\n\t \t\t\t}\n\n\n\n\t \t</script>";
     return $table;
 }
예제 #11
0
파일: badd.php 프로젝트: 10brain/10brain
                         $result = $csv->write(CSV_TEMP);
                         */
     // 完了画面 --------------------------------------------------------------
     if ($decision) {
         $vali = new Validation();
         $Key24 = $io->get_param_html("isbn");
         $Key25 = $io->get_param_html("title");
         $Key26 = $io->get_param_html("genre");
         $Key27 = $io->get_param_html("pub");
         $Key28 = $io->get_param_html("writer");
         $Key29 = $io->get_param_html("into");
         $Key30 = $io->get_param_html("year");
         $Key31 = $io->get_param_html("amazon");
         $Key32 = $io->get_param_html("remarks");
         //データベース更新
         $obj = new BookModel();
         $result = $obj->GETBookAdd($ActType, $Key1, $Key24, $Key25, $Key26, $Key27, $Key28, $Key29, $Key30, $Key31, $Key32);
         if ($result == 0) {
             include HTML_SUCCESS;
         } else {
             $db_error = 'システムエラーです。開発者に連絡してください。';
             include TEMP_INPUT;
         }
     } else {
         //				pg_query($conID, "rollback");
         // 失敗画面
         //処理どうし→登録に失敗
         include HTML_FAILURE;
     }
 } else {
     // リファラ制限画面
예제 #12
0
 /**
  * 获取详情
  * PUT /books/123
  * @method GET_infoAction
  * @param  integer        $id [资源id]
  * @author NewFuture
  */
 public function PUT_infoAction($id = 0)
 {
     $pid = $this->authPrinter();
     $book = [];
     if (Input::put('name', $name, 'title')) {
         $book['name'] = $name;
     }
     if (Input::put('detail', $detail, 'text')) {
         $book['detail'] = $detail;
     }
     if (Input::put('price', $price, 'float')) {
         $book['price'] = $price;
     }
     if (empty($book)) {
         $this->response(0, '无修改内容');
     } elseif (BookModel::where('id', $id)->where('pri_id', $pid)->update($book)) {
         $this->response(1, $book);
     } else {
         $this->response(0, '修改失败');
     }
 }
예제 #13
0
 $Key42 = $_POST['KEYWORD42'];
 //返却日
 $Key43 = $_POST['KEYWORD43'];
 //書籍タイトル
 /*echo $Key0;
   echo $Key1;
   echo $Key2;
   echo $Key3;*/
 echo $Key0;
 echo $Key42;
 if ($result == 0) {
     $obj = new BookModel();
     $result = $obj->GETBorrowAdd($ActType, $Key0, $Key40, $Key42);
     if ($result == 0) {
         //データベース更新
         $obj = new BookModel();
         $result = $obj->GETStock($ActType, $Key0, $Key40);
         if ($result == 0) {
             include 'book_suc.html';
         } else {
             include 'book_fal.html';
         }
     }
 } else {
     if ($_POST["ActionType"] != "TgRSPInf") {
         $error = "";
     } elseif ($result == 1) {
         $error = "入力内容に誤りがあります。再度入力してください。";
     } else {
         $error = "ただいまサーバーが込み合っております。";
     }
예제 #14
0
} elseif (!isPW($_POST["KEYWORD2"], 10, 1)) {
    $result = 1;
} else {
    $ActType = $_POST["ActionType"];
    $Key0 = $_POST["KEYWORD0"];
    //社員番号
    $Key1 = $_POST["KEYWORD1"];
    //ID
    $Key2 = $_POST["KEYWORD2"];
    //パスワード
    $Key3 = $_POST["KEYWORD3"];
    //名前
    $Key40 = $_POST["KEYWORD40"];
    //書籍番号
    //貸出一覧確認
    $obj = new BookModel();
    //入力された情報の確認
    $result = $obj->GETBorrowU($ActType, $Key0, $Key40, $dspBorrowU);
    //画面表示
    if ($result == 0) {
        $return_run = 'return_run.php';
        include "return_confirm.html";
    } else {
        if ($_POST["ActionType"] != "TgRSPInf") {
            $error = "";
        } elseif ($result == 1) {
            $error = "入力内容に誤りがあります。再度入力してください。";
        } else {
            $error = "ただいまサーバーが込み合っております。";
            //include("../login/login.html");
        }
    public function render()
    {
        // Here comes the rendering process
        $js = '

';
        //add Product to session
        //Only if its not yet there
        if (isset($_SESSION['shoppingCart']['id']) && isset($_GET['id'])) {
            if (!in_array($_GET['id'], $_SESSION['shoppingCart']['id'])) {
                $_SESSION['shoppingCart']['id'][] = $_GET['id'];
            }
        }
        //add chosen values to session
        //adress data
        if (isset($_POST['lastname'])) {
            $_SESSION['payment_lastname'] = $_POST['lastname'];
        }
        if (isset($_POST['firstname'])) {
            $_SESSION['payment_firstname'] = $_POST['firstname'];
        }
        if (isset($_POST['street'])) {
            $_SESSION['payment_street'] = $_POST['street'];
        }
        if (isset($_POST['plz'])) {
            $_SESSION['payment_plz'] = $_POST['plz'];
        }
        if (isset($_POST['country'])) {
            $_SESSION['payment_country'] = $_POST['country'];
        }
        //shipping method
        if (isset($_POST['shippingMethod'])) {
            $_SESSION['payment_shippingMethod'] = $_POST['shippingMethod'];
        }
        //payment method
        if (isset($_POST['paymentMethod'])) {
            $_SESSION['payment_paymentMethod'] = $_POST['paymentMethod'];
        }
        //gift box
        if (isset($_POST['giftBox'])) {
            $_SESSION['payment_giftBox'] = $_POST['giftBox'];
        }
        if (isset($_POST['comment'])) {
            $_SESSION['payment_comment'] = $_POST['comment'];
        }
        $htmlList = "";
        //translations
        $title1 = i("Delivery Address");
        $title2 = i("Shipping Method");
        $title3 = i("Payment Method");
        $title4 = i("Gift Box");
        $title5 = i("Order");
        $html = "";
        $html .= $htmlList;
        //input all posted Values
        $inputs = Utilities::hiddenInputsFromPost();
        $html .= '
      <div>
        ' . $inputs . '
      </div>
      ';
        //Use Userdata if logged in
        if (UserHandler::instance()->loggedin()) {
            if (UserHandler::instance()->user()) {
                $firstName = UserHandler::instance()->user()->getValue('first_name');
                $lastName = UserHandler::instance()->user()->getValue('last_name');
                $streetname = UserHandler::instance()->user()->getValue('streetname');
                $zip = UserHandler::instance()->user()->getValue('zip');
                $city = UserHandler::instance()->user()->getValue('city');
                $email = UserHandler::instance()->user()->getValue('email');
            } else {
                $firstName = "";
                $lastName = "";
                $streetname = "";
                $zip = "";
                $city = "";
                $email = "";
            }
            $greeting = i('Hello');
            $loginMask = $greeting . ' ' . $firstName . ' ' . $lastName;
        }
        //a form to submit to myself
        $html .= "<div id='deliveryAddress' class=" . GrootPaymentView::visibility("deliveryAddress") . ">";
        $html .= '
      <div class="hidden"><input name="deliveryAddressStore"></input></div>
      <form action="" method="POST">
      <h1>' . $title1 . '</h1>
        <div class="column1">' . i("first_name") . '</div><div class=""><input class="input1 " value="' . $firstName . '" name="firstname"></input></div>
        <div class="column1">' . i("last_name") . '</div><div class=""><input class="input1" value="' . $lastName . '" name="lastname"></input></div>
        <div class="column1">' . i("streetname") . '</div><div class=""><input class="input1" value="' . $streetname . '" name="street"></input></div>
        <div class="column1">' . i("zip") . '</div><div class=""><input class="input1" value="' . $zip . '" name="plz"></input></div>
        <div class="column1">' . i("city") . '</div><div class=""><input class="input1" value="' . $city . '" name="country"></input></div><br />
        <input type="reset" class="button button-primary" value="' . i("Reset") . '"><input type="submit" class="button button-primary" value="' . i("Confirm") . '"/>
        <input class="input1" type="hidden" name="poster" value="deliveryAddress"></input>
      </form>';
        $html .= '</div>';
        //a form to submit to myself
        $html .= "<div id='shippingMethod' class=" . GrootPaymentView::visibility("shippingMethod") . ">";
        $html .= '
      <div class="hidden"><input name="shippingMethodStore"></input></div>
      <form action="" method="POST">
      <h1>' . $title2 . '</h1><br />
        <div class="column2">' . i("Home delivery") . '</div><div class="column2"><input type="radio" name="shippingMethod" value="Home delivery" checked></input></div>
        <div class="column2" >' . i("Nearest store") . '</div><div class="column2"><input type="radio" name="shippingMethod" value="Nearest Store"></input></div>
        <div class="column2">' . i("Other") . '</div><div class="column2"><input type="radio" name="shippingMethod" value="Other"></input></div>
        <div class="bottomButton"><input type="reset" class="button button-primary" value="' . i("Reset") . '"><input  type="submit" class="button button-primary" value="' . i("Confirm") . '"/></div>
        <input class="input1" type="hidden" name="poster" value="shippingMethod"></input>
      </form>';
        $html .= '</div>';
        //a form to submit to myself
        $html .= "<div id='paymentMethod' class=" . GrootPaymentView::visibility("paymentMethod") . ">";
        $html .= '
      <div class="hidden"><input name="paymentMethodStore"></input></div>
      <form action="" method="POST">
      <h1>' . $title3 . '</h1><br />
        <div class="column2">' . i("Visa") . '</div><div class="column2"><input type="radio" name="paymentMethod" value="Visa" checked></input></div>
        <div class="column2">' . i("Postfinance") . '</div><div class="column2"><input type="radio" name="paymentMethod" value="Postfinance"></input></div>
        <div class="column2">' . i("Maestro") . '</div><div class="column2"><input type="radio" name="paymentMethod" value="Maestro"></input></div>
        <div class="column2">' . i("Check") . '</div><div class="column2"><input type="radio" name="paymentMethod" value="Check"></input></div>
        <div class="column2">' . i("PayPal") . '</div><div class="column2"><input type="radio" name="paymentMethod" value="PayPal"></input></div>
        <div class="column2">' . i("Other") . '</div><div class="column2"><input type="radio" name="paymentMethod" value="Other"></input></div>
        <div class="bottomButton"><input type="reset" class="button button-primary" value="' . i("Reset") . '"><input  type="submit" class="button button-primary" value="' . i("Confirm") . '"/></div>
        <input class="input1" type="hidden" name="poster" value="paymentMethod"></input>
      </form>';
        $html .= '</div>';
        //a form to submit to myself
        //onclick JS funktion
        $html .= "<div id='giftBox' class=" . GrootPaymentView::visibility("giftBox") . ">";
        $html .= '
      <div class="hidden"><input name="giftBox"></input></div>
      <form action="" method="POST">
      <h1>' . $title4 . '</h1><br />
        <h3>' . i("Is it a gift?") . '</h3>
        <div class="column2">' . i("No") . '</div><div class="column2"><input type="radio" name="giftBox" value="No" checked></input></div>
        <div class="column2">' . i("Yes") . '</div><div class="column2"><input type="radio" name="giftBox" value="Yes"></input></div>
        <div class="column2">' . i("Bemerkung") . ':</div><div class="column2"><textarea name="comment" rows="10" cols="80"></textarea></div>
        <div class="bottomButton"><input id="realSubmitButton"  type="submit" class="button button-primary hidden" value="' . i("Confirm") . '"/><input type="reset" class="button button-primary" value="' . i("Reset") . '"><input id="fakeSubmitButton" type="button" onclick="orderConfirmation()" class="button button-primary" value="' . i("Confirm") . '"/></div>
        <input class="input1" type="hidden" name="poster" value="giftBox"></input>
      </form>';
        $html .= '</div>';
        //a form to submit to myself
        $html .= "<div id='orderComplete' class=" . GrootPaymentView::visibility("orderComplete") . ">";
        $html .= '
      <div class="hidden"><input name="orderComplete"></input></div>
      <h1>' . $title5 . '</h1><br />
        <h3>' . i("thx_for_order_msg") . '</h3>
          ' . i("email_send_msg") . ' ' . $email . ' <br>

          <a href="index.php?view=home">
                  <input class="button button-primary" type="button" value="' . i('back_to_main') . '"></input>
                </a>

        ';
        //if the order is completed and accepted, send an email to the user email with the previous saved content
        if (GrootPaymentView::visibility("orderComplete") != "hidden") {
            $email_adress = $email;
            //"*****@*****.**";
            $email_title = i("Order from Groot Shop");
            $emailContent = "";
            $emailContent .= "" . i("Order from Groot Shop") . " \n";
            $emailContent .= i("order_confirmation_msg") . " \n";
            $emailContent .= " \n";
            $emailContent .= $title1 . " \n";
            $emailContent .= "--------------------------------\n";
            $emailContent .= i('first_name') . ":  " . $_SESSION['payment_firstname'] . " \n";
            $emailContent .= i('last_name') . ":  " . $_SESSION['payment_lastname'] . " \n";
            $emailContent .= i('streetname') . ":  " . $_SESSION['payment_street'] . " \n";
            $emailContent .= i('zip') . ":  " . $_SESSION['payment_plz'] . " \n";
            $emailContent .= i('city') . ":  " . $_SESSION['payment_country'] . " \n";
            $emailContent .= " \n";
            $emailContent .= $title2 . ": " . i($_SESSION['payment_shippingMethod']) . " \n";
            $emailContent .= $title3 . ": " . i($_SESSION['payment_paymentMethod']) . " \n";
            $emailContent .= $title4 . ": " . i($_SESSION['payment_giftBox']) . " \n";
            $emailContent .= i('Note') . ":  " . $_SESSION['payment_comment'] . " \n";
            $emailContent .= "--------------------------------\n";
            $emailContent .= " \n";
            $emailContent .= $title5 . " \n";
            //shoppingcart content
            $myArray = json_decode($_COOKIE["shoppingCart"]);
            $myCart = new ShoppingCart($myArray);
            $cart = $myCart->getCart();
            foreach ($cart as $cartIsbn => $cartAmount) {
                $list = BookModel::findList(array('isbn' => array($cartIsbn)), null);
                $title = $list[0]['title'];
                $emailContent .= i('title') . " " . $title . "  " . i('isbn') . ":  " . $cartIsbn . "  " . $cartAmount . "x \n";
            }
            $emailContent .= "--------------------------------\n";
            $emailContent .= " \n";
            $emailContent .= " \n";
            $emailContent .= i("greetings_from_groot_team_msg") . " \n";
            $email_message = $emailContent;
            //TSCM Bitte beim Testen auskommentiert, weil es jedes mal wieder eine Email an mich versantd hat
            mail($email_adress, $email_title, $email_message);
        }
        $html .= '</div>';
        //show post values
        $postedValues = "";
        foreach ($_POST as $key => $value) {
            $postedValues .= "key = {$key} und value = {$value} </br>";
        }
        return $html;
    }
 /**
 * Create a Book in our mysql DB works with form and $_Post
 * @author TSCM
 */
 public function createBook()
 {
     if (isset($_POST['createBook'])) {
         unset($_POST['createBook']);
         //delete the content of the createBook button
         BookModel::create($_POST);
         //create book
     }
 }
예제 #17
0
 $Key1 = $_POST["KEYWORD1"];
 //ID
 $Key2 = $_POST["KEYWORD2"];
 //パスワード
 $Key40 = $_POST["KEYWORD40"];
 //貸出番号
 $Key20 = $_POST["KEYWORD20"];
 //書籍番号
 $Key3 = $_POST["KEYWORD3"];
 //名前
 $obj = new BookModel();
 //borrow返却処理
 $result = $obj->GETReturnU($ActType, $Key0, $Key40);
 if ($result == 0) {
     //borrowへの処理が成功したら
     $obj = new BookModel();
     $result = $obj->GETStockAdd($ActType, $Key20);
 }
 //画面表示
 if ($result == 0) {
     include "return_suc.html";
 } else {
     if ($_POST["ActionType"] != "TgRSPInf") {
         $error = "";
     } elseif ($result == 1) {
         $error = "入力内容に誤りがあります。再度入力してください。";
     } elseif ($result == 5) {
         $error = "返却できませんでした。再度確認してください";
         include 'return_input.html';
     } else {
         $error = "ただいまサーバーが込み合っております。";
예제 #18
0
 public function __construct($bDAL)
 {
     self::$bookDAL = $bDAL;
 }
예제 #19
0
파일: badd.php 프로젝트: 10brain/10brain
 $Key30 = $io->get_param_html("year");
 $Key31 = $io->get_param_html("amazon");
 $Key32 = $io->get_param_html("remarks");
 //データベース更新
 $obj = new BookModel();
 $result = $obj->GETBookAdd($ActType, $Key1, $Key24, $Key25, $Key26, $Key27, $Key28, $Key29, $Key30, $Key31, $Key32);
 if ($result == 0) {
     //coverテーブルに同じISBNが登録されているか確認する
     $obj = new BookModel();
     $result = $obj->GETCoverIsbn($ActType, $Key0, $Key24);
     if ($result == 0) {
         //登録されていればすでに登録されています。表紙を変更する場合は編集がめんいってね
         include HTML_SUCCESS_2;
     } elseif ($result == 1) {
         //登録されていなければISBN登録し、選択画面へ
         $obj = new BookModel();
         $result = $obj->GETCoverIsbnAdd($ActType, $Key24, $dspCoverIsbn);
         if ($result == 0) {
             //ISBN登録完了すればsuc画面へ移動し、画像登録へ
             include HTML_SUCCESS;
         } else {
             include HTML_FAILURE;
         }
     } else {
         $db_error = 'システムエラーです。開発者に連絡してください。';
         include TEMP_INPUT;
     }
 } else {
     $db_error = 'システムエラーです。開発者に連絡してください。';
     include TEMP_INPUT;
 }
예제 #20
0
파일: badd.php 프로젝트: 10brain/10brain
         $obj = new BookModel();
         $result = $obj->GETCoverIsbn($ActType, $Key24, $dspCoverIsbn);
         $Key22 = '/admin/book_add/tmp_cover/' . $dspCoverIsbn[1];
         if ($result == 0) {
             //登録されていればすでに登録されています。表紙を変更する場合は編集がめんいってね
             $obj = new BookModel();
             $result = $obj->GETNewBooknum($ActType, $dspNewBooknum);
             if ($result == 0) {
                 include HTML_SUCCESS_2;
             }
         } elseif ($result == 1) {
             //登録されていなければISBN登録し、選択画面へ
             $obj = new BookModel();
             $result = $obj->GETCoverIsbnAdd($ActType, $Key24);
             if ($result == 0) {
                 $obj = new BookModel();
                 $result = $obj->GETNewBooknum($ActType, $dspNewBooknum);
                 //ISBN登録完了すればsuc画面へ移動し、画像登録へ
                 include HTML_SUCCESS;
             } else {
                 include HTML_FAILURE;
             }
         } else {
             $db_error = 'システムエラーです。開発者に連絡してください。';
             include TEMP_INPUT;
         }
     } else {
         $db_error = 'システムエラーです。ページを更新して再入力するか開発者に連絡してください。';
         include TEMP_INPUT;
     }
 } else {
예제 #21
0
<?php

/**
 * Created by PhpStorm.
 * User: gdimitrov
 * Date: 30.9.2015 г.
 * Time: 12:54 ч.
 */
include '../DB/mySQL.php';
include '../Model/Author.php';
include '../Model/BookModel.php';
$aut = new Author();
$authors = $aut->selectAllAuthors();
if ($_POST) {
    $bookAuthors = $_POST['authors'];
    $bookName = $_POST['bookName'];
    $book = new BookModel();
    $book->insertBook($bookName, $bookAuthors);
    header('Location: ../View/allBooks.php');
}
예제 #22
0
<?php

include_once "testdb.php";
include_once "models/book_model.php";
$bookModel = new BookModel();
if (session_status() == PHP_SESSION_NONE) {
    session_start();
}
$serror = '';
if (isset($_POST['search'])) {
    if (!empty($_POST['tosearch'])) {
        $item = $_POST['tosearch'];
        //echo $item;
        // To protect MySQL injection for Security purpose
        $item = stripslashes($item);
        $item = mysql_real_escape_string($item);
        //$query = "SELECT * FROM book WHERE title LIKE '%$item%'";
        //echo $query;
        //$result = mysql_query($query);
        $book_array = array();
        $book_array = $bookModel->searchBook($item);
        if ($book_array) {
            $_SESSION['searched_item'] = $item;
            header("location: book_page.php");
        } else {
            if (isset($_SESSION['searched_item'])) {
                unset($_SESSION['searched_item']);
            }
            $serror = "No books found";
            header("location: book_page.php");
        }
예제 #23
0
파일: top.php 프로젝트: 10brain/10brain
$ActType = "";
$Key1 = "";
$Key2 = "";
//IDとパスワードチェック
if (!isID($_POST["KEYWORD1"], 40, 1)) {
    $result = 1;
} elseif (!isPW($_POST["KEYWORD2"], 10, 1)) {
    $result = 1;
} else {
    $ActType = $_POST["ActionType"];
    $Key1 = $_POST["KEYWORD1"];
    //ID
    $Key2 = $_POST["KEYWORD2"];
    //パスワード
    //DB問い合わせ
    $obj = new BookModel();
    $result = $obj->GETTopLogin($ActType, $Key1, $Key2, $dspUserInfo, $dspBookNewList);
    $Key3 = $dspUserInfo[1];
    $Key0 = $dspUserInfo[0];
}
//画面表示
if ($result == 0) {
    //管理者か一般ユーザーか判定
    if ($dspUserInfo[1] == '管理者') {
        include "../admin/top/top.html";
        /**メンテ用
                $ActType = null;
                $Key1 = null;  //ID
                $Key2 = null;  //パスワード
        
                include("../login/ment.html");
 public function render()
 {
     // Here comes the rendering process
     $htmlContent = "";
     //Main Content
     //id und class Bezeichnungen der HTML Elementen
     $idContent = "content";
     $classProduct = "product-detail";
     $classImage = "img-preview-detail";
     $classDescription = "description";
     $classDescriptionText = "description-text-detail";
     $label1 = "label1";
     //local config
     $maxDescriptionCharlenght = 20000;
     $imagePath = "/src/theme/images/";
     $lang_pageTitel = i("Productview");
     $button1 = i("Buy");
     //Product array
     $products = array();
     //get the product list
     $products = BookModel::findList(null, null);
     //save id
     if (isset($_GET['id'])) {
         $_SESSION['productdetail_id_selected'] = $_GET['id'];
     }
     //create an arraylist
     foreach ($products as $book) {
         if ($_SESSION['productdetail_id_selected'] != $book['isbn']) {
             continue;
         }
         $paragraph = Utilities::buildParagraph($book);
         //too long text?
         if (strlen($book['description']) > $maxDescriptionCharlenght) {
             $book['description'] = substr($book['description'], 0, $maxDescriptionCharlenght);
             $book['description'] = $book['description'] . "...";
         } else {
             //not too long, display it all
             $modDescription = $book['description'];
         }
         /*
          * schwf5: Element in Warenkorb legen
          */
         $note = "";
         $found = false;
         //Auslesen der BuchID
         if (isset($_GET["id"])) {
             $currentID = $_GET["id"];
         } else {
             $currentID = 0;
         }
         //Prüfen ob Seite mit added action geladen wurde (d.h. dass Buch in Korb gelegt wurde)
         if (isset($_GET["action"]) && $_GET["action"] == "added") {
             $amount = $_POST["amountSelection"];
             //Seite wurde neu geladen. Prüfen, ob bereits ein Warenkorb existiert
             //Korb existiert schon. Items also in den Warenkorb hinzufügen
             if (isset($_COOKIE["shoppingCart"])) {
                 //Prüfen, ob dieser Artikel schon hinzugefügt wurde. Wenn ja, den Amount hinzutun
                 $cartArray = json_decode($_COOKIE["shoppingCart"]);
                 foreach ($cartArray as $index) {
                     if ($index->ID == $currentID) {
                         $note = "Buch war schon im Korb - Anzahl aktualisiert";
                         $index->amount += $amount;
                         setcookie("shoppingCart", json_encode($cartArray));
                         $found = true;
                     }
                 }
                 if (!$found) {
                     array_push($cartArray, array("ID" => $currentID, "amount" => $amount));
                     setcookie("shoppingCart", json_encode($cartArray));
                 }
             } else {
                 $cartArray = array(array("ID" => $currentID, "amount" => $amount));
                 setcookie("shoppingCart", json_encode($cartArray));
             }
             //
         } else {
         }
         $htmlContent .= "\n        <div class=\"{$classProduct}\">\n        <div class=\"{$classImage}\"><img  src=\"" . $book['cover'] . "\"  />\n          </div>\n          <div class=\"{$classDescription}\">\n\n           {$paragraph}\n\n              <div>\n                  <br>" . i('Amount') . ":\n                  <form action='index.php?view=productdetail&id={$currentID}&action=added' method='post'>\n                  <select name='amountSelection' class='input-border'>\n\n  \t\t\t\t\t <option value='1'>1</option>\n \t\t\t\t\t <option value='2'>2</option>\n \t\t\t\t\t <option value='3'>3</option>\n \t\t\t\t\t <option value='4'>4</option>\n \t\t\t\t\t <option value='5'>5</option>\n\n\t\t\t\t\t</select>\n\t\t\t\t\t<input class='button button-primary' type='submit' name='submit' value='" . i('Add to cart') . "' />\n\t\t\t\t\t</form>\n\n\n\n              </div>\n\n           </div>\n        </div>";
     }
     //textmessage, after a product was placed in shoppingcart
     if (isset($_GET["action"])) {
         $buyState = "Produkt wurde in den Warenkorb gelegt.<br>";
     } else {
         $buyState = "";
     }
     //display page
     $htmlContentBody = "\n\t\t<div id=\"content\">\n        <span style='color:red'>{$buyState}</span>\n \t\t{$note}\n          <h1>" . $lang_pageTitel . "</h1>\n           {$htmlContent}\n        </div>\n\n";
     return $htmlContentBody;
 }
예제 #25
0
 $ActType = $_POST["ActionType"];
 $Key0 = $_POST["KEYWORD0"];
 //社員番号
 $Key1 = $_POST["KEYWORD1"];
 //ID
 $Key2 = $_POST["KEYWORD2"];
 //パスワード
 $Key3 = $_POST["KEYWORD3"];
 //名前
 $Key40 = $_POST['KEYWORD40'];
 //書籍番号
 /*echo $Key0;
   echo $Key1;
   echo $Key2;
   echo $Key3;*/
 $obj = new BookModel();
 $result = $obj->GETBorrowSearch($Key40, $dspBorrowS);
 if ($result == 0) {
     //echo $result;
     $borrow_bN = $dspBorrowS[0];
     $borrow_ti = $dspBorrowS[1];
     $borrow_st = $dspBorrowS[3];
     $cover = $dspBorrowS[6];
     if (!is_null($cover)) {
         $cover = '/admin/book_add/tmp_cover/' . $cover;
     } else {
         $cover = '/admin/book_add/tmp_cover/noimage.png';
     }
     if ($borrow_st == 1) {
         $borrow_conf = 'borrow_conf.php';
         include "borrow_day_input.html";
예제 #26
0
 } else {
     if ($io->get_param("step_from") == "agree") {
         // 入力画面 ================================================================
         if (CHECK_REFERER == "" or $_SERVER["HTTP_REFERER"] == URL_ACTION) {
             include TEMP_INPUT;
         } else {
             // リファラ制限画面
             include TEMP_BLOCK;
         }
     } else {
         // 同意画面 ================================================================
         if (CHECK_REFERER == "" or strpos($_SERVER["HTTP_REFERER"], CHECK_REFERER) !== false) {
             // GETパラメータ(sp)を取得
             $io->set_parameters($_GET);
             if (isset($Key21)) {
                 $obj = new BookModel();
                 $result = $obj->GETBookDetail($ActType, $Key20, $Key21, $dspBookDet);
                 $Key20 = $dspBookDet[10];
                 //書籍番号
                 $Key21 = $dspBookDet[8];
                 //isbn
                 $Key22 = $dspBookDet[0];
                 //タイトル
                 $Key23 = $dspBookDet[1];
                 //ジャンル
                 $Key24 = $dspBookDet[2];
                 //出版社
                 $Key25 = $dspBookDet[3];
                 //著者
                 $Key26 = $dspBookDet[4];
                 //紹介文
    BookModel::create(array('name' => "Die Schriften von Accra", 'isbn' => "3257242824", 'cover' => "theme/images/books/3257242824.jpg", 'title' => "Die Schriften von Accra", 'author' => "Paulo Coelho", 'year_of_publication' => 2014, 'price' => 15.0, 'currency' => "CHF", 'available' => "Sofort", 'language' => "DE", 'description' => "Was bleibt, wenn alles verloren scheint?\n14. Juli 1099. Vor den Toren Jerusalems steht das feindliche Heer der Kreuzritter. Im Morgengrauen werden sie angreifen. Es ist wohl die letzte Nacht, die Muslime, Juden und Christen friedlich in der Heiligen Stadt verbringen werden. Die meisten schärfen ihre Waffen. Doch da sind noch ein paar Männer und Frauen jeden Alters, die sich um einen geheimnisvollen Fremden scharen – den Kopten. Sie glauben, er werde sie auf den Kampf vorbereiten, aber da täuschen sie sich.\nEinst fortgegangen aus seiner Heimat Griechenland, um die Welt zu erobern, hat der geheimnisvolle Fremde in Jerusalem einen Schatz gefunden, den ihm keiner mehr nehmen kann: Erkenntnisse über die wesentlichen Dinge im menschlichen Leben, über unsere Werte und Ziele, unsere Träume, die wir nicht aufschieben dürfen, über die Schwierigkeiten, die wir überwinden müssen und die uns nur stärker machen; Antworten auf existentielle Fragen, die uns auch heute noch beschäftigen.", 'original_language' => "DE", 'number_of_pages' => 214, 'version' => 1, 'type' => "Heft", 'genre' => "Roman"));
    BookModel::create(array('name' => "A Lucky Luke Adventure - Dalton City", 'isbn' => "1905460139", 'cover' => "theme/images/books/1905460139.jpg", 'title' => "A Lucky Luke Adventure - Dalton City", 'author' => "Goscinny", 'year_of_publication' => 2007, 'price' => 10.0, 'currency' => "CHF", 'available' => "Sofort", 'language' => "EN", 'description' => "In this new volume, Lucky Luke has to clean out a whole city: Fenton Town, so named because it has been taken over by Dean Fenton, a desperado of the worst sort... Fenton Town has become the most depraved city in all of Texas. Lucky Luke makes a short visit to town—just the time needed to put Fenton in prison and chase out the remaining rabble.", 'original_language' => "EN", 'number_of_pages' => 42, 'version' => 1, 'type' => "Taschenbuch", 'genre' => "Comic"));
    BookModel::create(array('name' => "On my way to Samarkand: memoirs of a travelling writer", 'isbn' => "1480208299", 'cover' => "theme/images/books/1480208299.jpg", 'title' => "On my way to Samarkand: memoirs of a travelling writer", 'author' => "Garry Douglas Kilworth", 'year_of_publication' => 2012, 'price' => 12.0, 'currency' => "CHF", 'available' => "Sofort", 'language' => "EN", 'description' => "Garry (Douglas) Kilworth is a varied and prolific writer who has travelled widely since childhood, living in a number of countries, especially in the Far East. His books include science fiction and fantasy, historical novels, literary novels, short story collections, children's books and film novelisations. This autobiography contains anecdotes about his farm worker antecedents and his rovings around the globe, as well as his experiences in the middle list of many publishing houses. The style is chatty, the structure loose - pole vaulting time and space on occasion - and the whole saga is an entertaining ramble through a 1950s childhood, foreign climes and the genre corridors of the literary world.", 'original_language' => "EN", 'number_of_pages' => 324, 'version' => 1, 'type' => "Audio-Buch", 'genre' => "Reisen"));
    BookModel::create(array('name' => "National Geographic Student World Atlas Fourth Edition", 'isbn' => "1426317751", 'cover' => "theme/images/books/1426317751.jpg", 'title' => "National Geographic Student World Atlas Fourth Edition", 'author' => "National Geographic", 'year_of_publication' => 2014, 'price' => 9.0, 'currency' => "CHF", 'available' => "Sofort", 'language' => "EN", 'description' => "The new fourth edition of National Geographic's award-winning Student Atlas of the World is more fascinating and fact-filled than ever, and has gone INTERACTIVE with new digital extras, including scannable pages that link to photo galleries and quizzes. Dynamic, user-friendly content includes photos, facts, charts, graphics, and full-color political, physical, and thematic maps on important topics. From the cartographic experts at National Geographic comes the latest edition of its award-winning student atlas, with everything kids want and need to know about our changing world!", 'original_language' => "EN", 'number_of_pages' => 144, 'version' => 4, 'type' => "Taschenbuch", 'genre' => "Geografie"));
    BookModel::create(array('name' => "Omas Kochkniffkladde: Die 500 pfiffigsten Kochtipps", 'isbn' => "3939722847", 'cover' => "theme/images/books/3939722847.jpg", 'title' => "Omas Kochkniffkladde: Die 500 pfiffigsten Kochtipps", 'author' => "Regionalia Verlag", 'year_of_publication' => 2014, 'price' => 13.0, 'currency' => "CHF", 'available' => "Sofort", 'language' => "DE", 'description' => "Keine Beschreibung vorhanden.", 'original_language' => "DE", 'number_of_pages' => 128, 'version' => 2, 'type' => "E-Book", 'genre' => "Kochen"));
    BookModel::create(array('name' => "Show Me How: 500 Things You Should Know -\nInstructions for Life from the Everyday to the Exotic", 'isbn' => "0061662577", 'cover' => "theme/images/books/0061662577.jpg", 'title' => "Show Me How: 500 Things You Should Know -\nInstructions for Life from the Everyday to the Exotic", 'author' => "Lauren Smith, Derek Fagerstrom", 'year_of_publication' => 2008, 'price' => 12.0, 'currency' => "CHF", 'available' => "Sofort", 'language' => "EN", 'description' => "Keine Beschreibung vorhanden.", 'original_language' => "EN", 'number_of_pages' => 320, 'version' => 4, 'type' => "Heft", 'genre' => "Fachliteratur"));
    BookModel::create(array('name' => "Vegetarisch! Das Goldene von GU: Rezepte zum Glänzen und Genießen", 'isbn' => "3833822015", 'cover' => "theme/images/books/3833822015.jpg", 'title' => "Vegetarisch! Das Goldene von GU: Rezepte zum Glänzen und Genießen", 'author' => "Alessandra Redies", 'year_of_publication' => 2011, 'price' => 22.0, 'currency' => "CHF", 'available' => "Sofort", 'language' => "DE", 'description' => "Keine Beschreibung vorhanden.", 'original_language' => "DE", 'number_of_pages' => 600, 'version' => 1, 'type' => "Hardcover", 'genre' => "Kochen"));
    BookModel::create(array('name' => "Im Tal des Fuchses", 'isbn' => "3442382599", 'cover' => "theme/images/books/3442382599.jpg", 'title' => "Im Tal des Fuchses", 'author' => "Charlotte Link", 'year_of_publication' => 2013, 'price' => 9.949999999999999, 'currency' => "CHF", 'available' => "Sofort", 'language' => "DE", 'description' => "Was, wenn dein Entführer spurlos verschwindet und niemand weiß, wo du bist?\n\n\nEin sonniger Augusttag, ein einsam gelegener Parkplatz zwischen Wiesen und Feldern. Vanessa Willard wartet auf ihren Mann, der noch eine Runde mit dem Hund dreht. In Gedanken versunken bemerkt sie nicht das Auto, das sich nähert. Als sie ein unheimliches Gefühl beschleicht, ist es schon zu spät: Ein Fremder taucht auf, überwältigt, betäubt und verschleppt sie. In eine Kiste gesperrt, wird sie in einer Höhle versteckt, ausgestattet mit Wasser und Nahrung für eine Woche. Doch noch ehe der Täter seine Lösegeldforderung an ihren Mann stellen kann, wird er wegen eines anderen Deliktes verhaftet. Und überlässt Vanessa ihrem Schicksal …", 'original_language' => "DE", 'number_of_pages' => 567, 'version' => 3, 'type' => "Heft", 'genre' => "Krimi"));
    BookModel::create(array('name' => "Die Eule mit der Beule", 'isbn' => "3789167061", 'cover' => "theme/images/books/3789167061.jpg", 'title' => "Die Eule mit der Beule", 'author' => "Susanne Weber", 'year_of_publication' => 2013, 'price' => 5.95, 'currency' => "CHF", 'available' => "Sofort", 'language' => "DE", 'description' => "Arme kleine Eule! Ein wunderbares Trostbuch.\nDie kleine Eule hat eine Beule. Der Fuchs pustet, die Maus bringt ein Pflaster und die Schlange streichelt ihr die Wange. Doch was hilft am besten? Natürlich ein Kuss von der Mama! Ein absolutes Lieblingsbuch für kleine Kinder mit der süßesten Eule der Welt. Einfach zum Liebhaben und Mitfühlen! Klare Bilder und einfache Reime zum Mitsprechen sorgen für viel Spaß beim Lesen.", 'original_language' => "DE", 'number_of_pages' => 132, 'version' => 1, 'type' => "Taschenbuch", 'genre' => "Kinderbuch"));
    BookModel::create(array('name' => "Der Drachenflüsterer", 'isbn' => "3570400026", 'cover' => "theme/images/books/3570400026.jpg", 'title' => "Der Drachenflüsterer", 'author' => "Boris Koch", 'year_of_publication' => 2010, 'price' => 7.95, 'currency' => "CHF", 'available' => "Sofort", 'language' => "DE", 'description' => "Märchenhaft und abenteuerlich\n\n\nDer „Drachenflüsterer“ erzählt packend und humorvoll von Freundschaft, erster Liebe und unfreiwilligem Heldentum. Eine großartige Mischung aus Buddy Movie, Huckleberry Finn und klassischer Fantasy!\n\n\nDer fünfzehnjährige Ben ist ein Waisenkind und lebt im langweiligsten Dorf der Welt. Noch weiß er es nicht, doch er verfügt über eine besondere Gabe: Er ist ein Drachenflüsterer. Als er mit den falschen Leuten Ärger bekommt, lässt er alles hinter sich und erringt die Freundschaft eines Großen Drachens. Nur warum muss es ausgerechnet ein Drache mit psychischen Problemen sein …?\n\n\nAll-Age-Fantasy für alle Fans von Cornelia Funke, Kai Meyer, Philip Pullman und Jonathan Stroud", 'original_language' => "DE", 'number_of_pages' => 354, 'version' => 3, 'type' => "Taschenbuch", 'genre' => "Fantasy"));
    BookModel::create(array('name' => "Honigtod", 'isbn' => "1495319792", 'cover' => "theme/images/books/1495319792.jpg", 'title' => "Honigtod", 'author' => "Hanni Münzer", 'year_of_publication' => 2014, 'price' => 3.99, 'currency' => "CHF", 'available' => "Sofort", 'language' => "DE", 'description' => "Als sich die junge Amerikanerin Felicity 2012 auf die Suche nach ihrer Mutter macht, stößt sie in Rom auf die Spuren ihrer eigenen Familienvergangenheit - und auf ein quälendes Geheimnis aus der dunkelsten Zeit unserer Geschichte.\nUngewollt tritt Felicity eine Reise in die Vergangenheit an und erfährt die Geschichte ihrer Urgroßmutter Elisabeth und deren Tochter Deborah.\nEin Netz aus schicksalhafter Liebe, Schuld und Sühne zerstörte das Leben der beiden Frauen und warf über Generationen einen Schatten auf Felicitys eigenes Leben.\n\n„HONIGTOT“ ist eine Geschichte über Liebe und Obsession, Schuld und Sühne, Verrat und Rache ... bis zum bittersüßen Ende. ", 'original_language' => "DE", 'number_of_pages' => 406, 'version' => 1, 'type' => "E-Book", 'genre' => "Roman"));
    BookModel::create(array('name' => "Guardians of the Galaxy: Bd. 1 Originalstories:\nGuardians of the Galaxy 0.1-3, Guardians of the Galaxy:\nTomorrow's Avengers 1", 'isbn' => "3862018822", 'cover' => "theme/images/books/3862018822.jpg", 'title' => "Guardians of the Galaxy: Bd. 1 Originalstories:\nGuardians of the Galaxy 0.1-3, Guardians of the Galaxy:\nTomorrow's Avengers 1", 'author' => "Steve McNiven ,Sara Pichelli ", 'year_of_publication' => 2014, 'price' => 9.99, 'currency' => "CHF", 'available' => "Sofort", 'language' => "EN", 'description' => "Guardians of the Galaxy, Better than ever. There has never been a Guardians of the Galaxy Guide like this. <p><p>It contains 74 answers, much more than you can imagine; comprehensive answers and extensive details and references, with insights that have never before been offered in print. Get the information you need--fast! This all-embracing guide offers a thorough view of key knowledge and detailed insight. This Guide introduces what you want to know about Guardians of the Galaxy. <p><p>A quick look inside of some of the subjects covered: Guardians of the Galaxy (2008 team) - War of Kings, Cloak of Levitation - Guardians of the Galaxy, Guardians of the Galaxy (soundtrack)", 'original_language' => "EN", 'number_of_pages' => 115, 'version' => 1, 'type' => "E-Book", 'genre' => "Comic"));
    BookModel::create(array('name' => "400 Reisen, die Sie nie vergessen werden", 'isbn' => "3866902409", 'cover' => "theme/images/books/3866902409.jpg", 'title' => "400 Reisen, die Sie nie vergessen werden", 'author' => "Keith Bellows", 'year_of_publication' => 2011, 'price' => 21.99, 'currency' => "CHF", 'available' => "Sofort", 'language' => "EN", 'description' => "Goethe beschrieb es als beste Bildung überhaupt, Tucholsky als Sehnsucht nach leben. Reisen und die Lust darauf treiben uns seit Jahrtausenden an. Goethe beschrieb es als beste Bildung überhaupt, Tucholsky als Sehnsucht nach leben. Reisen und die Lust darauf treiben uns seit Jahrtausenden an. NATIONAL GEOGRAPHIC hat die schönsten Fernweh-Ziele in einem Bildband gesammelt - in aktualisierter Auflage, im Softcover zum Nachschlagen und Planen, wohin die nächste Reise geht: von den Bergen Kasachstans bis zum Baikalsee, von den Hochanden bis in den Regenwald; durchs Australische Outback oder die Amalfiküste entlang. Je nach Geschmack, Typ und Geldbeutel nimmt der Bildband den Leser mit, entweder zu Fuß, per Schiff, im luxuszug oder per Pferdekarren ... ein unterhaltsames Kompendium für Abenteurer, Genießer, Kulturfreunde und Globetrotter. 400 Traumreisen, getestet und für unbedingt nachahmenswert befunden. Übersichtskarten, verführerische Fotos, Top-10-Listen und viele nützliche Infos sorgen dafür, dass unterwegs durch die Welt auch nichts schiefgeht. Was fehlt? Kofferpacken müssen Sie allein.", 'original_language' => "EN", 'number_of_pages' => 84, 'version' => 1, 'type' => "Audio-Buch", 'genre' => "Reisen"));
    BookModel::create(array('name' => "Geografie - Brandenburg Grundschule: 5./6. Schuljahr - Arbeitsheft", 'isbn' => "3060646163", 'cover' => "theme/images/books/3060646163.jpg", 'title' => "Geografie - Brandenburg Grundschule: 5./6. Schuljahr - Arbeitsheft", 'author' => "Silke Schulze", 'year_of_publication' => 2004, 'price' => 7.85, 'currency' => "CHF", 'available' => "Sofort", 'language' => "DE", 'description' => "oethe beschrieb es als beste Bildung überhaupt, Tucholsky als Sehnsucht nach leben. Reisen und die Lust darauf treiben uns seit Jahrtausenden an. NATIONAL GEOGRAPHIC hat die schönsten Fernweh-Ziele in einem Bildband gesammelt - in aktualisierter Auflage, im Softcover zum Nachschlagen und Planen, wohin die nächste Reise geht: von den Bergen Kasachstans bis zum Baikalsee, von den Hochanden bis in den Regenwald; durchs Australische Outback oder die Amalfiküste entlang. Je nach Geschmack, Typ und Geldbeutel nimmt der Bildband den Leser mit, entweder zu Fuß, per Schiff, im luxuszug oder per Pferdekarren ... ein unterhaltsames Kompendium für Abenteurer, Genießer, Kulturfreunde und Globetrotter. 400 Traumreisen, getestet und für unbedingt nachahmenswert befunden. Übersichtskarten, verführerische Fotos, Top-10-Listen und viele nützliche Infos sorgen dafür, dass unterwegs durch die Welt auch nichts schiefgeht. Was fehlt? Kofferpacken müssen Sie allein.", 'description' => "", 'original_language' => "DE", 'number_of_pages' => 32, 'version' => 1, 'type' => "Taschenbuch", 'genre' => "Geografie\n"));
    BookModel::create(array('name' => "Wochenplan Deutsch 4. Schuljahr:\nJede Woche übersichtlich auf einem Bogen", 'isbn' => "3866320647", 'cover' => "theme/images/books/3866320647.jpg", 'title' => "Wochenplan Deutsch 4. Schuljahr:\nJede Woche übersichtlich auf einem Bogen", 'author' => "Ulrike Stolz", 'year_of_publication' => 2013, 'price' => 17.8, 'currency' => "CHF", 'available' => "Sofort", 'language' => "DE", 'description' => "Die Wochenplanarbeit ermöglicht den Schülern, ihr individuelles Lerntempo zu wählen. Damit können Sie konsequent am jeweiligen Thema arbeiten. Gleichzeitig werden die verschiedenen heterogenen Niveaustufen einer Klasse berücksichtigt. Jede Woche ist in fünf Einheiten auf einem Bogen zusammengefasst. Wann Sie welchen Bogen einsetzen, wählen Sie selbst ? ganz individuell nach dem jeweils zu behandelnden Thema. Sie tragen nur noch die Wochennummer bzw. das Datum ein, ", 'original_language' => "DE", 'number_of_pages' => 80, 'version' => 1, 'type' => "Taschenbuch", 'genre' => "Lehrmittel"));
    BookModel::create(array('name' => "Fachkunde für Garten- und Landschaftsbau: Lehrbuch", 'isbn' => "3582041565", 'cover' => "theme/images/books/3582041565.jpg", 'title' => "Fachkunde für Garten- und Landschaftsbau: Lehrbuch", 'author' => "Holger Seipel", 'year_of_publication' => 2013, 'price' => 45.8, 'currency' => "CHF", 'available' => "Sofort", 'language' => "DE", 'description' => "Alles für den Gartenfreund In unserem Garten-Shop finden Sie alles, was Sie zum Gärtnern, Gestalten und Genießen brauchen: Gartenmöbel, Gartenwerkzeug, Gartendekoration, Blumen & Pflanzen und vieles mehr.\nNeu bei Amazon.de: Der Gartenkalender für einen schnellen Überblick jeden Monat.", 'original_language' => "DE", 'number_of_pages' => 548, 'version' => 1, 'type' => "Taschenbuch", 'genre' => "Fachliteratur"));
}
//Check if there is the type Table, if not, create some entries
if (!$db->tableExists('type')) {
    TypeModel::create(array('key' => 'pocketbook'));
    TypeModel::create(array('key' => 'audio_book'));
    TypeModel::create(array('key' => 'ebook'));
    TypeModel::create(array('key' => 'hard_cover'));
    TypeModel::create(array('key' => 'leaflet'));
    TypeModel::create(array('key' => 'comic'));
    TypeModel::create(array('key' => 'booklet'));
}
if (!$db->tableExists('genre')) {
    GenreModel::create(array('key' => 'science'));
    GenreModel::create(array('key' => 'fantasy'));
    GenreModel::create(array('key' => 'crime'));
예제 #28
0
파일: return.php 프로젝트: 10brain/10brain
if (!isID($_POST["KEYWORD1"], 40, 1)) {
    $result = 1;
} elseif (!isPW($_POST["KEYWORD2"], 10, 1)) {
    $result = 1;
} else {
    $ActType = $_POST["ActionType"];
    $Key0 = $_POST["KEYWORD0"];
    //社員番号
    $Key1 = $_POST["KEYWORD1"];
    //ID
    $Key2 = $_POST["KEYWORD2"];
    //パスワード
    $Key3 = $_POST["KEYWORD3"];
    //名前
    //貸出一覧確認
    $obj = new BookModel();
    //入力された情報の確認
    $result = $obj->GETBorrowUList($ActType, $Key0, $dspBorrowUList);
    //画面表示
    if ($result == 0) {
        include "return_input.html";
    } else {
        if ($_POST["ActionType"] != "TgRSPInf") {
            $error = "";
        } elseif ($result == 1) {
            $error = "入力内容に誤りがあります。再度入力してください。";
        } else {
            $error = "ただいまサーバーが込み合っております。";
        }
        include "../login/login.html";
    }
예제 #29
0
파일: search.php 프로젝트: 10brain/10brain
} else {
    $ActType = $_POST["ActionType"];
    $Key0 = $_POST["KEYWORD0"];
    //社員番号
    $Key1 = $_POST["KEYWORD1"];
    //ID
    $Key2 = $_POST["KEYWORD2"];
    //パスワード
    $Key3 = $_POST["KEYWORD3"];
    //名前
    $Key21 = $_POST["KEYWORD21"];
    //フリーワード
    $Key22 = $_POST["KEYWORD22"];
    //and or
    //DB問い合わせ
    $obj = new BookModel();
    $result = $obj->GETBookList($ActType, $Key21, $Key22, $dspBookList);
    //画面表示
    if ($result == 0) {
        include "search.html";
    } else {
        if ($_POST["ActionType"] != "TgRSPInf") {
            $error = "";
        } elseif ($result == 1) {
            $error = "入力内容に誤りがあります。再度入力してください。";
        } else {
            $error = "ただいまサーバーが込み合っております。";
        }
        include "../../login/login.html";
    }
}