You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

435 lines
13 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta http-equiv="X-UA-Compatible" content="ie=edge" />
  5. <meta charset="UTF-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7. <meta name="viewport" content="initial-scale=1">
  8. <title>Welcome to Greater Chennai Corporation</title>
  9. <link rel="stylesheet" href="style.css" />
  10. <style>
  11. body {
  12. background-image: url("bg.jpg");
  13. height: 500px;
  14. background-position: center;
  15. background-repeat: no-repeat;
  16. background-size: cover;
  17. /* Resize the background image to cover the entire container */
  18. }
  19. </style>
  20. </head>
  21. <body background="desktop/RiponBuilding.jpg;">
  22. <form action="data.jsp" class="form" method="post">
  23. <h2 class="heading">Property Tax Appointment</h2>
  24. <h4 class="heading">Senior Citizen Request</h4>
  25. <div class="box">
  26. <div class="firstbox">
  27. <div>
  28. <h3><label for="exampleInputPassword1"><span id="onlinepayment-sub">
  29. Search By &nbsp;
  30. <input type="radio" id="isNew" name="isNew" value='N' checked onClick="setIsExistingSelected(1)" style="font-size: 10.5px;">
  31. Existing Bill Number &nbsp;
  32. <input name="isNew" type="radio" id="isNew" value='Y' onClick="setIsExistingSelected(0)" style="font-size: 10.5px;">
  33. General Revision New Bill Number </span></label></h3>
  34. </div>
  35. </div>
  36. </div>
  37. <div class="box">
  38. <div class="firstbox">
  39. <div class="inputcontainer">
  40. <label class="label" for="zone"> Zone </label>
  41. <select class="blockinput" name="zone" id="zone" onchange="getDivision()">
  42. <option value="0">Select Zone</option>
  43. <option value="01">01</option>
  44. <option value="02">02</option>
  45. <option value="03">03</option>
  46. <option value="04">04</option>
  47. <option value="05">05</option>
  48. <option value="06">06</option>
  49. <option value="07">07</option>
  50. <option value="08">08</option>
  51. <option value="09">09</option>
  52. <option value="10">10</option>
  53. <option value="11">11</option>
  54. <option value="12">12</option>
  55. <option value="13">13</option>
  56. <option value="14">14</option>
  57. <option value="15">15</option>
  58. </select>
  59. </div>
  60. <div class="inputcontainer">
  61. <label class="label" for="division"> Division </label>
  62. <select class="blockinput" name="division" id="division">
  63. <option value="0">Select Division</option>
  64. </select>
  65. </div>
  66. <div class="inputcontainer">
  67. <label class="label" for="billno"> Bill No </label>
  68. <input
  69. class="blockinput"
  70. id="billno"
  71. type="text" name="billno"
  72. />
  73. </div>
  74. <div class="inputcontainer div_sub_no">
  75. <label class="label" for="subno"> Sub No </label>
  76. <input
  77. class="blockinput"
  78. id="subno"
  79. type="text" name="subno"
  80. placeholder="000"
  81. readonly
  82. />
  83. </div><br>
  84. </div>
  85. <button type="submit" class="button">Submit</button>
  86. </div>
  87. </form>
  88. <h2 class="heading ">Details</h2>
  89. <div class="box form">
  90. <span id="status" style="color: red" style="font-weight:bold"></span>
  91. <div class="secondbox">
  92. <div class="inputcontainer2">
  93. <label class="label2" for="assessname" > Assessee Name </label>
  94. <input
  95. class="input"
  96. id="assessname"
  97. type="text"
  98. disabled
  99. placeholder="Name"
  100. style="font-weight:bold"/>
  101. </div>
  102. <div class="inputcontainer2">
  103. <label class="label2" for="address" > Address </label>
  104. <textarea
  105. class="input"
  106. id="address"
  107. disabled
  108. placeholder="Address"
  109. style="font-weight:bold"></textarea>
  110. </div>
  111. <div class="inputcontainer2">
  112. <label class="label2" for="presenttax" > Present Tax </label>
  113. <input
  114. class="input"
  115. id="presenttax"
  116. type="text"
  117. disabled
  118. placeholder="Present Tax"
  119. style="font-weight:bold"
  120. />
  121. </div>
  122. <div class="inputcontainer2">
  123. <label class="label2" for="due"> Due </label>
  124. <input
  125. class="input"
  126. id="due"
  127. type="text"
  128. disabled
  129. placeholder="Due"
  130. style="font-weight:bold"
  131. />
  132. </div>
  133. <div class="inputcontainer2">
  134. <label class="label2" for="mobileno" > Mobile Number </label>
  135. <input
  136. class="input"
  137. id="mobileno"
  138. type="number"
  139. disabled
  140. placeholder="Mobile Number"
  141. style="font-weight:bold"
  142. />
  143. </div>
  144. </div>
  145. </div>
  146. <form id="form_appointment" class="">
  147. <h2 class="heading ">Appointment Booking Details</h2>
  148. <div class="box form">
  149. <div class="secondbox">
  150. <div class="inputcontainer2">
  151. <label class="label2" for="propertyid" > Property ID </label>
  152. <input
  153. class="input"
  154. id="propertyid"
  155. disabled
  156. placeholder="00-000-00000-000"
  157. type="text" name="propertyid"
  158. maxlength="16"
  159. style="font-weight:bold"
  160. />
  161. </div>
  162. <div class="inputcontainer2">
  163. <label class="label2" for="contactaddress"> Contact Address </label>
  164. <textarea
  165. class="input"
  166. id="contactaddress"
  167. onclick="validateContAddr()"
  168. placeholder="Enter Contact Address"
  169. ></textarea>
  170. </div>
  171. <div class="inputcontainer2">
  172. <label class="label2" for="mobno"> Contact Number </label>
  173. <input
  174. class="inputnum"
  175. id="mobno"
  176. type="number"
  177. pattern="\d*"
  178. maxlength="10"
  179. placeholder="Enter Contact Number"
  180. />
  181. <button type="button" class="button" id="btn_send_otp" onclick="sendOtp()">OTP</button>
  182. </div>
  183. <div class="inputcontainer2" id="otp">
  184. <label class="label2" for="mobno"> </label>
  185. <input class="inputnum" id="otpvalue" type="text" pattern="\d*" maxlength="6" placeholder="Enter OTP"/>
  186. <button class="button" type="button" onClick="verifyOtp()" id="btn_verify_otp">Verify</button>
  187. </div> </div>
  188. <div class="thirdbox">
  189. <div class="inputcontainer3">
  190. <label class="label" for="age"> Age </label>
  191. <input class="blockinput" id="age" type="text" placeholder="Age" disabled/>
  192. </div>
  193. <div class="inputcontainer3">
  194. <label class="label" for="appdate"> Appointment Date </label>
  195. <input class="blockinput date_picker" id="appdate" type="date" placeholder="" onkeydown="return false" disabled />
  196. </div>
  197. <div class="inputcontainer3">
  198. <label class="label" for="apptime"> Appointment Time </label>
  199. <input class="blockinput" id="apptime" type="time" placeholder="" min="6:00" max="20:00" disabled />
  200. </div>
  201. </div>
  202. </div>
  203. <div class="buttonbox">
  204. <button type="button" class="button" id="save" onClick="insertData()">Save</button>
  205. <button type="reset" class="button" id="clear">Clear</button>
  206. </div>
  207. </form>
  208. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
  209. <script>
  210. var boolIsExistingSelected = 1;
  211. $(document).ready(function(){
  212. var today = new Date().toISOString().split('T')[0];
  213. document.getElementsByClassName('date_picker')[0].setAttribute('min', today);
  214. });
  215. function setIsExistingSelected( val ) {
  216. boolIsExistingSelected = val;
  217. if(false == val){
  218. $('#subno').val('000');
  219. $('#subno').attr('disabled', 'disabled');
  220. $('.div_sub_no').hide();
  221. }else {
  222. $('#subno').attr('disabled', false);
  223. $('.div_sub_no').show();
  224. }
  225. }
  226. $('.form').submit(function(e){
  227. $('#assessname').val('');
  228. $('#address').val('');
  229. $('#presenttax').val('');
  230. $('#due').val('');
  231. $('#mobileno').val('');
  232. $('#propertyid').val('');
  233. e.preventDefault();
  234. var zone = $('#zone').val();
  235. var division = $('#division').val();
  236. var subno = $('#subno').val();
  237. if(subno == '' ){
  238. subno = '000';
  239. }
  240. /*if(parseInt( division ) < 10){
  241. division = '00'+division;
  242. }
  243. if(parseInt( division ) < 100){
  244. division = '0'+division;
  245. console.log('d: ' + division);
  246. }*/
  247. var billno = $('#billno').val();
  248. var url = 'data.jsp?zone='+zone+'&division='+division+'&billno='+billno+'&subno='+subno+'&isExistingSelected='+boolIsExistingSelected;
  249. $('#status').html('<p>Searching data..</p>');
  250. $.ajax({
  251. url: url,
  252. data: {},
  253. complete: function(xhr, statusText){
  254. if(xhr.status == 200 && xhr.responseText != '' && xhr.responseText != null){
  255. console.log('l: ' + xhr.responseText.trim().length);
  256. if(xhr.responseText.trim().length == 0) {
  257. $('#status').html('<p>No data found.</p>');
  258. return;
  259. }
  260. $('#status').html('');
  261. var json = $.parseJSON(xhr.responseText);
  262. console.log(json.length);
  263. $('#assessname').val(json[0].OWNERSNAME);
  264. $('#address').val(json[0].ADDRESS);
  265. $('#presenttax').val(json[0].AGGREGATE_CURRENT_DEMAND);
  266. $('#due').val(json[0].DUE);
  267. $('#mobileno').val(json[0].MOBILENO);
  268. $('#propertyid').val(json[0].UPICNO);
  269. }
  270. },
  271. error: function(xhr, statusText, err){
  272. }
  273. });
  274. });
  275. $('#form_appointment').submit(function(e) {
  276. e.preventDefault();
  277. });
  278. function getDivision() {
  279. var zone = $('#zone').val();
  280. var url = 'getDivision.jsp?zone='+zone;
  281. $.ajax({
  282. url: url,
  283. data: {},
  284. complete: function(xhr, statusText){
  285. if(xhr.status == 200 && xhr.responseText != '' && xhr.responseText != null){
  286. var arrObjDivisions = $.parseJSON(xhr.responseText);
  287. var options = '';
  288. $(arrObjDivisions).each(function(){
  289. if(this.DIVISION != null){
  290. options += '<option value="'+this.DIVISION+'">'+this.DIVISION+'</option>';
  291. }
  292. });
  293. $('#division').html(options);
  294. }
  295. },
  296. error: function(xhr, statusText, err){
  297. }
  298. });
  299. }
  300. function validateContactNumber() {
  301. var contact_number = $('#mobno').val();
  302. if(contact_number.length != 10){
  303. alert('Please enter 10 digit mobile number.');
  304. return false;
  305. }
  306. return true;
  307. }
  308. function sendOtp() {
  309. // validating property id
  310. var property_id = $('#propertyid').val();
  311. if(property_id == '') {
  312. alert('Invalid property id.');
  313. return;
  314. }
  315. // validating contact number
  316. if( false == validateContactNumber() ) {
  317. return false;
  318. }
  319. var contact_number = $('#mobno').val();
  320. // sending OTP
  321. $.post('send_otp.jsp?mobno='+contact_number,function(response) {
  322. alert(response);
  323. document.getElementById('otp').style.display="flex";
  324. $('#otpvalue').focus();
  325. $('#btn_send_otp').attr('disabled','disabled');
  326. });
  327. }
  328. function verifyOtp() {
  329. var entered_otp = $('#otpvalue').val();
  330. if(entered_otp == '' || entered_otp.legth == 0) {
  331. alert('Please enter OTP.');
  332. return;
  333. }
  334. $.post('otp_verification.jsp?entered_otp='+entered_otp,function(response){
  335. if(response == 'success') {
  336. $('#age').attr('disabled',false);
  337. $('#appdate').attr('disabled',false);
  338. $('#apptime').attr('disabled',false);
  339. $('#save').attr('disabled',false);
  340. $('#clear').attr('disabled',false);
  341. $('#btn_verify_otp').attr('disabled','disabled');
  342. }else{
  343. alert(response);
  344. }
  345. });
  346. }
  347. function insertData() {
  348. // age validation
  349. var property_id = $('#propertyid').val();
  350. var contact_address = $('#contactaddress').val();
  351. var mobile_number = $('#mobno').val();
  352. var age = $('#age').val();
  353. var app_date = $('#appdate').val();
  354. var app_time = $('#apptime').val();
  355. if( contact_address == '' || contact_address.length == 0 ){
  356. alert('Please enter contact address');
  357. return;
  358. }
  359. if(age < 60) {
  360. alert('Age should be 60 or greater than 60.');
  361. return;
  362. }
  363. if(app_date == '' || app_date.length == 0){
  364. alert('Please select date.');
  365. return;
  366. }
  367. if( app_time == '' || app_time.length == 0 ){
  368. alert('Please choose time.');
  369. return;
  370. }
  371. var array_time = app_time.split(':');
  372. if(array_time[0] < 6 || array_time[0] > 20) {
  373. alert('Please select time between 6:00 to 20:00');
  374. return;
  375. }
  376. $.post('save.jsp',{
  377. 'age': age,
  378. 'app_date': app_date,
  379. 'app_time': app_time,
  380. 'property_id': property_id,
  381. 'contact_address': contact_address,
  382. 'mobile_number' : mobile_number
  383. },function(response){
  384. alert(response);
  385. window.location.reload();
  386. });
  387. }
  388. </script>
  389.  </body>
  390. </html>