<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Status Update</title>
	
	<link rel="stylesheet" href="//code.jquery.com/ui/1.13.1/themes/base/jquery-ui.css">
  	
  	<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
  	<script src="https://code.jquery.com/ui/1.13.1/jquery-ui.js"></script>
</head>
<style type="text/css">
body{
	margin: auto;
	width: 100%;
	padding: 10px;
	
}
table {
    border-collapse: collapse;
    margin: 25px 250px;
    font-size: 0.9em;
    font-family: sans-serif;
    min-width: 500px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
}
table thead tr {
    
    text-align: left;
}
table th,table td {
    padding: 12px 15px;
}
table tbody tr {
    border-bottom: 1px solid #dddddd;
}

table tbody tr.active-row {
    font-weight: bold;
    color: #009879;
}
.hidden{
	
}
</style>
<script>
$( function() {
	 
    $( "#datepickerEnd" ).datepicker({ dateFormat: 'dd-M-yy'}).datepicker();
    
  } );

</script>
<body>
	
					  
					  
		<form id="form" action="/ibase/servlet/email" method="POST" enctype="multipart/form-data">
		
		<input type="hidden" name="empcode" id="empcode" value="<%= request.getParameter("empcode") %>" class=" hidden"/>
		<input type="hidden" name="requestid" id="requestid" value="<%= request.getParameter("requestid") %>" class=" hidden"/>
		<input type="hidden" name="description" id="description" value="<%= request.getParameter("description") %>" class=" hidden"/>
		<input type="hidden" name="actiondtl" id="actiondtl" value="<%= request.getParameter("actiondtl") %>" class=" hidden"/>
		<input type="text" name="stdtime" id="stdtime" value="<%= request.getParameter("stdtime") %>" class=" hidden"/>
		<input type="hidden" name="startdate" id="startdate" value="<%= request.getParameter("startdate") %>" class=" hidden"/>
		
		
			<table>
				<tr>
					<td>
						<label>New Status</label>
					</td>
					<td>
						<select name="newStatus" id="newStatus" >
						<option value="WIP">WIP</option>
						<option value="Hold">Hold</option>
						<option value="DevComplete">DevComplete</option>
						<option value="UT">UT</option>
						<option value="ToQC">ToQC</option>
						<option value="ReWork">ReWork</option>
						<option value="Done">Done</option>
						<option value="Delivered">Delivered</option>
						<option></option>
					</select>	
					</td>
				</tr>
				<tr>
					<td>
					<label>Remark/Status</label>
					</td>
					<td>
					<textarea rows="3" cols="40" placeholder="Enter your current status / Remark" name="newRemark" id="newRemark" ></textarea>
					</td>
				</tr>
				<tr>
					<td>
					<label>Hrs Spent Today</label>
					</td>
					<td>
					<input type="number"  name="hrsSpendToday" id="hrsSpendToday" placeholder="Hrs" />
					</td>
				</tr>
				<tr>
					<td>
					<label>Hrs Left</label>					
					</td>
					<td>
					<input type="number" name="hrsLeft" id="hrsLeft" placeholder="Hrs Left"/>
					</td>
				</tr>
				<tr>
					<td>
					<label>New End Date</label>					
					</td>
					<td>
					<input type="text" class="date" name="dateEnd"  id="datepickerEnd" placeholder="dd/mm/yyyy" />
					</td>
				</tr>
				
				<tr>
					<td>
					<label>Additional Email</label>					
					</td>
					<td>
					<input type="email" name="additionalEmail" id="additionalEmail" placeholder="Additional Email"  />
					</td>
				</tr>
			<!-- 	<tr>
					<td>
					<label>Mail to KB</label>					
					</td>
					<td>
					<select name="mailKb" id="mailKb">
					<option>YES</option>
					<option>NO</option>
					</select>
					</td>
				</tr>
			-->
				<tr>
					<td>
					<label>Attachment 1:</label>					
					</td>
					<td>
					<input type="file" name="attachment1" id="attachment1"  size="50" />
					</td>
				</tr>
				<tr>
					<td>
					<label>Attachment 2:</label>					
					</td>
					<td>
					<input type="file" name="attachment2" id="attachment2" size="50" />
					</td>
				</tr>
				<tr>
					<td>
					<label>Attachment 3:</label>
					</td>
					<td>
					<input type="file" name="attachment3" id="attachment3" size="50"  />
					</td>
				</tr>
				<tr>
					<td>
					<input type="submit"/>
					<button type="button" onClick="">SEND</button>
					</td>					
				</tr>
			</table>
			</form>
		
</body>
<script type="text/javascript">
	function statusUpdate(){
		 var form = $("#form");
		$.ajax({
			  
			  type:'POST',
			  
			  form.serialize(),
				  
			  url:'email',
			 success:function(response){
				 if(response=="No data to show"){
					
					 alert(response);	 
				 }else{
					 writePlanTable(response); 
				 }
			 },
			 error: function(data) {
				 jQuery('.alert').show();
               jQuery('.alert').html(data.fail);
				  }
		  });
	}


</script>
</html>