Пример #1
0
<?php

session_start();
if (isset($_POST['action']) && $_POST['action'] == 'reset') {
    redo();
} else {
    if (!isset($_SESSION['gold']) && !isset($_SESSION['activities'])) {
        $_SESSION['gold'] = 0;
        $_SESSION['activities'] = "";
    }
}
// var_dump($_POST);
if ($_POST['building'] == 'farm') {
    farm();
} else {
    if ($_POST['building'] == 'cave') {
        cave();
    } else {
        if ($_POST['building'] == 'house') {
            house();
        } else {
            if ($_POST['building'] == 'casino') {
                casino();
            }
        }
    }
}
?>
 

<?php 
Пример #2
0
 */
/**
 * Configuration file
 */
include "config.inc.php";
/**
 * XHTML functions
 */
include "functions/functions.xhtml.php";
/**
 * Work functions
 */
include "functions/functions.work.php";
$operator_id = get_operator_id();
if (isset($_GET['redo'])) {
    redo(intval($_GET['redo']));
}
xhtml_head(T_("Work History"), true, array("css/table.css"));
if ($operator_id != false) {
    $sql = "SELECT wu.work_unit_id,(CASE WHEN DATE(wu.completed) = DATE(NOW()) THEN CONCAT('" . T_("Today") . " ',DATE_FORMAT(wu.completed,'%H:%i:%s')) ELSE wu.completed END) as completed,c.name, CONCAT('<a href=\\'?redo=',wu.work_unit_id,'\\'>" . T_("Redo") . "</a>') as redo,\r\n\t\t\t(SELECT CASE WHEN CHAR_LENGTH(TRIM(data)) < " . WORK_HISTORY_STRING_LENGTH . " THEN data ELSE CONCAT(SUBSTR(data,1,(" . (WORK_HISTORY_STRING_LENGTH - 3) . ")),'...') END FROM cell_revision WHERE cell_id = wu.cell_id ORDER BY cell_revision_id DESC LIMIT 1) as data, p.description\r\n\t\tFROM work_unit as wu, work as w, `column` as c,process as p\r\n\t\tWHERE wu.operator_id = '{$operator_id}'\r\n\t\tAND w.work_id = wu.work_id\r\n\t\tAND c.column_id = w.column_id\r\n\t\tAND p.process_id = wu.process_id\r\n\t\tAND completed IS NOT NULL\r\n\t\tORDER BY completed DESC\r\n\t\tLIMIT " . WORK_HISTORY_LIMIT;
    $work = $db->GetAll($sql);
    if (empty($work)) {
        print "<p>" . T_("No work history") . "</p>";
    } else {
        translate_array($work, array("description"));
        xhtml_table($work, array('completed', 'name', 'data', 'description', 'redo'), array(T_("Date"), T_("Column"), T_("Data"), T_("Process"), T_("Redo?")));
    }
} else {
    print "<p>" . T_("No operator") . "</p>";
}
xhtml_foot();