<?php

	include("template_top.php");
	
	
	
	
	
?>

<!--
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
-->

<!--
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" />

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js"></script>
-->	 
  
  
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
  
<!--
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
-->

<!--
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button>


<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal">
  Launch demo modal
</button>

-->

<!--
 <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#myModal">
    Open modal
  </button>
</div>
-->



			
				<!-- Main content -->
				<section class="content">
					
					<div class="container-fluid">
		  
		<!-- -->

<!--		
		<div class="modal fade" id="myModal" role="dialog">
			
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal">&times;</button>
						<h4 class="modal-title">Modal Header</h4>
					</div>
					<div class="modal-body">
						<p>Some text in the modal.</p>
					</div>
					<div class="modal-footer">
					  <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
					</div>
				</div>
			</div>
		</div>
	-->	  
		<!-- -->

                        <div class="row">
                                
                                <!--<div class="col-lg-12"> -->
                                <!--
									<div class="col-md-11 col-md-offset-10">
                                    <!--<div class="align-self-end ml-auto">   --> 
                       	        <!--    <a class="col-sm-2 btn btn-md btn-info" href="#new_project" data-toggle="modal"><center><i class="fa fa-plus"></i> New Project</center></a>
                                    </div>	
								-->
							
								<div class="d-flex flex-column"> <!-- text-white text-center border border-dark"> -->
        
								<!--
								<div class="bg-success p-2 m-2 align-self-start"> 
								align-self-start 
								</div> -->
		
									<div class=" p-2 m-2 align-self-end "> <!-- ml-auto" -->
									
										<!--
										<a  class =" btn btn-md btn-info  text-white text-center border border-dark" href="#new_project" data-toggle="modal"><center><i class="fa fa-plus"></i> New Project</center></a>
										<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="plouf">   Open modal </button>
										-->
										<!--
										<a href="#new_project" class="btn btn-lg btn-primary" data-bs-toggle="modal"><i class="fa fa-plus"></i> Nouveau projet</a>
										-->
										<a href="#new_project" class="btn btn-md btn-primary  text-white text-center border border-dark" data-bs-toggle="modal"><i class="fa fa-plus"></i> Nouveau projet</a>

										<a href="#update_project" class="btn btn-md btn-primary  text-white text-center border border-dark" data-bs-toggle="modal"><i class="fa fa-plus"></i> Edition projet</a>

										</div> 
		
								</div>
							
							</div>
		
		<!--
        <div class="bg-success p-2 m-2 align-self-center"> 
            align-self-center 
        </div> 
        <div class="bg-success p-2 m-2 align-self-baseline"> 
            align-self-baseline 
        </div> 
        <div class="bg-success p-2 m-2 align-self-stretch"> 
            align-self-stretch 
        </div> -->
    
	<!--</div>  -->
           
   
	<?php
		//include ("/modales/nouveau_projet_modal.php");
		
	?>
		
	
<!--		 
<div class="modal" id="plouf">
  <div class="modal-dialog">
    <div class="modal-content">

      
      <div class="modal-header">
        <h4 class="modal-title">Modal Heading</h4>
        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
      </div>

     
      <div class="modal-body">
        Modal body..
      </div>

     
      <div class="modal-footer">
        <button type="button" class="btn btn-danger" data-bs-dismiss="modal">Close</button>
      </div>

    </div>
  </div>
</div>
-->		   
                            
                           

<!-- -->						
							<div class="row">
								<div class="col-12 col-sm-6 col-md-3">
									<div class="info-box">
										<span class="info-box-icon bg-info elevation-1"><i class="fas fa-users"></i></span>
										<div class="info-box-content">
										<span class="info-box-text">Clients</span>
										<span class="info-box-number"><?php echo "123"; ?></span>
										</div>
									</div>
								</div>
								
								
								<div class="col-12 col-sm-6 col-md-3">
									<div class="info-box mb-3">
										<span class="info-box-icon bg-danger elevation-1"><i class="fas fa-user-tie"></i></span>
										<div class="info-box-content">
										<span class="info-box-text">Staffs</span>
										<span class="info-box-number">
										<?php echo "coco"; ?></span>
										</div>
									</div>
								</div>
								
							</div><!-- ./ row -->
							

							<div class="row">
								<div class="col-md-12">
									<div class="card card-purple">
										<div class="card-header">
										<h3 class="card-title">xxxxxxxxxxxxxxxxxxx Création d'une catégorie</h3>
										</div>
                                
										<form method="post" enctype="multipart/form-data" role="form">
										<div class="card-body">
											<div class="row">
												<div class=" col-md-6 form-group">
													<label for="exampleInputEmail1">Nom</label>
													<input type="text" name="name" required class="form-control" id="exampleInputEmail1">
												</div>
											</div>

											<div class="row">
												<div class=" col-md-6 form-group">
													<label for="exampleInputEmail1">Staff Phone Number</label>
													<input type="text" name="phone" required class="form-control" id="exampleInputEmail1">
												</div>
                                            </div>

											<div class="row">
												<div class=" col-md-6 form-group">
													<label for="exampleInputEmail1">Staff Email</label>
													<input type="email" name="email" required class="form-control" id="exampleInputEmail1">
												</div>
											</div>

										<div class="clearfix"></div>

										</div> <!-- /.card-body -->

										<div class="card-footer">
											<button type="submit" name="ajouter_categorie" class="btn btn-success">Ajouter</button>
										</div>
										
										</form>
									</div>   <!-- /.card -->
								</div><!-- /.col -->
							</div> <!-- /.row -->
							
							
							
							
							<div class="panel panel-default">
								<div class="panel-heading">
								<h3>Zoulou</h3>
								</div> 
        
								<div class="panel-body"> 
			
									<table id="position" class="table table-bordered table-condensed">
										<thead>
								
										<tr id="heads">
										<th class="col-md-2 text-center">Project</th>
										<th class="col-md-2 text-center">Location</th>
										<th class="col-md-1 text-center">Deadline</th>
										<th class="col-md-1 text-center"></th>
										</tr>
										</thead>
		
										<tbody>
								
										<?php
								
										include '../includes/db.php';
	   
										$query=  mysqli_query($conn, "SELECT * FROM projects where io = '".$_GET['io']."'");
			
										while($row = mysqli_fetch_assoc($query)) 
										{   
											$id =$row['project_id']; 
										?>
										<tr>

										<td style="text-transform:capitalize" class="text-center"><?php echo $row['project'] ?></td>
										<td style="text-transform:capitalize" class="text-center"><?php echo $row['location'] ?></td>
										<td style="text-transform:capitalize" class="text-center"><?php echo date("M. d, Y",strtotime($row['deadline'])) ?></td>
										<td style="text-transform:capitalize" class="text-center"><center><a href="index.php?page=project_detail&id=<?php echo $id ?>&stats=<?php echo $_GET['io'] ?>"><i class="fa fa-eye"></i> View </a></center></td>
										</tr>
		   
										<?php } ?>
										</tbody>
									</table>
								</div>
							</div>
							
						</div>
							
							
							
					</div><!--/. container-fluid -->
				</section> <!-- /.content -->
			

<?php

	//include("add_modal.php"); // prévoir un répertoire ("../includes/blabla");

	//include ("/modales/nouveau_projet_modal.html");
	
?>

<?php
	
	include("template_bottom.php");
	
	include ("/modales/nouveau_projet_modal.php");

	
	include ("/modales/update_projet_modal.php");
?>

<div id="retCode1">message</div>

<!--
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
-->
<script>


  


	jQuery(document).ready(function(){
						jQuery("#proj_form").submit(function(e){
								e.preventDefault();
								var formData = jQuery(this).serialize();
								
								console.log("  --- " + formData);
								
								$.ajax({
									type: "POST",
									url: "pipo.php?action=project",
									data: formData,
									success: function(html)
									{
										console.log(html);
									
										if( html === "error")
											 $('#err_msg2').show();
										else
										{
											 $('#suc_msg2').show();
											  setTimeout(function() {
                $('#new_project').modal('toggle');
            }, 3000);
										}
										//$('#retCode1').html(html); // html
										//console.log("pipotron");
										
										// $('#suc_msg2').show();
										//s $('#div-field').html(html);
										//alert("Bingo");
									 
									}
								});
									return false;
						});
						});
</script>

