<?php require_once('../Connections/portCon.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$currentPage = $_SERVER["PHP_SELF"];
  
mysql_select_db($database_portCon, $portCon);
$query_rsprint = "SELECT * FROM `work` WHERE category = 'print'";
$rsprint = mysql_query($query_rsprint, $portCon) or die(mysql_error());
$row_rsprint = mysql_fetch_assoc($rsprint);
$totalRows_rsprint = mysql_num_rows($rsprint);

mysql_select_db($database_portCon, $portCon);
$query_rsweb = "SELECT * FROM `work` WHERE category = 'web'";
$rsweb = mysql_query($query_rsweb, $portCon) or die(mysql_error());
$row_rsweb = mysql_fetch_assoc($rsweb);
$totalRows_rsweb = mysql_num_rows($rsweb);

mysql_select_db($database_portCon, $portCon);
$query_rsmulti = "SELECT * FROM `work` WHERE category = 'multimedia'";
$rsmulti = mysql_query($query_rsmulti, $portCon) or die(mysql_error());
$row_rsmulti = mysql_fetch_assoc($rsmulti);
$totalRows_rsmulti = mysql_num_rows($rsmulti);

mysql_select_db($database_portCon, $portCon);
$query_rsmisc = "SELECT * FROM `work` WHERE category = 'miscellaneous'";
$rsmisc = mysql_query($query_rsmisc, $portCon) or die(mysql_error());
$row_rsmisc = mysql_fetch_assoc($rsmisc);
$totalRows_rsmisc = mysql_num_rows($rsmisc);

$maxRows_rswork = 10;
$pageNum_rswork = 0;
if (isset($_GET['pageNum_rswork'])) {
  $pageNum_rswork = $_GET['pageNum_rswork'];
}
$startRow_rswork = $pageNum_rswork * $maxRows_rswork;

$colname_rswork = "-1";
if (isset($_GET['id'])) {
  $colname_rswork = $_GET['id'];
}
mysql_select_db($database_portCon, $portCon);
$query_rswork = sprintf("SELECT * FROM `work` WHERE id = %s", GetSQLValueString($colname_rswork, "int"));
$query_limit_rswork = sprintf("%s LIMIT %d, %d", $query_rswork, $startRow_rswork, $maxRows_rswork);
$rswork = mysql_query($query_limit_rswork, $portCon) or die(mysql_error());
$row_rswork = mysql_fetch_assoc($rswork);

if (isset($_GET['totalRows_rswork'])) {
  $totalRows_rswork = $_GET['totalRows_rswork'];
} else {
  $all_rswork = mysql_query($query_rswork);
  $totalRows_rswork = mysql_num_rows($all_rswork);
}
$totalPages_rswork = ceil($totalRows_rswork/$maxRows_rswork)-1;

$queryString_rswork = "";
if (!empty($_SERVER['QUERY_STRING'])) {
  $params = explode("&", $_SERVER['QUERY_STRING']);
  $newParams = array();
  foreach ($params as $param) {
    if (stristr($param, "pageNum_rswork") == false && 
        stristr($param, "totalRows_rswork") == false) {
      array_push($newParams, $param);
    }
  }
  if (count($newParams) != 0) {
    $queryString_rswork = "&" . htmlentities(implode("&", $newParams));
  }
}
$queryString_rswork = sprintf("&totalRows_rswork=%d%s", $totalRows_rswork, $queryString_rswork);


?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="../styleeoh.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="gallery.js"></script>
<title>MISSAMANDAJEANNE.COM | design portfolio</title>


</head>

<body>
<?php include("../html/top.html"); ?> 
  
 
<div id="wrap">
 
 <div id="gallery">   
  

  
  
  <!--web stuff-->
  <p><span class="resumeheading" style="padding-right:145px">Web</span><br/><br/>
<?php do { ?>
    <a href="index.php?recordID=<?php echo $row_rsweb['id']; ?>"><img src="<?php echo $row_rsweb['thumb']; ?>" border="1"/></a>
    <?php } while ($row_rsweb = mysql_fetch_assoc($rsweb)); ?>  </p><br/>
    
  <!--print stuff-->
 <p><span class="resumeheading" style="padding-right:133px">print</span><br /><br/>
   <?php do { ?>
    <a href="index.php?recordID=<?php echo $row_rsprint['id']; ?>"><img src="<?php echo $row_rsprint['thumb']; ?>" border="1"/></a>
    <?php } while ($row_rsprint = mysql_fetch_assoc($rsprint)); ?> </p><br/>     
      
  <!--multimedia stuff-->
  <p><span class="resumeheading" style="padding-right:85px">multimedia</span><br /><br/>
     <?php do { ?>
    <a href="index.php?recordID=<?php echo $row_rsmulti['id']; ?>"><img src="<?php echo $row_rsmulti['thumb']; ?>" border="1"/></a>
    <?php } while ($row_rsmulti = mysql_fetch_assoc($rsmulti)); ?>  </p><br/>

  <!--misc stuff-->
  <p><span class="resumeheading" style="padding-right:143px">misc</span><br /><br />
    <?php do { ?>
     <a href="index.php?recordID=<?php echo $row_rsmisc['id']; ?>"> <img src="<?php echo $row_rsmisc['thumb']; ?>" border="1"/></a>
      <?php } while ($row_rsmisc = mysql_fetch_assoc($rsmisc)); ?> </p>
    <br/>
  
<!--end gallery--></div>
  
  
  <div id="content"> <?php include("work.php");?> <br/><br/></div>
  

<div id="foot"><?php include("../html/foot.html"); ?> </div>


</div>
</body>
</html>
<?php
mysql_free_result($rsweb);

mysql_free_result($rsprint);

mysql_free_result($rsmulti);

mysql_free_result($rsmisc);

mysql_free_result($rswork);

?>
