Current File : /home/obabain/public_html/abc/Accounting_Periods.jsp |
<%@include file="master.jsp" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@include file="Connection.jsp" %>
<%
ResultSet resultSet = null;
%>
<%@page import="java.sql.*,java.util.*"%>
<%@page import="java.sql.ResultSet"%>
<style type="text/css">
.highlight-error {
border-color: red;
}
</style>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" 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>
<script src="js/jquery-2.1.0.min.js"></script>
<script src="js/tableEdit-0.1.js"></script>
<body>
<script type="text/javascript">
$(document).ready(function () {
$('#datepicker').datepicker({
uiLibrary: 'bootstrap'
});
});
</script>
<div class="row">
<form action="" method="post" id="contact" name="form1">
<section id="main">
<div class="container">
<div class="row" style="width:110%">
<div class="col-md-10" >
<div class="panel panel-default" >
<div class="panel-heading main-color-bg">
<h3 class="panel-title">Account and Ledger "Accounting Periods" Form:</h3>
</div>
<div class="panel-body" >
<b> No of Periods per Year:</b><input type="number" name="quantity" min="12" max="12" value="12">
<br>
<div class="row" >
<b></b>
<br>
<div float:left>
<label for="lastname" style="margin-left:5px;">Period No:</label>
<input class="" style="width:130px;margin-left:px;height:30px;" type="number" min="1"
name="p_no" placeholder=""/>
<label for="lastname" style="margin-left:70px;">Period Id:</label>
<input id="lastname" class="form-controle" style="width:130px;margin:px;height:30px;" type="text"
name="p_pid" placeholder=""/>
<label for="lastname" style="margin-left:50px;">Fiscal year:</label>
<input id="lastname" style="width:130px;margin:px;height:30px;" type="number" name="p_FiscalYear" min="2001" max="2020"
placeholder="CurrentYear"/> <span class="add-on"><i class="icon-th"></i></span>
</div>
</div> <br>
<div class="panel-body" >
<div class="row" >
<div float:left>
<label for="lastname" style="margin-left:84px;">Month start date:</label>
<input id="lastname" style="width:130px;margin:px;height:30px;" type="date"
name="p_MSdate" placeholder=""/> <span class="add-on"><i class="icon-th"></i></span>
<label for="lastname" style="margin-left:45px;">Month end date:</label>
<input id="lastname" style="width:130px;margin:px;height:30px;" type="date"
name="p_MEdate" placeholder=""/> <span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<!-- <p>Date: <input type="text" id="datepicker" /></p>-->
</div>
</div>
<div class="modal-footer" id="contact_submit">
<input type="button" value="Back" style="background:#204b58;margin-right:720px" class="btn btn-info" />
<a class="btn btn-default" href="">Reset</a>
<!-- <button type="submit" style="background:#204b58" class="btn btn-info" >Save Changes</button>-->
<input type="submit" style="background:#204b58;" class="btn btn-info" value="Save changes">
<hr>
<%
String p_no=request.getParameter("p_no");
String p_pid=request.getParameter("p_pid");
String p_FiscalYear=request.getParameter("p_FiscalYear");
String p_MSdate=request.getParameter("p_MSdate");
String p_MEdate=request.getParameter("p_MEdate");
try
{
Statement st=con.createStatement();
int i=st.executeUpdate("insert into accountingperiods(p_no,p_pid,p_FiscalYear,p_MSdate,p_MEdate)values('"+p_no+"','"+p_pid+"','"+p_FiscalYear+"','"+p_MSdate+"','"+p_MEdate+"')");
out.println("");
}
catch(Exception e)
{
System.out.print(e);
e.printStackTrace();
}
%>
<div class="panel-body">
<table id="myTable" class="table table-bordered">
<tr>
<th style="text-align:center">Period No</th>
<th style="text-align:center">Period id</th>
<th style="text-align:center">Fiscal Year</th>
<th style="text-align:center">Month Start</th>
<th style="text-align:center">Month End</th>
</tr>
<%
try{
Statement st=con.createStatement();
String sql ="select * from accountingperiods";
resultSet = st.executeQuery(sql);
while(resultSet.next()){
%>
<tbody>
<tr>
<td align="center">
<%=resultSet.getString("p_no") %>
</td>
<td align="center">
<%=resultSet.getString("p_pid") %>
</td>
<td align="center">
<%=resultSet.getString("p_FiscalYear") %>
</td>
<td align="center">
<%=resultSet.getString("p_MSdate") %>
</td>
<td style="height:30px;"align="center">
<%=resultSet.getString("p_MEdate") %>
</td>
<%
}
} catch (Exception e) {
e.printStackTrace();
}
%>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</form>
</body>
</html>