"RSLR" ) { header("Location: logout.php"); die; } $_METHOD = "post"; $_INCLUDER = "index.php"; include("header.php"); $status_message = ""; // -- get user sub-accounts $rs_accounts = mysql_query("select account, password, unix_timestamp(expires) as expires from accounts where username = ". "'$G_username' order by account"); // -- handle paging $page_index = 1; if( isset($_REQUEST["page_index"]) ) $page_index = (int)entry_filter($_REQUEST["page_index"]); $page_count = ((int)(mysql_num_rows( $rs_accounts ) / $G_reselled_accounts_per_page)) + 1; if( isset($_REQUEST["page_first"]) ) $page_index = 1; if( isset($_REQUEST["page_previous"]) ) $page_index = (int)entry_filter($_REQUEST["page_index"]) - 1; if( isset($_REQUEST["page_next"]) ) $page_index = (int)entry_filter($_REQUEST["page_index"]) + 1; if( isset($_REQUEST["page_last"]) ) $page_index = $page_count; // -- correct page index if needed if( $page_index < 1 ) $page_index = 1; if( $page_index > $page_count) $page_index = $page_count; // -- add account if( !$G_disable_reseller_subaccount_creation ) { if( isset($_REQUEST["add"]) and isset($_REQUEST["add_username"]) and isset($_REQUEST["add_password"]) and isset($_REQUEST["add_months"]) ) { $_REQUEST["add_username"] = entry_filter($_REQUEST["add_username"]); $_REQUEST["add_password"] = entry_filter($_REQUEST["add_password"]); $current_date = date("Ymd", time()); $coverage_start = mktime(0, 0, 0, substr($current_date, 4, 2), substr($current_date, 6, 2), substr($current_date, 0, 4)); $coverage_end = $coverage_start + ((3600 * 24 * $G_days_per_month) * (int)$_REQUEST["add_months"]); if( (get_credit_balance( $G_username ) - (int)$_REQUEST["add_months"]) >= 0 ) { // -- check if account already exists if( (int)query_scalar("select count(*) from accounts where username = '$G_username' and ". "upper(account) = '".strtoupper($_REQUEST["add_username"])."'") == 0 ) { // -- add server user $server_status_description = ""; $effective_account = get_effective_account($_REQUEST["add_username"], $G_user_account_prefix); if( server_add_account($effective_account, $_REQUEST["add_password"], $coverage_end, TRUE, sprintf($G_fslb_global_account_comment, $G_username), $server_status_description) ) { // -- add record to the database mysql_begin(); if( db_insert("accounts", array( "username" => $G_username, "account" => $_REQUEST["add_username"], "password" => $_REQUEST["add_password"], "expires" => date("Y-m-d", $coverage_end)) ) ) { if( db_insert("transactions", array( "username" => $G_username, "transaction" => (int)query_scalar("select max(transaction) + 1 from transactions where username = '$G_username'"), "type" => "DBIT", "periods" => (int)$_REQUEST["add_months"], "account" => $_REQUEST["add_username"], "timestamp" => date("Y-m-d H:i:s"), "coverage_start" => date("Y-m-d", $coverage_start), "coverage_end" => date("Y-m-d", $coverage_end)) ) ) { mysql_commit(); header("Location: index.php"); die; } else { $status_message = grs("HOME_ADD_FAILED"); mysql_rollback(); } } else { $status_message = grs("HOME_ADD_FAILED"); mysql_rollback(); } } else $status_message = "SERVER: ".$server_status_description; } else $status_message = grs("HOME_ADD_ALREADY_EXISTS"); } else $status_message = grs("HOME_ADD_INSUFFICIENT_CREDIT"); } } ?>
:: ::
: : ... :
: : ...
:

: "> |
= $G_reselled_accounts_per_page ) break; ?> "); ?>
');">
".grs("HOME_NO_ACCOUNTS")."

:
" onClick="add_account();">
"" ) echo($status_message."."); ?>