Hi,

i have this error : Strict Standards: Non-static method department::showAllDepartment() should not be called statically, assuming $this from incompatible context in /opt/lampp/htdocs/nsubackend/lib/controller/mainController.php on line 577..

and heres my code:

574        function showDepartment(){
575	require_once('lib/model/classDepartment.php');
576	new department();
577	$departmentID = department::showAllDepartment();
578		
579	if(isset($_POST['addDepartment'])) $this->addDepartment();
580	if(isset($_POST['updateDepartment'])) $this->updateDepartment();
581	if(isset($_POST['yesDeleteDepartment'])) $this->deleteDepartment();
582	if(isset($_POST['noDeleteDepartment'])) echo "<script language='javascript'>window.location='department.php';</script>";
		require_once('lib/view/tpl.department.php');
	}

...hope you could help me here..

Recommended Answers

All 7 Replies

function showDepartment()
{
  require_once('lib/model/classDepartment.php');
  $dept = new department();
  $departmentID = $dept->showAllDepartment();
	
  if(isset($_POST['addDepartment'])) $this->addDepartment();
  if(isset($_POST['updateDepartment'])) $this->updateDepartment();
  if(isset($_POST['yesDeleteDepartment'])) $this->deleteDepartment();
  if(isset($_POST['noDeleteDepartment'])) echo "<script language='javascript'>window.location='department.php';</script>";
  require_once('lib/view/tpl.department.php');
}

Without knowing how the department class is setup, this is my best assumption.

So how will I configure that error? Does it mean i don't have initialize dept variable?

Hi,
I have another error which seems i can't find where and here is the error:
Parse error: syntax error, unexpected T_VARIABLE in C:\Program Files\xampp\htdocs\nsubackend\viewRooms.php on line 3

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>NSU || Room Schedules</title>
<script type="text/javascript">
	function print_me(){
		print();
		document.getElementById('pLbl').style.display='none';
		document.getElementById('pLbl').style.display='';

	}
</script>
</head>

<body>
<img src="<?php echo $server ?>/images/nsu.jpg" width="250px"><br />
NAVAL STATE UNIVERSITY - BILIRAN<br>
Naval, Biliran Leyte<br>
Telephone no. <br>
Telefax no. <br>
e-mail address:
<br><br>
<label style="font-size:24px; font-weight:bold;">Room Schedules<br /><br /></label>
<a id="pLbl" onclick="print_me();" style="cursor:pointer">Print</a>

hi pritaeas,

here's the code you ask...

<?php
session_start();
if($_SESSION['userLevel']==1 $_SESSION['userLevel']==2){
	require_once('lib/controller/mainController.php');
	$admin = new mainController('viewRooms');
	$admin->userAction();
}else{
	echo " <META HTTP-EQUIV=Refresh CONTENT='0; URL=index.php'>";
}
?>

You are missing something in your conditional statement:

if($_SESSION['userLevel']==1 $_SESSION['userLevel']==2){

should be (assuming its an OR condition):

if($_SESSION['userLevel']==1 || $_SESSION['userLevel']==2){

just viewed reply...been busy with my thesis...thank you mschroeder...I will apply it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.