负边距的应用

HTML:

<tr>
    <td class="PX15 widthTD1 textRight heightFirst" valign="top"><div class="paddingTop12">机器尺寸:</div></td>
    <td class="PX15 widthTD2 heightFirst">
        <ul class="widthTD2" id="chooseServer">
            <li>
                <div class="activeServer" onclick="tabServer(this);">1U服务器</div>
            </li>
            <li>
                <div class="defaultServer" onclick="tabServer(this);">2U服务器</div>
            </li>
            <li>
                <div class="defaultServer" onclick="tabServer(this);">4U服务器</div>
            </li>
        </ul>
    </td>
</tr>

"负边距的应用"继续阅读

SQLServer 存储过程实现单条件分页

SQLServer - 代码:

SQLServer Procedure Pagination_basic:
ALTER PROCEDURE [qiancheng].[Pagination_basic] (
@Table_name VARCHAR (255),
--name of table
@Rows_target VARCHAR (1000) = '*',
--search rows
@Rows_condition VARCHAR (1000) = '',
--the condition to find target (no where)
@Rows_order VARCHAR (255) = '',
--the rows to rank
@Order_type INT = 0,
-- *Q*C* 0 normal 1 down
@PageSizes INT = 10,
--the size of each page
@PageIndex INT = 1,
--current page
@ShowPages INT,
--whether show the pages *Q*C* 1-yes 0-no
@ShowRecords INT,
--whether show the record *Q*C* 1-yes 0-no
@Records_total INT OUTPUT,
--returned total records
@Pages_total INT OUTPUT --returned total pages
) AS
DECLARE @MainSQL_QC nvarchar (2000) --Main SQL sentence
DECLARE @Var_QC VARCHAR (100) --Temporary variate
DECLARE @Order_QC VARCHAR (400) --the sort to rank
SET @Records_total = 0
SET @Pages_total = 0
IF @ShowRecords = 1
OR @ShowPages = 1
BEGIN

IF @Rows_condition != ''
SET @MainSQL_QC = 'select @Records_total = count(1) from [' + @Table_name + '] where ' +@Rows_condition
ELSE

SET @MainSQL_QC = 'select @Records_total = count(1) from [' + @Table_name + ']' EXEC sp_executesql @MainSQL_QC,
 N'@Records_total int out' ,@Records_total OUTPUT
END
IF @ShowPages = 1
BEGIN

IF @Records_total <= @PageSizes
SET @Pages_total = 1
ELSE

BEGIN

SET @Pages_total = @Records_total /@PageSizes
IF (@Records_total %@PageSizes) > 0
SET @Pages_total = @Pages_total + 1
END
END
IF @Order_type = 1
BEGIN

SET @Var_QC = '<(select min'
SET @Order_QC = ' order by [' + @Rows_order + '] desc'
END
ELSE

BEGIN

SET @Var_QC = '>(select max'
SET @Order_QC = ' order by [' + @Rows_order + '] asc'
END
IF @PageIndex = 1
BEGIN

IF @Rows_condition != ''
SET @MainSQL_QC = 'select top ' + str(@PageSizes) + ' ' +@Rows_target + ' from [' + @Table_name + '] where ' + @Rows_condition + ' ' + @Order_QC
ELSE

SET @MainSQL_QC = 'select top ' + str(@PageSizes) + ' ' +@Rows_target + ' from [' + @Table_name + '] ' + @Order_QC
END
ELSE

BEGIN

IF @Rows_condition != ''
SET @MainSQL_QC = 'select top ' + str(@PageSizes) + ' ' +@Rows_target + ' from [' + @Table_name + '] where [' + @Rows_order + ']' + @Var_QC + '([' + @Rows_order + ']) from (select top ' + str((@PageIndex - 1) *@PageSizes) + ' [' + @Rows_order + '] from [' + @Table_name + '] where ' + @Rows_condition + ' ' + @Order_QC + ') as Tmep_QC) and ' + @Rows_condition + ' ' + @Order_QC
ELSE

SET @MainSQL_QC = 'select top ' + str(@PageSizes) + ' ' +@Rows_target + ' from [' + @Table_name + '] where [' + @Rows_order + ']' + @Var_QC + '([' + @Rows_order + ']) from (select top ' + str((@PageIndex - 1) *@PageSizes) + ' [' + @Rows_order + '] from [' + @Table_name + ']' + @Order_QC + ') as Tmep_QC)' + @Order_QC
END EXEC (@MainSQL_QC)

调用:execute pagination_basic 'UserDetail','*','','id','1','5','1','1','1','',''

主要是末尾的语句,拆分下来便是这样:

select top 每页数 列名 from [表名] where [排序字段名] < --1 倒序输出若列 小于之前页数的最小值

(select min ( [排序字段名] ) from --2 获得一个指定列名中的最小值并输出

(select top (当前页-1) * 每页数 [排序字段名] from [表名] where [条件] [排序类型]) --3 选择之前页数总数据倒序输出

as Tmep_QC) --4 建立一个名为 Tmep_QC 的临时表 --2 获得一个指定列名中的最小值并输出

and [条件] [排序类型] --1 倒序输出若列 小于之前页数的最小值

jQuery AJAX 遮罩实例

function transferip()
{
    var site_list=$("textarea[name='Oldsite']").val();
    var ip_list=$("textarea[name='Oldip']").val();
    var ip_new=$("input[name='Newip']").val();
    if(ip_list==""||ip_new=="")
    {
        alert('IT CANNOT BE EMPTY!');
        return false;
    }
    ajaxStar("LOADING...");
    $.ajax(
    {
        type:"post",
        url:"transip.mazey",
        data:{"search":"check_ip","ip_list":escape(ip_list),"ip_new":ip_new,"site_list":escape(site_list)},
        error:function(){
            ajaxClose();
            alert("SYSTEM ERROR!");
        },
        success:function(msg)
        {
            ajaxClose();
            var msgArr=msg.split("-|-")
            if(msgArr[0]=="413")
            {
                alert(msgArr[1]);
            }
            else
            {
                alert(msgArr[1]);
            }

        }
    }
    )
}

/**div加载ajax效果***/
function ajaxStar(str,e){//str提示信息  e:iframe框访
    var html="";
    html+="<div id='ajaxLoadDiv'></div>";
    html+="<div class='ajaxLoadIcon'>";
    html+= "<span class='ajaxIcon'></span>";
    if(str)
        html+="<span class='ajaxInfo'>"+str+"</span>";
    html+="</div>";
    $("body").append(html);    
    var divH=$(document).height();//-$("#admin_topbj").height();
    $("#ajaxLoadDiv").css({"height":divH,"top":0,"opacity":0.5});
    var iconTop=$(window).height()/2;
    iconTop=iconTop+$(document).scrollTop();
    $(".ajaxLoadIcon").css({"top":iconTop+"px"});
}

/****关闭ajax遮罩*****/
function ajaxClose(){    
    $("#ajaxLoadDiv").remove();
    $(".ajaxLoadIcon").remove();    
}

function look_seven(){
    window.location.href="/Setinmanager/winhost/migratejob/record.asp";
}

图片:overlay.png

图片:ajaxLoad.gif

jQuery AJAX 同步和异步的区别

function paginationGo(page){
    sendata = {"page":page};
    $.ajax({
        type:"POST",
        url:"newqc1.asp",
        async:true,
        timeout:10000,
        data:sendata,
        success:function(data){
            //alert(data+"aa");
            $("#qc01").html(data);
        },
        error:function(data){
            alert("连接服务器失败!");
        }
    });
}

当异步关了的时候(同步),即 async: false,传输数据的时候页面会假死,即不可进行其他操作。