<%@ Page CodeBehind="mysetup.aspx.cs" Language="c#" AutoEventWireup="True" Inherits="Webdisk.mysetup" %>

<%@ Import Namespace="Webdisk" %>
<link href="<%=xml.GetStyle()%>" rel="stylesheet" type="text/css">
<form runat="server">
<input type="hidden" id="hiddenUser" runat="server" />
<input type="hidden" id="hiddenintopostion" runat="server" />
<input type="hidden" id="hiddenUploadmode1" runat="server" />
<input type="hidden" id="hiddenmrorder" runat="server" />
<input type="hidden" id="hiddenlistcount" runat="server" />
<div class="menuBlock" style="background:#fff;">
    <div class="menuHead" style="overflow: hidden; border-bottom: 1px dashed #cfcfcf;">
        <h2 style="font-size: 18px; color: #1EA7DF;">
            <img src="pics/syssetup.gif">
            个性设置</h2>
    </div>
    <table class="form-table">
        <tr>
            <td style="width: 19%;" class="label">
                默认文件列表排序方式：
            </td>
            <td>
                <select class="input4" name="select" id="mrorder">
                    <option value="name asc" selected>名称升序</option>
                    <option value="name desc">名称降序</option>
                    <option value="update asc">时间升序</option>
                    <option value="update desc">时间降序</option>
                    <option value="size asc">大小升序</option>
                    <option value="size desc">大小降序</option>
                    <option value="pic asc">类型升序</option>
                    <option value="pic desc">类型降序</option>
                </select>
            </td>
        </tr>
        <tr>
            <td class="label">
                文件每页列表数：
            </td>
            <td>
				<select name="listcount" id="listcount" class="input4">
					<option value="5">5</option>
					<option value="10">10</option>
					<option value="15">15</option>
					<option selected value="20">20</option>
					<option value="30">30</option>
					<option value="40">40</option>
				</select>
            </td>
        </tr>
        <tr style="display:none;">
            <td class="label">
                登录后默认进入空间：
            </td>
            <td>
               <label><input type="radio" name="intopostion" value="0">我的空间</label>
               <label><input type="radio" name="intopostion" value="1">公共空间</label>
                   
                
            </td>
        </tr>
        <tr runat="server" id="uploadmode">
            <td class="label">
                上传方式：
            </td>
            <td>
               <label><input type="radio" name="mode1" value="0">普通上传</label>
               <label><input type="radio" name="mode1" value="1">ActiveX插件上传</label>
                
            </td>
        </tr>
        <tr>
            <td class="label">
            </td>
            <td>
                <input class="but1" id="btnSaveSetup" type="button" value="保存" name="Button1" onclick="submitSetUp();" runat="server">
            </td>
        </tr>
    </table><br></br><br></br><br></br>
</div>
</form>
<script type="text/javascript">
	function initVal (){
		var pos = $("#hiddenintopostion").val();
		$('[name="intopostion"]').each(function (){
			if(this.value == pos ){
				this.checked = true;
			}
		});
		var model = $("#hiddenUploadmode1").val();
		$('[name="mode1"]').each(function (){
			if(this.value == model ){
				this.checked = true;
			}
		});
		var mroder = $("#hiddenmrorder").val();
		if(mroder != "" && mroder != "null"){
			$("#mrorder")[0].value = mroder;
		}
		var count = $("#hiddenlistcount").val();
		if(count != ""){
			$("#listcount")[0].value = count;
		}
	}
	function submitSetUp(){
	
		var d = dialog();
		d.showModal();
		$.ajax({
			data : {listcount :  encodeURI($("#listcount").val()) ,user : encodeURI($("#hiddenUser").val()),intopostion : encodeURI($('[name="intopostion"]:checked').val()),
					uploadmode : encodeURI($('[name="mode1"]:checked').val()), mrorder: encodeURI($("#mrorder").val())},
			dataType : "json",
			cache:false,
			url : "OtherHandler.ashx?cmd=SaveMySetup" ,
			success : function(data){
				if(data.code == 1 ){
					
				}else{
				
				}
				d.content(data.msg);
				setTimeout(function(){
						d.close().remove();
					},2000);
			}
		});
	}
	initVal();
</script>
