﻿// JScript 文件
function BindPLReport(reportID)
{
    var res=BaseIndex.GetPLProsByOrderNo(reportID).value;
    $("#reportInfo").html(res);
}

function BindAllPLReport()
{
    var res=BaseIndex.GetPLProsByOrderNo("").value;
    $("#reportInfo").html(res);
}

    function doLogin(){
        var m1 = "Email format is incorrect";
        var m2 = "E-Mail don't exists";
        var m3 = "Wrong password";
        var email = $("#email").val();
        if(/^[a-zA-Z0-9_\.]+@[a-zA-Z0-9-]+[\.a-zA-Z]+$/.test(email)==false){
            alert(m1);
            $("#email").focus();
            return false;
        }
        
        var pwd = $.trim($("#pwd").val());
        if(pwd==""){
            alert(m3);
            $("#pwd").focus();
            return false;
        }
        
        var res = BaseIndex.checkLogin(email,pwd).value;
        if(res=="noEmail"){
            alert(m2);
            $("#email").focus();
            return false;
        }else if(res=="no"){
            alert(m3);
            $("#pwd").focus();
            return false;
        }
        return true;
    }
    
  function comment(ip,newsID)
	 {
	    if($("#tbInfo").val()=="")
	    {
	        alert("you not input....");
	        return;
	    }
	    else
	    {
	        
	        var nickName=$("#nickName").val();
	        var info=$("#tbInfo").val();
	        
	        if(info.length>500)
	        {
	            alert("Sorry for long input!");
	            return;
	        }
	        var res=BaseIndex.AddComment(newsID.toString(),nickName,info,ip.toString()).value;
	        if(res=="1")
	        {
	            location.reload();
	        }
	    }
	 }