88 lines
2.1 KiB
PHP
88 lines
2.1 KiB
PHP
<?php
|
|
/*
|
|
* @version $Id: index.php 10381 2008-06-01 03:35:53Z $
|
|
* @package Carteasy
|
|
* @copyright Copyright (C) 2005 - 2011 Wlanium
|
|
* @license proprietary
|
|
* @author Thomas Bartelt
|
|
* Carteasy is a web shop system
|
|
*/
|
|
|
|
include_once './core/base/edit.class.php';
|
|
|
|
class Vendors_Edit extends Base_Edit {
|
|
|
|
public function __construct($base_object, $id = false) {
|
|
parent::__construct($base_object, $id);
|
|
} // end __construct
|
|
|
|
public function get_data($id = false) {
|
|
if ($id) {
|
|
$this->set_id($id);
|
|
}
|
|
|
|
return $this->select_one('herstellerinformationen');
|
|
} // end get_data
|
|
|
|
public function delete_data($id = false) {
|
|
if ($id) {
|
|
$this->set_id($id);
|
|
}
|
|
|
|
return $this->delete_one('herstellerinformationen');
|
|
} // end delete
|
|
|
|
public function create($data) {
|
|
return $this->create_one('herstellerinformationen', $data);
|
|
} // end create
|
|
|
|
public function update($data, $id = false) {
|
|
if ($id) {
|
|
$this->set_id($id);
|
|
}
|
|
|
|
return $this->update_one('herstellerinformationen', $data);
|
|
} // end update
|
|
|
|
public function get_all() {
|
|
$result = $this->db->query("SELECT id, marke_name, hersteller_name FROM herstellerinformationen ORDER BY hersteller_name");
|
|
|
|
$data = array();
|
|
while ($row = $result->fetch_object()) {
|
|
$vendor = new stdClass();
|
|
$vendor->id = intval($row->id);
|
|
$vendor->name = $row->marke_name . ' - ' . $row->hersteller_name;
|
|
$vendor->value = intval($row->id);
|
|
$vendor->hersteller_id = intval($row->id);
|
|
$data[] = $vendor;
|
|
}
|
|
|
|
return $data;
|
|
} // end get_all
|
|
|
|
public function get_dropdown_data() {
|
|
return $this->get_all();
|
|
} // end get_dropdown_data
|
|
|
|
protected function select_one($table) {
|
|
if ($this->id) {
|
|
// Debug-Ausgabe
|
|
error_log("Vendor select_one - Suche nach ID: " . $this->id);
|
|
|
|
$sql = "SELECT * FROM herstellerinformationen WHERE id = " . intval($this->id);
|
|
$result = $this->db->query($sql);
|
|
|
|
// Debug-Ausgabe
|
|
error_log("Vendor select_one - SQL: " . $sql);
|
|
|
|
if ($result && $result->num_rows > 0) {
|
|
return $result->fetch_object();
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
}// end ItemTypeDefinition_Edit
|
|
|
|
/* EOF */ |