
<?php include_once('header.php'); ?>
<?php include_once('sidebar.php'); ?>
	<!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper ">
	<section class="content-header">
      <h1>Messages</h1>
    </section>
  
 
		<section class="content">
			
		<div class="backf pt30">
		
			<!-- <div class="row mb20">
				<div class="col-sm-10 col-sm-offset-1 col-md-8 ">
					<div class="form-group">
					  <label for="usr">Email Name:</label>
					  <input type="text" class="form-control" id="usr">
					</div>
					 <div class="form-group">
					  <label for="usr">Grade:</label>
					 <select class="form-control"><option>A</option></select>
					</div>
					
					<div class="mb20">
						<button class="btn btn-success" >SAVE</button>
					</div>
					<div class="mb20">
						<button class="btn btn-info upoadldbtn" >Upload Button</button>
						<input type="file" id="my_file" style="display: none;" multiple /> 
					</div>
					
				</div>
			</div> -->

			
			<div class="table-responsive">
				<table  class="table table-striped datatble">
					<thead>
					  <tr>
						
						<th>Sent From</th>
						<th>E-mail</th>
						<th>Phone</th>
						<th>Message</th>
						<th>Action</th>
					  </tr>
					</thead>
					<tbody>
					<?php foreach($data as $d){ ?>
					  <tr>
						<td><?php echo $d->customer_name; ?></td>
						<td><?php echo $d->email; ?></td>
						<td><?php echo $d->phone; ?></td>
						<td><?php echo $d->message; ?></td>
						<td><button class="btn btn-warning">Reply</button>
						<button class="btn btn-danger" data-toggle="modal"  data-target="#delete-client" onclick="del_data('<?php echo $d->id; ?>')">Delete</button></td>
					  </tr>
					<?php } ?>
					  
					</tbody>
				  </table>
			</div>

      </div>
		
		</section>
		
		
		
  </div>
  
  
  
  
  
  <!-- Modal -->
<div id="add-job" class="modal fade" role="dialog">
  <div class="modal-dialog">
<form method="post" action="<?php echo base_url(); ?>main_controller/add_jobs">
    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Add Job </h4>
      </div>
      <div class="modal-body">
        <div class="form-group">
		  <label for="usr">Category Name:</label>
		  <select class="form-control"  name="job_cat">
		 <?php foreach($jobtypes as $d){ ?>
		 <option value="<?php echo $d->id; ?>"><?php echo $d->job_type; ?></option>
		 <?php } ?>
		  
		  </select>
		</div>
		<div class="form-group">
		  <label for="usr">Job Title:</label>
		  <input type="text" class="form-control" id="usr" name="job_title">
		</div>
		<div class="form-group">
		  <label for="usr">Job Type:</label>
		  <select class="form-control"  name="job_type">
		 <?php foreach($jobdurationtypes as $d){ ?>
		 <option value="<?php echo $d->job_type_ID; ?>"><?php echo $d->job_type; ?></option>
		 <?php } ?>
		  
		  </select>
		</div>
		<div class="form-group">
		  <label for="usr">Hourly Rate:</label>
		  <input type="text" class="form-control" id="usr"  name="job_hourly">
		</div>
		<div class="form-group">
		  <label for="usr">Description:</label>
		  <input type="text" class="form-control" id="usr"  name="job_desc">
		</div>
		<div class="form-group">
		  <label for="usr">Start Date:</label>
		  <input type="text" class="form-control date" id="job_start"  name="job_start">
		</div>
		<div class="form-group">
		  <label for="usr">End Date:</label>
		  <input type="text" class="form-control date" id="job_end"  name="job_end">
		</div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="submit" class="btn btn-success" >Save</button>
      </div>
    </div>
</form>
  </div>
</div>
  
  
  <!-- Modal -->
<div id="edit-job" class="modal fade" role="dialog">
  <div class="modal-dialog">
<form method="post" action="<?php echo base_url(); ?>main_controller/edit_jobs">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Edit Job </h4>
      </div>
      <div class="modal-body">
        <div class="form-group">
		 <div class="form-group">
		  <label for="usr">Category Name:</label>
		  <select class="form-control"  name="edit_job_cat" id="edit_job_cat">
		 <?php foreach($jobtypes as $d){ ?>
		 <option value="<?php echo $d->id; ?>"><?php echo $d->job_type; ?></option>
		 <?php } ?>
		  
		  </select>
		</div>
		<div class="form-group">
		  <label for="usr">Job Title:</label>
		  <input type="text" class="form-control" id="edit_job_title" name="edit_job_title">
		</div>
		<div class="form-group">
		  <label for="usr">Job Type:</label>
		  <select class="form-control"  name="edit_job_type" id="edit_job_type">
		 <?php foreach($jobdurationtypes as $d){ ?>
		 <option value="<?php echo $d->job_type_ID; ?>"><?php echo $d->job_type; ?></option>
		 <?php } ?>
		  
		  </select>
		</div>
		<div class="form-group">
		  <label for="usr">Hourly Rate:</label>
		  <input type="text" class="form-control" id="edit_job_hourly"  name="edit_job_hourly">
		  <input type="hidden" class="form-control" id="job_id"  name="job_id">
		</div>
		<div class="form-group">
		  <label for="usr">Description:</label>
		  <input type="text" class="form-control" id="edit_job_desc"  name="edit_job_desc">
		</div>
		<div class="form-group">
		  <label for="usr">Start Date:</label>
		  <input type="text" class="form-control date" id="edit_job_start"  name="edit_job_start">
		</div>
		<div class="form-group">
		  <label for="usr">End Date:</label>
		  <input type="text" class="form-control date" id="edit_job_end"  name="edit_job_end">
		</div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="submit" class="btn btn-success" >Save</button>
      </div>
      </div>
     
    </div>
</form>
  </div>
</div>
  
  
  
  
  
<!-- Modal -->
<div id="delete-client" class="modal fade" role="dialog">
  <div class="modal-dialog">
<form method="post" action="<?php echo base_url(); ?>main_controller/delete_mails">
    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">Delete Mail</h4>
      </div>
      <div class="modal-body">
        <div class="form-group">
		  <label for="usr">Do you want to Delete Mail?</label>
		 
		  <input type="hidden" class="form-control" id="del_id" name="del_id">
		</div>
		
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="submit" class="btn btn-success" >Delete</button>
      </div>
    </div>
</form>
  </div>
  </div> 
</div>   
<?php include_once('footer.php'); ?>
<script>
function set_data(id,cat,title,type,hourly,desc,start,end){
	$("#edit_job_cat").val(cat); //alert(fname);
	$("#edit_job_title").val(title); //alert(page_name);
	$("#edit_job_type").val(type); //alert(page_name);
	$("#edit_job_hourly").val(hourly); //alert(page_name);
	$("#job_id").val(id); //alert(page_name);
	$("#edit_job_desc").val(desc); //alert(page_name);
	$("#edit_job_start").val(start); //alert(page_name);
	$("#edit_job_end").val(end); //alert(page_name);
	
	
}
function del_data(id){
	$("#del_id").val(id);
}
$(function() {
    $("#job_start").datepicker();
    $("#job_end").datepicker();
	
	$("#edit_job_start").datepicker();
    $("#edit_job_end").datepicker();
});
</script>
