|
<%
//int syndicate_num = syndicate;
//int syndicate_num = 0;
//int syndicate_credits = 0;
//int rank = 0;
//int rank_now = 0;
//int out_of = 0;
int pod_owned = 0;
rs = stmt.executeQuery("SELECT pod_owned FROM pods_accounts WHERE username = '"+username+"' ");
if(rs.next()) {
pod_owned = rs.getInt("pod_owned");
}
/*
if(syndicate == 0) {
rank = pool_rank;
rank_now = pool_rank;
rs = stmt.executeQuery("SELECT COUNT(*) AS tot FROM accounts WHERE syndicate = 0");
if(rs.next()) {
out_of = rs.getInt("tot");
}
}
else {
rank = syndicate_rank;
rank_now = syndicate_rank_now;
rs = stmt.executeQuery("SELECT COUNT(*) AS tot FROM accounts WHERE syndicate > 0");
if(rs.next()) {
out_of = rs.getInt("tot");
}
rs = stmt.executeQuery("SELECT worth FROM syndicates WHERE number = "+syndicate+" ");
if(rs.next()) {
syndicate_credits = rs.getInt("worth");
}
}
*/
//count campaigns
rs = stmt.executeQuery("SELECT COUNT(*) AS total_campaigns FROM pods_campaigns WHERE username = '"+username+"' ");
int total_campaigns = 0;
if(rs.next()) {
total_campaigns = rs.getInt("total_campaigns");
}
//pod ownership
int pod_rank = 0;
double pod_value = 0;
double pp_bonus = 0;
double pp_per_surfer = 0;
double pod_reserve = 0;
//this member should own a pod
rs = stmt.executeQuery("SELECT * FROM pods_pods WHERE username = '"+username+"' and pod_owned = 1 ");
if(rs.next()) {
pod_rank = rs.getInt("pod_rank");
pod_value = rs.getInt("pod_value");
pp_bonus = rs.getDouble("pod_bonus");
pp_per_surfer = rs.getDouble("pp_per_surfer");
pod_reserve = rs.getDouble("pod_reserve");
}
/////////
java.util.Date now = new java.util.Date();
// POWER SURF
int[] ps_hour = new int[35];
ps_hour[1] = 10;
ps_hour[2] = 5;
ps_hour[3] = 22;
ps_hour[4] = 15;
ps_hour[5] = 9;
ps_hour[29] = 13;
ps_hour[30] = 18;
int thisHour = 0;
int tomoHour = 0;
int dom = 0;
rs = stmt.executeQuery("SELECT DAYOFMONTH(NOW()) AS dom, DAYOFMONTH(DATE_ADD(NOW(), INTERVAL 1 DAY)) AS dom2, HOUR(NOW()) AS thishour");
if(rs.next()) {
//if(rs.getInt("dom") > 16) {
dom = rs.getInt("dom");
thisHour = ps_hour[rs.getInt("dom")];
tomoHour = ps_hour[rs.getInt("dom2")];
//}
}
String ps_today = "";
if(thisHour < 12) {
ps_today += Integer.toString(thisHour)+"AM PST";
} else if(thisHour == 12) {
ps_today += Integer.toString(thisHour)+"PM PST";
} else {
ps_today += Integer.toString(thisHour-12)+"PM PST";
}
String ps_tomo = "";
if(tomoHour < 12) {
ps_tomo += Integer.toString(tomoHour)+"AM PST";
} else if(tomoHour == 12) {
ps_tomo += Integer.toString(tomoHour)+"PM PST";
} else {
ps_tomo += Integer.toString(tomoHour-12)+"PM PST";
}
//
if(dom == 31) {
ps_today = "Starts Tomorrow";
}
if(dom == 5) {
ps_tomo = "N/A - Last day is Oct 5th";
}
if(dom > 5 && dom < 29) {
ps_today = "N/A - Offer has ended";
ps_tomo = "N/A - Offer has ended";
}
//if(dom == 4) { //bonus hour jan 4th
// ps_today = ps_today + " & 4PM PST";
//}
//if(dom == 3) {//bonus hour jan 4th
// ps_tomo = ps_tomo + " & 4PM PST";
//}
%>
|
<%@ include file="../includes/member_right_column.jsp"%>
|