function datatable_admin_day($con, $Table_Process, $tablename, $exclude, $today)
{
    $Table_Process = new Table_Process();
    $table_exclude = explode(' ', $Table_Process->create_exclude_table_statement($con, $Table_Process));
    $Table_list = $Table_Process->create_table_statement_exclude($con, $table_exclude);
    $querytable = $con->query("select table_name from information_schema.tables where table_schema= DATABASE() {$Table_list};");
    while ($row = $querytable->fetch(PDO::FETCH_ASSOC)) {
        foreach ($row as $tablename) {
            $querynull = "SELECT * FROM {$tablename} WHERE `Submitted` LIKE '{$today}%';";
            $nullrc = $con->query($querynull);
            $null = $nullrc->rowCount();
            if ($null > 0) {
                $stmt_list = $Table_Process->create_statement($con, $tablename, $exclude);
                print "<table border='1'>";
                $tablenameucfirst = $Table_Process->titlecase($tablename);
                $prettytablename = str_replace('_', ' ', $tablenameucfirst);
                print "<tr><th colspan=8>{$prettytablename}</th></tr>";
                $query = "SELECT {$stmt_list} FROM {$tablename} WHERE `Submitted` LIKE '{$today}%';";
                $result = $con->query($query);
                $row = $result->fetch(PDO::FETCH_ASSOC);
                print "<tr>";
                foreach ($row as $field => $value) {
                    $fieldnameucfirst = $Table_Process->titlecase($field);
                    $prettyfieldname = str_replace('_', ' ', $fieldnameucfirst);
                    print "<th>{$prettyfieldname}</th>";
                }
                print "</tr>";
                $data = $con->query($query);
                if ($data->rowCount() > 0) {
                    $data->setFetchMode(PDO::FETCH_ASSOC);
                    foreach ($data as $row) {
                        print "<tr> \n";
                        foreach ($row as $name => $value) {
                            print "<td>{$value}</td>";
                        }
                        print "</tr>";
                    }
                }
                print "</table><br />";
            }
        }
    }
}
function datatable_department_month($con, $Table_Process, $tablename, $exclude, $today)
{
    $Table_Process = new Table_Process();
    $table_exclude = explode(' ', $Table_Process->create_exclude_table_statement($con, $Table_Process));
    $Table_list = $Table_Process->create_table_statement_exclude($con, $Table_Process, $table_exclude);
    $querytable = $con->query("select table_name from information_schema.tables where table_schema= DATABASE() \r\n\r\n{$Table_list};");
    while ($row = $querytable->fetch(PDO::FETCH_ASSOC)) {
        foreach ($row as $tablename) {
            $querynull = "SELECT * FROM {$tablename} WHERE `Submitted` LIKE '{$today}%';";
            $nullrc = $con->query($querynull);
            $null = $nullrc->rowCount();
            if ($null > 0) {
                $stmt_list = $Table_Process->create_statement($con, $Table_Process, $tablename, $exclude);
                print "<table border='1'>";
                $tablenameucfirst = $Table_Process->titlecase($tablename);
                $prettytablename = str_replace('_', ' ', $tablenameucfirst);
                print "<tr><th colspan=8>\r\n\r\n{$prettytablename}</th></tr>";
                $query = "SELECT \r\n\r\n{$stmt_list} FROM {$tablename} WHERE `Submitted` LIKE '{$today}%';";
                $result = $con->query($query);
                $row = $result->fetch(PDO::FETCH_ASSOC);
                print "<tr>";
                foreach ($row as $field => $value) {
                    $fieldnameucfirst = $Table_Process->titlecase($field);
                    $prettyfieldname = str_replace('_', ' ', $fieldnameucfirst);
                    print "<th>{$prettyfieldname}</th>";
                }
                print "</tr>";
                $data = $con->query($query);
                if ($data->rowCount() > 0) {
                    $data->setFetchMode(PDO::FETCH_ASSOC);
                    foreach ($data as $row) {
                        print "<tr> \n";
                        foreach ($row as $name => $value) {
                            print "<td>";
                            print "{$value}";
                            print "</td>";
                        }
                        print "</tr>";
                    }
                }
                $existsquery = "SHOW COLUMNS FROM {$tablename} LIKE 'Total_Items'";
                $existsrc = $con->query($existsquery);
                $exists = $existsrc->rowCount();
                if ($exists > 0) {
                    $itemsquery = "SELECT SUM(`Total_Items`) AS value_month FROM {$tablename} WHERE `Submitted` LIKE '{$today}%';";
                    $items = $con->query($itemsquery);
                    $items->setFetchMode(PDO::FETCH_ASSOC);
                    foreach ($items as $row) {
                        $itemsmonth = $row['value_month'];
                        print "<tr><td colspan=8><b>Total Items: " . $itemsmonth . "</td></tr>";
                    }
                }
                $texistsquery = "SHOW COLUMNS FROM {$tablename} LIKE 'Total_Time'";
                $texistsrc = $con->query($texistsquery);
                $texists = $texistsrc->rowCount();
                if ($texists > 0) {
                    $totaltimequery = "SELECT SEC_TO_TIME( SUM( TIME_TO_SEC( `Total_Time` ) ) ) AS value_month FROM {$tablename} WHERE `Submitted` LIKE '{$today}%';";
                    $totaltime = $con->query($totaltimequery);
                    $totaltime->setFetchMode(PDO::FETCH_ASSOC);
                    foreach ($totaltime as $row) {
                        $timemonth = $row['value_month'];
                        print "<tr><td colspan=8><b>Total Time: " . $timemonth . "</td></tr>";
                    }
                }
                print "</table><br />";
            }
        }
    }
}
示例#3
0
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Tabula Rasa.  If not, see <http://www.gnu.org/licenses/>.
*/
//Do not remove this line - it is integral to login system.
include_once 'include/processes.php';
// Inserts Navigation Bar
include "include/nav.php";
//Checks if user is logged in.
$exclude = explode(' ', $Table_Process->create_exclude_statement($con, $Table_Process));
$Login_Process = new Login_Process();
$Login_Process->check_status($_SERVER['SCRIPT_NAME']);
$Table_Process = new Table_Process();
$Login = $Login_Process->log_in($con, $_POST['user'], $_POST['pass'], $_POST['page'], $_POST['submit']);
$New = $Login_Process->Register($con, $_POST, $_POST['process']);
?>
<!-- Site_Name is registered in constants.php and is used in the title tag of every page -->

<!-- Login Form -->
<?php 
//Variables needed for conditional processing
//Rendered Code Starts Here.
if (!$con) {
    print "<title>" . Site_Name . " | Welcome</title><body>";
    print "<div style='width:600px;'>Welcome to Tabula Rasa. Here are a few things you will need to know as you configure the system:<br /><br />\nYou will first need a server running PHP 5.5 or above, preferably PHP 7.  You will need a server running MySQL.  Instructions on how to install MySQL can be found here: <a href='http://dev.mysql.com/doc/refman/5.6/en/installing.html'>Installing and Upgrading MySQL</a>.<br/>\nOnce you have MySQL up and running, there is a database schema in the include folder of this directory with a .sql extension.  Importing this file will set up everything needed for this system to run.<br />\n<br />\nOnce you create the database, you will need to tell the system where to find it by opening /include/constants.php and supplying the information requested. Constants.php also contains variables for naming your system.<br />\nOnce the system knows where to find the database, this documentation will only be viewable when editing the index.php file. For more detailed information, please open README.md.<br /><br />\nTabula Rasa is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.<br /><br />\n\nTabula Rasa is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.<br /><br />\n\nYou should have received a copy of the GNU General Public License\nalong with Tabula Rasa.  If not, see <http://www.gnu.org/licenses/>.<br />\n<br /><br />\n<br /></div>";
}
if ($con) {
    $queryusertable = "SELECT * FROM `" . DBTBLE . "`;";