<?php /* Smarty version Smarty-3.1.8, created on 2015-11-25 14:17:02
         compiled from "D:\wwwroot\o2o\htdocs\themes\default\xiche\ucenter\car\add.html" */ ?>
<?php /*%%SmartyHeaderCode:6719565029699f09c5-72046440%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'a7968a75e00cedf34d20869aa0c2c31bee008aeb' => 
    array (
      0 => 'D:\\wwwroot\\o2o\\htdocs\\themes\\default\\xiche\\ucenter\\car\\add.html',
      1 => 1448432216,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '6719565029699f09c5-72046440',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.8',
  'unifunc' => 'content_56502969a7d3e5_35504927',
  'variables' => 
  array (
    'chepai' => 0,
    'item' => 0,
    'list' => 0,
    'k' => 0,
    'v' => 0,
    'val' => 0,
    'checolor' => 0,
    'gid' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_56502969a7d3e5_35504927')) {function content_56502969a7d3e5_35504927($_smarty_tpl) {?><?php if (!is_callable('smarty_function_link')) include 'D:\\wwwroot\\o2o\\htdocs\\system\\plugins/smarty\\function.link.php';
?><!DOCTYPE HTML>
<html>
    <head>
        <?php echo $_smarty_tpl->getSubTemplate ("xiche/block/sheader.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

    </head>
    <body>
    
        <script>
            require(["zepto", "underscore", "frozen"], function($, _, fz) {
                $(".plate").click(function(){
                    $(".plateNum_mask").show();
                });
                $(".carBrand").click(function(){
                    $(".carBrand_mask").show();
                });
                $(".carColor").click(function(){
                    $(".carColor_mask").show();
                });

                $(".payWay_mask .cancel").click(function(){
                    $(this).parent().parent().parent().hide();
                }); 
                
                $('#chepai li').click(function(){
                    $('#paizhao_sf').val($(this).text());
                    $(".payWay_mask").hide();
                })
                
                $('#brand .city_list li').click(function(){
                    var sub = $(this).attr('sub');
                    if(sub == 1){
                        //有子集
                        
                        var link = "<?php echo smarty_function_link(array('ctl'=>'xiche/ucenter/car/sub'),$_smarty_tpl);?>
";
                        var brand_id = $(this).attr('val');
                        $.post(link,{brand_id:brand_id},function(ret){
                           if(ret.error){
                                  alert('失败!');
                              }else{
                                  
                                  var html = '';
                                  html+='<div class="payWay_mask carBrand_mask" id="sub_div" style="display:block;z-index:99999;">';
                                  html+='<div class="cont">';
                                  html+='<div class="title"><a href="#" class="left cancel">取消</a>选择子品牌<a href="#" class="right">确定</a></div><ul>';
                                  html+='<li class="box_list">';
                                  html+='<ul class="city_list">'
                                  $.each(ret.r, function(key, value){
                                    html+='<li style="height:0.3rem;line-height:0.3rem;padding-left:0.1rem;" val="'+value.brand_id+'">'+value.title+'</li>';
                                  })
                                  html+='</ul>';
                                  html+='</li>';
                                  html+='</ul></div></div></div></div>';
                                  $('body').append(html);
        
                                   $(".payWay_mask .cancel").click(function(){
                                        $(this).parent().parent().parent().remove();
                                   }); 
                                    
                                   $('#sub_div .city_list li').click(function(){
                                        $('#brand_name').val($(this).text());
                                        $('#brand_id').val($(this).attr('val'));
                                        $('#sub_div').remove();
                                        $('.payWay_mask').hide();
                                   })
                                   

                              }
                          },'json');
 
                        
                    }else{
                        //若没有子集，点击后直接赋值
                        $('#brand_name').val($(this).text());
                        $('#brand_id').val($(this).attr('val'));
                        $(".payWay_mask").hide();
                    }
                    
                })
                
                $('#che_color li').click(function(){
                    $('#color').val($(this).text());
                    $(".payWay_mask").hide();
                })
               
          if (!window.applicationCache) {
                  alert("不支持HTML5");
          }
          $('#list3').addClass('on');
      });
</script>


<script type="text/javascript">

        function fileSelected(obj){
            var files = obj.files;
            for(var i=0;i<files.length;i++){
                var tag = '';
                var rFilter = /^(image\/gif|image\/jpeg|image\/jpg|image\/png)$/i;
            if (! rFilter.test(files[i].type)) {                   
                alert("只允许上传JPG、PNG、GIF格式图片");
                return false;
            }
            var reader = new FileReader();
            reader.onloadstart = function(e){
                    $(".loading").show();
            }
            reader.onload = function(e){
                $(".login_hadport").css("background-image","url("+e.target.result+")");
            }
            reader.readAsDataURL(files[i]);
        }
} 
</script>


<header>
    <i class="left"><a id="icon_goback" href="<?php echo smarty_function_link(array('ctl'=>'xiche/ucenter/car'),$_smarty_tpl);?>
"></a></i>
    <div class="title">添加车辆</div>
    <i class="right"></i>
</header>

<div class="payWay_mask plateNum_mask">
	<div class="cont">
    	<div class="title"><a href="#" class="left cancel">取消</a>选择车牌<a href="#" class="right">确定</a></div>
        <ul id='chepai'>
            <?php  $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['item']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['chepai']->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;
?>
                <li><?php echo $_smarty_tpl->tpl_vars['item']->value;?>
</li>
             <?php } ?>
        </ul>
    </div>
</div>

<div class="payWay_mask carBrand_mask">
	<div class="cont">
    	<div class="title"><a href="#" class="left cancel">取消</a>选择品牌<a href="#" class="right">确定</a></div>
        <div id="city">
            <div class="city_box">
                <ul id="brand">
                    <?php  $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['v']->_loop = false;
 $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['list']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value){
$_smarty_tpl->tpl_vars['v']->_loop = true;
 $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['v']->key;
?>
                    <li class="box_list">
                        <p id="<?php echo $_smarty_tpl->tpl_vars['k']->value;?>
"><?php echo $_smarty_tpl->tpl_vars['k']->value;?>
</p>
                        <ul class="city_list">
                            <?php  $_smarty_tpl->tpl_vars['val'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['val']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['v']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['val']->key => $_smarty_tpl->tpl_vars['val']->value){
$_smarty_tpl->tpl_vars['val']->_loop = true;
?>
                            <li val="<?php echo $_smarty_tpl->tpl_vars['val']->value['brand_id'];?>
" sub="<?php echo $_smarty_tpl->tpl_vars['val']->value['sub'];?>
" style="height:0.3rem;line-height:0.3rem;padding-left:0.1rem;"><?php echo $_smarty_tpl->tpl_vars['val']->value['title'];?>
</li>
                            <?php } ?>
                        </ul>
                    </li>
                    <?php } ?>
                </ul>
                <div class="city_fixed">
                    <ul>
                        <?php  $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['v']->_loop = false;
 $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['list']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value){
$_smarty_tpl->tpl_vars['v']->_loop = true;
 $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['v']->key;
?>
                        <li><a href="#<?php echo $_smarty_tpl->tpl_vars['k']->value;?>
"><?php echo $_smarty_tpl->tpl_vars['k']->value;?>
</a></li>
                        <?php } ?>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>



<div class="payWay_mask carColor_mask">
	<div class="cont">
    	<div class="title"><a href="#" class="left cancel">取消</a>选择车身颜色<a href="#" class="right">确定</a></div>
        <ul id="che_color">
            <?php  $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['item']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['checolor']->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;
?>
                <li><?php echo $_smarty_tpl->tpl_vars['item']->value;?>
</li>
             <?php } ?>
        </ul>
    </div>
</div>

<section id="" class="page_center_box">
    <form action="<?php echo smarty_function_link(array('ctl'=>'xiche/ucenter/car/add'),$_smarty_tpl);?>
" mini-form="car-form" id="sbtfrm" method="post" ENCTYPE="multipart/form-data">
	<div class="login_hadport hadport_cam">

                <input type="file" name="car_photo" onchange="fileSelected(this)" id="fileField" style="background:none;border:none;border-radius:0.5rem;height:100%;width:100%;opacity:0;filter:alpha(opacity=0);"  />
                
		<a href="###" class="cam"></a>
	</div>
	<ul class="form_list_box" id="carInfor">
	    <li class="pd0 mb10">
        	<table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <th><em class="ico_1"></em></th>
                    <td width="50"><p class="plate"><input type="text" name="paizhao_sf" id="paizhao_sf" value="京"><em></em></p></td>
                    <td><input type="text" class="plateNum" name="paizhao_hao" placeholder="车牌号"></td>
                </tr>
                <tr>
                    <th><em class="ico_2"></em></th>
                    <td colspan="2">
                        <input type="text" class="carBrand" name="brand_name" id="brand_name"  placeholder="选择车辆品牌">
                        <input type="hidden" name="brand_id" id="brand_id" value="">
                    </td>
                </tr>
                <tr>
                    <th><em class="ico_3"></em></th>
                    <td colspan="2"><input type="text" class="carColor" id="color" name="color" placeholder="选择车身颜色"></td>
                </tr>
                <?php if ($_smarty_tpl->tpl_vars['gid']->value){?>
                <input type="hidden" name="gid" id="gid" value="<?php echo $_smarty_tpl->tpl_vars['gid']->value;?>
">
                <?php }?>
            </table>
        </li>
    </ul>
        <div class="yuee_btn"> <input type="submit" value="保存" class="btn" style="width:100%;"></div>
    </form>
</section>
        
<?php echo $_smarty_tpl->getSubTemplate ("xiche/block/sfooter.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>


<script>
 /*require(["zepto", "underscore", "submit", "frozen"], function($, _, submit, fz) {
	   var sbt = new submit();
	   sbt.init({
 	       "form": $("#sbtfrm"),
                "success" : function(ret){
                    if(ret.error){
                        alert(1);
                    }else{
                        alert(2);
                    }
                }
 	           // submit
	       }
 	   });
 });*/
</script>
    </body>
</html><?php }} ?>