Location: PHPKode > projects > TimeSheet4dotProject > ts4dp/timesheet/getTasks.php
<?php
require_once('session.php');
require_once('global4app.php');
// get company id, do a query, print as a html select UI widget - and its done
// if no company id as request (get), then print error ... 
$htmlOutput = "";
if ($_POST['projectId'] == "")
{
	$htmlOutput = '<select id=taskName disabled><option id=0>No Tasks</option></select>';
}
else
{
	$htmlOutput = '<select id=taskName style="{width:275}"><option id=0>Select a Tasks</option>'; 
	//echo 'select * from tasks where task_project = '. $_GET['projectId'];
	$result = db_loadList('select * from tasks where task_project = '. $_POST['projectId']);
	foreach($result as $row)
	{
		$htmlOutput = $htmlOutput .  '<option value='.$row['task_id'].'>'.$row['task_name'].'</option>';
	}
	$htmlOutput = $htmlOutput . '</select>';	
	
}
echo ($htmlOutput);
?>
Return current item: TimeSheet4dotProject