Example #1
0
        print "(value:)" . $vinfo[$info[0]][$info[1]] . "-(pay:)" . $pay . "=" . $point . "<br>";
        print "<tr>";
        print "<td>{$info['1']}</td>";
        print "<td>{$info['2']}";
        print "<td>{$info['0']}</td>";
        print "<td>{$point}</td>";
        print "</tr>";
        $line = $info[1] . ",price=" . $info[2] . ",user="******",point=" . $point . "\n";
        $lines = $lines . $line;
        #push(@data,$item.",price=".$price.",user="******",point=".$point);
    }
    if (strlen(file_get_contents("log/{$lognum}/room{$rn}/result")) < 5) {
        file_put_contents("log/{$lognum}/room{$rn}/result", $lines);
    }
    print "</table><br><br>";
}
$lognum = getLognumber();
$usernum = getInfo("user_number");
for ($rn = 1; $rn <= 6; $rn++) {
    $file = "log/{$lognum}/room{$rn}/transition";
    $lines = explode("\n", file_get_contents($file));
    #var_dump($lines);
    if (count($lines) > $usernum + 1) {
        writeResult($rn);
    }
}
?>
</center>
</body>
</html>
Example #2
0
<?php

require 'util.php';
require 'providers/factory.php';
$catRef = explode("/", $_REQUEST["catID"]);
$treeCatID = $catRef[0];
$dbCatID = $catRef[1];
$ticket = $_REQUEST["ticket"];
$rowIDs = $_REQUEST["rowIDs"];
function writeResult($treeCatID, $dbCatID, $rowIDs)
{
    $treeProvider = ProviderFactory::getTree();
    $tblRef = $treeProvider->getTableRef($treeCatID, $dbCatID);
    if ($tblRef['srcType'] == '') {
        die;
    }
    $provider = ProviderFactory::getTable($tblRef);
    if (Util::checkAccess($ticket, $catRef)) {
        $provider->deleteRows($tblRef, $rowIDs);
    }
}
writeResult($treeCatID, $dbCatID, $rowIDs);
Example #3
0
}
function compile($showPath)
{
    $sourcePath = $showPath . '/' . SOURCE_FILE;
    if (is_file($sourcePath)) {
        ob_start();
        include $sourcePath;
        $result = ob_get_clean();
        return $result;
    } else {
        throw new Exception("Source path {$sourcePath} is not readable.");
    }
}
function writeResult($showPath, $result)
{
    $destinationPath = $showPath . '/' . DESTINATION_FILE;
    if (is_writable($showPath)) {
        file_put_contents($destinationPath, $result);
    } else {
        throw new Exception("Destination path {$destinationPath} is not writable.");
    }
}
try {
    $showPath = getShowPath(getShowName($argv, $argc));
    $result = compile($showPath);
    writeResult($showPath, $result);
    exit("Show compiled successfully to {$showPath}.\n");
} catch (Exception $e) {
    fwrite(STDERR, $e->getMessage() . "\n");
    exit(1);
}
Example #4
0
<?php

require 'util.php';
require 'providers/factory.php';
$recID = $_REQUEST["recID"];
$catRef = explode("/", $_REQUEST["catID"]);
$treeCatID = $catRef[0];
$dbCatID = $catRef[1];
$ticket = $_REQUEST["ticket"];
$data = $_REQUEST["data"];
function writeResult($treeCatID, $dbCatID, $recID, $data)
{
    $treeProvider = ProviderFactory::getTree();
    $tblRef = $treeProvider->getTableRef($treeCatID, $dbCatID);
    if ($tblRef['srcType'] == '') {
        die;
    }
    $provider = ProviderFactory::getTable($tblRef);
    if (Util::checkAccess($ticket, $catRef)) {
        $provider->saveRecordData($tblRef, $dbCatID, $recID, $data);
    }
}
writeResult($treeCatID, $dbCatID, $recID, $data);