<?php
include_once("../config/templateConfig.inc.php");
include_once("../config/databaseConfig.inc.php");
$templateMain   = new SmartTemplate('SaveDIY.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();
/*
输出主体部分
*/
$Cpu         = $_POST["Cpu"];
$Camera      = $_POST["Camera"];
$CDROM       = $_POST["CDROM"];
$Box         = $_POST["Box"];
$Disk        = $_POST["Disk"];
$Displaycard = $_POST["Displaycard"];
$Keyboard    = $_POST["Keyboard"];
$Mainboard   = $_POST["Mainboard"];
$Memory      = $_POST["Memory"];
$Monitor     = $_POST["Monitor"];
$Networkcard = $_POST["Networkcard"];
$Printer     = $_POST["Printer"];
$Scanner     = $_POST["Scanner"];
$Soundbox    = $_POST["Soundbox"];
$Soundcard   = $_POST["Soundcard"];

list($name, $price) = split (":", $Cpu);
$Tprice = $Tprice + $price;
list($name, $price) = split (":", $Camera);
$Tprice = $Tprice + $price;
list($name, $price) = split (":", $CDROM);
$Tprice = $Tprice + $price;
list($name, $price) = split (":", $Box);
$Tprice = $Tprice + $price;
list($name, $price) = split (":", $Disk);
$Tprice = $Tprice + $price;
list($name, $price) = split (":", $Displaycard);
$Tprice = $Tprice + $price;
list($name, $price) = split (":", $Keyboard);
$Tprice = $Tprice + $price;
list($name, $price) = split (":", $Mainboard);
$Tprice = $Tprice + $price;
list($name, $price) = split (":", $Memory);
$Tprice = $Tprice + $price;
list($name, $price) = split (":", $Monitor);
$Tprice = $Tprice + $price;
list($name, $price) = split (":", $Networkcard);
$Tprice = $Tprice + $price;
list($name, $price) = split (":", $Printer);
$Tprice = $Tprice + $price;
list($name, $price) = split (":", $Scanner);
$Tprice = $Tprice + $price;
list($name, $price) = split (":", $Soundbox);
$Tprice = $Tprice + $price;
list($name, $price) = split (":", $Soundcard);
$Tprice = $Tprice + $price;

$myOrder = <<< ORDER
<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr>
    <td width="20" height="1">&nbsp;</td>
    <td colspan="2" class="con5">主件</td>
  </tr>
  <tr>
    <td width="20" height="25">&nbsp;</td>
    <td width="107" align="right" class="con3">C P U :</td>
    <td width="489" class="con3">{$Cpu}</td>
  </tr>
  <tr>
    <td width="20" height="25">&nbsp;</td>
    <td align="right" class="con3">主　板:</td>
    <td class="con3">{$Mainboard}</td>
  </tr>
  <tr>
    <td width="20" height="25">&nbsp;</td>
    <td align="right" class="con3">内　存:</td>
    <td class="con3">{$Memory}</td>
  </tr>
  <tr>
    <td width="20" height="25">&nbsp;</td>
    <td align="right" class="con3">硬　盘:</td>
    <td class="con3">{$Disk}</td>
  </tr>
  <tr>
    <td width="20" height="25">&nbsp;</td>
    <td align="right" class="con3">显示器:</td>
    <td class="con3">{$Monitor}</td>
  </tr>
  <tr>
    <td width="20" height="25">&nbsp;</td>
    <td align="right" class="con3">CD-ROM:</td>
    <td class="con3">{$CDROM}</td>
  </tr>
  <tr>
    <td width="20" height="25">&nbsp;</td>
    <td align="right" class="con3">键盘鼠标:</td>
    <td class="con3">{$Keyboard}</td>
  </tr>
  <tr>
    <td width="20" height="25">&nbsp;</td>
    <td colspan="2" class="con3"><span class="con5">配件</span></td>
  </tr>
  <tr>
    <td width="20" height="25">&nbsp;</td>
    <td align="right" class="con3">显　卡:</td>
    <td class="con3">{$Displaycard}</td>
  </tr>
  <tr>
    <td width="20" height="25">&nbsp;</td>
    <td align="right" class="con3">声　卡:</td>
    <td class="con3">{$Soundcard}</td>
  </tr>
  <tr>
    <td width="20" height="25">&nbsp;</td>
    <td align="right" class="con3">网　卡:</td>
    <td class="con3">{$Networkcard}</td>
  </tr>
  <tr>
    <td height="25">&nbsp;</td>
    <td colspan="2" class="con5">外设</td>
  </tr>
  <tr>
    <td height="25">&nbsp;</td>
    <td align="right" class="con3">打印机:</td>
    <td class="con3">{$Printer}</td>
  </tr>
  <tr>
    <td height="25">&nbsp;</td>
    <td align="right" class="con3">扫描仪:</td>
    <td class="con3">{$Scanner}</td>
  </tr>
  <tr>
    <td height="25">&nbsp;</td>
    <td align="right" class="con3">音　箱:</td>
    <td class="con3">{$Soundbox}</td>
  </tr>
  <tr>
    <td height="25" rowspan="2">&nbsp;</td>
    <td align="right" class="con3">摄像头:</td>
    <td class="con3">{$Camera}</td>
  </tr>
  <tr>
    <td align="right" class="con3">&nbsp;</td>
    <td align="center" class="con1">合计：{$Tprice}￥</td>
  </tr>
</table>
ORDER;

$templateMain->assign('Cpu',$Cpu);
$templateMain->assign('Camera',$Camera);
$templateMain->assign('CDROM',$CDROM);
$templateMain->assign('CDROM',$Box);
$templateMain->assign('Disk',$Disk);
$templateMain->assign('Displaycard',$Displaycard);
$templateMain->assign('Keyboard',$Keyboard);
$templateMain->assign('Mainboard',$Mainboard);
$templateMain->assign('Memory',$Memory);
$templateMain->assign('Monitor',$Monitor);
$templateMain->assign('Networkcard',$Networkcard);
$templateMain->assign('Printer',$Printer);
$templateMain->assign('Scanner',$Scanner);
$templateMain->assign('Soundbox',$Soundbox);
$templateMain->assign('Soundcard',$Soundcard);
$templateMain->assign('Tprice',$Tprice);
$templateMain->assign('Order',$myOrder);

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