Current File : //home/obabain/ms_obaba_in/FiscalYear.jsp
<%@include file="master.jsp" %>
<%@include file="Connection.jsp" %>
<%
ResultSet resultSet = null;
%>
<%@page import="java.sql.*,java.util.*"%>
<%@page import="java.sql.ResultSet"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<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>
<div class="row">
<form action=""  method="post" id="contact" name="form1">
<section id="main">
<div class="container">
 <div class="row" >
    <div class="col-md-9" style="width:85%">
       <div class="panel panel-default" style="background-color:#eae9e9;">
       <div class="panel-heading main-color-bg">
        <h3 class="panel-title">Fiscal Year</h3>
    </div>
     <div class="panel-body"  >
    
       <div class="row" >
         <b></b>
         <br>
         <div float:left>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <label for="lastname" style="margin-left:5px;">Year&nbsp;Start:</label>
                <input id="lastname" class=""  style="width:130px;margin-left:px;height:30px;"  type="date" 
                       
                   name="f_Ystart"    placeholder=""/>&nbsp;&nbsp;&nbsp;&nbsp;
                    
          
          <label for="lastname" style="margin-left:30px;">Year End:</label>
                <input id="lastname" class="form-controle"  style="width:130px;margin:px;height:30px;"  type="date" 
                       
                 name="f_Yend"      placeholder=""/>
                 
            
                <label for="lastname" style="margin-left:60px;">Year:</label>
                <input id="lastname"   style="width:120px;margin:px;height:30px;"  type="number" 
                       
                 name="f_year"  min="2001" max="2018"    placeholder="select year"/> <span class="add-on"><i class="icon-th"></i></span>
                
                 
                 
                 
                  </div> 
 <div class="form-group col-xs-2">
 <p> <label for="lastname" style="margin:5px;"> </label></p>
  </div> 
  </div>
  </div>  
   <div class="modal-footer" id="contact_submit">
         <input type="button" value="Back" style="background:#009191;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:#009191;" class="btn btn-info" value="Save Changes">

      </div>   
 <%
 Statement st=null;
String f_Ystart=request.getParameter("f_Ystart");
String f_Yend=request.getParameter("f_Yend");
String f_year=request.getParameter("f_year");
try
{

 st=con.createStatement();
int i=st.executeUpdate("insert into fiscalyear(f_Ystart,f_Yend,f_year)values('"+f_Ystart+"','"+f_Yend+"','"+f_year+"')");

}
catch(Exception e)
{
System.out.print(e);
e.printStackTrace();
}
%>      
<b></b>
<div class="panel-body">
<table id="myTable" class="table table-bordered">
<tr>
<th>Sl no</th>
<th>Year</th>
<th>Year Start</th>
<th>Year End</th>
<th>Edit</th>
<th>Delete</th>
</tr>
<%
try{

String sql ="select * from fiscalyear";
resultSet = st.executeQuery(sql);
while(resultSet.next()){
%>
<tbody>
<tr>

<td>
<%=resultSet.getString("f_id")%>
</td>

<td>
<%=resultSet.getString("f_year")%>
</td>

<td>
<%=resultSet.getString("f_Ystart")%>
</td>

<td>
<%=resultSet.getString("f_Yend") %>
</td>

<td>
<a href="editfiscalyear.jsp?Id=<%=resultSet.getString("f_id")%>"><span class="glyphicon glyphicon-pencil"></span></a>
</td>







<td style="height:30px;">
<a href="deleteFiscalYear.jsp?Id=<%=resultSet.getString("f_id")%>"><button type="button" class="delete"><i class='glyphicon glyphicon-trash'></i></button></a>
 </td>
<%
}

} catch (Exception e) {
e.printStackTrace();
}
%>

</tr>



</tbody>
</table>
</div> 
  
    
      
       
       
     
 </div>
    </div>
  </div>
</div>
</div>
</section>




</div>
</form>
</body>
</html>