Jump to content

[SOLVED] what am i doing wrong ???


scarface83

Recommended Posts

Can anyone see what im doing wrong here ?

$abs_value - doesn't work ?

 

<?php 		
	if (isset($_GET['date'])) {
    

	require ('db_connect.inc');

	$query = mysql_query("SELECT tbl_colour.colour, absence_mgt.notes, absence_mgt.datestamp FROM tbl_colour,absence_mgt  WHERE absence_mgt.datestamp='$date' ") or die(mysql_error()); 



	$row = mysql_fetch_array( $query );
	$any_entry = $row["colour"];

			if($any_entry =="" OR $any_entry == "0") { require ('select_absence.php');
			unset($_GET['date']); }
			else { 

			$notes =$row['notes'] ;
			$abs_value =$row['abs_value']  ;
			$stamp = $row['datestamp'];  

			list($year,$month,$day) = split("-",$stamp);
			$datestamp = $day."-".$month."-".$year;
			echo $abs_value;
			}

}
                switch ($abs_value) {
		case 1:
	    $abs_value = "Late";
	    break;

		case 2:
	    $abs_value = "Sick";
		break;

  			case 3:
	    $abs_value = "Sick (Half Day)";
    		break;

  			case 4:
	    $abs_value = "AWOL";
    		break;

  			case 5:
	    $abs_value = "Holiday";
    		break;

  			case 6:
	    $abs_value = "Holiday (Half Day)";
    		break;

  			case 7:
	    $abs_value = "Lieu Day";
    		break;

  			case 8:
	    $abs_value = "Dependency Leave";
    		break;

  			case 9:
	    $abs_value = "Personal Leave";
    		break;

  			case 10:
	    $abs_value = "Other";
    		break;

	}	
?>

Link to comment
https://forums.phpfreaks.com/topic/44538-solved-what-am-i-doing-wrong/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.