Location: PHPKode > projects > Content*Builder > modules/todo/todoBox.php
<?php
	$waitingQuery  = mysql_query("SELECT title, description, todoID, currentstage, SUBSTRING(status,1,1) as stat, SUBSTRING(status,2,3) as sort FROM ".TABLE."_sext_todo WHERE SUBSTRING(status,1,1) = '1' ORDER BY sort DESC LIMIT 0,5");
	$workingQuery  = mysql_query("SELECT title, description, todoID, currentstage, SUBSTRING(status,1,1) as stat, SUBSTRING(status,2,3) as sort FROM ".TABLE."_sext_todo WHERE SUBSTRING(status,1,1) = '2' ORDER BY sort DESC LIMIT 0,5");
	$finishedQuery = mysql_query("SELECT title, description, todoID, currentstage, SUBSTRING(status,1,1) as stat, SUBSTRING(status,2,3) as sort FROM ".TABLE."_sext_todo WHERE SUBSTRING(status,1,1) = '3' ORDER BY sort DESC LIMIT 0,5");
	
	while($waitingRow  = mysql_fetch_object($waitingQuery)) {
		$stage = $waitingRow->currentstage;
		if($stage > 100) { $stage = 100; }
		$stage = $stage / 2;
		$waiting[title][] = $waitingRow->title;
		$waiting[desc][]  = $waitingRow->description;
		$waiting[stage][] = $stage;
		$waiting[id][]    = $waitingRow->todoID;
	}
	while($workingRow  = mysql_fetch_object($workingQuery)) {
		$stage = $workingRow->currentstage;
		if($stage > 100) { $stage = 100; }
		$stage = $stage / 2;
		$working[title][] = $workingRow->title;
		$working[desc][]  = $workingRow->description;
		$working[stage][] = $stage;		
		$working[id][]    = $workingRow->todoID;
	}
	while($finishedRow = mysql_fetch_object($finishedQuery)) {
		$stage = $finishedRow->currentstage;
		if($stage > 100) { $stage = 100; }
		$stage = $stage / 2;
		$finished[title][] = $finishedRow->title;
		$finished[desc][]  = $finishedRow->description;
		$finished[stage][] = $stage;
		$finished[id][]    = $finishedRow->todoID;
	}
	
	$tpl->assign("MOD_IMG_DIR", $location."templates/");
	$todoWorking = array(  
		"TITLE" => $working[title],
		"DESC"  => $working[desc],
		"STAGE" => $working[stage],
		"ID"    => $working[id]
	);
	$tpl->assign("todoWorking", $todoWorking);
	
	$todoWaiting = array(
		"TITLE" => $waiting[title],
		"DESC"  => $waiting[desc],
		"STAGE" => $waiting[stage],
		"ID"    => $waiting[id]
	);
	$tpl->assign("todoWaiting", $todoWaiting);
	
	$todoFinished = array(
		"TITLE" => $finished[title],
		"DESC"  => $finished[desc],
		"STAGE" => $finished[stage],
		"ID"    => $finished[id]
	);
	$tpl->assign("todoFinished", $todoFinished);
	
	$tpl->display("todoBox.template");	
	
?>
Return current item: Content*Builder