<?php require_once "admin/lib/viewer_functions.php"; ?>
<?php if (!$CURRENT_USER) { websiteLogin_redirectToLogin(); } ?>
<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */
  require_once "admin/lib/viewer_functions.php";

  list($servicesRecords, $servicesMetaData) = getRecords(array(
    'tableName'   => 'services',
  ));

?>
<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */
  require_once "admin/lib/viewer_functions.php";

  list($projectsRecords, $projectsMetaData) = getRecords(array(
    'tableName'   => 'projects',
	'where' => "project_manager LIKE '%\t". $CURRENT_USER['id'] ."\t%'" ,

  ));

?>
<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */
  require_once "admin/lib/viewer_functions.php";

  list($accountsRecords, $accountsMetaData) = getRecords(array(
    'tableName'   => 'accounts',
  ));

?>
<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */
  require_once "admin/lib/viewer_functions.php";

  list($departmentsRecords, $departmentsMetaData) = getRecords(array(
    'tableName'   => 'departments',
  ));

?>
<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */
  require_once "admin/lib/viewer_functions.php";

  list($client_listRecords, $client_listMetaData) = getRecords(array(
    'tableName'   => 'client_list',
  ));

?>
<!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" />
<title>S2S Frontdesk v2.0</title>
<link href="css/main.css" rel="stylesheet" type="text/css" />
</head>

<body>
<table width="900" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td colspan="2" align="left" valign="top"><?php include("includes/header.php"); ?></td>
  </tr>
   <?php include("includes/login.php"); ?>
  <tr>
    <td width="252" height="100%" align="center" valign="top" style="padding:0px 10px 0px 0px"><?php include("includes/menu.php"); ?><script type="text/javascript">
	var acc8 = new Spry.Widget.Accordion("Accordion1", { useFixedPanelHeights: false, defaultPanel: -1 });
</script></td>
    <td width="928" align="left" valign="top" style="padding:0px 0px 0px 0px"><table width="700" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="10" height="8" align="left" valign="top" bgcolor="#434343"><img src="images/top_left.jpg" width="10" height="8" /></td>
        <td width="730" height="8" align="left" valign="top" bgcolor="#434343">&nbsp;</td>
        <td width="10" height="8" align="left" valign="top" bgcolor="#434343"><img src="images/top_right.jpg" width="10" height="8" /></td>
      </tr>
      <tr>
        <td height="600" colspan="3" align="left" valign="top" background="images/main_bg.jpg" bgcolor="#838383" style="background-repeat:repeat-x;padding:5px 25px 20px 25px"><table width="650" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="left" valign="middle" style="padding:0px 0px 10px 0px" class="header">
    <span class="subheader">  <?php if ($CURRENT_USER): ?>

  <?php echo $CURRENT_USER['fullname'] ?>



 

<?php endif ?></span>
    <br />
    DASHBOARD</td>
          
             <td align="right" valign="middle" style="padding:0px 0px 10px 0px"><form method="POST" action="index.php">
      <input type="text" name="project_manager,project_title,num,client_keyword" value="" id="menu4">
  
  <input type="submit" name="submit" value="Search">
</form></td>
          </tr>
        </table>
          <table width="650" border="0" cellspacing="0" cellpadding="0">
            <tr>
             
              <td align="left" valign="top" style="padding:0px 0px 8px 10px"><table width="630" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td align="left" valign="top" bgcolor="#333333" id="menu3" style="padding:8px 0px 8px 8px">Active Jobs</td>
                </tr>
                <tr>
                  <td align="left" valign="top"><table width="630" border="0" cellspacing="0" cellpadding="0" id="menu3" >
                     <tr>
                      <td width="58" height="30" align="left" valign="middle" style="padding:0px 8px 0px 8px">ID</td>
                      <td width="271" height="30" align="left" valign="middle" style="padding:0px 8px 0px 0px">Project Title</td>
                      <td width="71" height="30" align="center" valign="middle" style="padding:0px 8px 0px 0px">Status</td>
                    </tr>
                  </table>
                    <?php foreach ($projectsRecords as $record): ?>
                    <?php $bgColor = (@$bgColor == "#CCCCCC") ? '#999999' : '#CCCCCC'; ?>
                    <?php if ($record['project_status'] != 'Active') { continue; } ?>
                    <table width="630" border="0" cellspacing="0" cellpadding="0" id="menu4" style="margin-bottom:3px" bgcolor="<?php echo $bgColor; ?>">
                      <tr>
                        <td width="58" height="30" align="left" valign="middle" style="padding:0px 8px 0px 8px"><?php echo $record['client'] ?><?php echo $record['num'] ?></td>
                        <td width="277" height="30" align="left" valign="middle" style="padding:0px 8px 0px 0px"><a href="<?php echo $record['_link'] ?>"><?php echo $record['project_title'] ?></a></td>
                        <td width="65" height="30" align="center" valign="middle" style="padding:0px 8px 0px 0px"><?php echo $record['phase'] ?></td>
                      </tr>
                    </table>
                    <?php endforeach; ?></td>
                </tr>
              </table></td>
            </tr>
            <tr>
              <td align="left" valign="top" style="padding:0px 0px 8px 10px"><table width="630" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td align="left" valign="top" bgcolor="#333333" id="menu3" style="padding:8px 0px 8px 8px">Pending Proposals</td>
                </tr>
                <tr>
                  <td align="left" valign="top"><table width="630" border="0" cellspacing="0" cellpadding="0" id="menu3" >
                    <tr>
                      <td width="58" height="30" align="left" valign="middle" style="padding:0px 8px 0px 8px">ID</td>
                      <td width="271" height="30" align="left" valign="middle" style="padding:0px 8px 0px 0px">Project Title</td>
                      <td width="71" height="30" align="center" valign="middle" style="padding:0px 8px 0px 0px">Status</td>
                    </tr>
                  </table>
                    <?php foreach ($projectsRecords as $record): ?>
                    <?php $bgColor = (@$bgColor == "#CCCCCC") ? '#999999' : '#CCCCCC'; ?>
                     <?php if ($record['project_status'] != 'Quote') { continue; } ?> 
                    <table width="630" border="0" cellspacing="0" cellpadding="0" id="menu4" style="margin-bottom:3px" bgcolor="<?php echo $bgColor; ?>">
                      <tr>
                        <td width="58" height="30" align="left" valign="middle" style="padding:0px 8px 0px 8px"><?php echo $record['client'] ?><?php echo $record['num'] ?></td>
                        <td width="277" height="30" align="left" valign="middle" style="padding:0px 8px 0px 0px"><a href="<?php echo $record['_link'] ?>"><?php echo $record['project_title'] ?></a></td>
                        <td width="65" height="30" align="center" valign="middle" style="padding:0px 8px 0px 0px"><?php echo $record['phase'] ?></td>
                      </tr>
                    </table>
                    <?php endforeach; ?></td>
                </tr>
              </table></td>
            </tr>
          </table></td>
      </tr>
      <tr>
        <td align="left" valign="bottom" bgcolor="#838383"><img src="images/bottom_left.jpg" width="10" height="8" /></td>
        <td align="left" valign="top" bgcolor="#838383">&nbsp;</td>
        <td align="left" valign="bottom" bgcolor="#838383"><img src="images/bottom_right.jpg" width="10" height="8" /></td>
      </tr>
    </table></td>
  </tr>
  
</table>
<table width="900" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td align="left" valign="top" style="padding:20px 0px 25px 5px" class="footer"><?php include("includes/footer.php"); ?></td>
  </tr>
</table>
</body>
</html>