Example #1
0
echo $tmpl_dir;
?>
/images/menubtmcenter.gif" width="6" height="11"></td>
    <td width="1%" ><img src="images/menubtmright.gif"></td>
  </tr>
</table></div>
  <p>&nbsp;  </p>
<p>

<?php 
// List Reports
ob_start();
?>

<select name="ri_ID" size="5" id="ri_ID">
  <option value="">Select an Invoice</option>
  <?php 
func_fill_combo_conditionally("select ri_ID, ri_title from `cs_reseller_invoice` where ri_reseller_id = '{$reseller_id}' ORDER BY `ri_date` ASC ", $_POST['rp_ID'], $cnn_cs);
?>
</select>
<BR>
<input type="hidden" name="reseller_id" value="<?php 
echo $reseller_id;
?>
">
<input name="Submit" type="submit" value="View Invoice">
<?php 
$invoiceHistory = ob_get_contents();
ob_end_clean();
doTable($invoiceHistory, "Invoice History", "viewResellerInvoice.php");
include "includes/footer.php";
Example #2
0
function dieLog($val = "", $msg = false, $report = true)
{
    global $etel_debug_mode;
    global $smarty;
    global $companyInfo;
    global $adminInfo;
    if (!$msg) {
        $msg = "You have reached a page that is currently not available. Please try again later.";
    }
    $debug_array = debug_backtrace();
    $debug_info = "\nUser: "******"\n";
    foreach ($debug_array as $lv => $data) {
        foreach ($data as $key => $txt) {
            if (is_array($txt)) {
                foreach ($txt as $key2 => $txt2) {
                    $debug_info .= " {$key}.{$key2}: " . substr(print_r($txt2, true), 0, 100) . " \n";
                }
            } else {
                $debug_info .= $key . ": " . substr(print_r($txt, true), 0, 100) . " \n";
            }
        }
    }
    $val = "Error found: " . $debug_info . " ~ " . $val;
    if ($etel_debug_mode) {
        $msg .= "<BR>" . $val;
    }
    doTable($msg, "Page Unavailable", NULL, false, true, true);
    if ($report) {
        toLog('erroralert', 'misc', $val, -1);
    }
    if (file_exists('includes/footer.php') && $smarty) {
        include 'includes/footer.php';
    }
    exit;
}
Example #3
0
        if ($_POST['updateUser']) {
            $adminInfo['li_user_view'] = $li_user_view;
            $adminConfig['vList'] = explode("|", $_POST['userIdList']);
            $sql = "update  `cs_login` set `li_config` = '" . addslashes(gzcompress(serialize($adminConfig))) . "', li_user_view='" . $adminInfo['li_user_view'] . "' WHERE `userid` = " . $adminInfo['userid'];
            mysql_query($sql) or dieLog(mysql_error());
        }
        $_REQUEST['tobatchfield'] = implode(", ", $adminConfig['vList']);
        beginTable();
        ?>
		<input type="hidden" name="userid" id="userid" value="<?php 
        echo $userid;
        ?>
">
		<input type="hidden" name="updateUser" id="updateUser" value="1">
		
		
		<?php 
        echo func_get_enum_radio('cs_login', 'li_user_view', 'li_user_view', $adminInfo['li_user_view']);
        beginTable();
        echo genCompanyViewTable('userManage.php', 'userManage.php', $level);
        endTable("Company Payment");
        ?>
		
		<?php 
        $userSelect = ob_get_contents();
        ob_end_clean();
        doTable($userSelect, "User May View", "userManage.php", false, false, false, 'frmSelComp');
    }
    $adminConfig = NULL;
}
include "includes/footer.php";
// List Reports
ob_start();
?>
<select name="mi_ID" size="5" id="mi_ID">
  <option value="">Select an Invoice</option>
  <?php 
func_fill_combo_conditionally("select mi_ID, mi_title from `cs_merchant_invoice` where mi_company_id = '{$companyId}' ORDER BY `mi_date` DESC ", $mi_ID, $cnn_cs);
?>
</select>
<BR>
<input type="hidden" name="focus" value="invoice">
<input name="Submit" type="submit" value="View Invoice">
<?php 
$invoiceHistory = ob_get_contents();
ob_end_clean();
doTable($invoiceHistory, "Invoice History", "");
//$mi_pay_info = calcReal();
?>
  <style type="text/css">
<!--
.style1 {font-size: 10px}
.style4 {font-size: 12px; font-weight: bold; }
.style5 {
	color: #FFFFFF;
}
.style7 {
	font-size: 12px;
	color: #CC3300;
	font-weight: bold;
}
-->
Example #5
0
<html>
<head>
<title>Player</title>
</head>
<body>

<?php 
require "DB.php";
require "util.php";
error_reporting(E_ERROR | E_WARNING | E_PARSE);
$db = DB::connect("mysql://*****:*****@localhost/games");
$name = $_GET['name'];
$name = mysql_real_escape_string($name);
echo "<h1>{$name}</h1>";
echo "<h3>Attendance: " . getNum($db, "select count(*) as num from scores inner join games on games.gameid = scores.gameid where games.number = 1 and scores.name = '{$name}'") . "</h3>";
echo "<h3>Games Played: " . getNum($db, "select count(*) as num from scores where name = '{$name}'") . "</h3>";
echo "<h3>Games Won: " . getNum($db, "select count(*) as num from scores where name = '{$name}' and position=1") . "</h3>";
echo "<h3>ELO: " . getNum($db, "select elo from elo where name = '{$name}' order by eloid desc limit 1") . "</h3>";
echo "<img src=\"graphs/elo.php?name={$name}\">";
doTable("Besties", $db, "select opp, concat(round(p / t * 100,0),'%') as pct from (select scores.name,s.name as opp,count(*) as p from scores inner join scores as s on scores.gameid = s.gameid where scores.name = '{$name}' and s.name <> '{$name}' group by s.name order by p desc) as plays join (select scores.name,count(*) as t from scores where scores.name = '{$name}') as total using (name) order by p/t desc limit 10");
doTable("Wins", $db, "select games.name,count(*) as num from games inner join scores on games.gameid=scores.gameid where scores.name='{$name}' and scores.position=1 group by games.name order by count(*) desc");
doTable("Games Played", $db, "select games.name,count(*) as num from games inner join scores on games.gameid = scores.gameid where scores.name = '{$name}' group by games.name order by num desc");
doPositionTable("Play History", $db, "select games.date,games.name,scores.position from games inner join scores on scores.gameid=games.gameid where scores.name = '{$name}' order by games.date asc, games.number asc");
?>

</body>
</html>
?>
">
        </input>
        <?php 
$by = 'transactionId';
if (!$id && !$reference_number) {
    doTable("Transaction Invalid", "Error", NULL, true, true, true);
    die;
}
if (!$id && $reference_number) {
    $transactionInfo = getTransactionInfo($reference_number, $display_test_transactions, 'reference_number');
} else {
    $transactionInfo = getTransactionInfo($id, $display_test_transactions);
}
if (!is_array($transactionInfo)) {
    doTable("Transaction Not Found", "Error", NULL, true, true, true);
    die;
}
$activity = UserActivity($transactionInfo);
if ($activity == "ACT") {
    $act = "User Account is Active (Active).";
} else {
    if ($activity == "UNF") {
        $act = "User Account Not Found (Inactive).";
    } else {
        if ($activity == "PNF") {
            $act = "Password Incorrect (Inactive).";
        } else {
            if ($activity == "SNF") {
                $act = "Site Not Found (Inactive).";
            } else {
?>
';
		document.getElementById('rp_period').value = '<?php 
echo $rp_period;
?>
';
		document.getElementById('bank_Creditcard').value = '<?php 
echo $_POST['bank_Creditcard'];
?>
';
	</script>
</table>
<?php 
$addRemoveReports = ob_get_contents();
ob_end_clean();
doTable($addRemoveReports, $_POST['rp_title'], "riskAssess.php");
include "includes/footer.php";
function gen_row($change = false)
{
    global $global_row;
    if ($change) {
        $global_row = 3 - $global_row;
    }
    return $global_row;
}
function genReportSection($rp_source_query)
{
    $result = mysql_query($rp_source_query) or dieLog(mysql_error() . " ~ {$rp_source_query}");
    $source_data = mysql_fetch_assoc($result);
    list($Total_Transactions, $Total_Amount) = explode("|", $source_data['Total']);
    list($Approved_Transactions, $Approved_Amount) = explode("|", $source_data['Sales']);
Example #8
0
<title>Stats</title>
</head>
<body>

<?php 
require "DB.php";
require "util.php";
$db = DB::connect("mysql://*****:*****@localhost/games");
$sql = "select name,count(*) as num from scores group by name order by num desc";
doTable("# Games Played", $db, $sql);
$sql = "select s1.name as n1,s2.name as n2, count(*) as num from scores as s1 join scores as s2 on s1.gameid = s2.gameid where s1.name < s2.name group by s1.name, s2.name order by num desc limit 20";
doTable("Top pairings", $db, $sql);
$sql = "select name, elo from (select * from elo order by `name`, eloid desc) x group by `name` order by elo desc";
doTable("ELO", $db, $sql);
$sql = "select name,count(*) as num from scores where position=1 group by name order by num desc";
doTable("# Games Won", $db, $sql);
$sql = "SELECT name, concat(round(w / p * 100,0),'%') AS win_pct FROM (SELECT name, count(*) w FROM scores WHERE position=1 GROUP BY name) AS wins JOIN (SELECT name, count(*) p FROM scores GROUP BY name) AS plays USING (name) ORDER BY  w / p DESC";
doTable("Win Percentage", $db, $sql);
$sql = "select name,round(avg(position),1) as num from scores group by name order by num asc";
doTable("Average Rank", $db, $sql);
$sql = "SELECT name, round(avg((position-1) / (max_position-1)) * 4 + 1,1) AS avg_norm_rank FROM scores JOIN ( SELECT gameid, max(position) AS max_position FROM scores GROUP BY gameid) AS max_positions USING (gameid) GROUP BY name ORDER BY avg_norm_rank";
doTable("Normalised Rank", $db, $sql);
$sql = "select owner,count(*) as num from games group by owner order by num desc";
doTable("Game Owners", $db, $sql);
$sql = "select name,count(*) as num from games group by name order by num desc";
doTable("Top Games", $db, $sql);
?>

</body>
</html>
<select name="mi_ID" size="5" id="mi_ID">
  <option value="">Select an Invoice</option>
  <?php 
func_fill_combo_conditionally("select mi_ID, mi_title from `cs_merchant_invoice` where mi_company_id = '{$companyId}' ORDER BY `mi_date` DESC ", $mi_ID, $cnn_cs);
?>
</select>
<BR>
<input type="hidden" name="companyId" value="<?php 
echo $companyId;
?>
">
<input name="Submit" type="submit" value="View Invoice">
<?php 
$invoiceHistory = ob_get_contents();
ob_end_clean();
doTable($invoiceHistory, "Invoice History", "viewCompanyInvoice.php");
//$mi_pay_info = calcReal();
?>

    
<script language="javascript">
function reverseInvoice(mi_ID)
{
	if(!confirm("Are you sure you want to delete this invoice and reverse all calculated data affiliated with it?"))
		return 0;
	document.location.href="viewCompanyInvoice.php?mi_ID="+mi_ID+"&action=reverse";
	
}
function changeStatus(mi_ID,status)
{
	document.location.href="viewCompanyInvoice.php?mi_ID="+mi_ID+"&action=changestatus&status="+status;
Example #10
0
<title>Game</title>
</head>
<body>

<?php 
require "DB.php";
require "util.php";
error_reporting(E_ERROR | E_WARNING | E_PARSE);
$db = DB::connect("mysql://*****:*****@localhost/games");
$name = $_GET['name'];
echo "<h1>{$name}</h1>";
$name = mysql_real_escape_string($name);
echo "<h3>Times Played: " . getNum($db, "select count(*) as num from games where name = '{$name}'") . "</h3>";
doTable("Plays", $db, "select scores.name,count(*) as num from scores inner join games on games.gameid = scores.gameid where games.name = '{$name}' group by scores.name order by num desc");
doTable("Wins", $db, "select scores.name,count(*) as num from games inner join scores on games.gameid = scores.gameid where games.name='{$name}' and scores.position=1 group by scores.name order by num desc");
doTable("Win %", $db, "SELECT name, w / p * 100 AS win_pct FROM (SELECT scores.name, count(*) w FROM scores inner join games on games.gameid = scores.gameid WHERE position=1 and games.name = '{$name}' GROUP BY scores.name) AS wins JOIN (SELECT scores.name, count(*) p FROM scores inner join games on games.gameid = scores.gameid where games.name = '{$name}' GROUP BY scores.name) AS plays USING (name) ORDER BY win_pct DESC");
echo "<p>";
$sql = "select date,number,name,owner,gameid from games where name='{$name}'  order by date asc, number asc";
$q = $db->query($sql);
echo "<table border=1>";
echo "<tr><th>#<th>Date<th>#<th>Player<th>Score<th>Player<th>Score<th>Player<th>Score<th>Player<th>Score<th>Player<th>Score<th>Player<th>Score<th>Player<th>Score";
$idx = 1;
while ($q->fetchInto($r1)) {
    echo "<tr><td>{$idx}<td>{$r1['0']}<td>{$r1['1']}";
    $idx++;
    $gameid = $r1[4];
    $sql = "select name, points from scores where gameid = {$gameid} order by position asc";
    $q2 = $db->query($sql);
    while ($q2->fetchInto($r2)) {
        echo "<td><a href=\"player.php?name={$r2['0']}\">{$r2['0']}</a><td>{$r2['1']}";
    }
Example #11
0
','<?php 
    echo $id;
    ?>
');
		updateComparison('<?php 
    echo $_POST['compare'][$id];
    ?>
','<?php 
    echo $id;
    ?>
');
	</script>
  <?php 
}
?>
  <tr>
    <td colspan="5" align="center" class="row<?php 
echo gen_row(1);
?>
"><input name="Submit" type="submit" value="Submit">
      <in1put name="Submit" type="submit" value="Add Option"></td>
  </tr>
</table>
<?php 
$addRemoveReports = ob_get_contents();
ob_end_clean();
doTable($addRemoveReports, ucfirst($mode) . " a Report", "addRiskReport.php");
include "includes/footer.php";
?>
</p>