<?php /* Smarty version Smarty-3.1.8, created on 2015-11-25 13:52:06
         compiled from "admin:xiche/goods/product.html" */ ?>
<?php /*%%SmartyHeaderCode:3167756554c86b46d42-77980801%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'cee0788152fa1061de374a51b0a54d938e263d97' => 
    array (
      0 => 'admin:xiche/goods/product.html',
      1 => 1446876132,
      2 => 'admin',
    ),
  ),
  'nocache_hash' => '3167756554c86b46d42-77980801',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'pager' => 0,
    'MOD' => 0,
    'goods' => 0,
    'items' => 0,
    'item' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.8',
  'unifunc' => 'content_56554c86cd54a2_77730086',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_56554c86cd54a2_77730086')) {function content_56554c86cd54a2_77730086($_smarty_tpl) {?><?php if (!is_callable('smarty_function_link')) include 'D:\\wwwroot\\o2o\\htdocs\\system\\plugins/smarty\\function.link.php';
?><?php echo $_smarty_tpl->getSubTemplate ("admin:common/header.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

<div class="page-title">
	<table width="100%" align="center" cellpadding="0" cellspacing="0" >
		<tr>
			<td width="30" align="right"><img src="<?php echo $_smarty_tpl->tpl_vars['pager']->value['url'];?>
/images/main-h5-ico.gif" alt="" /></td>
			<th><?php echo $_smarty_tpl->tpl_vars['MOD']->value['title'];?>
</th>
			<td align="right"><?php echo smarty_function_link(array('ctl'=>"xiche/goods:index",'class'=>"button",'title'=>"返回商品管理"),$_smarty_tpl);?>
</td>
			<td width="15"></td>
		</tr>
	</table>
</div>
<div class="page-data">
    <p class="text-align tip-notice"><b>商品：<?php echo $_smarty_tpl->tpl_vars['goods']->value['title'];?>
</b></p></td>
	<form id="items-form">
    <input type="hidden" name="goods_id" value="<?php echo $_smarty_tpl->tpl_vars['goods']->value['goods_id'];?>
" />
    <table width="100%" border="0" cellspacing="0" class="table-data table" id="item-table">
    <tr>
        <th class="w-100">ID</th>
        <th>附加服务名称</th>
        <th class="w-100">价格</th>
        <th class="w-50">排序</th>
        <th class="w-150"><a href="###" batch="add_new_line" >新增一行</a></th>
    </tr>
    <?php  $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['item']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['items']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value){
$_smarty_tpl->tpl_vars['item']->_loop = true;
?>
    <tr id="item-<?php echo $_smarty_tpl->tpl_vars['item']->value['product_id'];?>
">
        <td><label><input type="checkbox" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['product_id'];?>
" name="product_id[]" CK="PRI"/><?php echo $_smarty_tpl->tpl_vars['item']->value['product_id'];?>
<label></td>
        <td><input type="text" name="data[<?php echo $_smarty_tpl->tpl_vars['item']->value['product_id'];?>
][title]" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['title'];?>
" class="input w-300"/></td>
        <td><input type="text" name="data[<?php echo $_smarty_tpl->tpl_vars['item']->value['product_id'];?>
][price]" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['price'];?>
" class="input w-100"/></td>
        <td><input type="text" name="data[<?php echo $_smarty_tpl->tpl_vars['item']->value['product_id'];?>
][orderby]" value="<?php echo $_smarty_tpl->tpl_vars['item']->value['orderby'];?>
" class="input w-50"/></td>
        <td>
            <?php echo smarty_function_link(array('ctl'=>"xiche/goods:delproduct",'args'=>$_smarty_tpl->tpl_vars['item']->value['product_id'],'act'=>"mini:删除",'confirm'=>"mini:确定要删除吗？",'remove'=>"mini:",'title'=>"删除",'class'=>"button"),$_smarty_tpl);?>

        </td>
    </tr>
    <?php } ?>
    </table>
	</form>
	<div class="page-bar">
        <table>
            <tr>
            <td class="w-100"><label><input type="checkbox" CKA="PRI"/>&nbsp;&nbsp;全选</label></td>
            <td colspan="10" class="left">
            <?php echo smarty_function_link(array('ctl'=>"xiche/goods:delproduct",'type'=>"button",'submit'=>"mini:#items-form",'confirm'=>"mini:确定要批量删除选中的内容吗?",'priv'=>"hide",'value'=>"批量删除"),$_smarty_tpl);?>
</td>
            <td class="w-200"><?php echo smarty_function_link(array('ctl'=>"xiche/goods:updateproduct",'type'=>"button",'submit'=>"mini:#items-form",'title'=>"保存数据"),$_smarty_tpl);?>
</td>
        </tr>
        </table>
	</div>
</div>
<script type="text/paint" id="item-line-tmpl">
    <tr>
        <td class="left"><label><input type="checkbox" value="" disabled="disabled" />New<label></td>
        <td><input type="text" name="product[{index}][title]" class="input w-300" value=""></td>
        <td><input type="text" name="product[{index}][price]" value="" class="input w-100" value=""></td>
        <td><input type="text" name="product[{index}][orderby]" value="50" class="input w-50" value=""></td>
        <td><a href="###" batch="remove_item_line">移除</a></td>
    </tr>
</script>
<script type="text/javascript">
(function(K, $){
$(document).ready(function(){
    var tmpl = $("#item-line-tmpl").html();
    $("a[batch='add_new_line']").click(function(){
        var k = K.Guid();
        $("#item-table").append(tmpl.replace(new RegExp("{index}","gm"),k));
    }).click();
    $("a[batch='remove_item_line']").die().live('click',function(){
        $(this).parent().parent('tr').remove();
    });
});
})(window.KT, window.jQuery)
</script>
<?php echo $_smarty_tpl->getSubTemplate ("admin:common/footer.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>
<?php }} ?>