<? if (!defined('ROOT')) exit('Can\'t Access !'); include template('admin_header','admin'); ?>
  <div id="right">
    <div class="right">
      <div style="width:auto;overflow-x:hidden;overflow-y:auto">
      
      <? if($_GET['get']=='list') { ?>
        <div class="tags">
          <div id="tagscontent">
            <div id="con_one_1">
              <div class="table_td" style="margin-top:10px;">
              <form method="post" action="" onsubmit="return remind();">
                  <table border="0" cellspacing="2" cellpadding="4" class="list" name="table" id="table" width="100%">
                    <thead>
                      <tr>
                        <th width="60px"><input type="checkbox" id="chkall" name="chkall" onclick="checkall(this.form, 'id')"></th>
                        <th align="center">编号</th>
                        <th align="center">标题</th>
                        <th align="center">所属分类</th>
                        <th align="center">发布时间</th>
                        <th align="center">操作</th>
                      </tr>
                    </thead>
                    
            <? if(is_array($this->newslist)) { foreach($this->newslist as $value) { ?>                    <tbody>
                      <tr class="s_out" onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                        <td align="center" ><input type="checkbox" name="id[]" value="<?=$value['id']?>"></td>
                        <td align="center"><?=$value['id']?></td>
                        <td align="left" style="padding-left:10px;"><?=$value['title']?></td>
                        <td align="left" style="padding-left:10px;"><?=$value['typename']?></td>
                        <td align="left" style="padding-left:10px;"><?=$value['addtime']?></td>
                        <td align="center"><a href="<?=$value['editurl']?>">编辑</a> <a onclick="return remind();" href="<?=$value['delurl']?>">删除</a></td>
                      </tr>
                    </tbody>
            <? } } ?>                    

                  </table>
                <div class="blank20"></div>
                 <?=config::form('button','删除','submit','','class=\'button\'');?>
                </form>
                <div class="page"><span><?=$this->pagetotal?>条记录/<? echo $_GET['page'] ? $_GET['page'] : 1  ?>页</span><?=$this->showpage?></div>
                <div class="blank20"></div>
              </div>
            </div>
          </div>
        </div>
        <div class="blank20"></div>
      <? } ?>
        
      <? if($_GET['get']=='add'||$_GET['get']=='edit') { ?>
        <div class="tags">
          <div id="tagstitle"><a class="hover"><?=$getName?></a></div>
          <div id="tagscontent">
            <form method="post" name="form1" action="">
              <div>
                <table border="0" cellspacing="2" cellpadding="4" class="list" name="table" id="table" width="100%">
                  <tbody>
                    <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                      <td class="left">标题</td>
                      <td>
                        <?=config::form('title',$this->news['title'],'input','','class=\'skey\'');?>                      
                        </td>
                    </tr>
                    
                    <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                      <td class="left">所属分类</td>
                      <td> 
                     <?=config::form('typeid',$this->news['typeid'],'select',$this->typelist);?>
                      </td>
                    </tr>
                    
                    <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                      <td class="left">发布时间</td>
                      <td>
                       <?=config::form('addtime',formattime($this->news['addtime']),'data',true,'datefmt');?>                    
                        </td>
                    </tr>
                    
                    <tr onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                      <td class="left">详细内容</td>
                      <td> 
                      <?=config::form('content',$this->news['content'],'editor','0','<1@1>');?>
                      </td>
                    </tr>


                  </tbody>
                </table>
              </div>
              <div class="blank20"></div>
               <?=config::form('button','提交','submit','','class=\'button\'');?>
            </form>
          </div>
        </div>
        <div class="blank20"></div>
      <? } ?>
        

      <? if($_GET['get']=='type') { ?>
        <div class="tags">
          <div id="tagscontent">
            <div id="con_one_1">
              <div class="table_td" style="margin-top:10px;">
              <form method="post" action="" onsubmit="return remind();">
                  <table border="0" cellspacing="2" cellpadding="4" class="list" name="table" id="table" width="100%">
                    <thead>
                      <tr>
                        <th align="center">编号</th>
                        <th align="center">分类名称</th>
                        <th align="center">排序</th>
                        <th align="center">操作</th>
                      </tr>
                    </thead>
                    <tbody id="type">         
            <? if(is_array($this->typelist)) { foreach($this->typelist as $value) { ?>                      <tr class="s_out" onmouseover="this.bgColor='#F5F5F5';" onmouseout="this.bgColor='ffffff';" bgcolor="#ffffff">
                        <td align="center"><?=$value['id']?><input type="hidden" name="id[]" value="<?=$value['id']?>"></td>
                        <td align="left" style="padding-left:10px;">
                          <?=config::form('typename[]',$value['typename'],'input','','class=\'skey\' style=\'width:130px;\'');?>
                        </td>
                        <td align="left" style="padding-left:10px;">
                          <?=config::form('typeorder[]',$value['typeorder'],'input','','class=\'skey\' style=\'width:50px;\'');?>
                        </td>
                        <td align="center"><a onclick="return remind();" href="<?=$value['delurl']?>">删除</a></td>
                      </tr>

            <? } } ?>                    </tbody>      

                  </table>
                <div class="blank20"></div>
                 <?=config::form('button','确认修改','submit','','class=\'button\'');?> 
                 <input type="button" name="button" id="typebutton" value="添加一个分类" onclick="addtype();" class="button" />
              </form>
              </div>
            </div>
          </div>
        </div>
        <div class="blank20"></div>
      <? } ?>



      </div>
      <div class="clear"></div>
    </div>
    <div class="clear"></div>
  </div>
</div>
<? include template('admin_footer','admin'); ?>
