ob_start('ob_gzhandler');
?>
SL Project Manager
//echo time();
include('config.php');
//$category_templates = array('Perl/CGI', 'PHP', 'ASP', 'C/C++', 'Java', 'JSP', 'Javascript', 'XML', 'Cold Fusion', 'Flash', 'Python', 'Visual Basic', '.NET', 'Script Installation', 'Website Design', 'Graphic Design', 'Translation', 'Search Engine Optimization', 'Data Entry', 'Writing', 'Marketing');
$category_templates = array('.NET', 'ASP', 'Ajax', 'C/C++', 'CMS', 'CSS', 'Cold Fusion', 'Data Entry', 'Delphi', 'Flash', 'Graphic Design', 'Handheld', 'JSP', 'Java', 'Javascript', 'Joomla', 'LDAP', 'Links', 'MS Access', 'MS SQL', 'Marketing', 'Multimedia', 'MySQL', 'Oracle', 'PHP', 'Perl/CGI', 'PostgreSQL', 'Python', 'SQL', 'Script Installation', 'Search Engine Optimization', 'Security', 'System Administration', 'Translation', 'Visual Basic', 'Website Design', 'Wordpress', 'Writing', 'XHTML', 'XML', 'mSQL');
if (empty($_GET['limit'])) {$limit = 10;} else {$limit = $_GET['limit'];}
$only_featured = $_GET['only_featured'];
//echo $only_featured;
echo '
";
if (!empty($_GET['submit'])) {
if (!empty($_GET['status'])) {
$query = "UPDATE projects SET status = '{$_GET['status']}' WHERE guid = {$_GET['guid']};";
mysql_query($query);
}
for ($i = 0; $i < count($category_templates); $i++) {
$dvar = 'd' . ($i + 1);
if ($_GET[$dvar] == 'yes') {
$dextra .= " AND category NOT LIKE '%{$category_templates[$i]}%'";
$hiddens .= "";
}
}
$fextra = $only_featured == 'yes' ? " AND featured = 'yes'" : '';
$query = "SELECT guid, title, link, featured, category, status, `webmaster_name`, `webmaster_rating` FROM projects WHERE status = 'new'$fextra$dextra ORDER BY guid DESC LIMIT $limit;";
$query2 = "SELECT COUNT(*) FROM projects WHERE status = 'new'$fextra$dextra;";
if ($_GET['submit'] == 'Bids' OR ($_GET['mode'] == 'Bids' AND $_GET['submit'] == 'Set')) {
$query = "SELECT guid, title, link, featured, category, status, `webmaster_name`, `webmaster_rating` FROM projects WHERE status = 'bid' ORDER BY guid DESC LIMIT $limit;";
$query2 = "SELECT COUNT(*) FROM projects WHERE status = 'bid';";
}
if ($_GET['submit'] == 'Watching' OR ($_GET['mode'] == 'Watching' AND $_GET['submit'] == 'Set')) {
$query = "SELECT guid, title, link, featured, category, status, `webmaster_name`, `webmaster_rating` FROM projects WHERE status = 'watching' ORDER BY guid DESC LIMIT $limit;";
$query2 = "SELECT COUNT(*) FROM projects WHERE status = 'watching';";
}
if ($_GET['submit'] == 'Closed' OR ($_GET['mode'] == 'Closed' AND $_GET['submit'] == 'Set')) {
$query = "SELECT guid, title, link, featured, category, status, `webmaster_name`, `webmaster_rating` FROM projects WHERE status = 'closed' ORDER BY guid DESC LIMIT $limit;";
$query2 = "SELECT COUNT(*) FROM projects WHERE status = 'closed';";
}
if ($_GET['submit'] == 'Trash' OR ($_GET['mode'] == 'Trash' AND $_GET['submit'] == 'Set')) {
$query = "SELECT guid, title, link, featured, category, status, `webmaster_name`, `webmaster_rating` FROM projects WHERE status = 'trash' ORDER BY guid DESC LIMIT $limit;";
$query2 = "SELECT COUNT(*) FROM projects WHERE status = 'trash';";
}
if ($_GET['submit'] == 'Search' OR ($_GET['mode'] == 'Search' AND $_GET['submit'] == 'Set')) {
$query = "SELECT guid, title, link, featured, category, status, `webmaster_name`, `webmaster_rating` FROM projects WHERE title LIKE '%{$_GET['keyword']}%' OR webmaster_name = '{$_GET['keyword']}' ORDER BY guid DESC LIMIT $limit;";
$query2 = "SELECT COUNT(*) FROM projects WHERE title LIKE '%{$_GET['keyword']}%' AND status = 'new';";
}
//echo $query;
$result2 = mysql_query($query2);
list($num_of_new_projects) = mysql_fetch_row($result2);
$result = mysql_query($query);
$num_of_showed_projects = mysql_num_rows($result);
$curmode = ($_GET['submit'] != 'Set') ? ($_GET['submit']) : ($_GET['mode']);
echo "
Showed: $num_of_showed_projects of $num_of_new_projects
Current status: $curmode
";
while (list($guid, $title, $link, $featured, $category, $status, $webmaster_name, $webmaster_rating) = mysql_fetch_row($result)) {
$webmaster_name .= "($webmaster_rating)";
$time_posted = gmdate("G:i, j F, Y", $guid + 3600*3);
if ($status == 'new') {$s1 = 'selected';} else {$s1 = '';}
if ($status == 'watching') {$s2 = 'selected';} else {$s2 = '';}
if ($status == 'bid') {$s3 = 'selected';} else {$s3 = '';}
if ($status == 'closed') {$s4 = 'selected';} else {$s4 = '';}
if ($status == 'trash') {$s5 = 'selected';} else {$s5 = '';}
echo "
| $title
| $featured
| $category
| $webmaster_name
| $time_posted
|
";
}
echo '
|
';
} else {
include('process_bids.php');
}
?>