You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					114 lines
				
				4.4 KiB
			
		
		
			
		
	
	
					114 lines
				
				4.4 KiB
			|   
											1 year ago
										 | <!DOCTYPE html> | ||
|  | <html lang="en"> | ||
|  | <head> | ||
|  |     <meta http-equiv="content-type" content="text/html; charset=UTF-8"> | ||
|  |     <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
|  |     <script type="text/javascript" src="{$smarty.const.CSS_URL}/js/jquery-1.8.1.min.js"></script> | ||
|  |     <script type="text/javascript" src="{$smarty.const.CSS_URL}/js/jquery.form.js"></script> | ||
|  |     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | ||
|  |     <title>添加用户</title> | ||
|  |     <meta name="viewport" content="width=device-width,initial-scale=1"> | ||
|  |     <link href="{$smarty.const.CSS_URL}/css/global.css?v={$smarty.const.CSS_JS_VERSION}" media="screen" rel="stylesheet" type="text/css"> | ||
|  | </head> | ||
|  | <body> | ||
|  | 
 | ||
|  | <div id="page"> | ||
|  |     <div class="container"> | ||
|  |         <section id="main"> | ||
|  |             <div id="main-content"> | ||
|  |                 <div class="record-control"> | ||
|  |                     <div class="header"> | ||
|  |                         <span style="font-size:14px;padding:5px">添加用户</span> | ||
|  |                         <div class="row"> </div> | ||
|  |                         <div class="flash-message"></div> | ||
|  | 
 | ||
|  |                         <ul class="tabs"><li></li></ul> | ||
|  |                     </div> | ||
|  |                 </div> | ||
|  | 
 | ||
|  |                 <div id="domain-list"> | ||
|  |                     <div class="entry"> | ||
|  |                         <div class="modal-body"> | ||
|  |                             <div class="wizard-container"><div> | ||
|  |                                 <div class="inputs"> | ||
|  |                                     <div id="form_area"> | ||
|  |                                         <form id="prescription-form" onsubmit="submitForm(event)"> | ||
|  |                                             <input id="id" name="id" type="hidden" value="{$data.id}"> | ||
|  | 
 | ||
|  |                                             <div class="row"> </div> | ||
|  | 
 | ||
|  |                                             <div class="row"> | ||
|  |                                                 <label for="name">用户名<font color='red'>*</font>:</label> | ||
|  |                                                 <input type="text" id="name" name="name" maxlength="" style="width:280px" value=""> | ||
|  |                                             </div> | ||
|  | 
 | ||
|  |                                             <div class="row"> </div> | ||
|  | 
 | ||
|  |                                             <div class="row" id="" style="position:relative;"> | ||
|  |                                                 <label> </label> | ||
|  | 
 | ||
|  |                                                 <button class="button primary next submitlock" id="submitbtn" onclick="submitForm()"><span class="tdesc_text" style="color:white;">提交</span></button> | ||
|  |                                             </div> | ||
|  | 
 | ||
|  |                                             <div class="row"> </div> | ||
|  |                                         </form> | ||
|  |                                     </div> | ||
|  |                                 </div> | ||
|  |                             </div> | ||
|  |                             </div></div> | ||
|  |                         <div style="display: none;" id="formtips"> | ||
|  |                             <div class="alert-message block-message info" style="color:red;"></div> | ||
|  |                         </div> | ||
|  |                     </div> | ||
|  |                     <!--end of a domain entry--> | ||
|  |                 </div> | ||
|  |                 <!-- 批量上传 <div id="onetickupload"></div> --> | ||
|  |             </div> | ||
|  |         </section> | ||
|  |     <!--end of main section--> | ||
|  |     </div><!--end of container--> | ||
|  | </div><!--end of #page--> | ||
|  | 
 | ||
|  | {literal} | ||
|  | <script type="text/javascript"> | ||
|  | 
 | ||
|  |     function submitForm(e) { | ||
|  |         e.preventDefault(); // 阻止默认表单提交 | ||
|  |         const name = document.getElementById('name').value; | ||
|  |         $.ajax({ | ||
|  |             url: '/admin/ajax_save_user', // 替换为你的服务器端处理文件 | ||
|  |             type: 'POST', | ||
|  |             data: {name:name}, | ||
|  |             dataType: 'json', | ||
|  |             success: function (response) { | ||
|  |                 alert(response.info); | ||
|  |                 if (response.status == true) { | ||
|  |                     window.location.href = "/admin/user_list" | ||
|  |                 } | ||
|  | 
 | ||
|  |                 if(response.data.code == 40002){ | ||
|  |                     window.location.href = "/admin/login"; | ||
|  |                 } | ||
|  |             }, | ||
|  |             error: function (xhr, status, error) { | ||
|  |                 console.error('错误:', response); | ||
|  |                 alert('提交失败,请重试。'); | ||
|  |             } | ||
|  |         }); | ||
|  |     } | ||
|  | 
 | ||
|  | </script> | ||
|  | <style> | ||
|  |     .add-button { | ||
|  |         width: 20px; | ||
|  |         height: 20px; | ||
|  |         background-color: #DD4B38; | ||
|  |         border: none; | ||
|  |         border-radius: 50px; | ||
|  |         color: #fff; | ||
|  |     } | ||
|  | </style> | ||
|  | {/literal} | ||
|  | 
 | ||
|  | </body> | ||
|  | </html> |