while ($array_userhours = mysql_fetch_array($result_userhours)) {
     if ($pdf->GetY() > 280) {
         $pdf->addPage();
     }
     $user_id = $array_userhours['user_id'];
     $user_name_first = $array_userhours['user_name_first'];
     $user_name_second = $array_userhours['user_name_second'];
     $user_user_added = $array_userhours['user_user_added'];
     $user_user_rate = $array_userhours['user_user_rate'];
     $ts_hours = $array_userhours['SUM(ts_hours)'];
     if ($user_user_added > $settings_timesheetstart) {
         $timesheet_datum_user = $user_user_added;
     } else {
         $timesheet_datum_user = $settings_timesheetstart;
     }
     $percent_complete = TimeSheetHours($user_id, $display) / 100;
     // Calculate how much time has been spent on non-project hours
     $sql_nonproject = "SELECT SUM(ts_hours) FROM intranet_timesheet, intranet_projects WHERE ts_project = proj_id AND ts_user = {$user_id} AND proj_fee_track != 1 AND ts_entry >= {$timesheet_datum_user}";
     $result_nonproject = mysql_query($sql_nonproject, $conn) or die(mysql_error());
     $array_nonproject = mysql_fetch_array($result_nonproject);
     $hours_nonproject = $array_nonproject['SUM(ts_hours)'];
     $sql_total = "SELECT SUM(ts_hours) FROM intranet_timesheet, intranet_projects WHERE ts_project = proj_id AND ts_user = {$user_id} AND ts_entry >= {$timesheet_datum_user}";
     $result_total = mysql_query($sql_total, $conn) or die(mysql_error());
     $array_total = mysql_fetch_array($result_total);
     $hours_total = $array_total['SUM(ts_hours)'];
     $percent_nonproject = $hours_nonproject / $hours_total;
     if ($percent_nonproject > 1) {
         $percent_nonproject = 1;
     }
     if ($percent_complete > 1) {
         $percent_complete = 1;
Ejemplo n.º 2
0
include_once "secure/prefs.php";
//Check for hiding the alerts box
if ($_POST[hidealerts]) {
    setcookie("timesheethide", $_POST[hidealerts]);
    $hidealerts = "yes";
}
// Check for details of any projects
$proj_details = ProjectTitle();
$proj_id = $proj_details[0];
if ($proj_id) {
    $proj_title = "<h1><a href=\"index2.php?page=project_view&amp;proj_id={$proj_id}\">{$proj_details['1']} {$proj_details['2']}</a></h1>";
} else {
    unset($proj_title);
}
// Check for any outstanding timesheets
$timesheetcomplete = TimeSheetHours($_COOKIE[user], "");
if ($_COOKIE[timesheetcomplete] < 75) {
    $timesheetaction = $timesheetaction . "<div class=\"warning\"><p><strong>Timesheets</strong></p><p>Your timesheets are only " . $timesheetcomplete . "% complete - <a href = \"popup_timesheet.php\">please fill them out</a>. If your timesheet drops below " . $settings_timesheetlimit . "% complete, you will not be able to access the intranet.</p></div>";
}
//if ($timesheet_percentage_complete < $settings_timesheetlimit) { header("Location: popup_timesheet.php"); }
// Check for any outstanding telephone messages
if ($_COOKIE[phonemessageview] > 0 or $_COOKIE[phonemessageview] == NULL) {
    $sql2 = "SELECT * FROM intranet_phonemessage WHERE message_for_user = '******'user']}' AND message_viewed = 0";
    $result2 = mysql_query($sql2, $conn) or die(mysql_error());
    $messages_outstanding = mysql_num_rows($result2);
    if ($messages_outstanding > 0) {
        $phonemessageview = $_COOKIE[phonemessageview] + 1;
        setcookie("phonemessageview", $phonemessageview, time() + 3600);
    }
}
// Check for any invoices due to be issued today
<?
// Include the cookie check information

include "inc_files/inc_checkcookie.php";

// Perform any actions required

if ($_GET[user_view] > 0) { $viewuser = $_GET[user_view]; } else { $viewuser = $_COOKIE[user]; }

if ($_POST[action] != NULL) { $include_action = "inc_files/action_" . $_POST[action] .".php"; include_once($include_action); TimeSheetHours($viewuser,""); }

$timesheetcomplete = TimeSheetHours($viewuser,"return");

// Include the header information

include("inc_files/inc_header.php");

// Set the week beginning variable from either POST or GET

	if ($_POST[ts_weekbegin] != NULL) {
	$ts_weekbegin = $_POST[ts_weekbegin];
	} elseif ($_GET[week] != NULL) {
	$ts_weekbegin = $_GET[week];
	} else {
	$ts_weekbegin = BeginWeek(time());
	}

$TSFormat = "popup";

// Header