Example #1
0
<?php

include '../lib.php';
include '../includes/db.php';
include '../includes/card.php';
die(json_encode(card_search($_GET, card_connect())));
Example #2
0
     $searchbyset = filter_input(INPUT_GET, 'searchbyset', FILTER_VALIDATE_INT);
     $page = filter_input(INPUT_GET, 'page', FILTER_VALIDATE_INT);
     $row_count = 0;
     if ($page == 1) {
         $start = 0;
         $end = 50;
     } else {
         if ($page > 0) {
             $start = $page * 50 - 49;
             $end = 50;
         } else {
             $start = 0;
             $end = 50;
         }
     }
     $search_results = card_search($start, $end, $searchtype, $searchstring, $colors, $colortype, $set_id, $searchbyset);
     include 'searchResults.php';
     break;
 case 'details':
     $card_name = filter_input(INPUT_GET, 'cardname');
     $set_id = filter_input(INPUT_GET, 'setid', FILTER_VALIDATE_INT);
     $variation = filter_input(INPUT_GET, 'variation', FILTER_VALIDATE_INT);
     //var_dump($card_name);
     if (!empty($variation)) {
         //echo 'variation not empty';
         $card = get_card_details($card_name, $set_id, $variation);
     } else {
         //echo 'variation empty';
         $card = get_card_details($card_name, $set_id);
     }
     include 'cardDetails.php';
Example #3
0
<?php

include_once 'lib.php';
$name = param($_GET, 'name', '');
$data = card_search($_GET, $mysql_connection);
if ($data->num_rows == 1) {
    header('location: card.php?id=' . $data->cards[0]->id);
} else {
    html_head('Admin > Cards > Card search', array('style.css', 'admin.css'));
    ?>
 <body>
<?php 
    html_menu();
    ?>
  <div class="section">
   <h1>Search results</h1>
   <a href="../">Return to admin</a>
  <form action="cards.php" method="get">
   <input type="text" name="name" value="<?php 
    echo $name;
    ?>
">
   <input type="submit" value="Search">
  </form>
  <ul>
<?php 
    echo '<p>' . $data->num_rows . ' results in "' . $data->mode . '" search mode</p>';
    foreach ($data->cards as $card) {
        echo '   <li><a href="card.php?id=' . $card->id . '">' . $card->name . '</a></li>' . "\n";
    }
    ?>