在错误日志中,我在header.php的第7行和第109行收到错误,其中第7行显示"未定义索引:/var/www/ttm.com/public_html/include/header.php中的id 34;和"未定义的索引:第109行" /var/www/ttm.com/public_html/include/header.php中的全名。在升级之前,相同的代码工作正常。
这是我的header.php代码
<?php
include('data/db.php');
$base_url = "http://ttm.xceedance.com/";
if(!isset($_SESSION['login'])){
header("Location:login.php");
}
$user_id=$_SESSION['id'];
$sql_works = "select * from items where work_status!='Start' AND account_id='$user_id'";
$result_works = mysql_query($sql_works);
$acco_data=mysql_fetch_array($result_works);
if(!empty($acco_data))
{
$account_work_status=$acco_data['work_status'];
}
else
{
$sql_mett = "select * from meeting where work_status!='Start' AND account_id='$user_id'";
$result_mett = mysql_query($sql_mett);
$acco_mett=mysql_fetch_array($result_mett);
if(empty($acco_mett))
{
$sql_client = "select * from client_email where work_status!='Start' AND account_id='$user_id'";
$result_client = mysql_query($sql_client);
$acco_client=mysql_fetch_array($result_client);
if(empty($acco_client))
{
$sql_break = "select * from break where work_status!='Start' AND account_id='$user_id'";
$result_break = mysql_query($sql_break);
$acco_break=mysql_fetch_array($result_break);
if(!empty($acco_break))
{
$account_work_status=$acco_break['work_status'];
} else { $account_work_status='Start'; }
}
else
{
$account_work_status=$acco_client['work_status'];
}
}
else
{
$account_work_status=$acco_mett['work_status'];
}
}
//print_r($account_work_status);die;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="120" >
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Xceedance Exposure Management Time Tracker</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/sb-admin.css" rel="stylesheet">
<link href="css/mystyle.css" rel="stylesheet">
<link href="css/jquery-ui.css" rel="stylesheet">
<!-- Morris Charts CSS -->
<link href="css/plugins/morris.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div id="wrapper">
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<html><body><div id="image" style="float:left;"><?php if($account_work_status=='Start') { ?><a href="index.php"><?php } else { ?><a href="#workstatus_modal" data-toggle="modal"><?php } ?><img src="/images/logo.png"/></div></body></html>
<html><?php if($account_work_status=='Start') { ?><a class="navbar-brand" href="index.php"><?php } else { ?><a href="#workstatus_modal" data-toggle="modal" class="navbar-brand"><?php } ?>Exposure Management Time Tracker</a><html>
</div>
<!-- Top Menu Items -->
<ul class="nav navbar-right top-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user"></i> Welcome <?php echo $_SESSION['fullname'] ?> <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<a href="#"><i class="fa fa-fw fa-gear"></i> Settings</a>
</li>
<li>
<a href="chpass.php"><i class="fa fa-fw fa-gear"></i>Change Password</a>
</li>
<li class="divider"></li>
<li>
<?php if($account_work_status=='Start') { ?> <a href="logout.php"><?php } else { ?><a href="#workstatus_modal" data-toggle="modal"><?php } ?><i class="fa fa-fw fa-power-off"></i> Log Out</a>
</li>
</ul>
</li>
</ul>
<!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->