Current File : //home/obabain/public_html/abc/view_task_template.jsp
<%@include file="master.jsp" %>
<%@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>
<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>

<body>
<div class="row">
<form action="view_task_template.jsp" method="post"  >
<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">View Task Templates</h3>
        </div>
         
          
     <div class="panel-body"  >
    <!--  <div align="right" >
<a href="Fiscal_tax.jsp"><input type="button" value="Add New" style="background:#204b58;margin-right: 50px" class="btn btn-info"  /></a>
 </div> -->
    
       <div class="row" >
         
  

          <!--   
            <button type="submit" style="background:#fff" class="btn btn-default">All (0)</button>
        <button type="submit" style="background:#204b58" class="btn btn-info" >Active(0)</button>
          <button type="submit" style="background:#204b58" class="btn btn-info" >Inactive(0)</button>
 <br><br> -->
            
                    <b>View Task Templates:</b>         
            
       <div class="panel-body">
<table id="myTable" class="table table-bordered" style="width:800px; border:2 ">
<tr>
	<th>Template ID</th>
	<th>Description</th>
	
	<th>edit</th>
	<th>Delete</th>
</tr>
<%
try{
	Statement st=con.createStatement();
String sql ="select * from task_template";
resultSet = st.executeQuery(sql);
while(resultSet.next()){
%>





<tbody>

	<tr>

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

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


	<%-- <td>
<%=resultSet.getString("f_type") %>
	</td>
 
	<td>
<%=resultSet.getString("f_Eoperiod") %>
 	</td>
 
	<td>
<%=resultSet.getString("f_amount") %>
 	</td>
  --%>
 	<td>
 <a href="editTask_template.jsp?Id=<%=resultSet.getString("id") %>"><span class="glyphicon glyphicon-pencil"></span></a>
 	</td>
 
 	<td>
 <a href="view_task_template.jsp?id=<%=resultSet.getString("id") %>"><span class="glyphicon glyphicon-trash"></span> </a>
   <%
String id=request.getParameter("id");
try
{
/* Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/currency", "root", "root"); */
 st=con.createStatement();
int i=st.executeUpdate("DELETE FROM task_template WHERE id="+id);
out.println("");
}
catch(Exception e)
{
System.out.print(e);
e.printStackTrace();
}
%>    
 
 
 	</td>

</tr>
<%
}

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


</tbody>
</table>
 <div align="right" >
<a href="tasktemplate.jsp"><input type="button" value="Back" style="background:#204b58;margin-right: 50px" class="btn btn-info"  /></a>
 </div>
						</div>  
					</div>
     			</div>
  			</div>
		</div>
	</div>
</section>
<%-- <% }else{ 
     response.sendRedirect("login.jsp");
    } %> --%>
 <script src="http://cdn.ckeditor.com/4.6.1/standard/ckeditor.js"></script>
     <script src="http://cdn.ckeditor.com/4.6.1/standard/ckeditor.js"></script>  
   
 <script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js"></script>
<script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/additional-methods.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
 $('[data-type="adhaar-number"]').keyup(function() {
  var value = $(this).val();
  value = value.replace(/\D/g, "").split(/(?:([\d]{4}))/g).filter(s=s.length > 0).join("-");
  $(this).val(value);
});

$('[data-type="adhaar-number"]').on("change, blur", function() {
  var value = $(this).val();
  var maxLength = $(this).attr("maxLength");
  if (value.length != maxLength) {
    $(this).addClass("highlight-error");
    alert("Aadhar card number not valid");
  } else {
    $(this).removeClass("highlight-error");
  }
});</script>
</form>
</div>
</body>
</html>