change inactive standard
This commit is contained in:
+30
-30
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
Class Dropdown
|
||||
class Dropdown
|
||||
{
|
||||
|
||||
|
||||
private $host = 'localhost';
|
||||
private $username = 'solocla';
|
||||
private $password = '!Massarosa2';
|
||||
@@ -11,20 +11,17 @@ Class Dropdown
|
||||
|
||||
//establish connection
|
||||
public function __construct()
|
||||
|
||||
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
try {
|
||||
$this->connection = new mysqli($this->host, $this->username, $this->password, $this->dbname);
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
} catch (Exception $e) {
|
||||
echo "Connection error " . $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//fetch all country records from database
|
||||
public function fetchCountry()
|
||||
{
|
||||
@@ -32,53 +29,56 @@ Class Dropdown
|
||||
|
||||
$query = "SELECT * FROM article_type ORDER BY article_type.name_articletype";
|
||||
|
||||
if ($sql = $this->connection->query($query))
|
||||
{
|
||||
while ($rows = mysqli_fetch_assoc($sql))
|
||||
{
|
||||
if ($sql = $this->connection->query($query)) {
|
||||
while ($rows = mysqli_fetch_assoc($sql)) {
|
||||
$data[] = $rows;
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
//fetch model records from database depend upon country id
|
||||
public function fetchModel($idarticletype)
|
||||
{
|
||||
$data = null;
|
||||
|
||||
$query = "SELECT * FROM modelarticle WHERE idarticletype='".$idarticletype."' ";
|
||||
$query = "SELECT * FROM modelarticle WHERE idarticletype='" . $idarticletype . "' ";
|
||||
|
||||
if ($sql = $this->connection->query($query))
|
||||
{
|
||||
while ($rows = mysqli_fetch_assoc($sql))
|
||||
{
|
||||
if ($sql = $this->connection->query($query)) {
|
||||
while ($rows = mysqli_fetch_assoc($sql)) {
|
||||
$data[] = $rows;
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
//fetch Charact records from database depend on article type
|
||||
public function fetchCharact($idarticletype)
|
||||
{
|
||||
$data = null;
|
||||
|
||||
$query = "SELECT * FROM article_characteristic WHERE idarticletype='".$idarticletype."' ";
|
||||
$idarticletype = (int)$idarticletype;
|
||||
|
||||
if ($sql = $this->connection->query($query))
|
||||
{
|
||||
while ($rows = mysqli_fetch_assoc($sql))
|
||||
{
|
||||
$query = "
|
||||
SELECT DISTINCT
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user