<?php /* Smarty version Smarty-3.0.6, created on 2020-03-09 15:15:43
         compiled from "D:/AppServ/www/demo.hucart.com/hucart_cn/templates/adminsys\product_edit.tpl" */ ?>
<?php /*%%SmartyHeaderCode:318105e65ed1f605ef2-48867786%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'be8af822e44c6db9ff02abae8dbb8905061a06c1' => 
    array (
      0 => 'D:/AppServ/www/demo.hucart.com/hucart_cn/templates/adminsys\\product_edit.tpl',
      1 => 1485323398,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '318105e65ed1f605ef2-48867786',
  'function' => 
  array (
  ),
  'has_nocache_code' => false,
)); /*/%%SmartyHeaderCode%%*/?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title><?php echo $_smarty_tpl->getVariable('txt_title')->value;?>
 - Powered by HuCart.COM</title>
<link href="./css/bootstrap.min.css" rel="stylesheet">
<link href="./css/info.css" rel="stylesheet">
<script language="javascript" src="<?php echo $_smarty_tpl->getVariable('base_weburl')->value;?>
/js/pinyin.js"></script>
<script language="javascript" src="<?php echo $_smarty_tpl->getVariable('base_weburl')->value;?>
/js/admin_common.js"></script>
<!--[if lt IE 9]>
  <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script language="javascript">
	var webroot_url = '<?php echo $_smarty_tpl->getVariable('base_weburl')->value;?>
';
	function submitFun()
	{
			var idpro_name 			= document.getElementById('pro_name');
			var idprs_id 			= document.getElementById('prs_id');
			var idpro_num 			= document.getElementById('pro_num');
			var idpro_unit 			= document.getElementById('pro_unit');
			var idpro_img 			= document.getElementById('pro_img');
			var idpro_sell_price 	= document.getElementById('pro_sell_price');
			var content				= CKEDITOR.instances.pro_content.getData();
			//var idsuggestionInfo 	= document.getElementById('suggestionInfo');
	
			if(idpro_name.value=='')
			{
				alert('<?php echo $_smarty_tpl->getVariable('lang')->value['pro_name_err'];?>
');
				idpro_name.focus();
				return false;
			}else if(idprs_id.value=='')
			{
				alert('<?php echo $_smarty_tpl->getVariable('lang')->value['prs_id_err'];?>
');
				idprs_id.focus();
				return false;
			}else if(idpro_num.value=='')
			{
				alert('<?php echo $_smarty_tpl->getVariable('lang')->value['pro_num_err'];?>
');
				idpro_num.focus();
				return false;
			}else if(idpro_unit.value=='')
			{
				alert('<?php echo $_smarty_tpl->getVariable('lang')->value['pro_unit_err'];?>
');
				idpro_unit.focus();
				return false;
			}else if(idpro_img.value=='')
			{
				alert('<?php echo $_smarty_tpl->getVariable('lang')->value['pro_img_err'];?>
');
				idpro_img.focus();
				return false;
			}else if(idpro_sell_price.value=='')
			{
				alert('<?php echo $_smarty_tpl->getVariable('lang')->value['pro_sell_price_err'];?>
');
				idpro_sell_price.focus();
				return false;
			}else if(content=='')
			{
				alert('<?php echo $_smarty_tpl->getVariable('lang')->value['pro_content_err'];?>
');
				CKEDITOR.instances.pro_content.focus();
				return false;
			}
	
			//document.formSub.action='./index.php?load=product&act=add_info';
			document.formSub.target="_self"
			document.formSub.submit();
	}
	
	
	function get_pro_attribute(obj,pro_id_val)
	{
		$.post("./index.php?load=ajax_pro_type&act=get_pro_type",{ prt_id: obj.value,pro_id:pro_id_val },function(data){
		$("#div_pro_attribute").html(data);
		});	
	}
	
	function is_exists_barcode(obj)
	{
		pro_id_val = document.getElementById('pro_id').value;
		if(obj.value!=''){
			$.post("./index.php?load=ajax_exists_barcode&act=get_barcode",{barcode_val: obj.value ,pro_id:pro_id_val },function(data){
				if(data=='error'){
					$("#barcode_show_div").css("color","red");
					$("#barcode_show_div").html('<?php echo $_smarty_tpl->getVariable('lang')->value['barcode_exists_say'];?>
');
				}else{
					$("#barcode_show_div").css("color","black");
					$("#barcode_show_div").html('<?php echo $_smarty_tpl->getVariable('lang')->value['barcode_say'];?>
');
					}
			});
		}
	}
</script>
</head>
<body>
    <div class="info-tit"><span class="glyphicon glyphicon-paperclip"> </span> <?php echo $_smarty_tpl->getVariable('lang')->value['title'];?>
 > <?php echo $_smarty_tpl->getVariable('txt_title')->value;?>
 (<?php echo $_smarty_tpl->getVariable('lang')->value['need_edit'];?>
&nbsp;&nbsp; <?php echo $_smarty_tpl->getVariable('lang')->value['need_add'];?>
 <?php echo $_smarty_tpl->getVariable('lang')->value['need_del'];?>
)<a href="http://help.hucart.com/item-product_edit.html" target="_blank"  title="<?php echo $_smarty_tpl->getVariable('lang')->value['help_url'];?>
"><span class="glyphicon glyphicon-question-sign" style="float: right;"></span></a></div>
    <!-- custom con start -->
    <div class="info-add">
      <form class="form-horizontal" name="add-form" id="add-form" method="post" action="<?php echo $_smarty_tpl->getVariable('act_url')->value;?>
">
        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"><font color="red">*</font> <?php echo $_smarty_tpl->getVariable('lang')->value['field_list']['pro_name'];?>
</label>
          <div class="col-sm-10">
            <input class="form-control" name="pro_name" id="pro_name" value="<?php echo $_smarty_tpl->getVariable('info')->value['pro_name'];?>
" type="text"  style="width:450px;"  onblur="getPinYinValue('pro_name','pro_phoneticize')"  >
          </div>
        </div>
  
        <div class="form-group form-group-sm" style="display:none;">
          <label class="col-sm-2 control-label" for="i-tit"> <?php echo $_smarty_tpl->getVariable('lang')->value['field_list']['pro_phoneticize'];?>
</label>
          <div class="col-sm-3">
            <input class="form-control" name="pro_phoneticize" id="pro_phoneticize" value="<?php echo $_smarty_tpl->getVariable('info')->value['pro_phoneticize'];?>
" type="text"  style="width:300px;"    >
          </div><div class="col-sm-3"><?php echo $_smarty_tpl->getVariable('lang')->value['phoneticize_say'];?>
</div>
        </div>   
        
        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"><font color="red">*</font> <?php echo $_smarty_tpl->getVariable('lang')->value['field_list']['prs_id'];?>
</label>
          <div class="col-sm-3">
            <?php echo $_smarty_tpl->getVariable('pro_sort_select')->value;?>

          </div>
        </div>      
        
        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"> <?php echo $_smarty_tpl->getVariable('lang')->value['field_list']['bra_id'];?>
</label>
          <div class="col-sm-3">
            <?php echo $_smarty_tpl->getVariable('brand_select')->value;?>
 
          </div>
        </div> 

        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"> <?php echo $_smarty_tpl->getVariable('lang')->value['field_list']['prt_id'];?>
</label>
          <div class="col-sm-3">
            <?php echo $_smarty_tpl->getVariable('pro_type_select')->value;?>
 
          </div><script language="javascript" >
obj =  document.getElementById('prt_id');
get_pro_attribute(obj, '<?php echo $_smarty_tpl->getVariable('info')->value['pro_id'];?>
');</script>
        </div> 

        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"> <?php echo $_smarty_tpl->getVariable('lang')->value['field_list']['prt_id_val'];?>
</label>
          <div class="col-sm-6">
           <div id="div_pro_attribute"></div>
          </div>
        </div> 

        
        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"> <?php echo $_smarty_tpl->getVariable('lang')->value['field_list']['pro_barcode'];?>
</label>
          <div class="col-sm-3">
            <input class="form-control" name="pro_barcode" id="pro_barcode" value="<?php echo $_smarty_tpl->getVariable('info')->value['pro_barcode'];?>
" type="text"  style="width:300px;"  onblur="is_exists_barcode(this)"   >
          </div><div class="col-sm-4" style="margin-left:12px;" id="barcode_show_div"><?php echo $_smarty_tpl->getVariable('lang')->value['barcode_say'];?>
</div>
        </div>
        
        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"> <?php echo $_smarty_tpl->getVariable('lang')->value['field_list']['pro_spec'];?>
</label>
          <div class="col-sm-6">
            <input class="form-control" name="pro_spec" id="pro_spec" value="<?php echo $_smarty_tpl->getVariable('info')->value['pro_spec'];?>
" type="text"  style="width:300px;"    >
          </div>
        </div>
        
        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"><font color="red">*</font> <?php echo $_smarty_tpl->getVariable('lang')->value['field_list']['pro_num'];?>
</label>
          <div class="col-sm-6">
            <input class="form-control" name="pro_num" id="pro_num" value="<?php echo $_smarty_tpl->getVariable('info')->value['pro_num'];?>
" type="text"  style="width:300px;"    >
          </div>
        </div> 
        
        
        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"><font color="red">*</font> <?php echo $_smarty_tpl->getVariable('lang')->value['field_list']['pro_unit'];?>
</label>
          <div class="col-sm-6">
            <input class="form-control" name="pro_unit" id="pro_unit" value="<?php echo $_smarty_tpl->getVariable('info')->value['pro_unit'];?>
" type="text"  style="width:300px;"    >
          </div>
        </div> 
        
        
        <div class="form-group form-group-sm" id="img_div_arr">
          <label class="col-sm-2 control-label" for="i-tit"><font color="red">*</font> <?php echo $_smarty_tpl->getVariable('lang')->value['field_list']['pro_img'];?>
 <span  onclick="add_img_div()" >(+)</span></label>
          <div class="col-sm-3">
            <input class="form-control" name="pro_img[]" id="pro_img_0" value="<?php echo $_smarty_tpl->getVariable('info')->value['pro_img'];?>
" type="text"  style="width:300px;"    >
          </div>
          <div class="col-sm-3" style="margin-left:12px;"><button type="button" class="btn btn-default"  onclick="select_img('product','pro_img_0')" ><?php echo $_smarty_tpl->getVariable('lang')->value['add_img'];?>
</button></div>
        </div> 
 <?php  $_smarty_tpl->tpl_vars['img_item'] = new Smarty_Variable;
 $_smarty_tpl->tpl_vars['img_key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->getVariable('img_info')->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
if ($_smarty_tpl->_count($_from) > 0){
    foreach ($_from as $_smarty_tpl->tpl_vars['img_item']->key => $_smarty_tpl->tpl_vars['img_item']->value){
 $_smarty_tpl->tpl_vars['img_key']->value = $_smarty_tpl->tpl_vars['img_item']->key;
?>
        <div class="form-group form-group-sm" id="imgdel_<?php echo $_smarty_tpl->tpl_vars['img_key']->value;?>
">
          <label class="col-sm-2 control-label" for="i-tit"> <?php echo $_smarty_tpl->getVariable('lang')->value['field_list']['pro_img'];?>
 <span  onclick="del_img_div('del_<?php echo $_smarty_tpl->tpl_vars['img_key']->value;?>
')" >(-)</span></label>
          <div class="col-sm-3">
            <input class="form-control" name="pro_img[]" id="pro_img_a<?php echo $_smarty_tpl->tpl_vars['img_key']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['img_item']->value['pri_url'];?>
" type="text"  style="width:300px;"    >
          </div>
          <div class="col-sm-3" style="margin-left:12px;"><button type="button" class="btn btn-default" onclick="select_img('product','pro_img_a<?php echo $_smarty_tpl->tpl_vars['img_key']->value;?>
')" ><?php echo $_smarty_tpl->getVariable('lang')->value['add_img'];?>
</button></div>
        </div> 
 
 <?php }} ?>

        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"> <?php echo $_smarty_tpl->getVariable('lang')->value['field_list']['pro_production'];?>
</label>
          <div class="col-sm-6">
            <input class="form-control" name="pro_production" id="pro_production" value="<?php echo $_smarty_tpl->getVariable('info')->value['pro_production'];?>
" type="text"  style="width:300px;"    >
          </div>
        </div> 


        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"><font color="red">*</font> <?php echo $_smarty_tpl->getVariable('lang')->value['field_list']['pro_sell_price'];?>
</label>
          <div class="col-sm-6">
            <input class="form-control" name="pro_sell_price" id="pro_sell_price" value="<?php echo $_smarty_tpl->getVariable('info')->value['pro_sell_price'];?>
" type="text"  style="width:300px;"    >
          </div>
        </div> 
        
        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"> <?php echo $_smarty_tpl->getVariable('lang')->value['field_list']['pro_market_price'];?>
</label>
          <div class="col-sm-6">
            <input class="form-control" name="pro_market_price" id="pro_market_price" value="<?php echo $_smarty_tpl->getVariable('info')->value['pro_market_price'];?>
" type="text"  style="width:300px;"    >
          </div>
        </div> 
        
        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"> <?php echo $_smarty_tpl->getVariable('lang')->value['field_list']['pro_lowest_price'];?>
</label>
          <div class="col-sm-6">
            <input class="form-control" name="pro_lowest_price" id="pro_lowest_price" value="<?php echo $_smarty_tpl->getVariable('info')->value['pro_lowest_price'];?>
" type="text"  style="width:300px;"    >
          </div>
        </div> 
        
        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"> <?php echo $_smarty_tpl->getVariable('lang')->value['field_list']['pro_buy_price'];?>
</label>
          <div class="col-sm-6">
            <input class="form-control" name="pro_buy_price" id="pro_buy_price" value="<?php echo $_smarty_tpl->getVariable('info')->value['pro_buy_price'];?>
" type="text"  style="width:300px;"    >
          </div>
        </div> 

        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"><font color="red">*</font> <?php echo $_smarty_tpl->getVariable('lang')->value['field_list']['pro_content'];?>
</label>
          <div class="col-sm-6">
            <?php echo $_smarty_tpl->getVariable('ckeditorLoad')->value;?>

          </div>
        </div> 

        <div class="form-group form-group-sm">
          <label class="col-sm-2 control-label" for="i-tit"><font color="red">*</font> <?php echo $_smarty_tpl->getVariable('lang')->value['field_list']['pro_enabled'];?>
</label>
          <div class="col-sm-6">
<?php  $_smarty_tpl->tpl_vars['ei'] = new Smarty_Variable;
 $_smarty_tpl->tpl_vars['ek'] = new Smarty_Variable;
 $_from = $_smarty_tpl->getVariable('lang')->value['enabled_arr']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
if ($_smarty_tpl->_count($_from) > 0){
    foreach ($_from as $_smarty_tpl->tpl_vars['ei']->key => $_smarty_tpl->tpl_vars['ei']->value){
 $_smarty_tpl->tpl_vars['ek']->value = $_smarty_tpl->tpl_vars['ei']->key;
?>&nbsp;&nbsp;
<?php echo $_smarty_tpl->tpl_vars['ei']->value;?>
<input type="radio"   name="pro_enabled" id="pro_enabled[<?php echo $_smarty_tpl->tpl_vars['ek']->value;?>
]"  value="<?php echo $_smarty_tpl->tpl_vars['ek']->value;?>
" <?php if ($_smarty_tpl->tpl_vars['ek']->value==1){?> checked="checked" <?php }?>>
<?php }} ?>
          </div>
        </div> 

        <div class="form-group">
          <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-primary  btn-sm" onclick="return submitFun(this)" ><?php echo $_smarty_tpl->getVariable('edit_submit')->value;?>
</button>&nbsp;&nbsp;&nbsp;&nbsp;
            <button type="reset" class="btn btn-default btn-sm"><?php echo $_smarty_tpl->getVariable('lang')->value['reset'];?>
</button>
          </div>
        </div>
        <input type="hidden" name="act_type" value="<?php echo $_smarty_tpl->getVariable('act_type')->value;?>
">
        <input type="hidden" name="pro_id" id="pro_id"  value="<?php echo $_smarty_tpl->getVariable('info')->value['pro_id'];?>
">
      </form>
    </div>
    <!-- custom con end -->

    <footer class="footer">
      <div class="container">
        <p class="text-muted">Powered by <a href="http://Www.HuCart.COM" target="_blank">HuCart.COM</a></p>
      </div>
    </footer>
<script src="<?php echo $_smarty_tpl->getVariable('base_weburl')->value;?>
/js/jquery.min.js"></script>
<script src="<?php echo $_smarty_tpl->getVariable('base_weburl')->value;?>
/js/base.js"></script>
   <script language="javascript">
   var index_key = 0 ;
   function add_tr(obj_id)
   {
		var obj_id 			= obj_id;
		var sml_val 		= index_key;
		var show_name 		= $("#txt_pra_name_"+obj_id).val();
		var input_str 		= $("#show_val_id_"+obj_id).html(); 
		var price_str 		= $("#show_pri_id_"+obj_id).html();
		//alert(input_str);
		$('#pra_tr_'+obj_id).after("<tr  id=\"pra_tr_"+obj_id+"_sm"+sml_val+"\"   bgcolor=\"#f3f3f3\" onMouseOut=\"this.bgColor='#f3f3f3';\"; onMouseOver=\"this.bgColor='#C3E2FF';\" ><td class=\"tdcenter\">"+show_name+"</td><td class=\"keykey\">"+input_str+"</td><td class=\"keykey\">"+price_str+"</td><td class=\"keykey\"> <span  onclick=\"del_tr("+obj_id+","+sml_val+")\" >(-)</span> </td></tr>");
		index_key = index_key + 1;
   }
	var index_img_key = 0;
   function add_img_div()
   {
		$('#img_div_arr').after('<div class="form-group form-group-sm" id=\"img'+index_img_key+'\" ><label class="col-sm-2 control-label" for="i-tit"><?php echo $_smarty_tpl->getVariable('lang')->value['field_list']['pro_img'];?>
 <span  onclick="del_img_div('+index_img_key+')" >(-)</span></label><div class="col-sm-3"><input class="form-control" name="pro_img[]" id="pro_img_b'+index_img_key+'" value="<?php echo $_smarty_tpl->getVariable('info')->value['pro_img'];?>
" type="text"  style="width:300px;"></div><div class="col-sm-3"><button type="button" class="btn btn-default" onclick="select_img(\'product\',\'pro_img_b'+index_img_key+'\')" ><?php echo $_smarty_tpl->getVariable('lang')->value['add_img'];?>
</button></div></div>');
		index_img_key = index_img_key + 1;   
   }
   

   function del_img_div(del_key)
   { 
		 var is_del = window.confirm("<?php echo $_smarty_tpl->getVariable('lang')->value['is_delete'];?>
");  
 		 var obj_id = obj_id;
         if(!is_del){  
              return false;  
          }else{  
              $('#img'+del_key).remove();  
              return false;  
          }  
          return false;  
   }
   
   
   function del_tr(obj_id,sml_val)
   { 
		 var is_del = window.confirm("<?php echo $_smarty_tpl->getVariable('lang')->value['is_delete'];?>
");  
 		 var obj_id = obj_id;
         if(!is_del){  
              return false;  
          }else{  
              $('#pra_tr_'+obj_id+'_sm'+sml_val).remove();  
              return false;  
          }  
          return false;  
   }
    </script>
</body>
</html>