display->loadSkin( "info" ); class portfolio extends binBase { function portfolio( $status = 2 ) { global $bin; $this->construct(); if ( $status == 2 && !isset( $bin->URL[1] ) ) $this->showPortfolio(); else { if ( isset( $bin->URL[1] ) && is_numeric( $bin->URL[1] ) ) $this->getData( $bin->URL[1] ); elseif ( $status == 1 ) $this->showProjects(); else header( "Location: ".$bin->func->formatURL( "index" ) ); } } function showPortfolio() { global $bin, $db; $bin->display->title = "Portfolio"; $portfolio = $db->mysql->query( sprintf( $this->query['list'], 2 ) ); $web = ""; $desktop = ""; $cnt = array("web" => 0, "desktop" => 0); while ( $p = $db->mysql->fetch($portfolio) ) { $type = ( $p->type == 0 ) ? "web" : "desktop"; $cnt[$type]++; $p->url = $bin->func->formatURL( "portfolio", $p->id ); $$type .= $bin->skin->info->project_row($p); } $web = ( $cnt['web'] > 0 ) ? "" : "---"; $desktop = ( $cnt['desktop'] > 0 ) ? "" : "---"; $this->output .= $bin->skin->info->projects("Portfolio", "orange", $web, $desktop); } function showProjects() { global $bin, $db; $bin->display->title = "Current Projects"; $projects = $db->mysql->query( sprintf( $this->query['list'], 1 ) ); $web = ""; $desktop = ""; $cnt = array("web" => 0, "desktop" => 0); while ( $p = $db->mysql->fetch($projects) ) { $type = ( $p->type == 0 ) ? "web" : "desktop"; $cnt[$type]++; $p->url = $bin->func->formatURL( "projects", $p->id ); $$type .= $bin->skin->info->project_row($p); } $web = ( $cnt['web'] > 0 ) ? "" : "
---
"; $desktop = ( $cnt['desktop'] > 0 ) ? "" : "
---
"; $this->output .= $bin->skin->info->projects("Current Projects", "purple", $web, $desktop); } function getData( $id ) { global $bin, $db; $p = $db->mysql->fetch( $db->mysql->query( sprintf( $this->query['show'], $id ) ) ); $p = $bin->func->stripslashes( $p, 2 ); if ( $p->status == 2 ) { $p->status = "Portfolio"; $p->statusURL = $bin->func->formatURL( "portfolio" ); $p->date = "Finished"; $p->box = "orange"; $p->timestamp = $bin->func->getDate( $p->finished, "-medium", -1 ); } else { $p->status = "Current Projects"; $p->statusURL = $bin->func->formatURL( "projects" ); $p->date = "Started"; $p->box = "purple"; $p->timestamp = $bin->func->getDate( $p->started, "-medium", -1 ); } $bin->display->title = $p->status; $p->type = ( $p->type == 0 ) ? "Web" : "Software"; $p->typeURL = strtolower( $p->type ); $this->output .= $bin->skin->info->showProject( $p ); } } ?>