change inactive standard
This commit is contained in:
+23
-23
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
Class Dropdown
|
class Dropdown
|
||||||
{
|
{
|
||||||
|
|
||||||
private $host = 'localhost';
|
private $host = 'localhost';
|
||||||
@@ -14,12 +14,9 @@ Class Dropdown
|
|||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
$this->connection = new mysqli($this->host, $this->username, $this->password, $this->dbname);
|
$this->connection = new mysqli($this->host, $this->username, $this->password, $this->dbname);
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch (Exception $e)
|
|
||||||
{
|
|
||||||
echo "Connection error " . $e->getMessage();
|
echo "Connection error " . $e->getMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,10 +29,8 @@ Class Dropdown
|
|||||||
|
|
||||||
$query = "SELECT * FROM article_type ORDER BY article_type.name_articletype";
|
$query = "SELECT * FROM article_type ORDER BY article_type.name_articletype";
|
||||||
|
|
||||||
if ($sql = $this->connection->query($query))
|
if ($sql = $this->connection->query($query)) {
|
||||||
{
|
while ($rows = mysqli_fetch_assoc($sql)) {
|
||||||
while ($rows = mysqli_fetch_assoc($sql))
|
|
||||||
{
|
|
||||||
$data[] = $rows;
|
$data[] = $rows;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -48,12 +43,10 @@ Class Dropdown
|
|||||||
{
|
{
|
||||||
$data = null;
|
$data = null;
|
||||||
|
|
||||||
$query = "SELECT * FROM modelarticle WHERE idarticletype='".$idarticletype."' ";
|
$query = "SELECT * FROM modelarticle WHERE idarticletype='" . $idarticletype . "' ";
|
||||||
|
|
||||||
if ($sql = $this->connection->query($query))
|
if ($sql = $this->connection->query($query)) {
|
||||||
{
|
while ($rows = mysqli_fetch_assoc($sql)) {
|
||||||
while ($rows = mysqli_fetch_assoc($sql))
|
|
||||||
{
|
|
||||||
$data[] = $rows;
|
$data[] = $rows;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -66,19 +59,26 @@ Class Dropdown
|
|||||||
{
|
{
|
||||||
$data = null;
|
$data = null;
|
||||||
|
|
||||||
$query = "SELECT * FROM article_characteristic WHERE idarticletype='".$idarticletype."' ";
|
$idarticletype = (int)$idarticletype;
|
||||||
|
|
||||||
if ($sql = $this->connection->query($query))
|
$query = "
|
||||||
{
|
SELECT DISTINCT
|
||||||
while ($rows = mysqli_fetch_assoc($sql))
|
ac.*
|
||||||
{
|
FROM article_characteristic ac
|
||||||
|
INNER JOIN standards s
|
||||||
|
ON s.idarticlecharacteristic = ac.idarticlecharacteristic
|
||||||
|
AND s.idarticletype = ac.idarticletype
|
||||||
|
WHERE ac.idarticletype = $idarticletype
|
||||||
|
AND s.active = 'Y'
|
||||||
|
ORDER BY ac.name_articlecharacteristic
|
||||||
|
";
|
||||||
|
|
||||||
|
if ($sql = $this->connection->query($query)) {
|
||||||
|
while ($rows = mysqli_fetch_assoc($sql)) {
|
||||||
$data[] = $rows;
|
$data[] = $rows;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
Reference in New Issue
Block a user