<?php
include_once("../config/templateConfig.inc.php");
include_once("../config/databaseConfig.inc.php");
$templateMain   = new SmartTemplate('DIY.html');
$templateMenu   = new SmartTemplate('menu.html');
$templateTop    = new SmartTemplate('top.html');
$templateBottom = new SmartTemplate('copyRight.html');
/*
输出头部
*/
$templateTop->output();
/*
输出菜单
*/
$menu="在线DIY";
$submenu="";
$templateMenu->assign('MENU',$menu);
$templateMenu->output();
/*
取记录
输出主体部分
*/
$sqlCpu="select name,price from Cpu";
$rsCpu = $db->execute($sqlCpu);
$rsCpu = $rsCpu->GetRows();

$sqlCamera="select name,price from Camera";
$rsCamera = $db->execute($sqlCamera);
$rsCamera = $rsCamera->GetRows();

$sqlCDROM="select name,price from CDROM";
$rsCDROM = $db->execute($sqlCDROM);
$rsCDROM = $rsCDROM->GetRows();

$sqlBox="select name,price from Box";
$rsBox = $db->execute($sqlBox);
$rsBox = $rsBox->GetRows();

$sqlDisk="select name,price from Disk";
$rsDisk = $db->execute($sqlDisk);
$rsDisk = $rsDisk->GetRows();

$sqlDisplaycard="select name,price from Displaycard";
$rsDisplaycard = $db->execute($sqlDisplaycard);
$rsDisplaycard = $rsDisplaycard->GetRows();

$sqlKeyboard="select name,price from Keyboard";
$rsKeyboard = $db->execute($sqlKeyboard);
$rsKeyboard = $rsKeyboard->GetRows();

$sqlMainboard="select name,price from Mainboard";
$rsMainboard = $db->execute($sqlMainboard);
$rsMainboard = $rsMainboard->GetRows();

$sqlMemory="select name,price from Memory";
$rsMemory = $db->execute($sqlMemory);
$rsMemory = $rsMemory->GetRows();

$sqlMonitor="select name,price from Monitor";
$rsMonitor = $db->execute($sqlMonitor);
$rsMonitor = $rsMonitor->GetRows();

$sqlNetworkcard="select name,price from Networkcard";
$rsNetworkcard = $db->execute($sqlNetworkcard);
$rsNetworkcard = $rsNetworkcard->GetRows();

$sqlPrinter="select name,price from Printer";
$rsPrinter = $db->execute($sqlPrinter);
$rsPrinter = $rsPrinter->GetRows();

$sqlScanner="select name,price from Scanner";
$rsScanner = $db->execute($sqlScanner);
$rsScanner = $rsScanner->GetRows();

$sqlSoundbox="select name,price from Soundbox";
$rsSoundbox = $db->execute($sqlSoundbox);
$rsSoundbox = $rsSoundbox->GetRows();

$sqlSoundcard="select name,price from Soundcard";
$rsSoundcard = $db->execute($sqlSoundcard);
$rsSoundcard = $rsSoundcard->GetRows();

$templateMain->assign('Cpu',$rsCpu);
$templateMain->assign('Camera',$rsCamera);
$templateMain->assign('CDROM',$rsCDROM);
$templateMain->assign('Box',$rsBox);
$templateMain->assign('Disk',$rsDisk);
$templateMain->assign('Displaycard',$rsDisplaycard);
$templateMain->assign('Keyboard',$rsKeyboard);
$templateMain->assign('Mainboard',$rsMainboard);
$templateMain->assign('Memory',$rsMemory);
$templateMain->assign('Monitor',$rsMonitor);
$templateMain->assign('Networkcard',$rsNetworkcard);
$templateMain->assign('Printer',$rsPrinter);
$templateMain->assign('Scanner',$rsScanner);
$templateMain->assign('Soundbox',$rsSoundbox);
$templateMain->assign('Soundcard',$rsSoundcard);

$templateMain->output();
/*
输出页脚
*/
$templateBottom->output();
?>