<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Order_sn')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-order_sn" data-rule="required" class="form-control" name="row[order_sn]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-user_id" data-rule="required" data-source="user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Vip_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-vip_id" data-rule="required" data-source="vip/index" data-field="title" class="form-control selectpage" name="row[vip_id]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
                {foreach name="typeList" item="vo"}
                    <option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Xi_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-xi_id" data-rule="required" data-source="user/index" data-field="nickname" class="form-control selectpage" name="row[xi_id]" type="text" value="" onfocus="set_next_input(this);">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Xi_type')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-xi_type" class="form-control selectpicker" name="row[xi_type]">
                {foreach name="xiTypeList" item="vo"}
                    <option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Xi_images')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-xi_images" class="form-control" size="50" name="row[xi_images]" type="text">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-xi_images" class="btn btn-danger plupload" data-input-id="c-xi_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-xi_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-xi_images" class="btn btn-primary fachoose" data-input-id="c-xi_images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-xi_images"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-xi_images"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Zhao_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-zhao_id" data-rule="required" data-source="user/index" data-field="nickname" class="form-control selectpage" name="row[zhao_id]" type="text" value="" onfocus="set_next_input2(this);">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Zhao_type')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-zhao_type" class="form-control selectpicker" name="row[zhao_type]">
                {foreach name="zhaoTypeList" item="vo"}
                    <option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Zhao_images')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-zhao_images" class="form-control" size="50" name="row[zhao_images]" type="text">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-zhao_images" class="btn btn-danger plupload" data-input-id="c-zhao_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-zhao_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-zhao_images" class="btn btn-primary fachoose" data-input-id="c-zhao_images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-zhao_images"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-zhao_images"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Car_address')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-car_address" class="form-control" name="row[car_address]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Lat')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-lat" class="form-control" name="row[lat]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Lng')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-lng" class="form-control" name="row[lng]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Startime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-startime" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[startime]" type="text" value="{:date('Y-m-d H:i:s')}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Endtime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-endtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[endtime]" type="text" value="{:date('Y-m-d H:i:s')}">
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script>

    function set_next_input(obj) {
        //改变下面这个框的数据源
        console.log('洗车');
        $("#c-xi_id_text").data("selectPageObject").option.data = 'user/index?pid=1';
    }


    function set_next_input2(obj) {
        //改变下面这个框的数据源
        console.log('找车');
        $("#c-zhao_id_text").data("selectPageObject").option.data = 'user/index?pid=2';

    }
</script>