. if (!defined('EG')) die('Direct access not allowed!'); class DownloadController extends BaseController { public function __construct($model, $controller, $queryString) { $this->_topMenuClasses['download'] = " class='currentitem'"; parent::__construct($model, $controller, $queryString); $this->model('HardwareModel'); $data['title'] = 'download - '.Website::$generalName; $this->append($data); } public function index($lang = 'en') { $this->cleverLoad('index'); $this->right($lang); } //get the xml of the archive private function getXml($res) { $xml = null; $xml = "\n"; $xml .= "\n"; $xml .= "\t\n"; $xml .= "\t\th-node project\n"; $xml .= "\t\twww.h-node.com\n"; $xml .= "\t\t".date("Y-m-d H:m:s")."\n"; $xml .= "\t\tThe contents of this page are in the Public Domain (see the CC0 page at http://creativecommons.org/publicdomain/zero/1.0/ for detailed information). Anyone is free to copy, modify, publish, use, sell, or distribute the text for any purpose, commercial or non-commercial, and by any means.\n"; $xml .= "\t\n"; foreach ($res as $row) { $type = $row['hardware']['type']; $xml .= "\t\n"; $xml .= "\t\t".$row['hardware']['id_hard']."\n"; $xml .= "\t\t".$row['hardware']['type']."\n"; if ($type === 'notebook' or $type === 'printer') { $xml .= "\t\t".$row['hardware']['subtype']."\n"; } if ($type === 'notebook') { $xml .= "\t\t".$row['hardware']['bios']."\n"; } $xml .= "\t\t".$row['hardware']['model']."\n"; if ($type !== 'notebook') { $xml .= "\t\t".$row['hardware']['pci_id']."\n"; } $xml .= "\t\t".$row['hardware']['vendor']."\n"; $xml .= "\t\t".$row['hardware']['kernel']."\n"; $xml .= "\t\t".$row['hardware']['distribution']."\n"; $xml .= "\t\t".$row['hardware']['comm_year']."\n"; if ($type !== 'notebook') { $xml .= "\t\t".$row['hardware']['interface']."\n"; } if ($type === 'notebook' or $type === 'printer' or $type === 'scanner') { $xml .= "\t\t".$row['hardware']['compatibility']."\n"; } if ($type === 'notebook') { $xml .= "\t\t".$row['hardware']['wifi_type']."\n"; $xml .= "\t\t".$row['hardware']['video_card_type']."\n"; $xml .= "\t\t".$row['hardware']['webcam_type']."\n"; $xml .= "\t\t".$row['hardware']['wifi_works']."\n"; $xml .= "\t\t".$row['hardware']['video_card_works']."\n"; $xml .= "\t\t".$row['hardware']['webcam_works']."\n"; } if ($type === '3G-card' or $type === 'wifi') { $xml .= "\t\t".$row['hardware']['wifi_works']."\n"; } if ($type === 'soundcard') { $xml .= "\t\t".$row['hardware']['sound_card_works']."\n"; } if ($type === 'bluetooth') { $xml .= "\t\t".$row['hardware']['bluetooth_works']."\n"; } if ($type === 'webcam') { $xml .= "\t\t".$row['hardware']['webcam_works']."\n"; } if ($type === 'videocard') { $xml .= "\t\t".$row['hardware']['video_card_works']."\n"; } if ($type === 'printer' or $type === 'scanner' or $type === 'soundcard' or $type === 'webcam' or $type === 'bluetooth') { $xml .= "\t\t".$row['hardware']['driver']."\n"; } $xml .= "\t\t\n"; $xml .= "\t\t".$this->baseUrl."/".MyStrings::$reverse[$type]."/view/".$this->lang."/".$row['hardware']['id_hard']."/".encodeUrl($row['hardware']['model'])."\n"; $xml .= "\t\t".$this->baseUrl."/".MyStrings::$reverse[$type]."/history/".$this->lang."/".$row['hardware']['id_hard']."\n"; $xml .= "\t\n"; } $xml .= "\n"; return $xml; } public function all($lang = 'en') { header ("Content-Type:text/xml"); $res = $this->m['HardwareModel']->clear()->select()->where(array('-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); $data['xml'] = $this->getXml($res); $this->append($data); $this->clean(); $this->load('xml'); } public function notebooks($lang = 'en') { header ("Content-Type:text/xml"); $res = $this->m['HardwareModel']->clear()->select()->where(array('type'=>'notebook','-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); $data['xml'] = $this->getXml($res); $this->append($data); $this->clean(); $this->load('xml'); } public function wifi($lang = 'en') { header ("Content-Type:text/xml"); $res = $this->m['HardwareModel']->clear()->select()->where(array('type'=>'wifi','-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); $data['xml'] = $this->getXml($res); $this->append($data); $this->clean(); $this->load('xml'); } public function videocards($lang = 'en') { header ("Content-Type:text/xml"); $res = $this->m['HardwareModel']->clear()->select()->where(array('type'=>'videocard','-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); $data['xml'] = $this->getXml($res); $this->append($data); $this->clean(); $this->load('xml'); } public function printers($lang = 'en') { header ("Content-Type:text/xml"); $res = $this->m['HardwareModel']->clear()->select()->where(array('type'=>'printer','-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); $data['xml'] = $this->getXml($res); $this->append($data); $this->clean(); $this->load('xml'); } public function scanners($lang = 'en') { header ("Content-Type:text/xml"); $res = $this->m['HardwareModel']->clear()->select()->where(array('type'=>'scanner','-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); $data['xml'] = $this->getXml($res); $this->append($data); $this->clean(); $this->load('xml'); } public function threegcards($lang = 'en') { header ("Content-Type:text/xml"); $res = $this->m['HardwareModel']->clear()->select()->where(array('type'=>'3G-card','-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); $data['xml'] = $this->getXml($res); $this->append($data); $this->clean(); $this->load('xml'); } public function soundcards($lang = 'en') { header ("Content-Type:text/xml"); $res = $this->m['HardwareModel']->clear()->select()->where(array('type'=>'soundcard','-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); $data['xml'] = $this->getXml($res); $this->append($data); $this->clean(); $this->load('xml'); } public function webcams($lang = 'en') { header ("Content-Type:text/xml"); $res = $this->m['HardwareModel']->clear()->select()->where(array('type'=>'webcam','-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); $data['xml'] = $this->getXml($res); $this->append($data); $this->clean(); $this->load('xml'); } public function bluetooth($lang = 'en') { header ("Content-Type:text/xml"); $res = $this->m['HardwareModel']->clear()->select()->where(array('type'=>'bluetooth','-deleted'=>'no'))->orderBy("type,hardware.id_hard")->send(); $data['xml'] = $this->getXml($res); $this->append($data); $this->clean(); $this->load('xml'); } }