commit
fabd52b62f
18 changed files with 893 additions and 0 deletions
-
17.classpath
-
31.project
-
12.settings/.jsdtscope
-
2.settings/org.eclipse.core.resources.prefs
-
10.settings/org.eclipse.jdt.core.prefs
-
8.settings/org.eclipse.wst.common.component
-
9.settings/org.eclipse.wst.common.project.facet.core.xml
-
1.settings/org.eclipse.wst.jsdt.ui.superType.container
-
1.settings/org.eclipse.wst.jsdt.ui.superType.name
-
3src/main/webapp/META-INF/MANIFEST.MF
-
12src/main/webapp/WEB-INF/web.xml
-
55src/main/webapp/data.jsp
-
20src/main/webapp/getDivision.jsp
-
436src/main/webapp/index.html
-
17src/main/webapp/otp_verification.jsp
-
44src/main/webapp/save.jsp
-
46src/main/webapp/send_otp.jsp
-
169src/main/webapp/style.css
@ -0,0 +1,17 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<classpath> |
||||
|
<classpathentry kind="src" path="src/main/java"/> |
||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"> |
||||
|
<attributes> |
||||
|
<attribute name="module" value="true"/> |
||||
|
</attributes> |
||||
|
</classpathentry> |
||||
|
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"> |
||||
|
<attributes> |
||||
|
<attribute name="module" value="true"/> |
||||
|
</attributes> |
||||
|
</classpathentry> |
||||
|
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/> |
||||
|
<classpathentry kind="lib" path="E:/software/ojdbc6.jar"/> |
||||
|
<classpathentry kind="output" path="build/classes"/> |
||||
|
</classpath> |
||||
@ -0,0 +1,31 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<projectDescription> |
||||
|
<name>Myproject</name> |
||||
|
<comment></comment> |
||||
|
<projects> |
||||
|
</projects> |
||||
|
<buildSpec> |
||||
|
<buildCommand> |
||||
|
<name>org.eclipse.jdt.core.javabuilder</name> |
||||
|
<arguments> |
||||
|
</arguments> |
||||
|
</buildCommand> |
||||
|
<buildCommand> |
||||
|
<name>org.eclipse.wst.common.project.facet.core.builder</name> |
||||
|
<arguments> |
||||
|
</arguments> |
||||
|
</buildCommand> |
||||
|
<buildCommand> |
||||
|
<name>org.eclipse.wst.validation.validationbuilder</name> |
||||
|
<arguments> |
||||
|
</arguments> |
||||
|
</buildCommand> |
||||
|
</buildSpec> |
||||
|
<natures> |
||||
|
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature> |
||||
|
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> |
||||
|
<nature>org.eclipse.wst.common.project.facet.core.nature</nature> |
||||
|
<nature>org.eclipse.jdt.core.javanature</nature> |
||||
|
<nature>org.eclipse.wst.jsdt.core.jsNature</nature> |
||||
|
</natures> |
||||
|
</projectDescription> |
||||
@ -0,0 +1,12 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<classpath> |
||||
|
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="src/main/webapp"/> |
||||
|
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/> |
||||
|
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject"> |
||||
|
<attributes> |
||||
|
<attribute name="hide" value="true"/> |
||||
|
</attributes> |
||||
|
</classpathentry> |
||||
|
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/> |
||||
|
<classpathentry kind="output" path=""/> |
||||
|
</classpath> |
||||
@ -0,0 +1,2 @@ |
|||||
|
eclipse.preferences.version=1 |
||||
|
encoding/<project>=UTF-8 |
||||
@ -0,0 +1,10 @@ |
|||||
|
eclipse.preferences.version=1 |
||||
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled |
||||
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 |
||||
|
org.eclipse.jdt.core.compiler.compliance=17 |
||||
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error |
||||
|
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled |
||||
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error |
||||
|
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning |
||||
|
org.eclipse.jdt.core.compiler.release=enabled |
||||
|
org.eclipse.jdt.core.compiler.source=17 |
||||
@ -0,0 +1,8 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> |
||||
|
<wb-module deploy-name="Myproject"> |
||||
|
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> |
||||
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> |
||||
|
<property name="context-root" value="Myproject"/> |
||||
|
<property name="java-output-path" value="/Myproject/build/classes"/> |
||||
|
</wb-module> |
||||
|
</project-modules> |
||||
@ -0,0 +1,9 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<faceted-project> |
||||
|
<fixed facet="java"/> |
||||
|
<fixed facet="wst.jsdt.web"/> |
||||
|
<fixed facet="jst.web"/> |
||||
|
<installed facet="java" version="17"/> |
||||
|
<installed facet="jst.web" version="4.0"/> |
||||
|
<installed facet="wst.jsdt.web" version="1.0"/> |
||||
|
</faceted-project> |
||||
@ -0,0 +1 @@ |
|||||
|
org.eclipse.wst.jsdt.launching.baseBrowserLibrary |
||||
@ -0,0 +1 @@ |
|||||
|
Window |
||||
@ -0,0 +1,3 @@ |
|||||
|
Manifest-Version: 1.0 |
||||
|
Class-Path: |
||||
|
|
||||
@ -0,0 +1,12 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" id="WebApp_ID" version="4.0"> |
||||
|
<display-name>Myproject</display-name> |
||||
|
<welcome-file-list> |
||||
|
<welcome-file>index.html</welcome-file> |
||||
|
<welcome-file>index.jsp</welcome-file> |
||||
|
<welcome-file>index.htm</welcome-file> |
||||
|
<welcome-file>default.html</welcome-file> |
||||
|
<welcome-file>default.jsp</welcome-file> |
||||
|
<welcome-file>default.htm</welcome-file> |
||||
|
</welcome-file-list> |
||||
|
</web-app> |
||||
@ -0,0 +1,55 @@ |
|||||
|
<%@page import="java.sql.*"%> |
||||
|
<% |
||||
|
try{ |
||||
|
String zone = request.getParameter("zone"); |
||||
|
String division = request.getParameter("division"); |
||||
|
String billno = request.getParameter("billno"); |
||||
|
String subno = request.getParameter("subno"); |
||||
|
String is_existing_selected = request.getParameter("isExistingSelected"); |
||||
|
|
||||
|
|
||||
|
String sql; |
||||
|
String sql1; |
||||
|
if(Integer.parseInt(is_existing_selected) == 1){ |
||||
|
sql = "select * from mv1@erp where UPICNO = '" + zone + "-" + division + "-" + billno + "-" + subno+"'"; |
||||
|
|
||||
|
}else{ |
||||
|
sql = "select * from mv1@erp where UPICNO IN (select PROPERTYID from egpt_basic_property@erp where DL_PROPERTYID = '" + zone + "-" + division + "-" + billno + "')"; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@10.1.0.14:1521:chncorp","erp","erp"); |
||||
|
Statement stmt = conn.createStatement(); |
||||
|
ResultSet rs = stmt.executeQuery(sql); |
||||
|
//Statement stmt1 = conn.createStatement(); |
||||
|
//ResultSet rs1 = stmt1.executeQuery(sql1); |
||||
|
//out.println(rs1); |
||||
|
//out.println(sql); |
||||
|
|
||||
|
while(rs.next()){ |
||||
|
|
||||
|
String no1 = rs.getString("AGGREGATE_CURRENT_DEMAND"); |
||||
|
String no2 = rs.getString("AGGREGATE_ARREAR_DEMAND"); |
||||
|
String no3 = rs.getString("AGGREGATE_ARREAR_LP_DEMAND"); |
||||
|
String no4 = rs.getString("CURRENT_COLLECTION"); |
||||
|
String no5 = rs.getString("ARREARCOLLECTION"); |
||||
|
String no6 = rs.getString("ARREAR_LP_COLLECTION"); |
||||
|
String no7 = rs.getString("ARREAR_INCENTIVE"); |
||||
|
|
||||
|
Integer due = ( Integer.parseInt( no1 ) + Integer.parseInt( no2 ) + Integer.parseInt( no3 ) ) - ( Integer.parseInt( no4 ) + Integer.parseInt( no5 ) + Integer.parseInt( no6 ) + Integer.parseInt( no7 ) ); |
||||
|
%> |
||||
|
[ |
||||
|
{"OWNERSNAME":"<%=rs.getString("OWNERSNAME")%>", "ADDRESS":"<%=rs.getString("ADDRESS")%>", "AGGREGATE_CURRENT_DEMAND": "<%=rs.getString("AGGREGATE_CURRENT_DEMAND")%>", "DUE":"<%= due %>", "MOBILENO": "<%=rs.getString("MOBILENO")%>", "UPICNO": "<%=rs.getString("UPICNO")%>"} |
||||
|
|
||||
|
] |
||||
|
<% |
||||
|
} |
||||
|
// Returns all employees (active and terminated) as json. |
||||
|
response.setContentType("application/json"); |
||||
|
|
||||
|
}catch(SQLException e){ |
||||
|
out.println(e); |
||||
|
} |
||||
|
|
||||
|
%> |
||||
@ -0,0 +1,20 @@ |
|||||
|
[ |
||||
|
<%@ page import="java.sql.*"%> |
||||
|
<% |
||||
|
String zone = request.getParameter("zone"); |
||||
|
|
||||
|
|
||||
|
Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@10.1.0.14:1521:chncorp","erp","erp"); |
||||
|
Statement stmt = conn.createStatement(); |
||||
|
ResultSet rs = stmt.executeQuery("select * from TBL_DIVISION where zone = " + zone); |
||||
|
|
||||
|
while(rs.next()){ |
||||
|
%> |
||||
|
{"DIVISION": "<%=rs.getString("DIVISION")%>"}, |
||||
|
<% |
||||
|
} |
||||
|
|
||||
|
// Returns all employees (active and terminated) as json. |
||||
|
response.setContentType("application/json"); |
||||
|
%> |
||||
|
{}] |
||||
@ -0,0 +1,436 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="en"> |
||||
|
<head> |
||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> |
||||
|
<meta charset="UTF-8"> |
||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
||||
|
<meta name="viewport" content="initial-scale=1"> |
||||
|
<title>Welcome to Greater Chennai Corporation</title> |
||||
|
<link rel="stylesheet" href="style.css" /> |
||||
|
<style> |
||||
|
body { |
||||
|
background-image: url("bg.jpg"); |
||||
|
height: 500px; |
||||
|
background-position: center; |
||||
|
background-repeat: no-repeat; |
||||
|
background-size: cover; |
||||
|
/* Resize the background image to cover the entire container */ |
||||
|
} |
||||
|
</style> |
||||
|
</head> |
||||
|
<body background="desktop/RiponBuilding.jpg;"> |
||||
|
<form action="data.jsp" class="form" method="post"> |
||||
|
<h2 class="heading">Property Tax Appointment</h2> |
||||
|
<h4 class="heading">Senior Citizen Request</h4> |
||||
|
<div class="box"> |
||||
|
<div class="firstbox"> |
||||
|
<div> |
||||
|
<h3><label for="exampleInputPassword1"><span id="onlinepayment-sub"> |
||||
|
Search By |
||||
|
<input type="radio" id="isNew" name="isNew" value='N' checked onClick="setIsExistingSelected(1)" style="font-size: 10.5px;"> |
||||
|
Existing Bill Number |
||||
|
<input name="isNew" type="radio" id="isNew" value='Y' onClick="setIsExistingSelected(0)" style="font-size: 10.5px;"> |
||||
|
General Revision New Bill Number </span></label></h3> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="box"> |
||||
|
<div class="firstbox"> |
||||
|
<div class="inputcontainer"> |
||||
|
<label class="label" for="zone"> Zone </label> |
||||
|
<select class="blockinput" name="zone" id="zone" onchange="getDivision()"> |
||||
|
<option value="0">Select Zone</option> |
||||
|
<option value="01">01</option> |
||||
|
<option value="02">02</option> |
||||
|
<option value="03">03</option> |
||||
|
<option value="04">04</option> |
||||
|
<option value="05">05</option> |
||||
|
<option value="06">06</option> |
||||
|
<option value="07">07</option> |
||||
|
<option value="08">08</option> |
||||
|
<option value="09">09</option> |
||||
|
<option value="10">10</option> |
||||
|
<option value="11">11</option> |
||||
|
<option value="12">12</option> |
||||
|
<option value="13">13</option> |
||||
|
<option value="14">14</option> |
||||
|
<option value="15">15</option> |
||||
|
</select> |
||||
|
</div> |
||||
|
<div class="inputcontainer"> |
||||
|
<label class="label" for="division"> Division </label> |
||||
|
<select class="blockinput" name="division" id="division"> |
||||
|
<option value="0">Select Division</option> |
||||
|
</select> |
||||
|
</div> |
||||
|
<div class="inputcontainer"> |
||||
|
<label class="label" for="billno"> Bill No </label> |
||||
|
<input |
||||
|
class="blockinput" |
||||
|
id="billno" |
||||
|
type="text" name="billno" |
||||
|
/> |
||||
|
</div> |
||||
|
<div class="inputcontainer div_sub_no"> |
||||
|
<label class="label" for="subno"> Sub No </label> |
||||
|
<input |
||||
|
class="blockinput" |
||||
|
id="subno" |
||||
|
type="text" name="subno" |
||||
|
placeholder="000" |
||||
|
readonly |
||||
|
/> |
||||
|
</div><br> |
||||
|
</div> |
||||
|
<button type="submit" class="button">Submit</button> |
||||
|
</div> |
||||
|
</form> |
||||
|
|
||||
|
<h2 class="heading ">Details</h2> |
||||
|
|
||||
|
<div class="box form"> |
||||
|
<span id="status" style="color: red" style="font-weight:bold"></span> |
||||
|
<div class="secondbox"> |
||||
|
<div class="inputcontainer2"> |
||||
|
<label class="label2" for="assessname" > Assessee Name </label> |
||||
|
<input |
||||
|
class="input" |
||||
|
id="assessname" |
||||
|
type="text" |
||||
|
disabled |
||||
|
placeholder="Name" |
||||
|
style="font-weight:bold"/> |
||||
|
</div> |
||||
|
<div class="inputcontainer2"> |
||||
|
<label class="label2" for="address" > Address </label> |
||||
|
<textarea |
||||
|
class="input" |
||||
|
id="address" |
||||
|
disabled |
||||
|
placeholder="Address" |
||||
|
style="font-weight:bold"></textarea> |
||||
|
</div> |
||||
|
<div class="inputcontainer2"> |
||||
|
<label class="label2" for="presenttax" > Present Tax </label> |
||||
|
<input |
||||
|
class="input" |
||||
|
id="presenttax" |
||||
|
type="text" |
||||
|
disabled |
||||
|
placeholder="Present Tax" |
||||
|
style="font-weight:bold" |
||||
|
/> |
||||
|
</div> |
||||
|
<div class="inputcontainer2"> |
||||
|
<label class="label2" for="due"> Due </label> |
||||
|
<input |
||||
|
class="input" |
||||
|
id="due" |
||||
|
type="text" |
||||
|
disabled |
||||
|
placeholder="Due" |
||||
|
style="font-weight:bold" |
||||
|
/> |
||||
|
</div> |
||||
|
<div class="inputcontainer2"> |
||||
|
<label class="label2" for="mobileno" > Mobile Number </label> |
||||
|
<input |
||||
|
class="input" |
||||
|
id="mobileno" |
||||
|
type="number" |
||||
|
disabled |
||||
|
placeholder="Mobile Number" |
||||
|
style="font-weight:bold" |
||||
|
/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<form id="form_appointment" class=""> |
||||
|
<h2 class="heading ">Appointment Booking Details</h2> |
||||
|
<div class="box form"> |
||||
|
<div class="secondbox"> |
||||
|
<div class="inputcontainer2"> |
||||
|
<label class="label2" for="propertyid" > Property ID </label> |
||||
|
<input |
||||
|
class="input" |
||||
|
id="propertyid" |
||||
|
disabled |
||||
|
placeholder="00-000-00000-000" |
||||
|
type="text" name="propertyid" |
||||
|
maxlength="16" |
||||
|
style="font-weight:bold" |
||||
|
/> |
||||
|
</div> |
||||
|
<div class="inputcontainer2"> |
||||
|
<label class="label2" for="contactaddress"> Contact Address </label> |
||||
|
<textarea |
||||
|
class="input" |
||||
|
id="contactaddress" |
||||
|
onclick="validateContAddr()" |
||||
|
placeholder="Enter Contact Address" |
||||
|
></textarea> |
||||
|
</div> |
||||
|
<div class="inputcontainer2"> |
||||
|
<label class="label2" for="mobno"> Contact Number </label> |
||||
|
<input |
||||
|
class="inputnum" |
||||
|
id="mobno" |
||||
|
type="number" |
||||
|
pattern="\d*" |
||||
|
maxlength="10" |
||||
|
placeholder="Enter Contact Number" |
||||
|
/> |
||||
|
<button type="button" class="button" id="btn_send_otp" onclick="sendOtp()">OTP</button> |
||||
|
</div> |
||||
|
<div class="inputcontainer2" id="otp"> |
||||
|
<label class="label2" for="mobno"> </label> |
||||
|
<input class="inputnum" id="otpvalue" type="text" pattern="\d*" maxlength="6" placeholder="Enter OTP"/> |
||||
|
<button class="button" type="button" onClick="verifyOtp()" id="btn_verify_otp">Verify</button> |
||||
|
</div> </div> |
||||
|
<div class="thirdbox"> |
||||
|
<div class="inputcontainer3"> |
||||
|
<label class="label" for="age"> Age </label> |
||||
|
<input class="blockinput" id="age" type="text" placeholder="Age" disabled/> |
||||
|
</div> |
||||
|
<div class="inputcontainer3"> |
||||
|
<label class="label" for="appdate"> Appointment Date </label> |
||||
|
<input class="blockinput date_picker" id="appdate" type="date" placeholder="" onkeydown="return false" disabled /> |
||||
|
</div> |
||||
|
<div class="inputcontainer3"> |
||||
|
<label class="label" for="apptime"> Appointment Time </label> |
||||
|
<input class="blockinput" id="apptime" type="time" placeholder="" min="6:00" max="20:00" disabled /> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="buttonbox"> |
||||
|
<button type="button" class="button" id="save" onClick="insertData()">Save</button> |
||||
|
<button type="reset" class="button" id="clear">Clear</button> |
||||
|
</div> |
||||
|
</form> |
||||
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script> |
||||
|
<script> |
||||
|
|
||||
|
var boolIsExistingSelected = 1; |
||||
|
$(document).ready(function(){ |
||||
|
var today = new Date().toISOString().split('T')[0]; |
||||
|
document.getElementsByClassName('date_picker')[0].setAttribute('min', today); |
||||
|
}); |
||||
|
|
||||
|
function setIsExistingSelected( val ) { |
||||
|
boolIsExistingSelected = val; |
||||
|
|
||||
|
if(false == val){ |
||||
|
$('#subno').val('000'); |
||||
|
$('#subno').attr('disabled', 'disabled'); |
||||
|
$('.div_sub_no').hide(); |
||||
|
|
||||
|
}else { |
||||
|
$('#subno').attr('disabled', false); |
||||
|
$('.div_sub_no').show(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
$('.form').submit(function(e){ |
||||
|
$('#assessname').val(''); |
||||
|
$('#address').val(''); |
||||
|
$('#presenttax').val(''); |
||||
|
$('#due').val(''); |
||||
|
$('#mobileno').val(''); |
||||
|
$('#propertyid').val(''); |
||||
|
e.preventDefault(); |
||||
|
var zone = $('#zone').val(); |
||||
|
var division = $('#division').val(); |
||||
|
var subno = $('#subno').val(); |
||||
|
|
||||
|
if(subno == '' ){ |
||||
|
subno = '000'; |
||||
|
} |
||||
|
|
||||
|
/*if(parseInt( division ) < 10){ |
||||
|
division = '00'+division; |
||||
|
} |
||||
|
if(parseInt( division ) < 100){ |
||||
|
division = '0'+division; |
||||
|
console.log('d: ' + division); |
||||
|
}*/ |
||||
|
|
||||
|
|
||||
|
|
||||
|
var billno = $('#billno').val(); |
||||
|
var url = 'data.jsp?zone='+zone+'&division='+division+'&billno='+billno+'&subno='+subno+'&isExistingSelected='+boolIsExistingSelected; |
||||
|
|
||||
|
|
||||
|
$('#status').html('<p>Searching data..</p>'); |
||||
|
|
||||
|
$.ajax({ |
||||
|
url: url, |
||||
|
data: {}, |
||||
|
complete: function(xhr, statusText){ |
||||
|
if(xhr.status == 200 && xhr.responseText != '' && xhr.responseText != null){ |
||||
|
console.log('l: ' + xhr.responseText.trim().length); |
||||
|
if(xhr.responseText.trim().length == 0) { |
||||
|
$('#status').html('<p>No data found.</p>'); |
||||
|
return; |
||||
|
} |
||||
|
$('#status').html(''); |
||||
|
var json = $.parseJSON(xhr.responseText); |
||||
|
|
||||
|
console.log(json.length); |
||||
|
$('#assessname').val(json[0].OWNERSNAME); |
||||
|
$('#address').val(json[0].ADDRESS); |
||||
|
$('#presenttax').val(json[0].AGGREGATE_CURRENT_DEMAND); |
||||
|
$('#due').val(json[0].DUE); |
||||
|
$('#mobileno').val(json[0].MOBILENO); |
||||
|
$('#propertyid').val(json[0].UPICNO); |
||||
|
} |
||||
|
}, |
||||
|
error: function(xhr, statusText, err){ |
||||
|
|
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
$('#form_appointment').submit(function(e) { |
||||
|
e.preventDefault(); |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
function getDivision() { |
||||
|
var zone = $('#zone').val(); |
||||
|
var url = 'getDivision.jsp?zone='+zone; |
||||
|
$.ajax({ |
||||
|
url: url, |
||||
|
data: {}, |
||||
|
complete: function(xhr, statusText){ |
||||
|
if(xhr.status == 200 && xhr.responseText != '' && xhr.responseText != null){ |
||||
|
var arrObjDivisions = $.parseJSON(xhr.responseText); |
||||
|
var options = ''; |
||||
|
$(arrObjDivisions).each(function(){ |
||||
|
if(this.DIVISION != null){ |
||||
|
options += '<option value="'+this.DIVISION+'">'+this.DIVISION+'</option>'; |
||||
|
} |
||||
|
|
||||
|
}); |
||||
|
$('#division').html(options); |
||||
|
} |
||||
|
}, |
||||
|
error: function(xhr, statusText, err){ |
||||
|
|
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
function validateContactNumber() { |
||||
|
var contact_number = $('#mobno').val(); |
||||
|
|
||||
|
if(contact_number.length != 10){ |
||||
|
alert('Please enter 10 digit mobile number.'); |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
function sendOtp() { |
||||
|
|
||||
|
// validating property id |
||||
|
var property_id = $('#propertyid').val(); |
||||
|
|
||||
|
if(property_id == '') { |
||||
|
alert('Invalid property id.'); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
// validating contact number |
||||
|
if( false == validateContactNumber() ) { |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
var contact_number = $('#mobno').val(); |
||||
|
|
||||
|
// sending OTP |
||||
|
$.post('send_otp.jsp?mobno='+contact_number,function(response) { |
||||
|
alert(response); |
||||
|
document.getElementById('otp').style.display="flex"; |
||||
|
$('#otpvalue').focus(); |
||||
|
$('#btn_send_otp').attr('disabled','disabled'); |
||||
|
}); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
function verifyOtp() { |
||||
|
var entered_otp = $('#otpvalue').val(); |
||||
|
|
||||
|
if(entered_otp == '' || entered_otp.legth == 0) { |
||||
|
alert('Please enter OTP.'); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
$.post('otp_verification.jsp?entered_otp='+entered_otp,function(response){ |
||||
|
|
||||
|
if(response == 'success') { |
||||
|
$('#age').attr('disabled',false); |
||||
|
$('#appdate').attr('disabled',false); |
||||
|
$('#apptime').attr('disabled',false); |
||||
|
$('#save').attr('disabled',false); |
||||
|
$('#clear').attr('disabled',false); |
||||
|
$('#btn_verify_otp').attr('disabled','disabled'); |
||||
|
}else{ |
||||
|
alert(response); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
function insertData() { |
||||
|
|
||||
|
// age validation |
||||
|
var property_id = $('#propertyid').val(); |
||||
|
var contact_address = $('#contactaddress').val(); |
||||
|
var mobile_number = $('#mobno').val(); |
||||
|
var age = $('#age').val(); |
||||
|
var app_date = $('#appdate').val(); |
||||
|
var app_time = $('#apptime').val(); |
||||
|
|
||||
|
if( contact_address == '' || contact_address.length == 0 ){ |
||||
|
alert('Please enter contact address'); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
if(age < 60) { |
||||
|
alert('Age should be 60 or greater than 60.'); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
if(app_date == '' || app_date.length == 0){ |
||||
|
alert('Please select date.'); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
if( app_time == '' || app_time.length == 0 ){ |
||||
|
alert('Please choose time.'); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
var array_time = app_time.split(':'); |
||||
|
if(array_time[0] < 6 || array_time[0] > 20) { |
||||
|
alert('Please select time between 6:00 to 20:00'); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
$.post('save.jsp',{ |
||||
|
'age': age, |
||||
|
'app_date': app_date, |
||||
|
'app_time': app_time, |
||||
|
'property_id': property_id, |
||||
|
'contact_address': contact_address, |
||||
|
'mobile_number' : mobile_number |
||||
|
},function(response){ |
||||
|
alert(response); |
||||
|
window.location.reload(); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
||||
@ -0,0 +1,17 @@ |
|||||
|
<%@ page language="java" session="true"%> |
||||
|
<%@ page language="java" import ="java.io.*,java.sql.*,java.net.HttpURLConnection,java.net.*,java.io.*,java.util.*" %> |
||||
|
<%@ page trimDirectiveWhitespaces="true"%> |
||||
|
<% |
||||
|
int session_otp = (Integer) session.getAttribute("otp"); |
||||
|
String string_entered_otp = request.getParameter("entered_otp"); |
||||
|
int entered_otp = Integer.parseInt(string_entered_otp); |
||||
|
if(session_otp == entered_otp) |
||||
|
{ |
||||
|
out.clear(); |
||||
|
out.print("success"); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
out.print("Incorrect OTP. Please enter correct OTP."); |
||||
|
} |
||||
|
%> |
||||
@ -0,0 +1,44 @@ |
|||||
|
<%@ page import="java.sql.*,java.time.*"%> |
||||
|
<% |
||||
|
String property_id = request.getParameter("property_id"); |
||||
|
String contact_address = request.getParameter("contact_address"); |
||||
|
String mobile_number = request.getParameter("mobile_number"); |
||||
|
String age = request.getParameter("age"); |
||||
|
String app_date = request.getParameter("app_date"); |
||||
|
String app_time = request.getParameter("app_time"); |
||||
|
|
||||
|
// app_date=" to_date('"+app_date+"','rrrr-mm-dd') "; |
||||
|
|
||||
|
//out.println( property_id+" "+contact_address+" "+mobile_number+" "+age+" "+ app_date +" "+app_time ); |
||||
|
|
||||
|
try{ |
||||
|
Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@10.1.0.14:1521:chncorp","erp","erp"); |
||||
|
Statement stmt = conn.createStatement(); |
||||
|
stmt.execute("insert into appointment_dtl(App_Property_id, Contact_addr, Mobile_num, Age, App_Date, App_time)"+ |
||||
|
" values ("+ |
||||
|
"'"+property_id+"',"+ |
||||
|
"'"+contact_address+"',"+ |
||||
|
"'"+mobile_number+"',"+ |
||||
|
"'"+age+"',"+ |
||||
|
" to_date('"+app_date+"','rrrr-mm-dd'),"+ |
||||
|
"'"+app_time+"') " |
||||
|
); |
||||
|
|
||||
|
|
||||
|
/*PreparedStatement st = conn.prepareStatement("insert into appointment_dtl(App_Property_id, Contact_addr, Mobile_num, Age, App_Date, App_time) values(?,?,?,?,?,?)"); |
||||
|
st.setString(1, property_id); |
||||
|
st.setString(2, contact_address); |
||||
|
st.setString(3, mobile_number); |
||||
|
st.setString(4, age); |
||||
|
st.setDate(5, app_date); |
||||
|
st.setString(6, app_time); |
||||
|
|
||||
|
st.executeUpdate(); |
||||
|
*/ |
||||
|
out.print("Appointment was booked Successfully."); |
||||
|
conn.close(); |
||||
|
} |
||||
|
catch(Exception e){ |
||||
|
out.print(e); |
||||
|
} |
||||
|
%> |
||||
@ -0,0 +1,46 @@ |
|||||
|
<%@ page language="java" session="true"%> |
||||
|
<%@ page language="java" import ="java.io.*,java.sql.*,java.net.HttpURLConnection,java.net.*,java.io.*,java.util.*" %> |
||||
|
<%@ page trimDirectiveWhitespaces="true"%> |
||||
|
<% |
||||
|
String MobileNo=request.getParameter("mobno"); |
||||
|
Random rand = new Random(); |
||||
|
int otp = rand.nextInt(90000) + 10000; |
||||
|
out.println("OTP sent successfully!"); |
||||
|
String generatedToken="Your OTP is " +otp+ ". OTP is valid for the next 5 minutes.%0aBy%0aGreater Chennai Corporation."; |
||||
|
try |
||||
|
{ |
||||
|
generatedToken=generatedToken.replace(" ","%20"); |
||||
|
|
||||
|
String urlString="http://api.onex-ultimo.in/api/pushsms?user=GCCtrans&authkey=92kOC1RBGBIws&sender=GCCCRP&mobile="+MobileNo+"&text="+generatedToken+"&rpt=1&summary=1&output=json&entityid=1401572690000011081&templateid=1407165856492044436"; |
||||
|
URL myurl = null; |
||||
|
myurl = new URL(urlString ); |
||||
|
URLConnection connection = myurl.openConnection(); |
||||
|
HttpURLConnection conn = (HttpURLConnection)myurl.openConnection(); |
||||
|
conn.connect(); |
||||
|
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream())); |
||||
|
String line = ""; |
||||
|
String page_line = ""; |
||||
|
while( (line = br.readLine() ) != null ) |
||||
|
{ |
||||
|
page_line += line+""; |
||||
|
} |
||||
|
System.out.println("page_line :" +page_line); |
||||
|
|
||||
|
String[] tempvalue = page_line.split("<br>"); |
||||
|
String outputvalue = ""; |
||||
|
boolean isConnected = (conn.getContentLength() > 0); |
||||
|
java.util.Date dt=new java.util.Date(); |
||||
|
if(isConnected) |
||||
|
{ |
||||
|
System.out.print("Sending Sucess"); |
||||
|
conn.disconnect(); |
||||
|
} |
||||
|
|
||||
|
}catch(Exception ex) |
||||
|
{ |
||||
|
out.println("Error "+ex +" MobileNo"+MobileNo); |
||||
|
} |
||||
|
// storing otp in session |
||||
|
session.setAttribute("otp",otp); |
||||
|
|
||||
|
%> |
||||
@ -0,0 +1,169 @@ |
|||||
|
* { |
||||
|
margin: 0; |
||||
|
padding: 0; |
||||
|
font-family: sans-serif; |
||||
|
} |
||||
|
|
||||
|
.form { |
||||
|
width: 60%; |
||||
|
margin: 0 auto; |
||||
|
max-width: 42 rem; |
||||
|
} |
||||
|
|
||||
|
.heading { |
||||
|
font-size: 20px; |
||||
|
line-height: 32px; |
||||
|
font-weight: 800; |
||||
|
text-align: center; |
||||
|
text-transform: uppercase; |
||||
|
margin: 20px 0; |
||||
|
} |
||||
|
|
||||
|
.heading2 { |
||||
|
text-align: left !important; |
||||
|
} |
||||
|
|
||||
|
.box { |
||||
|
box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px; |
||||
|
padding: 12px 24px; |
||||
|
border-radius: 6px; |
||||
|
--tw-bg-opacity: 1; |
||||
|
background-color: rgb(249 250 251 / var(--tw-bg-opacity)); |
||||
|
} |
||||
|
|
||||
|
.firstbox { |
||||
|
display: flex; |
||||
|
flex-wrap: wrap; |
||||
|
padding-top: 20px; |
||||
|
margin-left: -12px; |
||||
|
margin-right: -12px; |
||||
|
margin-bottom: 24px; |
||||
|
} |
||||
|
|
||||
|
.inputcontainer { |
||||
|
width: 40%; |
||||
|
padding-left: 24px; |
||||
|
padding-right: 24px; |
||||
|
margin-bottom: 24px; |
||||
|
} |
||||
|
|
||||
|
.label { |
||||
|
display: block; |
||||
|
text-transform: uppercase; |
||||
|
letter-spacing: 0.025em; |
||||
|
--tw-text-opacity: 1; |
||||
|
color: rgb(55 65 81 / var(--tw-text-opacity)); |
||||
|
font-size: 12px; |
||||
|
line-height: 16px; |
||||
|
font-weight: 700; |
||||
|
margin-bottom: 8px; |
||||
|
} |
||||
|
|
||||
|
.blockinput { |
||||
|
width: 100%; |
||||
|
padding: 12px 20px; |
||||
|
margin: 8px 0; |
||||
|
display: inline-block; |
||||
|
border: 1px solid #ccc; |
||||
|
border-radius: 4px; |
||||
|
box-sizing: border-box; |
||||
|
} |
||||
|
|
||||
|
.secondbox { |
||||
|
display: grid; |
||||
|
padding-top: 20px; |
||||
|
margin-left: -12px; |
||||
|
margin-right: -12px; |
||||
|
margin-bottom: 24px; |
||||
|
} |
||||
|
|
||||
|
.inputcontainer2 { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
width: 100%; |
||||
|
padding-left: 12px; |
||||
|
padding-right: 12px; |
||||
|
margin-bottom: 24px; |
||||
|
font-weight:bold; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
#otp { |
||||
|
display: none; |
||||
|
} |
||||
|
|
||||
|
.text { |
||||
|
width: 50%; |
||||
|
margin: 0 0 8px; |
||||
|
display: inline-block; |
||||
|
} |
||||
|
|
||||
|
.label2 { |
||||
|
width: 40%; |
||||
|
text-transform: uppercase; |
||||
|
letter-spacing: 0.025em; |
||||
|
--tw-text-opacity: 1; |
||||
|
color: rgb(55 65 81 / var(--tw-text-opacity)); |
||||
|
font-size: 14px; |
||||
|
line-height: 16px; |
||||
|
font-weight: 700; |
||||
|
margin-bottom: 8px; |
||||
|
} |
||||
|
|
||||
|
.input { |
||||
|
width: 50%; |
||||
|
padding: 12px 20px; |
||||
|
margin: 8px 0; |
||||
|
display: inline-block; |
||||
|
border: 1px solid #ccc; |
||||
|
border-radius: 4px; |
||||
|
box-sizing: border-box; |
||||
|
} |
||||
|
|
||||
|
.button { |
||||
|
--tw-bg-opacity: 1; |
||||
|
background-color: rgb(59 130 246 / var(--tw-bg-opacity)); |
||||
|
--tw-text-opacity: 1; |
||||
|
color: rgb(255 255 255 / var(--tw-text-opacity)); |
||||
|
font-weight: 700; |
||||
|
padding: 8px 16px; |
||||
|
border: 1px; |
||||
|
border-radius: 4px; |
||||
|
margin-left: 8px; |
||||
|
} |
||||
|
|
||||
|
.button:hover { |
||||
|
--tw-bg-opacity: 1; |
||||
|
background-color: rgb(29 78 216 / var(--tw-bg-opacity)); |
||||
|
} |
||||
|
|
||||
|
.inputnum { |
||||
|
width: 40%; |
||||
|
padding: 12px 20px; |
||||
|
margin: 8px 0; |
||||
|
display: inline-block; |
||||
|
border: 1px solid #ccc; |
||||
|
border-radius: 4px; |
||||
|
box-sizing: border-box; |
||||
|
} |
||||
|
|
||||
|
.thirdbox { |
||||
|
display: flex; |
||||
|
flex-wrap: wrap; |
||||
|
margin-bottom: 8px; |
||||
|
} |
||||
|
|
||||
|
.inputcontainer3 { |
||||
|
width: 30%; |
||||
|
padding-right: 12px; |
||||
|
margin-bottom: 24px; |
||||
|
} |
||||
|
|
||||
|
.buttonbox { |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
padding-top: 32px; |
||||
|
padding-bottom: 32px; |
||||
|
width: 33.333333%; |
||||
|
margin: auto; |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue