%@ language="jscript" %>
<%
//Response.Write("五星性格大解盤-深度解析")
//declear the variables in this page
//=============================================
var arrstar0 =new Array();
var arrstar1 =new Array();
var arrstar2 =new Array();
var arrstar3 =new Array();
var arrstar4 =new Array();
var arrstar5 =new Array();
var arrstar6 =new Array();
var arrstar7 =new Array();
var arrstar8 =new Array();
var arrstar9 =new Array();
var arrstar10 =new Array();
var arrstar11 =new Array();
var arrstar12 =new Array();
var arrastro = new Array(arrstar0,arrstar1,arrstar2,arrstar3,arrstar4,arrstar5,arrstar6,arrstar7,arrstar8,arrstar9,arrstar10,arrstar11,arrstar12);
var rst_star = Server.CreateObject("ADODB.Recordset");
var Arr_First_Person = new Array();
var Arr_Second_Person = new Array();
var Arr_Person = new Array("the 2D array contains two personal information",Arr_First_Person,Arr_Second_Person);
var Arr_Stars_Code = new Array();
var Arr_Stars_Rate = new Array();
var Arr_Stars = new Array(Arr_Stars_Code,Arr_Stars_Rate);
var Arr_DivInto2_Rate = new Array(); //store the rate of all star of 2 way
var Arr_DivInto3_Rate = new Array(); //store the rate of all star of 3 way
var Arr_DivInto4_Rate = new Array(); //store the rate of all star of 4 way
var Boo_First_Person = new Boolean(true);//the boolean variable indicates the first perosn basic information integrity
var Boo_Second_Person = new Boolean(true);//the boolean variable indicates the second perosn basic information integrity
var Boo_First_Star = new Boolean(true);//the boolean variable indicates the first perosn stars information integrity
var Boo_Second_Star = new Boolean(true);//the boolean variable indicates the second perosn stars information integrity
var Num_Load_Person = new Number(1);
var Num_Desc_Sec = new Number(1);
//=============================================
//Get the information from the Form and store them in Arr_Person
//=============================================
if ( Request.Form("str_name_1st").Count != 0 && Request.Form("str_name_1st") != "" )
Arr_First_Person[Const_Name] = new String(Request.Form("str_name_1st"));
else Arr_First_Person[Const_Name] = new String("速配");
Arr_First_Person[Const_Year] = Request.Form("bir_year_1st");
Arr_First_Person[Const_Month] = Request.Form("bir_month_1st");
Arr_First_Person[Const_Day] = Request.Form("bir_day_1st");
Arr_First_Person[Const_Hour] = Request.Form("bir_hour_1st");
Arr_First_Person[Const_Minute] = Request.Form("bir_minute_1st");
Arr_First_Person[Const_Sex] = Request.Form("gender_1st");
Arr_First_Person[Const_Sun] = Request.Form("Star_Sun_1st");
Arr_First_Person[Const_Moon] = Request.Form("Star_Moon_1st");
Arr_First_Person[Const_Mercury] = Request.Form("Star_Mercury_1st");
Arr_First_Person[Const_Venus] = Request.Form("Star_Venus_1st");
Arr_First_Person[Const_Mars] = Request.Form("Star_Mars_1st");
if ( Request.Form("str_name_2nd").Count != 0 && Request.Form("str_name_2nd") != "" )
Arr_Second_Person[Const_Name] = new String(Request.Form("str_name_2nd"));
else Arr_Second_Person[Const_Name] = new String("速配");
Arr_Second_Person[Const_Year] = Request.Form("bir_year_2nd");
Arr_Second_Person[Const_Month] = Request.Form("bir_month_2nd");
Arr_Second_Person[Const_Day] = Request.Form("bir_day_2nd");
Arr_Second_Person[Const_Hour] = Request.Form("bir_hour_2nd");
Arr_Second_Person[Const_Minute] = Request.Form("bir_minute_2nd");
Arr_Second_Person[Const_Sex] = Request.Form("gender_2nd");
Arr_Second_Person[Const_Sun] = Request.Form("Star_Sun_2nd");
Arr_Second_Person[Const_Moon] = Request.Form("Star_Moon_2nd");
Arr_Second_Person[Const_Mercury] = Request.Form("Star_Mercury_2nd");
Arr_Second_Person[Const_Venus] = Request.Form("Star_Venus_2nd");
Arr_Second_Person[Const_Mars] = Request.Form("Star_Mars_2nd");
//=============================================
//check the personal basic information integrity
//and check the personal stars information integrity
//if they are not completeness, make the page go back
//=============================================
for(var i = 0;i <= 6; i++)
{
if ( Arr_First_Person[i].Count == 0 || Arr_First_Person[i] == "")
Boo_First_Person = false;
if ( Arr_Second_Person[i].Count == 0 || Arr_Second_Person[i] == "")
Boo_Second_Person = false;
}
for(var i = 7;i <= 11; i++)
{
if ( Arr_First_Person[i].Count == 0 || Arr_First_Person[i] == "")
Boo_First_Star = false;
if ( Arr_Second_Person[i].Count == 0 || Arr_Second_Person[i] == "")
Boo_Second_Star = false;
}
if ( Request.Form("load_sec").Count != 0 && Request.Form("load_sec") != "" )
Num_Load_Person = Request.Form("load_sec");
if ( Request.Form("desc_sec").Count != 0 && Request.Form("desc_sec") != "" )
Num_Desc_Sec = parseInt(Request.Form("desc_sec"),10);
%>
個性分析-深度解析
<%
if ( (Num_Load_Person == 1 && !Boo_First_Person) || (Num_Load_Person == 2 && !Boo_Second_Person && !Boo_Second_Star) )
{
%>
<%
Response.End();
}
//=============================================
//read special charactors from database and store them into arrastro
//=============================================
str_SQLstate="select * from StarTab";
rst_star.Open(str_SQLstate, cn_ado);
var i=1;
while (!rst_star.EOF)
{
arrstar0[i]=rst_star("ID").value;
arrstar1[i]=rst_star("brief").value;
arrstar2[i]=rst_star("divinto2").value;
arrstar3[i]=rst_star("divinto3").value;
arrstar4[i]=rst_star("divinto4").value;
arrstar5[i]=rst_star("Description").value;
arrstar6[i]=rst_star("idealmale").value;
arrstar7[i]=rst_star("idealfemale").value;
arrstar8[i]=rst_star("moneyconcept").value;
arrstar9[i]=rst_star("loveconcept").value;
arrstar10[i]=rst_star("foodconcept").value;
arrstar11[i]=rst_star("conclusionmode").value;
arrstar12[i]=rst_star("fieldconcept").value;
i++;
rst_star.MoveNext();
}
rst_star.Close();
//=============================================
//when the star code is not in Arr_Stars_Code, insert a new member into Arr_Stars_Code and Arr_Stars_Rate
//when the star code is in Arr_Stars_Code already, only accumulate rate of same star code in Arr_Stars_Rate
//At same time accumulate the 3 Arrays rate.
//the Arr_Temp_Person is the real work Array, in following will use this Array.
//=============================================
var Num_Temp = new Number();
var Boo_Temp = new Boolean();
var Arr_Temp_Person = Arr_Person[Num_Load_Person];
for (var i = 1;i < 3;i++) //Initial the Array Arr_DivInto2_Rate
Arr_DivInto2_Rate[i]=0;
for (var i = 1;i < 4;i++) //Initial the Array Arr_DivInto3_Rate
Arr_DivInto3_Rate[i]=0;
for (var i = 1;i < 5;i++) //Initial the Array Arr_DivInto4_Rate
Arr_DivInto4_Rate[i]=0;
for (var i = 7,Num_Count = 1;i <= 11 ;i++)
{
Num_Temp = Arr_Temp_Person[i];//Get the person star code
Boo_Temp = false;//indicate whether there is same star code in Arr_Stars_Code
Arr_DivInto2_Rate[arrastro[2][Num_Temp]] += arr_weight[Arr_Temp_Person[Const_Sex]][i-6]
Arr_DivInto3_Rate[arrastro[3][Num_Temp]] += arr_weight[Arr_Temp_Person[Const_Sex]][i-6]
Arr_DivInto4_Rate[arrastro[4][Num_Temp]] += arr_weight[Arr_Temp_Person[Const_Sex]][i-6]
for (var j = 1;(j < Arr_Stars_Code.length && !Boo_Temp);j++)
if ( Arr_Stars_Code[j] - Num_Temp === 0 )
Boo_Temp = true;
if ( Boo_Temp )
{
Arr_Stars_Rate[j-1] += arr_weight[Arr_Temp_Person[Const_Sex]][i-6];
}
else
{
Arr_Stars_Code[Num_Count] = Num_Temp;
Arr_Stars_Rate[Num_Count] = arr_weight[Arr_Temp_Person[Const_Sex]][i-6];
Num_Count++;
}
}
//==============================================
//this block is just display the information collection from Form
//=============================================
/*for (var i = 1;i <= 11; i++)
Response.Write(Arr_Person[1][i] + " ");
Response.Write("
");
for (var i = 1;i <= 11; i++)
Response.Write(Arr_Person[2][i] + " ");
Response.Write("
");
for (var i = 1;i < Num_Count; i++)
Response.Write(Arr_Stars[Const_Stars_Code][i] + " " + Arr_Stars[Const_Stars_Rate][i] + " ");
Response.Write("
");*/
//=============================================
%>