<?php /*a:1:{s:63:"D:\phpstudy\WWW\12xz\app\admin\view/default\admin\saveinfo.html";i:1782629701;}*/ ?>
<?php echo ModuleInclude('public/header'); ?>

<!-- right content start  -->
<div class="content-right">
	<div class="content">
        <!-- nav start -->
        <?php echo ModuleInclude('public/admin_nav', [
            'title'     => MyLang('admin.base_nav_title').(empty($data['id']) ? MyLang('created_title') : MyLang('edit_title')),
            'back_url'  => $is_setup == 1 ? '' : MyUrl('admin/admin/index', $form_back_params),
        ]); ?>
        <!-- nav end -->
        <!-- form start -->
        <form class="am-form form-validation am-form-full-screen am-form-popup-sticky" action="<?php echo MyUrl('admin/admin/save'); ?>" method="POST" request-type="ajax-<?php if($is_setup == 1): ?>view<?php else: ?>url<?php endif; ?>" request-value="<?php echo MyUrl('admin/admin/index', $form_back_params); ?>">
            <div class="am-form-group am-form-file">
                <label class="am-block"><?php echo MyLang('common_service.admin.form_item_avatar'); ?></label>
                <div class="am-form-file-upload-container">
                    <ul class="plug-file-upload-view avatar-images-view" data-form-name="avatar" data-max-number="1" data-dialog-type="images" data-is-eye="1">
                        <li class="plug-file-upload-submit" data-view-tag="ul.avatar-images-view">
                            <?php if(empty($data['avatar'])): ?>
                                <i class="iconfont icon-add"></i>
                            <?php else: ?>
                                <input type="text" name="avatar" value="<?php echo htmlentities((string) $data['avatar']); ?>" />
                                <img src="<?php echo htmlentities((string) $data['avatar']); ?>" />
                                <i class="iconfont icon-close"></i>
                                <i class="iconfont icon-eye"></i>
                            <?php endif; ?>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="am-form-group">
                <label><?php echo MyLang('common_service.admin.form_item_username'); if(empty($data)): ?><span class="am-form-group-label-tips-must">*</span><?php endif; ?><a href="javascript:;" class="am-icon-question-circle am-margin-left-xs" data-am-popover="{content: '<?php if(empty($data)): ?><?php echo MyLang('common_service.admin.form_item_username_created_tips'); else: ?><?php echo MyLang('common_service.admin.form_item_username_edit_tips'); ?><?php endif; ?>', trigger: 'hover focus', theme: 'sm'}"></a></label>
                <input type="text" name="username" placeholder="<?php echo MyLang('common_service.admin.form_item_username_message'); ?>" pattern="<?php echo MyConst('common_regex_username'); ?>" data-validation-message="<?php echo MyLang('common_service.admin.form_item_username_message'); ?>" class="am-radius" <?php if(!empty($data['username'])): ?>value="<?php echo htmlentities((string) $data['username']); ?>" disabled<?php endif; ?> required />
            </div>
            <div class="am-form-group">
                <label><?php echo MyLang('common_service.admin.form_item_password'); if(empty($data)): ?><span class="am-form-group-label-tips-must">*</span><?php else: ?><span class="am-form-group-label-tips"><?php echo MyLang('common_service.admin.form_item_password_edit_tips'); ?></span><?php endif; ?></label>
                <input type="password" name="login_pwd" placeholder="<?php echo MyLang('common_service.admin.form_item_password'); ?>" pattern="<?php echo MyConst('common_regex_pwd'); ?>"  data-validation-message="<?php echo MyLang('common_service.admin.form_item_password_message'); ?>" class="am-radius" autocomplete="off" <?php if(empty($data)): ?>required<?php endif; ?> />
            </div>
            <div class="am-form-group">
                <label><?php echo MyLang('common_service.admin.form_item_mobile'); ?></label>
                <input type="text" name="mobile" placeholder="<?php echo MyLang('common_service.admin.form_item_mobile'); ?>" pattern="<?php echo MyConst('common_regex_mobile'); ?>" data-validation-message="<?php echo MyLang('common_service.admin.form_item_mobile_message'); ?>" class="am-radius" <?php if(!empty($data['mobile'])): ?>value="<?php echo htmlentities((string) $data['mobile']); ?>"<?php endif; ?> />
            </div>
            <div class="am-form-group">
                <label><?php echo MyLang('common_service.admin.form_item_email'); ?></label>
                <input type="email" name="email" placeholder="<?php echo MyLang('common_service.admin.form_item_email'); ?>" maxlength="60" data-validation-message="<?php echo MyLang('common_service.admin.form_item_email_message'); ?>" class="am-radius" value="<?php if(!empty($data['email'])): ?><?php echo htmlentities((string) $data['email']); ?><?php endif; ?>" />
            </div>
            <?php if(!isset($data['id']) or $admin['id'] != $data['id']): ?>
                <div class="am-form-group">
                    <label><?php echo MyLang('common_service.admin.form_item_role'); ?><span class="am-form-group-label-tips-must">*</span></label>
                    <select class="am-radius chosen-select" name="role_id" data-validation-message="<?php echo MyLang('common_service.admin.form_item_role_message'); ?>" required>
                        <option value=""><?php echo MyLang('optional_tips'); ?></option>
                        <?php foreach($role_list as $v): ?>
                            <option value="<?php echo htmlentities((string) $v['id']); ?>" <?php if(isset($data['role_id']) and $data['role_id'] == $v['id']): ?>selected<?php endif; ?>><?php echo htmlentities((string) $v['name']); ?></option>
                        <?php endforeach; ?>
                    </select>
                </div>
            <?php endif; ?>
            <?php echo ModuleInclude('lib/gender'); ?>
            <div class="am-form-group">
                <label><?php echo MyLang('common_service.admin.form_item_status'); ?><span class="am-form-group-label-tips-must">*</span></label>
                <div class="am-radio-group">
                    <?php foreach(MyConst('common_admin_status_list') as $v): ?>
                        <label class="am-radio-inline am-margin-right-sm">
                            <input type="radio" name="status" value="<?php echo htmlentities((string) $v['value']); ?>" <?php if(isset($data['status']) and $data['status'] == $v['value']): ?>checked="checked"<?php else: if(!isset($data['status']) and isset($v['checked']) and $v['checked'] == true): ?>checked="checked"<?php endif; ?><?php endif; ?> data-am-ucheck /> <?php echo htmlentities((string) $v['name']); ?>
                        </label>
                    <?php endforeach; ?>
                </div>
            </div>

            <!-- 插件扩展数据 start -->
            <?php if(isset($shopxo_is_develop) and $shopxo_is_develop == true): ?>
                <div class="plugins-tag">
                    <span>plugins_view_admin_admin_save</span>
                </div>
            <?php endif; if(!empty($plugins_view_admin_admin_save_data) and is_array($plugins_view_admin_admin_save_data)): ?>
                <div class="card-grey">
                    <label class="am-text-sm am-text-warning"><?php echo MyLang('plugins_view_region_config_tips'); ?></label>
                    <div>
                        <?php foreach($plugins_view_admin_admin_save_data as $hook): if(is_string($hook) or is_int($hook)): ?>
                                <?php echo $hook; ?>
                            <?php endif; ?>
                        <?php endforeach; ?>
                    </div>
                </div>
            <?php endif; ?>
            <!-- 插件扩展数据 end -->
            
            <div class="am-form-popup-submit">
                <input type="hidden" name="id" <?php if(!empty($data['id'])): ?>value="<?php echo htmlentities((string) $data['id']); ?>"<?php endif; ?> />
                <button type="submit" class="am-btn am-btn-primary am-radius am-btn-xs btn-loading-example" data-am-loading="{spinner: 'circle-o-notch', loadingText:'<?php echo MyLang('save_title'); ?>'}">
                    <i class="am-icon-save"></i>
                    <span><?php echo MyLang('save_title'); ?></span>
                </button>
            </div>
        </form>
        <!-- form end -->
	</div>
</div>
<!-- right content end  -->

<!-- footer start -->
<?php echo ModuleInclude('public/footer'); ?>