

			 {include file="app/plug/view/giftmanage/nav"}

				<div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
					<i id="sidebar-toggle-icon" class="ace-icon fa fa-angle-double-left ace-save-state" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
				</div>
			</div>

			<div class="main-content">
				<div class="main-content-inner">
					<div class="breadcrumbs ace-save-state" id="breadcrumbs">
						<ul class="breadcrumb">
							<li>
								<i class="ace-icon fa fa-home home-icon"></i>
								<a href="index.php?r=index/agent/channel">首页</a>
							</li>
							<li class="active">{$pagetext['0']}</li>
						</ul><!-- /.breadcrumb -->
				
						<div class="nav-search" id="nav-search" style="display:block">
							
								<span class="input-icon">
                             
									<input type="text" placeholder="输入关键字搜索" class="nav-search-input" id="search" autocomplete="off" />
                                   <input type="button" class="sbtn"    style="display:none"/>
									<i class="ace-icon fa fa-search nav-search-icon"></i>
								</span>
							
						</div><!-- /.nav-search -->
					</div>
                

					<div class="page-content">
                    <div class="page-header">
							<h1>
								{$pagetext['0']}
								<small>
									<i class="ace-icon fa fa-angle-double-right"></i>
									{$pagetext['1']}
								</small>
							</h1>
						</div>
                      <div style="float:left; margin-bottom:15px;">
                   <a href="index.php?r=plug/giftmanage/addgift"><button class="btn btn-primary">添加礼物</button></a> <a onclick="ZhiCmsConfirm('确定更新产品库吗？','是的','取消','index.php?r=plug/giftmanage/overdue','正在执行')"><button class="btn btn-primary">一键检测更新宝贝</button></a>
                      </div>
					<table class="table table-striped table-bordered">
															<thead>
																<tr>
																	<th style="width:80px;" class="center">ID</th>
																	
								
																	<th style="width:70px;" >图片</th>
                                                                    <th style="width:200px;">宝贝名称</th>
                                                                    <th style="width:100px;" >价格</th>
                                                                    <th  style="width:200px;">送给谁</th>
                                                                  
                                                                  <th style="width:200px;">送礼的目的</th>
                                                                    <th style="width:200px;">送礼时间</th>
       
                                                                  <th style="width:200px;">送礼的专题</th>
                                                                  <th style="width:80px;">特殊选项</th>
																	<th  style="width:140px;">操作</th>
																</tr>
															</thead>

															<tbody>
                                                            {foreach $Page['list'] as $vo}
																<tr>
																	<td style="vertical-align:middle" class="center">{$vo['id']}</td>

																	<td style="vertical-align:middle">
																		<img src="{$vo['pic']}" style="width:50px; height:50px; border:1px solid #CCC">
																	</td>
																	
																	<td style="vertical-align:middle" class="hidden-480" >{$vo['itemstitle']}</td>																			
                                                                   																	
                                                                   
                                                                   
                                                                   
                                                                      <td style="vertical-align:middle">
                                                                 {$vo['price']}
                                                                    
                                                                    </td>
                                                                    
                                                                    <td style="vertical-align:middle">
                                                                    <?php
                                                                    $send=json_decode($vo['send']);
                                                                   
                                                                   	foreach($send as $giftvo){
                                                                    
                                                                    ?>
                                                                 
                                                                     <span class="badge badge-success">{obj('plug/giftmanage','controller')->getlistinfo($giftvo,'plug_gift_send')}</span>
                                                                     <?php
                                                                    }
                                                                   ?>
                                                                  
                                                                    
                                                                    
                                                                    
                                                                    </td>
                                                                    <td style="vertical-align:middle">
                                                                   
                                                                     <?php
                                                                    $mudi=json_decode($vo['mudi']);
                                                                   
                                                                   	foreach($mudi as $giftvo){
                                                                    
                                                                    ?>
                                                                 
                                                                     <span class="badge badge-warning">{obj('plug/giftmanage','controller')->getlistinfo($giftvo,'plug_gift_mudi')}</span>
                                                                     <?php
                                                                    }
                                                                   ?>
                                                                    
                                                                    </td>
                                                                    <td style="vertical-align:middle">
                                                                    
                                                                     <?php
                                                                    $sendtime=json_decode($vo['sendtime']);
                                                                   
                                                                   	foreach($sendtime as $giftvo){
                                                                    
                                                                    ?>
                                                                 
                                                                     <span class="badge badge-info">{obj('plug/giftmanage','controller')->getlistinfo($giftvo,'plug_gift_sendtime')}</span>
                                                                     <?php
                                                                    }
                                                                   ?>
                                                                    
                                                                    </td>
                                                                    <td style="vertical-align:middle">
                                                                     <?php
                                                                    $special=json_decode($vo['special']);
                                                                   
                                                                   	foreach($special as $giftvo){
                                                                    
                                                                    ?>
                                                                 
                                                                     <span class="badge badge-info">{obj('plug/giftmanage','controller')->getlistinfo($giftvo,'plug_gift_special')}</span>
                                                                     <?php
                                                                    }
                                                                   ?>
                                                                    
                                                                    </td>
                                                                    <td style="vertical-align:middle">
                                                                    {if $vo['diy']==1}
                                                                    <span class="label label-purple label-white middle">星座</span>
                                                                    {/if}
                                                                     {if $vo['diy']==2}
                                                                    <span class="label label-purple label-white middle">定制</span>
                                                                    {/if}
                                                                     {if $vo['diy']==3}
                                                                    <span class="label label-purple label-white middle">刻字</span>
                                                                    {/if}
                                                                    </td>
                                                                    
                                                                   
																	<td style="vertical-align:middle">
                                                               
                                                                    <a title="编辑" href="index.php?r=plug/giftmanage/editorgift&id={$vo['id']}"><button class="btn btn-xs btn-info">
																<i class="ace-icon fa fa-pencil bigger-120"></i>
															</button></a>
                                                             {if $vo['lock']=='0'}
                                                            <button class="btn btn-xs btn-danger"  onclick="ZhiCmsConfirm('确定要下架吗？','是的','取消','index.php?r=plug/giftmanage/lock&id={$vo['id']}&lock=1','下架中...')">
																下架
															</button>
                                                            {else}
                                                             <button class="btn btn-xs btn-success"  onclick="ZhiCmsConfirm('确定要上架吗？','是的','取消','index.php?r=plug/giftmanage/lock&id={$vo['id']}&lock=2','上架中...')">
																上架
															</button>
                                                            {/if}
                                                            <button class="btn btn-xs btn-danger"  onclick="ZhiCmsConfirm('确定删除吗？','是的','取消','index.php?r=plug/giftmanage/deletegift&id={$vo['id']}','正在删除')">
																<i class="ace-icon fa fa-trash-o bigger-120"></i>
															</button>
                                                            </td>
																</tr>
                                                                {/foreach}

															</tbody>
														</table>
                                                             <div style="float:right">
                                                       
                                                   <ul class="pagination">
												{$Page['page']}
											</ul>
                                            
                                            </div>
                                            <div style="width:100%; height:80px;"></div>
                                                        </div>
								

			

		<!-- basic scripts -->

		<!--[if !IE]> -->
		<script src="{__PUBLIC__}assets/js/jquery-2.1.4.min.js"></script>

		<!-- <![endif]-->

		<!--[if IE]>
<script src="{__PUBLIC__}assets/js/jquery-1.11.3.min.js"></script>
<![endif]-->
		<script type="text/javascript">
			if('ontouchstart' in document.documentElement) document.write("<script src='{__PUBLIC__}assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>
		<script src="{__PUBLIC__}assets/js/bootstrap.min.js"></script>

		<!-- page specific plugin scripts -->

		<!--[if lte IE 8]>
		  <script src="{__PUBLIC__}assets/js/excanvas.min.js"></script>
		<![endif]-->
		<script src="{__PUBLIC__}assets/js/jquery-ui.custom.min.js"></script>
		<script src="{__PUBLIC__}assets/js/jquery.ui.touch-punch.min.js"></script>
		<script src="{__PUBLIC__}assets/js/jquery.easypiechart.min.js"></script>
		<script src="{__PUBLIC__}assets/js/jquery.sparkline.index.min.js"></script>
		<script src="{__PUBLIC__}assets/js/jquery.flot.min.js"></script>
		<script src="{__PUBLIC__}assets/js/jquery.flot.pie.min.js"></script>
		<script src="{__PUBLIC__}assets/js/jquery.flot.resize.min.js"></script>

		<!-- ace scripts -->
		<script src="{__PUBLIC__}assets/js/ace-elements.min.js"></script>
		<script src="{__PUBLIC__}assets/js/ace.min.js"></script>
         <script src="{__PUBLIC__}global/layer/layer.js"></script>
        <link rel="stylesheet" href="{__PUBLIC__}global/message/css/jquery.my-message.1.1.css" />
        <script type="text/javascript" src="{__PUBLIC__}global/message/js/jquery.my-message.1.1.js"></script>
        <script src="{__PUBLIC__}global/js/index.js"></script>

		    <script>
					$('#search').bind('keypress', function (event) { 
   if (event.keyCode == "13") { 
    $(".sbtn").click();
	 gosbtn();
   }
  })
  function gosbtn(){
	 var keywords=$("#search").val();
	if(!keywords){
		//layer.msg('请输入关键字', function(){});
		return false;
	}
	
				  var url='index.php?r=plug/giftmanage/giftlist&key='+keywords;
	  	  location.href=url;

  }

</script>
	</body>
</html>
