Файл: Update 2.1.1/requests/getCurrenciesList.php
Строк: 42
<?php
ob_start();
session_start();
error_reporting(0);
include("../includes/config.php");
$db = new mysqli($CONF['host'], $CONF['user'], $CONF['pass'], $CONF['name']);
if ($db->connect_errno) {
echo "Failed to connect to MySQL: (" . $db->connect_errno . ") " . $db->connect_error;
}
$db->set_charset("utf8");
$settingsQuery = $db->query("SELECT * FROM settings ORDER BY id DESC LIMIT 1");
$settings = $settingsQuery->fetch_assoc();
include("../includes/functions.php");
$from = protect($_GET['from']);
$to = protect($_GET['to']);
$query = $db->query("SELECT * FROM companies WHERE name='$from'");
$row = $query->fetch_assoc();
$query2 = $db->query("SELECT * FROM currencies WHERE cid='$row[id]' and company_from='$from' and company_to='$to' ORDER BY id");
if($query2->num_rows>0) {
while($row2 = $query2->fetch_assoc()) {
if (strpos($list,$row2['currency_from']) !== false) { } else {
echo '<option value="'.$row2[currency_from].'">'.$row2[currency_from].'</option>';
}
$list .= $row2['currency_from'].",";
}
} else {
echo '<option value="0">NaN</option>';
}
?>