
<!doctype html>
<html class="no-js" lang="">

<head>
<?php error_reporting(0); ?>
    <!-- meta -->
    <meta charset="utf-8">
    <meta name="description" content="Flat, Clean, Responsive, application admin template built with bootstrap 3">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
    <!-- /meta -->

    <title>Carbon Blue</title>

    <!-- page level plugin styles -->
    <link rel="stylesheet" href="plugins/responsive-tables/theme.css">
    <!-- /page level plugin styles -->

    <!-- core styles -->
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="css/font-awesome.css">
    <link rel="stylesheet" href="css/themify-icons.css">
    <link rel="stylesheet" href="css/animate.min.css">
    <!-- /core styles -->

    <!-- template styles -->
    <link rel="stylesheet" href="css/skins/palette.css">
    <link rel="stylesheet" href="css/fonts/font.css">
    <link rel="stylesheet" href="css/main.css">
    <!-- template styles -->

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- load modernizer -->
    <script src="plugins/modernizr.js"></script>
	

	<link rel="stylesheet" href="awesomplete-gh-pages/awesomplete.css" />
<script src="awesomplete-gh-pages/awesomplete.js" async></script>
	
	<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
	
	<link rel="stylesheet" type="text/css" media="all" href="date/jsDatePick_ltr.min.css" />
	<script type="text/javascript" src="date/jsDatePick.min.1.3.js"></script>
	
 
 
</head>

<!-- body -->

<body>

 							  
    <div class="app">
        <!-- top header -->
        
		
		<?php
		 
		
		
	$cookie_name = "user_con";
	
if(!isset($_COOKIE[$cookie_name])) {
   // echo "Cookie named '" . $cookie_name . "' is not set!";
	header('Location: sign-in.php');
	exit;
} else {
    //echo "Cookie '" . $cookie_name . "' is set!<br>";
    //echo "Value is: " . $_COOKIE[$cookie_name];
}
?>

<?php
	 $_con_id =  $_COOKIE[$cookie_name];
									
									$con = mysql_connect('localhost', 'root', 'Boom95z') or die(mysql_error());
									mysql_select_db('orion9', $con);
								
									$result = mysql_query("select company_name from contractors where con_id=" . $_con_id);
									while($row = mysql_fetch_array($result))
									{    
										$company_name = $row['company_name']; 
									}
									


$result1 = mysql_query("select a.*, DATE_FORMAT(a.date_uploaded,'%d-%m-%Y') as 'datef' from contractor_documents a where a.con_id=" . $_con_id . " order by a.date_uploaded desc");
		
 ?>
										
 
  

<header class="header header-fixed navbar" style="background-color:#59b2ff;">

            <div class="brand" style="background-color:#ccc;"><center>
                <!-- toggle offscreen menu -->
          
                <a href="home.php?x=ocNvi07amIHwp7J6Zfr3fIvqLNE4h0UFdHbvHiF31nAqujxtzZxPI2ftQUx7VrN89YEQhkUiHvJbOhFogceYftr5oZckrZsAY6rf" class="navbar-brand">
                    <img src="unnamed.png"  alt="">
                     
                </a> </center>
            </div>

            <ul class="nav navbar-nav">
                <li class="hidden-xs"> 
                     
                </li> 
            </ul> 
            <ul class="nav navbar-nav navbar-right"> 
                <li class="off-right">
                    <a href="javascript:;" data-toggle="dropdown">
                        
                         <span class="hidden-xs ml10" style='font-family:calibri;'><?php echo $company_name ;?></span>
                        <i class="ti-angle-down ti-caret hidden-xs"></i>
                    </a>
                    <ul class="dropdown-menu animated fadeInRight">
                     
                        <li>
                            
							 <a href="log_con_out.php" onclick="">Logout</a>
                        </li>
                    </ul>
                </li>
            </ul>
        </header>
        <!-- /top header -->

        <section class="layout">
            <!-- sidebar menu -->
           <aside style='display:none;' class="sidebar offscreen-left" style="border-right:solid 1px #ccc;">
                <!-- main navigation -->
                <nav class="main-navigation" data-height="auto" data-size="6px" data-distance="0" data-rail-visible="true" data-wheel-step="10">
                    <br/>
                    <ul class="nav">
                        <!-- dashboard -->
                        <li style="background-color:#008362; font-family:calibri;  color:white; border-bottom:solid 1px white;">
                            <a href="home.php" onclick="checkChangesSideBar('home.php','ocNvi07amIHwp7J6Zfr3fIvqLNE4h0UFdHbvHiF31nAqujxtzZxPI2ftQUx7VrN89YEQhkUiHvJbOhFogceYftr5oZckrZsAY6rf')">
                              
                                <span style="color:white;"><i class="fa fa-rocket" style='font-size:15px;' aria-hidden="true"></i> PROJECTS</span>
                            </a>
                        </li>  
						   <li style="background-color:#438dcc;  font-family:calibri;  color:white; border-bottom:solid 1px white;">
                             <a href="contacts.php" >
                              
                                <span style="color:white;"><i class="fa fa-user" style='font-size:15px;' aria-hidden="true"></i> CONTACTS</span>
                            </a>
							<ul class="sub-menu" style="display: block;">
                                <li class="active">
                                    
									<a href="internal-contacts.php">
                                        <span>Internal Contacts</span>
                                    </a>
									<a href="contacts.php">
                                        <span>External Contacts</span>
                                    </a>
                                </li>
                             
                            </ul>
                        </li> 
						 <li style="background-color:#438dcc; font-family:calibri;   color:white; border-bottom:solid 1px white;">
                            <?php

if (date('D') == 'Sun')
	$lastSunday = date('d-m-Y');
else
	$lastSunday = date('d-m-Y', strtotime('last Sunday'));

?>



							<a href="timesheet.php?periodA=<?php echo $lastSunday; ?>">
                              
                                <span style="color:white;"><i class="fa fa-clock-o" style='font-size:15px;' aria-hidden="true"></i> TIMESHEETS</span>
                            </a>
                        </li> 
						 
						 <li style="background-color:#438dcc;   font-family:calibri;  color:white; border-bottom:solid 1px white;">
                           <a href="report-module.php">
                              
                                <span style="color:white;"><i class="fa fa-table" style='font-size:15px;' aria-hidden="true"></i> REPORTS</span>
                            </a>
                        </li>
                        <!-- /dashboard -->
     
                    </ul> 
                </nav>
            </aside>
            <!-- /sidebar menu -->

            <!-- main content -->
            <section class="main-content">

                <!-- content wrapper -->
                <div class="content-wrap">

								
				<br/>
				<br/><br/><br/><br/>
				
	 
				
                    <!-- inner content wrapper -->
                    <div class="wrapper">
					
					                        <section class="panel">
                            <!--<header class="panel-heading" style="background-color:#15acdc; color:white;">Home</header>-->
                            <div class="panel-body" style='padding:0px;'>
							
							 
							   
							   
							   
							   <?php
									
									$pid= $_GET['pid'];
									
									$con = mysql_connect('localhost', 'root', 'Boom95z') or die(mysql_error());
									mysql_select_db('orion9', $con);
								
									$prjTitle = '';
								
									$result = mysql_query("select  descr from projects where pid=" . $pid);
									while($row = mysql_fetch_array($result))
									{    
										$prjTitle = $row['descr']; 
									}
									?>
							   
							   
							   
							   
							   <!-- search -->
							   
							   	<div id="searchNow1" style="background-color:white; border: solid 1px #e8e8e8;;">
							 	<div id="ggg" style="background-color:white;  padding:20px; padding-top:3px; ">
							<div class="form-inline" id="searchNow" name="searchNow" action="home.php?x=ocNvi07amIHwp7J6Zfr3fIvqLNE4h0UFdHbvHiF31nAqujxtzZxPI2ftQUx7VrN89YEQhkUiHvJbOhFogceYftr5oZckrZsAY6rf" method="POST">
										
									
								<div style='height:10px;'></div>
									 
									  
		 
		<!--<div style='background-color:#ccc; font-family:calibri;padding:2px;color:white;'><center>PROJECT DETAILS</center></div>-->
					
					
<div id="sResults" class="table-responsive">
								
							 
								
								<!--<small><a href="project-view.php?pid=<?php echo $pid;?>"><i class="fa fa-caret-left" aria-hidden="true"></i> back to <i>project view</i></a></small>
								-->
								
									<div align='right'>
								<a href="contractor-home.php" class="btn btn-info" style='background-color:#ccc; border:solid 1px #ccc;'>Requests and Tasks</a>
								<a href="contractor-projects.php" class="btn btn-info" style='background-color:#ccc; border:solid 1px #ccc;'>My Projects</a>
								<a href="contractor-documents.php" class="btn btn-info" style='background-color:#59b2ff; border:solid 1px #59b2ff;'>My Documents</a>
								<a href="contractor-details.php" class="btn btn-info" style='background-color:#ccc; border:solid 1px #ccc;'>My Details</a>
<a href="contractor-managed-projects.php" class="btn btn-info" style='background-color:#ccc; border:solid 1px #ccc;'>Projects I'm Managing</a>
								</div>
								
								<div style='height:3px;'></div>
								<div class="row" id='b1'>
									<div class="col-md-6">
										<br><span style="font-size:25px; font-family:calibri;"><u><?php echo $totalResults;?></u> My Documents</span>
									<div style='display:inline-block; width:50px;'></div>
									
									 
									
									 
									</div>
									<div class="col-md-6">
									<br/>
									 <div align='right'>								  
									 <form action="upload-cont-doc.php" method="post" enctype="multipart/form-data">																																	<table border=0>											 <tr>											  
									 <td style='font-size:12px;'>Select file to upload<br/>											 
									 <input type="file" style='width:220px;' name="fileToUpload" required='required' id="fileToUpload"></td>
									 <td width='10px'></td>		
									 <td><small style='color:white;'>.</small><br/><input type="submit"  style='background-color:#ccc;border:solid 1px #ccc;' class="btn btn-success" value=" Upload Document" name="submit"></td>											 </tr>											
									 </table>											
									 </form>	
									</div>
									 </div>
								</div>
								
								
								<br>
                                    <table class="table table-bordered table-striped" style="font-size:15px; font-family:calibri;" id='b2'>
                                        <thead>
                                            <tr>
												<!--<th>PID</th>-->
												 
                                                <th>Document Name</th>  
												<th>Date Uploaded</th>												
												<th>Delete</th>   
                                            </tr>
                                        </thead> 
                                        <tbody> 
										  <?php
										while($row = mysql_fetch_array($result1))
										{   	
											$docu_id = $row['docu_id']; 
											$doc_type = $row['doc_type']; 
											$doc_title = $row['doc_title']; 
											$datef = $row['datef']; 
											
											echo "<tr>"; 
											echo "<td><a target='blank' href='contractor_docs/" . $doc_title . "'>" . $doc_title . "</a></td> ";
											echo "<td>" . $datef . "</td> ";
											echo "<td><a class='btn btn-info' href='delete-doc-contractor.php?docu_id=" . $docu_id ."'>DELETE</a></td> ";
											echo "</tr>";
										}
										
										?>
										
                                        </tbody>
                                    </table>
                                </div>

	 
								
								
								
								
			            </section>
					
					
			 
					
					<input type="hidden" value="">
                    </div>
                    <!-- /inner content wrapper -->

                </div>
                <!-- /content wrapper -->
                <a class="exit-offscreen"></a>
            </section>
            <!-- /main content -->
        </section>

    </div>
    <!-- core scripts -->
    <script src="plugins/jquery-1.11.1.min.js"></script>
    <script src="bootstrap/js/bootstrap.js"></script>
    <script src="plugins/jquery.slimscroll.min.js"></script>
    <script src="plugins/jquery.easing.min.js"></script>
    <script src="plugins/appear/jquery.appear.js"></script>
    <script src="plugins/jquery.placeholder.js"></script>
    <!-- /core scripts -->

    <!-- page level scripts -->
    <script src="plugins/responsive-tables/responsive-tables.js"></script>
    <!-- /page level scripts -->

    <!-- template scripts -->
    <script src="js/offscreen.js"></script>
    <script src="js/main.js"></script>
    <!-- /template scripts -->

    <!-- page script -->
    <!-- /page script -->

	
	
</body>
<!-- /body --> 
</html>
