Current File : //home/obabain/public_html/abc/EmpEditAttendence.jsp |
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@include file="Connection.jsp" %>
<%@include file="master.jsp" %>
<%
Statement st=con.createStatement();
ResultSet rs = null;
int count=0;
%>
<%!
String clname=null;
String month=null;
String date=null;
String shift=null;
String attendence=null;
String othrs=null;
String otrate=null;
String otamt=null;
%>
<%
String id=request.getParameter("Id");
rs=st.executeQuery("select * from attendence where aid="+id+"");
while(rs.next())
{
clname=rs.getString("ename");
month=rs.getString("month");
date=rs.getString("date");
shift=rs.getString("shift");
attendence =rs.getString("attendence");
othrs=rs.getString("othrs");
otrate=rs.getString("otrate");
otamt=rs.getString("otamt");
}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<link href="css/select2.min.css" rel="stylesheet">
<link href="css/jquery.datetimepicker.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<style type="text/css">
.template { display:none ; }
</style>
<title>Raw Material Quality Plan</title>
</head>
<body onload="loadData(<%=shift%>,'<%=attendence%>')">
<script>
function checkExist(){
var xmlhttp = new XMLHttpRequest();
var username = document.forms["jv"]["num"].value;
var url = "SalesTransferExist.jsp?username=" + username;
xmlhttp.onreadystatechange = function(){
if(xmlhttp.readyState == 4 && xmlhttp.status == 200){
if(xmlhttp.responseText == "Duplicate No.")
document.getElementById("isE").style.color = "red";
else
document.getElementById("isE").style.color = "green";
document.getElementById("isE").innerHTML = xmlhttp.responseText;
}
};
xmlhttp.open("GET",url,true);
xmlhttp.send();
}
</script>
<form action="EmpUpdateAttendence.jsp" id="contact" name="form1">
<div class="content">
<div class="row">
<div class="col-md-9" >
<div class="panel panel-default">
<div class="panel-heading main-color-bg">
<h3 class="panel-title">Employee Attendence Entry</h3>
<!-- <a style="background:;margin-top:-23px;margin-right:30px;" class="btn btn-danger pull-right" href=""></a>
<a style="background:#204b58" class="btn btn-info" onclick="goBack()">Back</a> -->
</div>
<center> <h3> Employee Name:<%=clname%></h3></center>
<input type="hidden" name="ename" value="<%=clname%>">
<input type="hidden" name="aid" value="<%=id%>">
<div class="row">
<div class="col-xs-3">
<label for="lastname" style="margin-left:5px; color:black;">Date</label>
<input type="text" name="date" class="amt form-control" style="width:180px;"readonly value="<%=month%>">
</div>
<div class="col-xs-3">
<label for="lastname" style="margin-left:5px; color:black;">Date</label>
<input type="date" name="date" class="amt form-control" style="width:180px;" readonly value="<%=date%>">
</div>
<div class="col-xs-3">
<label for="lastname" style="margin-left:5px; color:black;">Shift</label>
<select class="selectType form-control" name="shift" id="campInput" style="width:180px;" id="shift" value="<%=shift%>">
<option value="0">select</option>
<%
rs=st.executeQuery("select * from shift");
while(rs.next())
{
%>
<option value="<%=rs.getString("shift") %>"><%=rs.getString("shift")%></option>
<%} %>
</select>
</div>
<div class="col-xs-3">
<label for="lastname" style="margin-left:5px; color:black;">Attendence</label>
<select class="selectType form-control" name="attendence" id="campInput" style="width:180px;" id="attendence" value="<%=attendence%>">
<option value="0">select</option>
<option value="1">Present</option>
<option value="0">Absent</option>
</select>
</div>
</div>
<div class="row">
<div class="col-xs-3">
<label for="lastname" style="margin-left:5px; color:black;">O.T Hours</label>
<input type="text" name="othrs" class="price2 form-control" id="input1" style="width:180px;" value="<%=othrs%>">
</div>
<div class="col-xs-3">
<label for="lastname" style="margin-left:5px; color:black;">O.T Rate</label>
<input type="text" name="otrate" class="qty2 form-control" id="input2" style="width:180px;"value="<%=otrate%>">
</div>
<div class="col-xs-3">
<label for="lastname" style="margin-left:5px; color:black;">O.T Amount</label>
<input type="text" name="otamt" class="netamt2 form-control" id="output" <%=otamt%> onClick="calc()" style="width:180px;" onblur="checkExist()">
</div>
</div>
<div class="panel-body">
<br>
<div class="modal-footer" id="contact_submit">
<input type="button" value="Back" style="background:#204b58;" class="pull-left btn btn-info" onclick="goBack()">
<a class="btn btn-default" href="">Reset</a>
<input type="submit" style="background:#204b58;" class="btn btn-info" id="save" onclick="debitcredit();">
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</body>
<script>
$(document).on("change",".selectMat",function(){
var p=[];
var str=$(".selectMat:last").find("option:selected").text();
//alert(str);
p=str.split('--');
var a=p[1];
$(".descr:last").val(a);
$(".revno:last").val(p[2]);
$(".drgno:last").val(p[3]);
$(".div:last").val(p[4]);
$(".buyer:last").val(p[5]);
$(".price:last").val(p[6]);
});
</script>
<script>
function calc(){
var textValue1 = document.getElementById('input1').value;
var textValue2 = document.getElementById('input2').value;
document.getElementById('output').value = textValue1 * textValue2;
}
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.1/js/select2.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script>
$(function() {
initThings();
$('#add').on('click', function() { add_row($('#table1')); });
});
function add_row($table) {
var tr_id = $table.find('tr').length - 1;
var $template = $table.find('tr.template');
var $tr = $template.clone().removeClass('template').prop('id', tr_id);
$tr.find(':input').each(function() {
if($(this).hasClass('hasDatepicker')) {
$(this).removeClass('hasDatepicker').removeData('datepicker');
}
var input_id = $(this).prop('id');
input_id = input_id + tr_id;
$(this).prop('id', input_id);
var new_name = $(this).prop('name');
new_name = new_name.replace('[0]', '['+ tr_id +']');
$(this).prop('name', new_name);
$(this).prop('value', '');
});
$table.find('tbody').append($tr);
$('.byto:last').val(1);
$(".dateControl", $tr).datepicker({
dateFormat: "dd-mm-yy"
});
$(".selectType", $tr).select2();
$(".qty", $tr).select2();
$(".selectType:last").val(0).trigger("change");
$(".qty:last").val(0).trigger("change");
$(".selectStatus:last").val(-1).trigger("change");
$(".selectUnit:last").val(0).trigger("change");
}
function initThings() {
add_row($('#table1'));
}
</script>
<script src="js/select2.min.js"></script>
<script src="js/jquery.datetimepicker.full.js"></script>
<script>
$('.select1').select2();
</script>
<script>
$(document).on("change", ".amt", function() {
var sum = 0;
$(".amt").each(function(){
sum += +$(this).val();
});
$(".total").val(sum);
$( ".amt" ).focus();
$(".amt2:last").val(0);
});
$(document).on("change", ".amt2", function() {
var sum = 0;
$(".amt2").each(function(){
sum += +$(this).val();
});
$(".total2").val(sum);
});
$(document).on("change", ".byto", function() {
var sum = 0;
$(".amt").each(function(){
sum += +$(this).val();
});
$(".total2").val(sum);
$(".amt2:last").val(sum);
$(".amt:last").val(0);
});
$(document).ready(function($){
$('.byto').val(1);
})
</script>
<script>
function loadData(c,e)
{
document.getElementById('shift').value=c;
document.getElementById('attendence').value=e;
}
</script>
<script type="text/javascript">
function goBack() {
window.history.back();
};
</script>
</html>