|
@@ 100-118 (lines=19) @@
|
| 97 |
|
|
| 98 |
|
$smarty->display("search/searchresult.tpl"); |
| 99 |
|
} |
| 100 |
|
elseif ($_GET['type'] == 'IP') { |
| 101 |
|
$qterm = '%' . $term . '%'; |
| 102 |
|
|
| 103 |
|
$statement = gGetDb()->prepare("SELECT * FROM request WHERE email <> '[email protected]' and ip <> '127.0.0.1' and ip LIKE :term or forwardedip LIKE :term2;"); |
| 104 |
|
$statement->bindValue(":term", $qterm); |
| 105 |
|
$statement->bindValue(":term2", $qterm); |
| 106 |
|
$statement->execute(); |
| 107 |
|
$requests = $statement->fetchAll(PDO::FETCH_CLASS, "Request"); |
| 108 |
|
foreach ($requests as $r) { |
| 109 |
|
$r->setDatabase(gGetDb()); |
| 110 |
|
} |
| 111 |
|
|
| 112 |
|
$smarty->assign("term", $term); |
| 113 |
|
$smarty->assign("requests", $requests); |
| 114 |
|
$target = "IP address"; |
| 115 |
|
$smarty->assign("target", $target); |
| 116 |
|
|
| 117 |
|
$smarty->display("search/searchresult.tpl"); |
| 118 |
|
} |
| 119 |
|
elseif ($_GET['type'] == 'Request') { |
| 120 |
|
$qterm = '%' . $term . '%'; |
| 121 |
|
|
|
@@ 119-136 (lines=18) @@
|
| 116 |
|
|
| 117 |
|
$smarty->display("search/searchresult.tpl"); |
| 118 |
|
} |
| 119 |
|
elseif ($_GET['type'] == 'Request') { |
| 120 |
|
$qterm = '%' . $term . '%'; |
| 121 |
|
|
| 122 |
|
$statement = gGetDb()->prepare("SELECT * FROM request WHERE name LIKE :term;"); |
| 123 |
|
$statement->bindValue(":term", $qterm); |
| 124 |
|
$statement->execute(); |
| 125 |
|
$requests = $statement->fetchAll(PDO::FETCH_CLASS, "Request"); |
| 126 |
|
foreach ($requests as $r) { |
| 127 |
|
$r->setDatabase(gGetDb()); |
| 128 |
|
} |
| 129 |
|
|
| 130 |
|
$smarty->assign("term", $term); |
| 131 |
|
$smarty->assign("requests", $requests); |
| 132 |
|
$target = "requested name"; |
| 133 |
|
$smarty->assign("target", $target); |
| 134 |
|
|
| 135 |
|
$smarty->display("search/searchresult.tpl"); |
| 136 |
|
} |
| 137 |
|
else { |
| 138 |
|
BootstrapSkin::displayAlertBox("Unknown search type", "alert-error", "Error"); |
| 139 |
|
$smarty->display("search/searchform.tpl"); |