Location: PHPKode > projects > Tbroot Business Management Portal > tbroot/testcrap.php
<?php

/******************************************************************************************
 *
 * TESTCRAP.PHP - the monstrosity that grew into the main display system.
 *                DEPRICATED                
 * Copyright 2003(C) Tight Business Solutions, Inc.
 *
 * Author:         Kevin Croker <hide@address.com>
 * Creation Date:  7/15/2002
 * Website:        http://www.tightbusiness.com/
 *
 *       If you use our code, please credit us somewhere, preferedly by copying the little header 
 * at the top in some form reading "originally from...".  Also, if you like what you see, 
 * please let us know!  Also, if you detest what you see as terrible code that should be
 * stricken from the planet, PLEASE let us know!  We want to improve and we are completely
 * open-minded to any and all suggestions, comments, etc.  Please no flames though.
 *  
 * Thanks!
 * Tightbusiness Dev Team
 *
 *
 * THIS CODE IS COVERED BY GPL v2.  Read LICENSE that mandatorily came with this
 * code distribution.  Please note that v2 of the GPL and no later version of this 
 * license (at this time) can be applied.  (If you wonder why this is, read what 
 * Linus has to say about the FSF (this can be found in files with BIG CAPITAL 
 * LETTERS in the kernel sources))
 *
 * Please also take note of the following:
 *
 *                                  NO WARRANTY
 *
 * 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
 *     FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
 *     OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
 *     PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
 *     OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
 *     TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
 *     PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
 *     REPAIR OR CORRECTION.
 *
 * 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
 *     WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
 *     REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
 *     INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
 *     OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
 *     TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
 *     YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
 *     PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
 *     POSSIBILITY OF SUCH DAMAGES.
 *
 ***********************************************************************************
 * 
 * NOTICE: Any comments following may or may not be accurate, recent, or even applicable.
 *         Read the code to figure out whats really going on if there are any doubts.
 *
 ***********************************************************************************/

// Make global profiling variables
global $prof_start;
global $prof_stop;

// Start profiling
$GLOBALS['prof_start'] = microtime();

require 'tbroot.php';
$link = tbrootconnect() or tberror(100, "Cnc");

readfile('rootstyle.html');
?>

<TITLE>Tight Business Solutions - tbroot alpha v0.3</TITLE>
<BODY LINK="#0000FF" VLINK="#0000aa">
<TABLE cellspacing="5" cellpadding="7" cols="2">
<TR><TD BGColor="#00FF00" Width=150>

<?php
$userdata = mysql_fetch_assoc(mysql_query("select * from users where login='{$_COOKIE['authname']}'"));
echo "{$userdata['firstname']}'s personalized menu<BR>";
?>
<?php

if(isset($_GET['success'])) {
  echo "<B><FONT COLOR=\"#FFFF00\">Last system operation successful</B></FONT><BR>";
}
echo "<UL>";
echo "<LI><U>Vital Statistics:</U><BR>";
echo "<B>Clearance:</B> {$userdata['level']}<BR></LI>";

echo "<LI><U>Useful Functions:</U><BR>";
// f_user, f_pass, f_server
echo "<FORM Action=\"http://post.phpwebhosting.com/webmail/msglist.php\" Method=\"POST\">";
echo "<INPUT Type=\"Hidden\" Name=\"f_user\" Value=\"{$userdata['emaillogin']}\">";
echo "<INPUT Type=\"Hidden\" Name=\"f_pass\" Value=\"{$userdata['emailpass']}\">";
echo "<INPUT Type=\"Hidden\" Name=\"f_server\" Value=\"tightbusiness.com\">";
echo "<INPUT Type=\"Submit\" Value=\"Goto Email\">";
echo "</FORM><BR>";

if($userdata['onclock']) {
  
  $entry = mysql_fetch_assoc(mysql_query("select start from worklog where login='{$_COOKIE['authname']}' and title=''"));
  echo "<B>On clock since:</B><BR>{$entry['start']}<BR><BR>"; 
  echo "<INPUT Type=\"Button\" Value=\"Clock out...\" onClick=\"location.href='testcrap.php?specificform=worklogalpha.php&mode=clockfxns'\">";
}
else {
  echo "<INPUT Type=\"Submit\" Value=\"Clock in\" onClick=\"location.href='interface.php?Operation=clockin'\"> ";
}
echo "</UL>";
echo "<LI><U>My Projects:</U><BR>";

$projects = make2darray(mysql_query("select title, status from projects where contact='{$_COOKIE['authname']}'"), 'title');
$descriptions = make2darray(mysql_query("select varname, english from descriptions where varname like \"STATUS%\""), 'varname');

foreach($projects as $title => $data) {
  $latestwork = mysql_fetch_assoc(mysql_query("select login, start from worklog where title='$title' order by start desc limit 1"));
  echo "<A HREF=\"testcrap.php?specificform=projectalpha.php&mode=summarize&title=".urlencode($title)."\"><B>{$title}</B></A><BR>" . $descriptions[$data['status']]['english'] . "<BR>{$latestwork['start']}<BR>{$latestwork['login']}" . "<BR>";
}
?>
<LI>System Menu
<LI><A HREF="testcrap.php">tbroot Base (Forum)</A></LI>
<LI><A HREF="testcrap.php?specificform=usersalpha.php">Manage My Account</A></LI>
<?php

if($_COOKIE['authtype'] >= $GLOBALS['settings']['level_clockfxns']) {
  echo "<LI><A HREF=\"testcrap.php?specificform=worklogalpha.php&mode=clockfxns\">Clock Functions</A></LI>";
}

if($_COOKIE['authtype'] >= $GLOBALS['settings']['level_projectmodify']) {
  echo "<LI><A HREF=\"testcrap.php?specificform=projectalpha.php\">Project Functions</A></LI></UL>";
}

?>
<FORM Name="lo" Action="interface.php" Method="post"><INPUT Type="Hidden" Name="Operation"><INPUT Type="submit" Value="Logoff" onClick="document.lo.Operation.value='logout'"></FORM>
</TD><TD>

<?php
echo "<BR><BR>";
// See if we need to setup the default forum get post
if(!array_key_exists('mode', $_GET)) {
  $_GET['mode'] = 'test';
  $_GET['parent'] = -1;
  $_GET['depth'] = 4;
}
echo "</UL></UL>";

if(!$_GET['specificform']) {
  require('forumalpha.php');
}
else {
  require($_GET['specificform']);
}

// Stop profiling
$GLOBALS['prof_stop'] = microtime();
?>

</TD></TR></TABLE>
<HR>
Copyright Tight Business Solutions 2002, document generated by tbroot in
<?php
echo number_format(tbprofile(), 6);
?>

seconds
</BODY>
</HTML>
Return current item: Tbroot Business Management Portal