Advertisement
Guest User

Untitled

a guest
Dec 28th, 2017
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 121.83 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html xmlns:th="http://www.thymeleaf.org">
  3. <head>
  4. <div th:replace="includes/htmlhead :: htmlhead"></div>
  5. <div th:replace="fileUpload :: fileUploadIncludeStyle"></div>
  6. </head>
  7. <body class="page-container-bg-solid">
  8. <div class="page-wrapper">
  9. <div th:replace="includes/header :: header(${menu})">...</div>
  10. <div class="page-wrapper-row full-height">
  11. <div class="page-wrapper-middle">
  12. <div class="page-container">
  13. <div class="page-content-wrapper">
  14. <div class="page-body">
  15. <div class="container">
  16. <div class="row">
  17. <div class="col-md-12">
  18. <div class="main-box-div">
  19. <!--<div class="title-div" th:text="#{grievance.submission.form}"> </div>-->
  20. <div class="portlet light bordered" id="formWizard">
  21. <div class="portlet-title">
  22. <div class="caption">
  23. <i class=" icon-layers "></i>
  24. <span class="caption-subject bold uppercase" th:text="#{grievance.submission.form}"></span>
  25. <span class="step-title">&nbsp;</span>
  26. </div>
  27. </div>
  28. <div class="portlet-body form">
  29. <form class="form-horizontal" id="registerAndGrieveForm" action="api/file/upload" method="POST" enctype="multipart/form-data">
  30. <div class="form-wizard">
  31. <div class="form-body">
  32. <ul class="nav nav-pills nav-justified steps">
  33. <li id="tabLink1">
  34. <a href="#tab1" data-toggle="tab" class="step">
  35. <span class="number" th:text ="#{number.one}"></span>
  36. <span class="desc" th:text ="#{complainant.info}">
  37. <i class="fa fa-check"></i>
  38. </span>
  39. </a>
  40. </li>
  41. <li id="tabLink2">
  42. <a href="#tab2" data-toggle="tab"
  43. class="step active">
  44. <span class="number" th:text="#{number.two}"></span>
  45. <span class="desc" th:text="#{description.of.complaint}">
  46. <i class="fa fa-check"></i>
  47. </span>
  48. </a>
  49. </li>
  50. <li id="tabLink3">
  51. <a href="#tab3" data-toggle="tab" class="step">
  52. <span class="number" th:text="#{number.three}"> </span>
  53. <span class="desc" th:text ="#{verification}">
  54. <i class="fa fa-check"></i>
  55. </span>
  56. </a>
  57. </li>
  58. </ul>
  59. <div id="bar" class="progress progress-striped" role="progressbar">
  60. <div class="progress-bar progress-bar-success"></div>
  61. </div>
  62. <div class="tab-content">
  63. <div class="alert alert-danger display-none">
  64. <button class="close" data-dismiss="alert" th:text="#{enter.missing.info}"></button>
  65. </div>
  66. <div class="alert alert-success display-none">
  67. <button class="close" data-dismiss="alert" th:text="#{correct.info}"></button>
  68. </div>
  69. <div class="tab-pane active" id="tab1">
  70. <h3 class="block" th:text="#{fill.info}"></h3>
  71. <div class="form-group">
  72. <label class="control-label col-md-4" id="phoneNumberLabel"> <span th:text="#{mobile.number}"></span><span class="required">*</span></label>
  73. <div class="col-md-4">
  74. <input type="text" class="form-control" id="phoneNumber" name="phoneNumber" onblur="getUser();"/>
  75. </div>
  76. </div>
  77. <div style="display : none;" id="divPinNumber">
  78. <div class="form-group">
  79. <label class="control-label col-md-4" th:text="#{pin}"><span class="required">*</span></label>
  80. <div class="col-md-4">
  81. <input type="password" class="form-control" id="pinNumber" name="pinNumber"/>
  82. </div>
  83. </div>
  84.  
  85. <div class="form-actions">
  86. <div class="col-md-offset-4 col-md-8">
  87. <a class="btn green" onclick="doLogIn();" th:text="#{login}"> </a>
  88. </div>
  89. </div>
  90. </div>
  91.  
  92. <div id="divRest">
  93. <div class="form-group">
  94. <label class="control-label col-md-4" id="nameLabel"> <span th:text="#{full.name}"></span><span class="required">*</span></label>
  95. <div class="col-md-4">
  96. <input type="text" class="form-control" id="name" name="name"/>
  97. <!--<span class="help-block" th:text="#{provide.full.name}"> </span>-->
  98. </div>
  99. </div>
  100. <div class="form-group">
  101. <label class="col-md-4 control-label"><span th:text="#{nationality.label}" th:remove="tag"></span></label>
  102. <div class="col-md-8">
  103. <div class="mt-radio-inline">
  104. <label class="mt-radio">
  105. <input name="nationality" value="BANGLADESHI" type="radio">
  106. <span th:text="#{nationality.bangladeshi}" th:remove="tag"></span>
  107. <span ></span>
  108. </label>
  109. <label class="mt-radio">
  110. <input name="nationality" value="OTHER" type="radio">
  111. <span th:text="#{nationality.other}" th:remove="tag"></span>
  112. <span ></span>
  113. </label>
  114. </div>
  115. </div>
  116. </div>
  117. <div class="form-group">
  118. <label class="control-label col-md-4" id="nidOrBcnLabel"> <span th:text="#{nid}"></span><span class="required">*</span></label>
  119. <div class="col-md-4">
  120. <input type="text" class="form-control" name="nidOrBcn" id="nidOrBcn"/>
  121. <!--<span class="help-block" th:text="#{provide.nid}"> </span>-->
  122. <!--<span class="help-block" th:text="#{provide.nid}"> </span>-->
  123. </div>
  124. </div>
  125. <div class="form-group">
  126. <label class="control-label col-md-4" id="emailLabel"> <span th:text="#{email}"></span><span class="required">*</span></label>
  127. <div class="col-md-4">
  128. <input name="email" id="email" class="form-control" type="text">
  129. <!--<span class="help-block" th:text="#{provide.email}"> </span>-->
  130. </div>
  131. </div>
  132. <div class="form-group">
  133. <label class="control-label col-md-4" id="birthdateLabel" th:text="#{birth.date}"></label>
  134. <div class="col-md-4">
  135. <div class="input-group date" id='birthdate'>
  136. <input type="text" class="form-control" name="birthDate" data-date-end-date="0d">
  137. <span class="input-group-addon">
  138. <i class="glyphicon glyphicon-calendar"></i>
  139. </span>
  140. </div>
  141. </div>
  142. </div>
  143. <div class="form-group">
  144. <label class="control-label col-md-4" id="occupationLabel" th:text="#{occupation}"></label>
  145. <div class="col-md-4">
  146. <select id="occupation" id="occupation" name="occupation" class="select2 form-control input-inline">
  147. <option value="" selected style="display: none;" th:text="#{choose.occupation.type}"></option>
  148. <option th:value="BUSINESS" th:text="#{occupation.type.business}"></option>
  149. <option th:value="GOVT_SERVICE" th:text="#{occupation.type.govt.service}"></option>
  150. <option th:value="PVT_SERVICE" th:text="#{occupation.type.private.service}"></option>
  151. <option th:value="REPORTER" th:text="#{occupation.type.reporter}"></option>
  152. <option th:value="RETIRED" th:text="#{occupation.type.retired}"></option>
  153. <option th:value="HOUSEWIFE" th:text="#{occupation.type.housewife}"></option>
  154. <option th:value="STUDENT" th:text="#{occupation.type.student}"></option>
  155. <option th:value="OTHER" th:text="#{occupation.type.others}"></option>
  156. </select>
  157. </div>
  158. </div>
  159. <div class="form-group">
  160. <label class="control-label col-md-4" id="educationLabel" th:text="#{education}"></label>
  161. <div class="col-md-4">
  162. <select id="education" name="education" class="select2 form-control input-inline">
  163. <option value="" selected style="display: none;" th:text="#{choose.education.level}"></option>
  164. <option value="ILLITERATE" th:text="#{education.type.illiterate}"></option>
  165. <option value="LITERATE" th:text="#{education.type.literate}"></option>
  166. <option value="PSC" th:text="#{education.type.pec}"></option>
  167. <option value="JSC" th:text="#{education.type.jsc}"></option>
  168. <option value="SSC" th:text="#{education.type.ssc}"></option>
  169. <option value="HSC" th:text="#{education.type.hsc}"></option>
  170. <option value="HONORS" th:text="#{education.type.honors}"></option>
  171. <option value="MASTERS" th:text="#{education.type.masters}"></option>
  172. <option value="PHD" th:text="#{education.type.phd}"></option>
  173. </select>
  174. </div>
  175. </div>
  176. <div class="form-group">
  177. <label class="control-label col-md-4" id="genderLabel" th:text="#{gender}"></label>
  178. <div class="col-md-4">
  179. <div class="mt-radio-inline">
  180. <label class="mt-radio">
  181. <input name="gender" value="FEMALE" type="radio">
  182. <span th:text="#{female}" th:remove="tag"></span>
  183. <span></span>
  184. </label>
  185. <label class="mt-radio" >
  186. <input name="gender" value="MALE" type="radio">
  187. <span th:text="#{male}" th:remove="tag"></span>
  188. <span></span>
  189. </label>
  190. <label class="mt-radio">
  191. <input name="gender" value="OTHERS" type="radio"> <span th:text="#{other}" th:remove="tag"></span>
  192. <span></span>
  193. </label>
  194. </div>
  195. </div>
  196. </div>
  197.  
  198. <h3 class="block" id="permanentAddressLabel" th:text="#{permanent.address}"></h3>
  199. <div class="form-group">
  200. <label class="col-md-4 control-label"></label>
  201. <div class="col-md-8">
  202. <div class="mt-radio-inline">
  203. <label class="mt-radio" >
  204. <input value="UPAZILA" type="radio" name="permanentAddressTypeValue" checked="checked">
  205. <span th:text="#{upazilla}" th:remove="tag"></span>
  206. <span ></span>
  207. </label>
  208. <label class="mt-radio" >
  209. <input value="CITY_CORPORATION" type="radio" name="permanentAddressTypeValue" >
  210. <span th:text="#{city.corporation}" th:remove="tag"></span>
  211. <span ></span>
  212. </label>
  213. </div>
  214. <div id="permanentAddressTypeValueDiv"></div>
  215. </div>
  216. <span class="help-inline" style="color: red;"></span>
  217. </div>
  218.  
  219. <div class="form-group">
  220. <label class="col-md-4 control-label" id="permanentAddressHouseLabel"> <span th:text="#{address.details}" th:remove="tag"></span><span class="required">*</span></label>
  221. <div class="col-md-8">
  222. <input id="permanentAddressHouse" name="permanentAddressHouse" class="form-control" type="text">
  223. </div>
  224. <span style="color: red;"></span>
  225. </div>
  226. <div class="form-group">
  227. <label class="col-md-4 control-label " id="permanentAddressStreetLabel"><span th:text="#{address.details.local}" th:remove="tag"></span><span class="required">*</span></label>
  228. <div class="col-md-8">
  229. <input id="permanentAddressStreet" name="permanentAddressStreet" class="form-control" type="text">
  230. </div>
  231. <span style="color: red;"></span>
  232. </div>
  233. <div class="form-group">
  234. <label class="col-md-4 control-label" id="divisionLabel"><span th:text="#{division}" th:remove="tag"></span><span class="required">*</span>
  235. </label>
  236. <div class="col-md-4">
  237. <select class="select2 form-control" id="permanentAddressDivision" name="permanentAddressDivision">
  238. </select>
  239. </div>
  240. </div>
  241. <div class="form-group">
  242. <label class="col-md-4 control-label" id="districtLabel"><span th:text="#{district}" th:remove="tag"></span><span class="required">*</span>
  243. </label>
  244. <div class="col-md-4">
  245. <select id="permanentAddressDistrict" name="permanentAddressDistrict" class="select2 form-control">
  246. </select>
  247. </div>
  248. </div>
  249. <div class="form-group">
  250. <label class="col-md-4 control-label" id="permanentAddressTypeIdLbl"></label>
  251. <div class="col-md-4">
  252. <select id="permanentAddressTypeId" name="permanentAddressTypeId" class="select2 form-control">
  253. </select>
  254. </div>
  255. </div>
  256. <h3 class="block" id="presentAddressLabel">
  257. <span th:text="#{present.address}"></span> <input id="sameAsPermanent" type="checkbox"> <span class="small" th:text="#{permanent.present.same}"></span>
  258. </h3>
  259. <div class="form-group">
  260. <label class="col-md-4 control-label"></label>
  261. <div class="col-md-8">
  262. <div class="mt-radio-inline">
  263. <label class="mt-radio">
  264. <input name="presentAddressTypeValue" value="UPAZILA" type="radio" checked="checked">
  265. <span th:text="#{upazilla}" th:remove="tag"></span>
  266. <span ></span>
  267. </label>
  268. <label class="mt-radio">
  269. <input name="presentAddressTypeValue" value="CITY_CORPORATION" type="radio">
  270. <span th:text="#{city.corporation}" th:remove="tag"></span>
  271. <span ></span>
  272. </label>
  273. </div>
  274. <div id="presentAddressTypeValueDiv"></div>
  275. </div>
  276. </div>
  277.  
  278. <div class="form-group">
  279. <label class="col-md-4 control-label" > <span th:text="#{address.details}" th:remove="tag"></span><span class="required">*</span></label>
  280. <div class="col-md-8">
  281. <input id="presentAddressHouse" name="presentAddressHouse" class="form-control" type="text">
  282. </div>
  283. <span style="color: red;"></span>
  284. </div>
  285. <div class="form-group">
  286. <label class="col-md-4 control-label " id="presentAddressStreetLabel"><span th:text="#{address.details.local}" th:remove="tag"></span> <span class="required">*</span></label>
  287. <div class="col-md-8">
  288. <input id="presentAddressStreet" name="presentAddressStreet" class="form-control" type="text">
  289. </div>
  290. <span style="color: red;"></span>
  291. </div>
  292. <div class="form-group">
  293. <label class="control-label col-md-4"><span th:text="#{division}" th:remove="tag"></span> <span class="required">*</span></label>
  294. <div class="col-md-4">
  295. <select name="presentAddressDivision" id="presentAddressDivision" class="select2 form-control">
  296. </select>
  297. </div>
  298. </div>
  299. <div class="form-group">
  300. <label class="control-label col-md-4"><span th:text="#{district}" th:remove="tag"></span> <span class="required">*</span></label>
  301. <div class="col-md-4">
  302. <select name="presentAddressDistrict" id="presentAddressDistrict" class="select2 form-control">
  303. </select>
  304. </div>
  305. </div>
  306. <div class="form-group">
  307. <label class="col-md-4 control-label" id="presentAddressTypeIdLbl"></label>
  308. <div class="col-md-4">
  309. <select name="presentAddressTypeId" id="presentAddressTypeId" class="select2 form-control">
  310. </select>
  311. </div>
  312. </div>
  313.  
  314. </div>
  315. </div>
  316.  
  317. <div class="tab-pane" id="tab2">
  318. <h3 class="block" th:text="#{description.of.complaint}"></h3>
  319. <div class="well">
  320. <div class="form-group">
  321. <label class="control-label col-md-3" id="serviceTrackingNumberLabel" th:text="#{tracking.number}"></label>
  322. <div class="col-md-6">
  323. <input id="serviceTrackingNumber" name="serviceTrackingNumber" class="form-control" type="text">
  324. <span class="help-block" th:text="#{provide.tracking.number.from.form}"> </span>
  325. </div>
  326. </div>
  327. <div class="form-group">
  328. <label class="control-label col-md-3" th:text="#{choose.office.from.list}"></label>
  329. </div>
  330.  
  331. <div class="form-group">
  332. <div class="col-md-offset-1 col-md-11">
  333. <select id="officeLayers" class="select2 form-control input-inline">
  334. <option value="" selected style="display: none;" th:text="#{choose.office.type}"></option>
  335. <option value="1" th:text="#{ministry}"></option>
  336. <option value="2" th:text="#{department}"></option>
  337. <option value="3" th:text="#{division}"></option>
  338. <option value="4" th:text="#{district}"></option>
  339. <option value="5" th:text="#{upazilla}"></option>
  340. <option value="6" th:text="#{other}"></option>
  341. </select>
  342. <select id="firstSelection" class=" form-control input-inline" style="display: none;"></select>
  343. <select id="secondSelection" class=" form-control input-inline" style="display: none;"></select>
  344. <select id="thirdSelection" class=" form-control input-inline" style="display: none;"></select>
  345. </div>
  346. </div>
  347. </div>
  348.  
  349. <div class="form-group">
  350. <label class="control-label col-md-2" id="serviceIdLabel" th:text="#{service}"></label>
  351. <div class="col-md-10">
  352. <select id="serviceDropDown" name="serviceId" class="select2 form-control"></select>
  353. <div class="clearfix">&nbsp;</div>
  354. <input id="serviceOthers" name="serviceOthers" class="form-control hide" type="text" th:placeholder="#{service.others}">
  355. </div>
  356. </div>
  357.  
  358. <div class="form-group">
  359. <label class="control-label col-md-2" id='serviceReceiverLabel' th:text="#{service.receiver.label}"></label>
  360. <div class="col-md-10">
  361. <input id="serviceReceiver" name="serviceReceiver" class="form-control" type="text">
  362. </div>
  363. </div>
  364.  
  365. <div class="form-group">
  366. <label class="control-label col-md-2" id='relationLabel' th:text="#{service.receiver.relation}"></label>
  367. <div class="col-md-8">
  368. <div class="mt-radio-inline">
  369. <label class="mt-radio">
  370. <input checked="" name="relation" value="SELF" type="radio"><span th:text="#{service.receiver.relation.self}" th:remove="tag"></span><span></span>
  371. </label>
  372. <label class="mt-radio">
  373. <input name="relation" value="REPRESENTATIVE" type="radio"><span th:text="#{service.receiver.relation.represent}" th:remove="tag"></span><span></span>
  374. </label>
  375. <label class="mt-radio"> <input name="relation" value="RELATIVE" type="radio"><span th:text="#{service.receiver.relation.relative}" th:remove="tag"></span><span></span></label>
  376. </div>
  377. </div>
  378. </div>
  379.  
  380. <div class="form-group">
  381. <label class="control-label col-md-2" id='submissionDateLabel' th:text="#{application.date}"></label>
  382. <div class="col-md-4">
  383. <div class='input-group date' id='applicationDate'>
  384. <input type='text' class="form-control" name="submissionDate" data-date-end-date="0d" />
  385. <span class="input-group-addon">
  386. <span class="glyphicon glyphicon-calendar"></span>
  387. </span>
  388. </div>
  389. </div>
  390. </div>
  391.  
  392. <div class="form-group">
  393. <label class="control-label col-md-2" id='subjectLabel' th:text="#{complaint.subject}"></label>
  394. <div class="col-md-10">
  395. <input id="subject" name="subject" class="form-control" type="text">
  396. </div>
  397. </div>
  398. <div class="form-group">
  399. <label class="control-label col-md-2" id='bodyLabel' th:text="#{description.of.complaint}"></label>
  400. <div class="col-md-10">
  401. <div id="body" class="summernote"></div>
  402. </div>
  403. </div>
  404. <div th:replace="fileUpload :: fileUpload" id="fileupload"></div>
  405. <div class="well hide">
  406. <div class="form-group">
  407. <div class="col-md-12">
  408. <div class="mt-checkbox-list">
  409. <label class="mt-checkbox" >
  410. <input id="anonymous" type="checkbox">
  411. <span th:text="#{annonymous}" th:remove="tag"></span>
  412. <span></span>
  413. </label>
  414. </div>
  415. <span class="help-block" th:text="#{warning.about.annonymous}"> </span>
  416. </div>
  417. </div>
  418. </div>
  419. </div>
  420. <div class="tab-pane" id="tab3">
  421. <div class="">
  422. <div id="trackingNumberBlock">
  423. <h3 class="block" th:text="#{confirm.message}"></h3>
  424. <div id="confirmationDiv">
  425. <div class="row">
  426. <div class="col-md-6">
  427. <span th:text="#{to}"></span><br />
  428. <span th:text="#{gro}"></span><br />
  429. <span id="previewOfficeName"></span><br />
  430. <br />
  431. </div>
  432. <div class="col-md-offset-2 col-md-4">
  433. <span th:text="#{grievance.date.colon}"></span> <span id="previewDateCreated" th:text="#{today}"></span><br />
  434. <span th:text="#{track.colon}"></span> <span id="previewTrackingNumber">-</span><br />
  435. <span th:text="#{status.colon}"></span> <span th:text="#{unsubmitted}"></span> <br />
  436. </div>
  437. </div>
  438. <div class="row">
  439. <div class="col-md-12">
  440. <span th:text="#{subject.colon}"></span> <span id="previewSubject"></span> <br />
  441. <br />
  442. <span th:text="#{service.name.colon}"></span> <span id="previewServiceName"></span><br />
  443. <br />
  444. <span th:text="#{service.date.colon}"></span> <span id="previewServiceDate"></span><br />
  445. <br />
  446. <span th:text="#{service.tracking.number.colon}"></span> <span id="previewServiceTrackingNumber"></span><br />
  447. <br />
  448. <br />
  449. <span th:text="#{mr.ms}"></span>
  450. <br /><br />
  451. <span id="previewDescription"></span>
  452. </div>
  453. </div>
  454. <div class="row">
  455. <div class="col-md-12">
  456. <br /><br />
  457. <span th:text="#{yours.faithfully}"></span><br />
  458. <span id="previewName"></span> <br />
  459. <span id="previewPresentAddress"></span><br />
  460. <span id="previewMobileNumber"></span><br />
  461. </div>
  462. </div>
  463. <div class="row">
  464. <div class="col-md-12">
  465. <br /><br />
  466. <span th:text="#{other.info}"></span><hr />
  467. <span th:text="#{perm.add.colon}"></span> <br /> <span id="previewPermanentAddress"></span><br />
  468. <span th:text="#{email.colon}"></span> <span id="previewEmail"></span> <br />
  469. <span th:text="#{nid.colon}"></span> <span id="previewNid"></span><br />
  470. <span th:text="#{gender.colon}"></span> <span id="previewGender"></span><br />
  471. <span th:text="#{dob.colon}"></span> <span id="previewBirthdate"></span><br />
  472. <span th:text="#{occu.colon}"></span> <span id="previewOccupation"></span><br />
  473. <span th:text="#{education.colon}"></span> <span id="previewEducation"></span><br />
  474. <span th:text="#{service.received.by}"></span> <span id="previewServiceReceivedBy"></span><br />
  475. </div>
  476. </div>
  477. <div class="row">
  478. <div class="col-md-12">
  479. <br /><br />
  480. <div class="mt-element-list">
  481. <div class="mt-list-head list-simple">
  482. <div class="list-head-title-container">
  483. <div class="list-date">&nbsp;</div>
  484. <h3 class="list-title"><span th:text="#{attach.colon}"></span> </h3>
  485. </div>
  486. </div>
  487. <div class="mt-list-container list-simple">
  488. <ul id="previewAttachedFilesList">
  489.  
  490. </ul>
  491. <span class="hide" th:text="#{no.files.attached}"></span>
  492. </div>
  493. </div>
  494. </div>
  495. </div>
  496. </div>
  497. </div>
  498. </div>
  499. </div>
  500. <div class="tab-pane" id="tab4">
  501. </div>
  502. </div>
  503. </div>
  504. <div class="form-actions">
  505. <div class="row">
  506. <div class="col-md-12">
  507. <div class="pull-right">
  508. <a href="javascript:;" class="btn default button-previous"th:text="#{go.to.prev.step}">
  509. <i class="fa fa-angle-left"></i>
  510. </a>
  511. <a href="javascript:;" class="btn btn-outline green button-next" th:text="#{go.to.next.step}">
  512. <i class="fa fa-angle-right"></i>
  513. </a>
  514. <a href="javascript:;" class="btn green button-submit" th:text="#{send.complaint}">
  515. <i class="fa fa-check"></i>
  516. </a>
  517. </div>
  518. </div>
  519. </div>
  520. </div>
  521. </div>
  522. </form>
  523. </div>
  524. </div>
  525. </div>
  526. </div>
  527. </div>
  528. </div>
  529. </div>
  530. </div>
  531. </div>
  532. </div>
  533. </div>
  534. <div class="modal fade" id="ajaxProcessingModal" tabindex="-1" data-backdrop="static" data-keyboard="false">
  535. <div class="modal-dialog">
  536. <div class="modal-content">
  537. <div class="modal-body">
  538. <img src="../assets/global/img/loading-spinner-grey.gif" alt="" class="loading">
  539. <span th:text="#{processing}"> &nbsp;&nbsp; </span>
  540. </div>
  541. </div>
  542. </div>
  543. </div>
  544.  
  545.  
  546. <div class="modal fade" id="pinNumberModal" tabindex="-1" role="basic" aria-hidden="true" data-backdrop="static" data-keyboard="false">
  547. <div class="modal-dialog">
  548. <div class="modal-content">
  549. <div class="modal-header">
  550. <button type="button" class="close" data-dismiss="modal" onclick="javascript:;">×</button>
  551. </div>
  552. <div class="modal-body form">
  553. <form class="form-horizontal" action="#">
  554. <div class="form-body" align="center">
  555. <div class="form-group">
  556. <label class="control-label col-md-12">
  557. <span class="required">* </span><span th:text="#{pin.user.ask}"></span>
  558. </label>
  559. </div>
  560. <div class="form-group">
  561. <label class="control-label col-md-4"> <span th:text="#{mobile.number}"></span></label>
  562. <div class="col-md-4">
  563. <input type="text" class="form-control" disabled id="mobileNumberForNewUser" name="mobileNumberForNewUser"/>
  564. </div>
  565. </div>
  566. <div class="form-group">
  567. <label class="control-label col-md-4"> <span th:text="#{pin}"></span><span class="required">*</span></label>
  568. <div class="col-md-4">
  569. <input type="text" class="form-control" id="pinNumberForNewUser" name="pinNumberForNewUser"/>
  570. </div>
  571. </div>
  572. <div class="form-group last">
  573. <label class="control-label col-md-12">
  574. <a href="#/" th:text="#{send.ping.again}"></a>
  575. </label>
  576. </div>
  577. </div>
  578. </form>
  579. </div>
  580. <div class="modal-footer">
  581. <button type="button" class="btn dark btn-outline btn-primary" onclick="javascript:loginForPinNumberModal()">প্রেরণ করুন</button>
  582. </div>
  583. </div>
  584. </div>
  585. </div>
  586.  
  587. <div th:replace="includes/footer :: footer">...</div>
  588. </div>
  589. <div th:replace="includes/footer_includes :: footer">...</div>
  590. <script src="/assets/global/plugins/jquery-validation/js/jquery.validate.min.js" type="text/javascript"></script>
  591. <script src="/assets/global/plugins/jquery-validation/js/additional-methods.min.js" type="text/javascript"></script>
  592. <script src="/assets/global/plugins/bootstrap-wizard/jquery.bootstrap.wizard.min.js" type="text/javascript"></script>
  593. <script src="/assets/global/plugins/bootstrap-summernote/summernote.min.js" type="text/javascript"></script>
  594. <div th:replace="fileUpload :: fileUploadIncludeScript"></div>
  595. <script>
  596. $(document).ready(function() {
  597. $("#applicationDate").datepicker({
  598. format: 'dd/mm/yyyy',
  599. autoclose: true,
  600. language: jsLangCodeForLibs
  601. }); /* format: "dd-mm-yyyy" */
  602.  
  603. $("#birthdate").datepicker({
  604. format: "dd/mm/yyyy",
  605. startView: 2,
  606. autoclose: true,
  607. language: jsLangCodeForLibs
  608. });
  609.  
  610. /*$('.summernote').summernote({
  611. height: 300
  612. });*/
  613. $('.summernote').summernote({
  614. height: 100,
  615. toolbar: [
  616. // [groupName, [list of button]]
  617. ['style', ['bold', 'italic', 'underline', 'clear', 'fontname']],
  618. ['font', ['strikethrough', 'superscript', 'subscript']],
  619. ['fontsize', ['fontsize']],
  620. ['color', ['color']],
  621. ['para', ['ul', 'ol', 'paragraph']],
  622. ['Insert', ['table', 'hr']],
  623. ['Misc', ['undo', 'redo']]
  624. ]
  625. });
  626.  
  627. $('.select2').select2({
  628. width: '220px',
  629. language: jsLangCodeForLibs
  630. });
  631.  
  632. /*$('#firstSelection').select2();
  633. $('#secondSelection').select2();
  634. $('#thirdSelection').select2();*/
  635. });
  636. </script>
  637. <script th:inline="javascript">
  638. function getDivision() {
  639. $.ajax({
  640. url: "/api/geo/division",
  641. dataType: "text",
  642. success: function(result) {
  643.  
  644. var json = JSON.parse(result);
  645. for (var i = 0; i < json.length; ++i) {
  646. if (languageCode == "en") {
  647. $("#permanentAddressDivision").append(new Option(json[i].nameEnglish, json[i].id));
  648. $("#presentAddressDivision").append(new Option(json[i].nameEnglish, json[i].id));
  649. } else {
  650. $("#permanentAddressDivision").append(new Option(json[i].nameBangla, json[i].id));
  651. $("#presentAddressDivision").append(new Option(json[i].nameBangla, json[i].id));
  652. }
  653.  
  654. }
  655. $("#permanentAddressDivision").change();
  656. $("#presentAddressDivision").change();
  657. }
  658. });
  659. };
  660.  
  661. async function getDistrict(parent, child, grandChild) {
  662. await $.ajax({
  663. url: "/api/geo/district/" + $("#"+parent).val(),
  664. dataType: "text",
  665. success: function(result) {
  666. var json = JSON.parse(result);
  667. child.empty();
  668. grandChild.empty();
  669. for (var i = 0; i < json.length; ++i) {
  670. if (languageCode == "en") {
  671. child.append(new Option(json[i].nameEnglish, json[i].id));
  672. } else {
  673. child.append(new Option(json[i].nameBangla, json[i].id));
  674. }
  675. }
  676. //populate UPAZILA or CITYCORPORATION HERE
  677.  
  678. if(parent.startsWith("permanent")) {
  679. console.log(parent);
  680. $('input[type=radio][name=permanentAddressTypeValue]').change();
  681. }
  682. else {
  683. $('input[type=radio][name=presentAddressTypeValue]').change();
  684. }
  685. //child.select2();
  686. }
  687. });
  688. };
  689.  
  690. function setPlaceholder(parent, text) {
  691. parent.append(new Option("-- select " + text + " --", ""));
  692. parent.prop('selectedIndex', 0);
  693. };
  694.  
  695. async function getThana(divId, disId, parent) {
  696. await $.ajax({
  697. url: "/api/geo/thana/" + divId + "/" + disId,
  698. dataType: "text",
  699. success: function(result) {
  700. var json = JSON.parse(result);
  701. parent.empty();
  702. for (var i = 0; i < json.length; ++i) {
  703. if (languageCode == "en") {
  704. parent.append(new Option(json[i].nameEnglish, json[i].id));
  705. } else {
  706. parent.append(new Option(json[i].nameBangla, json[i].id));
  707. }
  708. }
  709.  
  710. //parent.select2();
  711. }
  712. });
  713. };
  714.  
  715. async function getUpazila(divId, disId, parent) {
  716. await $.ajax({
  717. url: "/api/geo/upazila/" + divId + "/" + disId,
  718. dataType: "text",
  719. success: function(result) {
  720. var json = JSON.parse(result);
  721. parent.empty();
  722. for (var i = 0; i < json.length; ++i) {
  723. if (languageCode == "en") {
  724. parent.append(new Option(json[i].nameEnglish, json[i].id));
  725. } else {
  726. parent.append(new Option(json[i].nameBangla, json[i].id));
  727. }
  728. }
  729. //parent.select2();
  730. }
  731. });
  732. };
  733.  
  734. async function getCitycorporation(divId, disId, parent) {
  735. await $.ajax({
  736. url: "/api/geo/citycorporation/" + divId + "/" + disId,
  737. dataType: "text",
  738. success: function(result) {
  739. var json = JSON.parse(result);
  740. parent.empty();
  741. for (var i = 0; i < json.length; ++i) {
  742. if (languageCode == "en") {
  743. parent.append(new Option(json[i].nameEnglish, json[i].id));
  744. } else {
  745. parent.append(new Option(json[i].nameBangla, json[i].id));
  746. }
  747. }
  748. //parent.select2();
  749. }
  750. });
  751. };
  752.  
  753. async function getMunicipality(divId, disId, parent) {
  754. await $.ajax({
  755. url: "/api/geo/municipality/" + divId + "/" + disId,
  756. dataType: "text",
  757. success: function(result) {
  758. var json = JSON.parse(result);
  759. parent.empty();
  760. for (var i = 0; i < json.length; ++i) {
  761. if (languageCode == "en") {
  762. parent.append(new Option(json[i].nameEnglish, json[i].id));
  763. } else {
  764. parent.append(new Option(json[i].nameBangla, json[i].id));
  765. }
  766. }
  767. //parent.select2();
  768. }
  769. });
  770. };
  771.  
  772. async function getAddressTypeList(parent, val, divId, disId) {
  773. switch (val) {
  774. case "THANA":
  775. await getThana(divId, disId, parent);
  776. break;
  777. case "UPAZILA":
  778. await getUpazila(divId, disId, parent);
  779. break;
  780. case "CITY_CORPORATION":
  781. await getCitycorporation(divId, disId, parent);
  782. break;
  783. case "MUNICIPALITY":
  784. await getMunicipality(divId, disId, parent);
  785. break;
  786. }
  787. }
  788.  
  789. function updateLabelOfEndPoint(lblId, typeValue) {
  790. var lbl = $("#"+lblId);
  791. console.log(lbl);
  792. lbl.empty();
  793. var lang = getCookie("lang");
  794. console.log(lang);
  795. switch(typeValue){
  796. case "UPAZILA":
  797. var content = (lang=="en"?"Upazilla":"উপজেলা");
  798. lbl.append(content);
  799. lbl.append("<span class=\"required\">*</span>");
  800. console.log(lbl);
  801. break;
  802. case "CITY_CORPORATION":
  803. var content = (lang=="en"?"City corporation":"সিটি কর্পোরেশন");
  804. lbl.append(content);
  805. lbl.append("<span class=\"required\">*</span>");
  806. console.log(lbl);
  807. break;
  808. }
  809. }
  810.  
  811. function initLabelOfEndPoint() {
  812. var typeValue = $('input[type=radio][name=permanentAddressTypeValue]:checked').val();
  813. updateLabelOfEndPoint('permanentAddressTypeIdLbl', typeValue);
  814. var typeValue = $('input[type=radio][name=presentAddressTypeValue]:checked').val();
  815. updateLabelOfEndPoint('presentAddressTypeIdLbl', typeValue);
  816. }
  817.  
  818. function doProcess() {
  819. initLabelOfEndPoint();
  820.  
  821. $("#permanentAddressDivision").change(function() {
  822. getDistrict("permanentAddressDivision", $("#permanentAddressDistrict"), $("#permanentAddressTypeId"));
  823. });
  824.  
  825. $("#presentAddressDivision").change(function() {
  826. getDistrict("presentAddressDivision", $("#presentAddressDistrict"), $("#presentAddressTypeId"));
  827. });
  828.  
  829. $("#permanentAddressDistrict").change(function() {
  830. //$('input[type=radio][name=permanentAddressTypeValue]:checked').prop('checked', false);
  831. //$("#permanentAddressTypeId").empty();
  832.  
  833. $('input[type=radio][name=permanentAddressTypeValue]').change();
  834. });
  835.  
  836. $("#presentAddressDistrict").change(function() {
  837. //$('input[type=radio][name=presentAddressTypeValue]:checked').prop('checked', false);
  838. //$("#presentAddressTypeId").empty();
  839.  
  840. $('input[type=radio][name=presentAddressTypeValue]').change();
  841. });
  842.  
  843. $('input[type=radio][name=permanentAddressTypeValue]').change(function() {
  844. var typeValue = $('input[type=radio][name=permanentAddressTypeValue]:checked').val();
  845. updateLabelOfEndPoint('permanentAddressTypeIdLbl', typeValue);
  846. getAddressTypeList($("#permanentAddressTypeId"), typeValue, $("#permanentAddressDivision").val(), $("#permanentAddressDistrict").val());
  847. });
  848.  
  849. $('input[type=radio][name=presentAddressTypeValue]').change(function() {
  850. var typeValue = $('input[type=radio][name=presentAddressTypeValue]:checked').val();
  851. updateLabelOfEndPoint('presentAddressTypeIdLbl', typeValue);
  852. getAddressTypeList($("#presentAddressTypeId"), typeValue, $("#presentAddressDivision").val(), $("#presentAddressDistrict").val()).then(function() {
  853.  
  854. if ($("#sameAsPermanent").is(":checked")) {
  855. $("#presentAddressTypeId").val($("#permanentAddressTypeId").val());
  856. $("#presentAddressTypeId").change();
  857. }
  858. });
  859.  
  860. });
  861.  
  862. $("#sameAsPermanent").change(function() {
  863. if (this.checked) {
  864. $("#presentAddressHouse").val($("#permanentAddressHouse").val());
  865. $("#presentAddressHouse").change();
  866.  
  867. $("#presentAddressStreet").val($("#permanentAddressStreet").val());
  868. $("#presentAddressStreet").change();
  869.  
  870. $("#presentAddressDivision").val($("#permanentAddressDivision").val());
  871. $("#presentAddressDivision").change();
  872.  
  873. getDistrict("presentAddressDivision", $("#presentAddressDistrict"), $("#presentAddressTypeId")).then(function(result) {
  874. $("#presentAddressDistrict").val($("#permanentAddressDistrict").val());
  875. $("#presentAddressDistrict").change();
  876.  
  877. var typeValue = $('input[type=radio][name=permanentAddressTypeValue]:checked').val();
  878. $('input[type=radio][name=presentAddressTypeValue]').val([typeValue]);
  879. $('input[type=radio][name=presentAddressTypeValue]:checked').change();
  880.  
  881. $("#presentAddressTypeId").val($("#permanentAddressTypeId").val());
  882. });
  883. } else {
  884. $("#presentAddressDivision").prop('selectedIndex', 0);
  885. $("#presentAddressDivision").trigger("change");
  886. $("#presentAddressDistrict").trigger("change");
  887. }
  888. });
  889.  
  890. getDivision();
  891.  
  892. };
  893. $(document).ready(function() {
  894. doProcess();
  895. });
  896. </script>
  897. <script>
  898. function getFirstLayers(id) {
  899. $.getJSON("/api/officelayers/" + id, function(result) {
  900. $("#firstSelection").empty();
  901. var opt;
  902. if (languageCode == "en") {
  903. opt = new Option("--Select office--", "");
  904. } else {
  905. opt = new Option("--অফিস বাছাই করুন--", "");
  906. }
  907. opt.setAttribute("style", "display: none;");
  908. $("#firstSelection").append(opt);
  909. $.each(result, function(i, field) {
  910. if (languageCode == "en") {
  911. $("#firstSelection").append(new Option(field.nameEnglish, field.id));
  912. } else {
  913. $("#firstSelection").append(new Option(field.nameBangla, field.id));
  914. }
  915. });
  916. $("#firstSelection").css("display", "inline-block");
  917. })
  918. .done(function() {
  919.  
  920. })
  921. .fail(function() {
  922.  
  923. }).always(function() {
  924.  
  925. });
  926. }
  927.  
  928. function getZilas() {
  929. $.getJSON("/api/geo/districts", function(result) {
  930. $("#firstSelection").empty();
  931. var opt;
  932. if (languageCode == "en") {
  933. opt = new Option("--Select district--", "");
  934. } else {
  935. opt = new Option("--জেলা বাছাই করুন--", "");
  936. }
  937. opt.setAttribute("style", "display: none;");
  938. $("#firstSelection").append(opt);
  939. $.each(result, function(i, field) {
  940. if (languageCode == "en") {
  941. $("#firstSelection").append(new Option(field.nameEnglish, field.id));
  942. } else {
  943. $("#firstSelection").append(new Option(field.nameBangla, field.id));
  944. }
  945. });
  946. $("#firstSelection").css("display", "inline-block");
  947. })
  948. .done(function() {
  949.  
  950. })
  951. .fail(function() {
  952.  
  953. }).always(function() {
  954.  
  955. });
  956. }
  957.  
  958. function onGetUpazilaZilaSelectionChange() {
  959. $.getJSON("/api/geo/upazilas/" + $("#firstSelection").val(), function(result) {
  960. $("#secondSelection").empty();
  961. $("#thirdSelection").empty();
  962.  
  963. $("#secondSelection").css("display", "none");
  964. $("#thirdSelection").css("display", "none");
  965.  
  966. var opt;
  967. if (languageCode == "en") {
  968. opt = new Option("--Select upazila--", "");
  969. } else {
  970. opt = new Option("--উপজেলা বাছাই করুন--", "");
  971. }
  972. opt.setAttribute("style", "display: none;");
  973. $("#secondSelection").append(opt);
  974. $.each(result, function(i, field) {
  975. if (languageCode == "en") {
  976. $("#secondSelection").append(new Option(field.nameEnglish, field.id));
  977. } else {
  978. $("#secondSelection").append(new Option(field.nameBangla, field.id));
  979. }
  980. });
  981. $("#secondSelection").css("display", "inline-block");
  982. })
  983. .done(function() {
  984.  
  985. })
  986. .fail(function() {
  987.  
  988. }).always(function() {
  989.  
  990. });
  991. }
  992.  
  993. function GetOfficesByZila() {
  994. $.getJSON("/api/officelayers/" + $('#officeLayers').val() + "/" + $("#firstSelection").val(), function(result) {
  995. $("#secondSelection").empty();
  996. var opt;
  997. if (languageCode == "en") {
  998. opt = new Option("--Select office--", "");
  999. } else {
  1000. opt = new Option("--অফিস বাছাই করুন--", "");
  1001. }
  1002. opt.setAttribute("style", "display: none;");
  1003. $("#secondSelection").append(opt);
  1004. $.each(result, function(i, field) {
  1005. if (languageCode == "en") {
  1006. $("#secondSelection").append(new Option(field.nameEnglish, field.id));
  1007. } else {
  1008. $("#secondSelection").append(new Option(field.nameBangla, field.id));
  1009. }
  1010. });
  1011. $("#secondSelection").css("display", "inline-block");
  1012. })
  1013. .done(function() {
  1014.  
  1015. })
  1016. .fail(function() {
  1017.  
  1018. }).always(function() {
  1019.  
  1020. });
  1021. }
  1022.  
  1023. function GetOfficesByUpazila() {
  1024. $.getJSON("/api/officelayers/" + $('#officeLayers').val() + "/" + $("#firstSelection").val() + "/" + $("#secondSelection").val(), function(result) {
  1025. $("#thirdSelection").empty();
  1026. var opt;
  1027. if (languageCode == "en") {
  1028. opt = new Option("--Select Office--", "");
  1029. } else {
  1030. opt = new Option("--অফিস বাছাই করুন--", "");
  1031. }
  1032. opt.setAttribute("style", "display: none;");
  1033. $("#thirdSelection").append(opt);
  1034. $.each(result, function(i, field) {
  1035. if (languageCode == "en") {
  1036. $("#thirdSelection").append(new Option(field.nameEnglish, field.id));
  1037. } else {
  1038. $("#thirdSelection").append(new Option(field.nameBangla, field.id));
  1039. }
  1040. });
  1041. $("#thirdSelection").css("display", "inline-block");
  1042. })
  1043. .done(function() {
  1044.  
  1045. })
  1046. .fail(function() {
  1047.  
  1048. }).always(function() {
  1049.  
  1050. });
  1051. }
  1052.  
  1053. function getDivisions() {
  1054. $.getJSON("/api/geo/division", function(result) {
  1055. $("#firstSelection").empty();
  1056. var opt;
  1057. if (languageCode == "en") {
  1058. opt = new Option("--Select division--", "");
  1059. } else {
  1060. opt = new Option("--বিভাগ বাছাই করুন--", "");
  1061. }
  1062. opt.setAttribute("style", "display: none;");
  1063. $("#firstSelection").append(opt);
  1064. $.each(result, function(i, field) {
  1065. if (languageCode == "en") {
  1066. $("#firstSelection").append(new Option(field.nameEnglish, field.id));
  1067. } else {
  1068. $("#firstSelection").append(new Option(field.nameBangla, field.id));
  1069. }
  1070. });
  1071. $("#firstSelection").css("display", "inline-block");
  1072. }).done(function() {})
  1073. .fail(function() {})
  1074. .always(function() {});
  1075. }
  1076.  
  1077. function GetOfficesByDivision() {
  1078. $.getJSON("/api/officelayers/division/" + $("#officeLayers").val() + "/" + $("#firstSelection").val(), function(result) {
  1079. $("#secondSelection").empty();
  1080. var opt;
  1081. if (languageCode == "en") {
  1082. opt = new Option("--Select office--", "");
  1083. } else {
  1084. opt = new Option("--অফিস বাছাই করুন--", "");
  1085. }
  1086. opt.setAttribute("style", "display: none;");
  1087. $("#secondSelection").append(opt);
  1088. $.each(result, function(i, field) {
  1089. if (languageCode == "en") {
  1090. $("#secondSelection").append(new Option(field.nameEnglish, field.id));
  1091. } else {
  1092. $("#secondSelection").append(new Option(field.nameBangla, field.id));
  1093. }
  1094. });
  1095. $("#secondSelection").css("display", "inline-block");
  1096. })
  1097. .done(function() {})
  1098. .fail(function() {})
  1099. .always(function() {});
  1100. }
  1101. </script>
  1102. <script th:inline="javascript">
  1103. function ajaxPost(url, accept, send, postData, onSuccess) {
  1104. $.ajax({
  1105. type: "POST",
  1106. url: url,
  1107. dataType: accept,
  1108. contentType: send,
  1109. data: postData,
  1110. success: onSuccess
  1111. });
  1112. }
  1113.  
  1114. function onLoginSuccessPostGrievance(data) {
  1115. $.post("/login?username=" + $("#phoneNumber").val() + "&password=" + "123qwe", postGrievance);
  1116. }
  1117.  
  1118. function getGrievance() {
  1119. var grievance = {};
  1120. var array = $("#tab2 :input").serializeArray();
  1121. $.each(array, function() {
  1122. grievance[this.name] = this.value || '';
  1123. });
  1124. var bodyContent = $("#body").summernote("code");
  1125. grievance['body'] = bodyContent;
  1126.  
  1127. var isAnonymous = false;
  1128. if ($("#anonymous").is(":checked")) {
  1129. isAnonymous = true;
  1130. }
  1131. grievance["isAnonymous"] = isAnonymous;
  1132. grievance["serviceType"] = "NAGORIK";
  1133.  
  1134. var officeId = getOfficeId();
  1135. grievance["officeId"] = officeId || '';
  1136.  
  1137.  
  1138. var files = [];
  1139. $("tr.template-download.fade.in").find("p.name").find("a").each(function(){
  1140. files.push($(this).attr("href"))
  1141. })
  1142.  
  1143. grievance["files"] = files;
  1144.  
  1145. var grievance = JSON.stringify(grievance);
  1146. return grievance;
  1147. }
  1148.  
  1149. function postGrievance(data) {
  1150. var grievance = getGrievance();
  1151. ajaxPost("/api/grievance", "json", "application/json; charset=utf-8", grievance, showMsgForGrievanceSubmission);
  1152. }
  1153.  
  1154. function showMsgForGrievanceSubmission(data) {
  1155. var isEmpty = jQuery.isEmptyObject(data);
  1156. closeLoading();
  1157. if (data.trackingNumber) {
  1158. if (languageCode == "en") {
  1159. $("#trackingNumberBlock").html("<h3 class='block'>Thank you</h3>Your complaint has been successfully submitted. Complaint's tracking number: <span class='trackingNumber'>" + data.trackingNumber + "</span>. <br />Please preserve this number to check the status of your complaint. <br /><br /> <a href='/dashboard.do' class='btn btn-primary btn-sm'>View complaints list</a>");
  1160. } else {
  1161. $("#trackingNumberBlock").html("<h3 class='block'>ধন্যবাদ</h3>আপনার অভিযোগটি যথাযথভাবে দাখিল হয়েছে।<br />অভিযোগটির ট্র্যাকিং নম্বর: <span class='trackingNumber'>" + data.trackingNumber + "</span>।<br />অভিযোগ প্রতিকারের পরবর্তী অবস্থা জানতে এই নম্বরটি সংরক্ষণ করুন।<br /><br /> <a href='/dashboard.do' class='btn btn-primary btn-sm'>অভিযোগের তালিকা দেখুন</a>");
  1162. }
  1163. $('#formWizard').find('.button-previous').remove();
  1164. $('#formWizard').find('.button-submit').remove();
  1165. } else {
  1166. if (languageCode == "en") {
  1167. $("#trackingNumberBlock").html("Sorry! Your complaint could not be submitted, please try again");
  1168. } else {
  1169. $("#trackingNumberBlock").html("দুঃখিত! আপনার অভিযোগটি জমা হয়নি, আরেকবার চেষ্টা করুন");
  1170. }
  1171. }
  1172. }
  1173.  
  1174. function registerComplainant(){
  1175. var user = getComplainantDTO();
  1176. ajaxPost("/register", "json", "application/json", user, null);
  1177. }
  1178.  
  1179. function doLogIn() {
  1180. $.post("/login?username=" + $("#phoneNumber").val() + "&password=" + $("#pinNumber").val(), function(data) {
  1181. var auth = getCookie('Authorization');
  1182. if (auth != "") {
  1183. $("#divPinNumber").css('display', 'none');
  1184. $("#divRest").css('display', 'block');
  1185. getJson("/api/complainant/" + $("#phoneNumber").val(), doAutopopulate);
  1186. } else {
  1187. }
  1188. });
  1189. }
  1190.  
  1191. function loginForPinNumberModal(){
  1192. $.post("/login?username=" + $("#phoneNumber").val() + "&password=" + $("#pinNumberForNewUser").val(), function(data) {
  1193. var auth = getCookie('Authorization');
  1194. if (auth != "") {
  1195. $("#pinNumberModal").modal('hide');
  1196. $('#formWizard').bootstrapWizard('next');
  1197. }
  1198. });
  1199. }
  1200.  
  1201. async function submitGrievance() {
  1202. var auth = getCookie('Authorization');
  1203. var userExist = await hasUser();
  1204. if (userExist==null) {
  1205. var user = getComplainantDTO();
  1206. ajaxPost("/register", "application/json", "application/json", user, null);
  1207. } else {
  1208. postGrievance();
  1209. }
  1210. }
  1211.  
  1212.  
  1213. function getComplainantDTO() {
  1214. var array = $('#tab1 :input').serializeArray();
  1215. var user = {};
  1216. $.each(array, function() {
  1217. user[this.name] = this.value || '';
  1218. });
  1219. var user = JSON.stringify(user);
  1220. return user;
  1221. }
  1222.  
  1223. function doRegister() {
  1224. var user = getComplainantDTO();
  1225. ajaxPost("/register", "application/json", "application/json", user, null);
  1226. }
  1227.  
  1228. function getJson(url, onGettingJson) {
  1229. $.getJSON(url, onGettingJson);
  1230. }
  1231.  
  1232. function getUser() {
  1233. getJson("/api/complainant/" + $("#phoneNumber").val(), checkIfUserExist);
  1234. }
  1235.  
  1236. async function hasUser() {
  1237. var hasUSER, user;
  1238. await $.getJSON("/api/complainant/" + $("#phoneNumber").val(), function(data) {
  1239. if (data.success==false){
  1240. return null;
  1241. }
  1242. else {
  1243. hasUSER = data;
  1244. }
  1245. });
  1246. return hasUSER;
  1247. }
  1248.  
  1249. function checkIfUserExist(data) {
  1250. if (data.success == false) {
  1251. $("#divPinNumber").css('display', 'none');
  1252. $("#divRest").css('display', 'block');
  1253. } else {
  1254. $("#divPinNumber").css('display', 'block');
  1255. $("#divRest").css('display', 'none');
  1256. }
  1257. }
  1258.  
  1259. function getCookie(cname) {
  1260. var name = cname + "=";
  1261. var decodedCookie = decodeURIComponent(document.cookie);
  1262. var ca = decodedCookie.split(';');
  1263. for (var i = 0; i < ca.length; i++) {
  1264. var c = ca[i];
  1265. while (c.charAt(0) == ' ') {
  1266. c = c.substring(1);
  1267. }
  1268. if (c.indexOf(name) == 0) {
  1269. return c.substring(name.length, c.length);
  1270. }
  1271. }
  1272. return "";
  1273. }
  1274.  
  1275. function addressPopulate(type, divisionId, districtId, addressTypeValue, addressTypeId) {
  1276. $("#" + type + "AddressDivision").val(divisionId);
  1277. getDistrict(type + "AddressDivision", $("#" + type + "AddressDistrict"), $("#" + type + "AddressTypeId")).then(function(result) {
  1278. $("#" + type + "AddressDistrict").val(districtId);
  1279. $('input[type=radio][name=' + type + 'AddressTypeValue]').val([addressTypeValue]);
  1280. getAddressTypeList($("#" + type + "AddressTypeId"), addressTypeValue, divisionId, districtId).then(function() {
  1281. $("#" + type + "AddressTypeId").val(addressTypeId);
  1282. });
  1283. });
  1284. }
  1285.  
  1286. function doAutopopulate(data) {
  1287. var presentDivision, presentDistrict, presentTypeValue, presentTypeId;
  1288. var permanentDivision, permanentDistrict, permanentTypeValue, permanentTypeId;
  1289. $.each(data, function(name, value) {
  1290. $('input[type=text][name=' + name + ']').val(value);
  1291. });
  1292. $("input[name=gender][value=" + data['gender'] + "]").prop('checked', true);
  1293. $("input[name=nationality][value=" + data['nationality'] + "]").prop('checked', true);
  1294. $('#occupation').val(data['occupation']);
  1295. $('#occupation').change();
  1296. $('#education').val(data['education']);
  1297. $('#education').change();
  1298. addressPopulate("present", data['presentAddressDivision'], data['presentAddressDistrict'], data['presentAddressTypeValue'], data['presentAddressTypeId']);
  1299. addressPopulate("permanent", data['permanentAddressDivision'], data['permanentAddressDistrict'], data['permanentAddressTypeValue'], data['permanentAddressTypeId']);
  1300. }
  1301.  
  1302. function doLogIn() {
  1303. $.post("/login?username=" + $("#phoneNumber").val() + "&password=" + $("#pinNumber").val(), function(data) {
  1304. var auth = getCookie('Authorization');
  1305. if (auth != "") {
  1306. $("#divPinNumber").css('display', 'none');
  1307. $("#divRest").css('display', 'block');
  1308. getJson("/api/complainant/" + $("#phoneNumber").val(), doAutopopulate);
  1309. } else {
  1310. }
  1311. });
  1312. }
  1313.  
  1314. function populateServiceDropdown(data) {
  1315. if ($('#serviceDropDown').data('select2')) {
  1316. $('#serviceDropDown').select2('destroy');
  1317. }
  1318. $select = $('#serviceDropDown');
  1319. $select.html('');
  1320. if (languageCode == "en") {
  1321. $select.append('<option value="" disabled selected hidden>***Select Service***</option>');
  1322. } else {
  1323. $select.append('<option value="" disabled selected hidden>***সেবা বাছাই করুন***</option>');
  1324. }
  1325.  
  1326. var i = 0;
  1327.  
  1328. $.each(data.services, function(key, val) {
  1329. $select.append('<option value="' + val.id + '">' + val.name + '</option>');
  1330. });
  1331.  
  1332. var strOthers = 'অন্যান্য';
  1333. if (languageCode == "en") {
  1334. strOthers = 'Others';
  1335. }
  1336.  
  1337. $select.append('<option value="0">' + strOthers + '</option>');
  1338.  
  1339. localStorage.setItem('services', JSON.stringify(data));
  1340. $('#serviceDropDown').select2();
  1341. $('#serviceDropDown').trigger('change');
  1342. }
  1343.  
  1344. function populateEmployeeDropDown(data) {
  1345. $('#employeeDropDown').html('');
  1346. $select = $('#employeeDropDown');
  1347. $select.html('');
  1348. //$select.append('<tbody>');
  1349. $select.append('<option value="" disabled selected hidden>***Select Employee***</option>');
  1350. $.each(data.objects, function(key, val) {
  1351. $select.append('<option value="' + val.id + '">' + val.name + '</option>');
  1352. })
  1353. //$select.append('</tbody>');
  1354. }
  1355.  
  1356. function getOfficeId() {
  1357. var officeId = 0;
  1358. if ($("#thirdSelection").data('select2')) {
  1359. officeId = $("#thirdSelection").val();
  1360. } else if ($("#secondSelection").data('select2')) {
  1361. officeId = $("#secondSelection").val();
  1362. } else if ($("#firstSelection").data('select2')) {
  1363. officeId = $("#firstSelection").val();
  1364. }
  1365. return officeId;
  1366. }
  1367.  
  1368. function getOfficeName() {
  1369. var officeName = "";
  1370. if ($("#thirdSelection").data('select2')) {
  1371. officeName = $("#thirdSelection option:selected").text();
  1372. } else if ($("#secondSelection").data('select2')) {
  1373. officeName = $("#secondSelection option:selected").text()
  1374. } else if ($("#firstSelection").data('select2')) {
  1375. officeName = $("#firstSelection option:selected").text()
  1376. }
  1377. return officeName;
  1378. }
  1379.  
  1380. function getOfficeName() {
  1381. var officeId = 0;
  1382. if ($("#thirdSelection").data('select2')) {
  1383. officeId = $("#thirdSelection option:selected").text();
  1384. } else if ($("#secondSelection").data('select2')) {
  1385. officeId = $("#secondSelection option:selected").text();
  1386. } else if ($("#firstSelection").data('select2')) {
  1387. officeId = $("#firstSelection option:selected").text();
  1388. }
  1389. return officeId;
  1390. }
  1391.  
  1392.  
  1393. function officeChangeEventHandler() {
  1394. var officeId = getOfficeId();
  1395. var url = '/api/office/service/' + officeId;
  1396. getJson(url, populateServiceDropdown);
  1397.  
  1398. /*var url = '/api/office/employee/' + officeId;
  1399. getJson(url, populateEmployeeDropDown);*/
  1400. }
  1401.  
  1402. function clearAllSelection() {
  1403. $("#firstSelection").empty();
  1404. $("#secondSelection").empty();
  1405. $("#thirdSelection").empty();
  1406. $("#serviceDropDown").empty();
  1407.  
  1408. $("#firstSelection").css("display", "none");
  1409. $("#secondSelection").css("display", "none");
  1410. $("#thirdSelection").css("display", "none");
  1411. }
  1412.  
  1413. function clearServiceAndEmployeeDropdown() {
  1414. $('#serviceDropDown').empty();
  1415. //$('#employeeDropDown').empty();
  1416. }
  1417.  
  1418. function showSuccess(msg) {
  1419. toastr.success(msg);
  1420. }
  1421.  
  1422. function showError(msg) {
  1423. toastr.error(msg);
  1424. }
  1425.  
  1426. function showLoading() {
  1427. $("#ajaxProcessingModal").modal('show');
  1428. }
  1429.  
  1430. function gotoFirstTab(){
  1431. $('#formWizard').bootstrapWizard('previous');
  1432. $('#formWizard').bootstrapWizard('previous');
  1433. }
  1434. function gotoSecondTab(){
  1435. $('#formWizard').bootstrapWizard('previous');
  1436. }
  1437.  
  1438.  
  1439. function closeFileUploadModal() {
  1440. //$("#fileUploadModal").modal('hide');
  1441. }
  1442.  
  1443. function closeLoading() {
  1444. $("#ajaxProcessingModal").modal('hide');
  1445. }
  1446.  
  1447. /*
  1448. function loadConfirmationTab(){
  1449. var array = $('#tab1 :input, #tab2 :input,#tab3 :input').serializeArray();
  1450. var files = new Array();
  1451. $("#divFileUpload").contents().find("td p.name a").each(function() {
  1452. var name = $(this).attr("href");
  1453. files.push(name);
  1454. });
  1455. var userAndComplaint = {}
  1456. var i = 0;
  1457. $.each(array, function() {
  1458. userAndComplaint[this.name] = this.value || '';
  1459.  
  1460. });
  1461. userAndComplaint["files"] = files;
  1462. console.log(userAndComplaint);
  1463.  
  1464. $("#confirmationDiv").html('');
  1465.  
  1466. label = $("#nameLabel").text();
  1467. label = label.substring(0,label.length-1);
  1468. value = $("#name").val();
  1469. $("#confirmationDiv").append("<div class=\"form-group\"><label class=\"control-label col-md-4\">"+label+"</label><div class='col-md-8'><p class=\"form-control-static\">"+ value+"</p> </div></div>");
  1470.  
  1471. label = $("#nidOrBcnLabel").text();
  1472. label = label.substring(0,label.length-1);
  1473. value = $("#nidOrBcn").val();
  1474. $("#confirmationDiv").append("<div class=\"form-group\"><label class=\"control-label col-md-4\">"+label+"</label><div class='col-md-8'><p class=\"form-control-static\">"+ value+"</p></div></div>");
  1475.  
  1476. label = $("#genderLabel").text();
  1477. value = $("input[name='gender']:checked").parent('label').text().replace(/\s/g, '');
  1478. $("#confirmationDiv").append("<div class=\"form-group\"><label class=\"control-label col-md-4\">"+label+"</label><div class='col-md-8'><p class=\"form-control-static\">"+ value+"</p> </div></div>");
  1479.  
  1480. var label = $("#phoneNumberLabel").text();
  1481. label = label.substring(0,label.length-1);
  1482. var value = $("#phoneNumber").val();
  1483. $("#confirmationDiv").append("<div class=\"form-group\"><label class=\"control-label col-md-4\">"+label+"</label><div class='col-md-8'><p class=\"form-control-static\">"+ value+"</p></div></div>");
  1484.  
  1485. label = $("#emailLabel").text().substring(0,label.length-1);
  1486. value = $("#email").val();
  1487. $("#confirmationDiv").append("<div class=\"form-group\"><label class=\"control-label col-md-4\">"+label+"</label><div class='col-md-8'><p class=\"form-control-static\">"+ value+"</p></div></div>");
  1488.  
  1489. //$("#confirmationDiv").append("<h3>"+$("#permanentAddressLabel").text()+"</h3>");
  1490.  
  1491. var strPermanentAddress = $("#permanentAddressHouse").val() + "<br />";
  1492. strPermanentAddress += $("#permanentAddressStreet").val() + "<br />";
  1493. strPermanentAddress += $("#permanentAddressTypeId option:selected").text() + ", ";
  1494. strPermanentAddress += $("#permanentAddressDistrict option:selected").text() + ", ";
  1495. strPermanentAddress += $("#permanentAddressDivision option:selected").text();
  1496. $("#confirmationDiv").append("<div class=\"form-group\"><label class=\"control-label col-md-4\">"+$("#permanentAddressLabel").text()+"</label><div class='col-md-8'><p class=\"form-control-static\">"+ strPermanentAddress+"</p> </div></div>");
  1497.  
  1498. var strPresentAddress = $("#presentAddressHouse").val() + "<br />";
  1499. strPresentAddress += $("#presentAddressStreet").val() + "<br />";
  1500. strPresentAddress += $("#presentAddressTypeId option:selected").text() + ", ";
  1501. strPresentAddress += $("#presentAddressDistrict option:selected").text() + ", ";
  1502. strPresentAddress += $("#presentAddressDivision option:selected").text();
  1503. $("#confirmationDiv").append("<div class=\"form-group\"><label class=\"control-label col-md-4\">"+$("#presentAddressLabel").text()+"</label><div class='col-md-8'><p class=\"form-control-static\">"+ strPresentAddress+"</p></div></div>");
  1504.  
  1505. label = $("#birthdateLabel").text();
  1506. value = $("input[name=birthDate]").val();
  1507. $("#confirmationDiv").append("<div class=\"form-group\"><label class=\"control-label col-md-4\">"+label+"</label><div class='col-md-8'><p class=\"form-control-static\">"+ value+"</p> </div></div>");
  1508.  
  1509. label = $("#occupationLabel").text();
  1510. value = $("#occupation").val();
  1511. $("#confirmationDiv").append("<div class=\"form-group\"><label class=\"control-label col-md-4\">"+label+"</label><div class='col-md-8'><p class=\"form-control-static\">"+ value+"</p></div></div>");
  1512.  
  1513.  
  1514.  
  1515. label = $("#serviceTrackingNumberLabel").text();
  1516. value = $("#serviceTrackingNumber").val();
  1517. $("#confirmationDiv").append("<div class=\"form-group\"><label class=\"control-label col-md-4\">"+label+"</label><div class='col-md-8'><p class=\"form-control-static\">"+ value+"</p> <a href=\"javascript:gotoSecondTab()\" class='fa fa-edit btn btn-circle btn-xs btn-primary'></a></div></div>");
  1518.  
  1519. label = $("#serviceIdLabel").text();
  1520. value = $("#serviceDropDown").val();
  1521. if (value == "0") {
  1522. value = $("#serviceOthers").val();
  1523. }
  1524. $("#confirmationDiv").append("<div class=\"form-group\"><label class=\"control-label col-md-4\">"+label+"</label><div class='col-md-8'><p class=\"form-control-static\">"+ value+"</p> <a href=\"javascript:gotoSecondTab()\" class='fa fa-edit btn btn-circle btn-xs btn-primary'></a></div></div>");
  1525.  
  1526. label = $("#submissionDateLabel").text();
  1527. value = $("input[name=submissionDate]").val();
  1528. $("#confirmationDiv").append("<div class=\"form-group\"><label class=\"control-label col-md-4\">"+label+"</label><div class='col-md-8'><p class=\"form-control-static\">"+ value+"</p> <a href=\"javascript:gotoSecondTab()\" class='fa fa-edit btn btn-circle btn-xs btn-primary'></a></div></div>");
  1529.  
  1530. label = $("#relationLabel").text();
  1531. value = $("input[name='relation']:checked").parent('label').text();
  1532. $("#confirmationDiv").append("<div class=\"form-group\"><label class=\"control-label col-md-4\">"+label+"</label><div class='col-md-8'><p class=\"form-control-static\">"+ value+"</p> <a href=\"javascript:gotoSecondTab()\" class='fa fa-edit btn btn-circle btn-xs btn-primary'></a></div></div>");
  1533.  
  1534. label = $("#subjectLabel").text();
  1535. value = $("#subject").val();
  1536. $("#confirmationDiv").append("<div class=\"form-group\"><label class=\"control-label col-md-4\">"+label+"</label><div class='col-md-8'><p class=\"form-control-static\">"+ value+"</p> <a href=\"javascript:gotoSecondTab()\" class='fa fa-edit btn btn-circle btn-xs btn-primary'></a></div></div>");
  1537.  
  1538. label = $("#bodyLabel").text();
  1539. value = $("#body").summernote("code");
  1540. $("#confirmationDiv").append("<div class=\"form-group\"><label class=\"control-label col-md-4\">"+label+"</label><div class='col-md-8'>"+ value+"</div></div>");
  1541.  
  1542. $("#confirmationDiv").append("</div>");
  1543.  
  1544. label = $("#fileUploadLabel").text();
  1545. $("#confirmationDiv").append("<div class=\"form-group\"><label class=\"control-label col-md-4\">"+label+"</label><div class='col-md-8'>"+"</div></div>");
  1546. $.each(files, function( index, value ) {
  1547. $("#confirmationDiv").append("<div class=\"form-group\"><label class=\"control-label col-md-4\">"+value+"</label></div>");
  1548. });
  1549. }
  1550. */
  1551.  
  1552. // Aftab - loadConfirmationTab
  1553. function loadConfirmationTab(){
  1554. var selectedServiceName = $("#serviceDropDown option:selected").text();
  1555. var selectedServiceId = $("#serviceDropDown").val();
  1556. if (selectedServiceId == 0) {
  1557. selectedServiceName = $("#serviceOthers").val();
  1558. }
  1559.  
  1560. var strPresentAddress = $("#presentAddressHouse").val() + "<br />";
  1561. strPresentAddress += $("#presentAddressStreet").val() + "<br />";
  1562. strPresentAddress += $("#presentAddressTypeId option:selected").text() + ", ";
  1563. strPresentAddress += $("#presentAddressDistrict option:selected").text() + ", ";
  1564. strPresentAddress += $("#presentAddressDivision option:selected").text();
  1565.  
  1566. var strPermanentAddress = $("#permanentAddressHouse").val() + "<br />";
  1567. strPermanentAddress += $("#permanentAddressStreet").val() + "<br />";
  1568. strPermanentAddress += $("#permanentAddressTypeId option:selected").text() + ", ";
  1569. strPermanentAddress += $("#permanentAddressDistrict option:selected").text() + ", ";
  1570. strPermanentAddress += $("#permanentAddressDivision option:selected").text();
  1571.  
  1572. var files = new Array();
  1573. $("#divFileUpload").contents().find("td p.name a").each(function() {
  1574. var name = $(this).attr("href");
  1575. files.push(name);
  1576. });
  1577.  
  1578. $("#previewOfficeName").html(getOfficeName());
  1579. //$("#previewDateCreated").html("");
  1580. //$("#previewTrackingNumber").html("");
  1581. $("#previewSubject").html($("#subject").val());
  1582. $("#previewServiceName").html(selectedServiceName);
  1583. $("#previewServiceDate").html($("input[name=submissionDate]").val());
  1584. $("#previewServiceTrackingNumber").html($("#serviceTrackingNumber").val());
  1585. $("#previewDescription").html($("#body").summernote("code"));
  1586. $("#previewName").html($("#name").val());
  1587. $("#previewPresentAddress").html(strPresentAddress);
  1588. $("#previewMobileNumber").html($("#phoneNumber").val());
  1589. $("#previewEmail").html($("#email").val());
  1590. $("#previewNid").html($("#nidOrBcn").val());
  1591. $("#previewGender").html($("input[name='gender']:checked").parent('label').text().replace(/\s/g, ''));
  1592. $("#previewBirthdate").html($("input[name=birthDate]").val());
  1593. $("#previewOccupation").html($("#occupation option:selected").text());
  1594. $("#previewEducation").html($("#education option:selected").text());
  1595.  
  1596. $("#previewServiceReceivedBy").html($("#serviceReceiver").val() + " (" + $("input[name='relation']:checked").parent('label').text() + ")");
  1597. $("#previewPermanentAddress").html(strPermanentAddress);
  1598.  
  1599. if (files.length > 0) {
  1600. var strFilesContent = "";
  1601. $.each(files, function( index, value ) {
  1602. strFilesContent += '' +
  1603. '<li class="mt-list-item">' +
  1604. '<div class="list-icon-container">' +
  1605. '<i class="icon-paper-clip"></i>' +
  1606. '</div>' +
  1607. '<div class="list-datetime"> &nbsp;</div>' +
  1608. '<div class="list-item-content">' +
  1609. '<h3 class="uppercase">' +
  1610. '<a target="_blank" href="' + value + '">' + (index+1) + '</a>' +
  1611. '</h3>' +
  1612. '</div>' +
  1613. '</li>';
  1614. });
  1615.  
  1616. $("#previewAttachedFilesList").html(strFilesContent);
  1617. } else {
  1618. $("#previewAttachedFilesList").next().show().remove();
  1619. }
  1620. }
  1621.  
  1622. $(document).ready(function() {
  1623.  
  1624. //$('#fileSelector').fileupload('option', { autoUpload:true,acceptFileTypes: /(\.|\/)(gif|jpe?g|png|doc|pdf|txt|mkv)$/i,maxFileSize: 10000000000});
  1625.  
  1626. $('#officeLayers').on("change", function() {
  1627. /* Following code checks if select2 exists with the dropdowns, if found, resets */
  1628. if ($("#firstSelection").data('select2')) {
  1629. $("#firstSelection").select2('destroy');
  1630. }
  1631.  
  1632. if ($("#secondSelection").data('select2')) {
  1633. $("#secondSelection").select2('destroy');
  1634. }
  1635.  
  1636. if ($("#thirdSelection").data('select2')) {
  1637. $("#thirdSelection").select2('destroy');
  1638. }
  1639.  
  1640. clearAllSelection();
  1641. clearServiceAndEmployeeDropdown();
  1642.  
  1643. switch (this.value) {
  1644. case "":
  1645. break;
  1646.  
  1647. case "1":
  1648. getFirstLayers("1");
  1649. $("#firstSelection").off("change");
  1650. $("#firstSelection").on("change", officeChangeEventHandler);
  1651.  
  1652. $("#firstSelection").select2({
  1653. width: '220px',
  1654. language: jsLangCodeForLibs
  1655. });
  1656. break;
  1657.  
  1658. case "2":
  1659. getFirstLayers("2");
  1660. $("#firstSelection").off("change");
  1661. $("#firstSelection").on("change", officeChangeEventHandler);
  1662.  
  1663. $("#firstSelection").select2({
  1664. width: '220px',
  1665. language: jsLangCodeForLibs
  1666. });
  1667. break;
  1668.  
  1669. case "3":
  1670. getDivisions("3");
  1671. $("#firstSelection").off("change");
  1672. $("#secondSelection").off("change");
  1673. $("#firstSelection").on("change", GetOfficesByDivision);
  1674. $("#secondSelection").on("change", officeChangeEventHandler);
  1675.  
  1676. $("#firstSelection").select2({
  1677. width: '220px',
  1678. language: jsLangCodeForLibs
  1679. });
  1680.  
  1681. $("#secondSelection").select2({
  1682. width: '220px',
  1683. language: jsLangCodeForLibs
  1684. });
  1685. break;
  1686.  
  1687. case "4":
  1688. getZilas();
  1689. $("#firstSelection").off("change");
  1690. $("#secondSelection").off("change");
  1691. $("#firstSelection").on("change", GetOfficesByZila);
  1692. $("#secondSelection").on("change", officeChangeEventHandler);
  1693.  
  1694. $("#firstSelection").select2({
  1695. width: '220px',
  1696. language: jsLangCodeForLibs
  1697. });
  1698.  
  1699. $("#secondSelection").select2({
  1700. width: '220px',
  1701. language: jsLangCodeForLibs
  1702. });
  1703. break;
  1704.  
  1705. case "5":
  1706. getZilas();
  1707. $("#firstSelection").off("change");
  1708. $("#firstSelection").on("change", onGetUpazilaZilaSelectionChange);
  1709.  
  1710. $("#secondSelection").off("change");
  1711. $("#secondSelection").on("change", GetOfficesByUpazila);
  1712.  
  1713. $("#thirdSelection").off("change");
  1714. $("#thirdSelection").on("change", officeChangeEventHandler);
  1715.  
  1716. $("#firstSelection").select2({
  1717. width: '220px',
  1718. language: jsLangCodeForLibs
  1719. });
  1720.  
  1721. $("#secondSelection").select2({
  1722. width: '220px',
  1723. language: jsLangCodeForLibs
  1724. });
  1725.  
  1726. $("#thirdSelection").select2({
  1727. width: '220px',
  1728. language: jsLangCodeForLibs
  1729. });
  1730. break;
  1731.  
  1732. case "6":
  1733. getFirstLayers("6");
  1734. $("#firstSelection").off("change");
  1735. $("#firstSelection").on("change", officeChangeEventHandler);
  1736.  
  1737. $("#firstSelection").select2({
  1738. width: '220px',
  1739. language: jsLangCodeForLibs
  1740. });
  1741. break;
  1742. }
  1743. });
  1744.  
  1745. $("a[href='#tab3']").on('click', loadConfirmationTab);
  1746.  
  1747. $("a.btn.btn-outline.green.button-next").on('click', function(){
  1748. if ($("#tab2").hasClass("active")){
  1749. loadConfirmationTab();
  1750. }
  1751. });
  1752.  
  1753. $('#serviceDropDown').on('change', function(e){
  1754. if ($(this).val() == "0") {
  1755. $('#serviceOthers').removeClass('hide');
  1756. } else {
  1757. $('#serviceOthers').val('');
  1758. $('#serviceOthers').addClass('hide');
  1759. }
  1760. });
  1761. });
  1762.  
  1763. </script>
  1764. <script type="text/javascript">
  1765. $(function() {
  1766. if (!jQuery().bootstrapWizard) {
  1767. return;
  1768. }
  1769.  
  1770. var form = $('#registerAndGrieveForm');
  1771. var error = $('.alert-danger', form);
  1772. var success = $('.alert-success', form);
  1773. var requiredText = "";
  1774.  
  1775. if (languageCode == "en") {
  1776. requiredText = "This field is required";
  1777. } else {
  1778. requiredText = "এই তথ্যটি প্রদান করা আবশ্যক";
  1779. }
  1780.  
  1781. form.validate({
  1782. doNotHideMessage: true,
  1783. errorElement: 'span',
  1784. errorClass: 'help-block help-block-error',
  1785. focusInvalid: false,
  1786. rules: {
  1787. phoneNumber: {
  1788. minlength: 11,
  1789. maxlength: 11,
  1790. required: true
  1791. },
  1792. pinNumber: {
  1793. minlength: 6,
  1794. required: true
  1795. },
  1796. name: {
  1797. minlength: 3,
  1798. required: true
  1799. },
  1800. nidOrBcn: {
  1801. required: true
  1802. },
  1803. permanentAddressStreet: {
  1804. required: true
  1805. },
  1806. permanentAddressDivision: {
  1807. required: true
  1808. },
  1809. permanentAddressDistrict: {
  1810. required: true
  1811. },
  1812. permanentAddressTypeValue: {
  1813. required: true
  1814. },
  1815. permanentAddressTypeId: {
  1816. required: true
  1817. },
  1818. email: {
  1819. required: true,
  1820. email: true
  1821. }
  1822. },
  1823.  
  1824. messages: {
  1825. phoneNumber: {
  1826. required: requiredText
  1827. },
  1828. pinNumber: {
  1829. required: requiredText
  1830. },
  1831. name: {
  1832. required: requiredText
  1833. },
  1834. nidOrBcn: {
  1835. required: requiredText
  1836. },
  1837. permanentAddressStreet: {
  1838. required: requiredText
  1839. },
  1840. permanentAddressDivision: {
  1841. required: requiredText
  1842. },
  1843. permanentAddressDistrict: {
  1844. required: requiredText
  1845. },
  1846. permanentAddressTypeValue: {
  1847. required: requiredText
  1848. },
  1849. permanentAddressTypeId: {
  1850. required: requiredText
  1851. },
  1852. email: {
  1853. required: requiredText
  1854. }
  1855. },
  1856.  
  1857. errorPlacement: function(error, element) {
  1858. if (element.attr("name") == "permanentAddressTypeValue") {
  1859. error.insertAfter("#permanentAddressTypeValueDiv");
  1860. } else if (element.attr("name") == "presentAddressTypeValue") {
  1861. error.insertAfter("#presentAddressTypeValueDiv");
  1862. } else {
  1863. error.insertAfter(element);
  1864. }
  1865. },
  1866.  
  1867. invalidHandler: function(event, validator) {
  1868. success.hide();
  1869. error.show();
  1870. App.scrollTo(error, -200);
  1871. },
  1872.  
  1873. highlight: function(element) {
  1874. $(element).closest('.form-group').removeClass('has-success').addClass('has-error');
  1875. },
  1876.  
  1877. unhighlight: function(element) {
  1878. $(element).closest('.form-group').removeClass('has-error');
  1879. },
  1880.  
  1881. success: function(label) {
  1882. label.addClass('valid').closest('.form-group').removeClass('has-error').addClass('has-success');
  1883. },
  1884.  
  1885. submitHandler: function(form) {
  1886. success.show();
  1887. error.hide();
  1888. }
  1889. });
  1890.  
  1891. var handleTitle = function(tab, navigation, index) {
  1892. var total = navigation.find('li').length;
  1893. var current = index + 1;
  1894. var stepText = "";
  1895.  
  1896. if (current == 1) {
  1897. if (languageCode==null || languageCode=="fr") {
  1898. stepText = "প্রথম ধাপ";
  1899. } else if (languageCode=="en") {
  1900. stepText = "Step 1";
  1901. }
  1902. } else if (current == 2) {
  1903. if (languageCode==null || languageCode=="fr") {
  1904. stepText = "দ্বিতীয় ধাপ";
  1905. } else if (languageCode=="en") {
  1906. stepText = "Step 2";
  1907. }
  1908. } else if (current == 3) {
  1909. if (languageCode==null || languageCode=="fr") {
  1910. stepText = "শেষ ধাপ";
  1911. } else if (languageCode=="en") {
  1912. stepText = "Final Step";
  1913. }
  1914. }
  1915. $('.step-title', $('#formWizard')).text(stepText);
  1916. jQuery('li', $('#formWizard')).removeClass("done");
  1917. var li_list = navigation.find('li');
  1918. for (var i = 0; i < index; i++) {
  1919. jQuery(li_list[i]).addClass("done");
  1920. }
  1921.  
  1922. if (current == 1) {
  1923. $('#formWizard').find('.button-previous').hide();
  1924. } else {
  1925. $('#formWizard').find('.button-previous').show();
  1926. }
  1927.  
  1928. if (current >= total) {
  1929. $('#formWizard').find('.button-next').hide();
  1930. $('#formWizard').find('.button-submit').show();
  1931. } else {
  1932. $('#formWizard').find('.button-next').show();
  1933. $('#formWizard').find('.button-submit').hide();
  1934. }
  1935. App.scrollTo($('.page-title'));
  1936. }
  1937.  
  1938. $('#formWizard').bootstrapWizard({
  1939. 'nextSelector': '.button-next',
  1940. 'previousSelector': '.button-previous',
  1941. onTabClick: function(tab, navigation, index, clickedIndex) {
  1942. success.hide();
  1943. error.hide();
  1944. if (form.valid() == false) {
  1945. return false;
  1946. }
  1947. handleTitle(tab, navigation, clickedIndex);
  1948. },
  1949. onNext: function(tab, navigation, index) {
  1950. success.hide();
  1951. error.hide();
  1952. if (form.valid() == false) {
  1953. return false;
  1954. }
  1955. handleTitle(tab, navigation, index);
  1956.  
  1957. if (index == 1){
  1958. var auth = getCookie('Authorization');
  1959. if (auth=="") {
  1960. registerComplainant();
  1961. $("#mobileNumberForNewUser").val($("phoneNumber").val());
  1962. $("#pinNumberModal").modal('show');
  1963. $("#mobileNumberForNewUser").val($("#phoneNumber").val())
  1964. return false;
  1965. }
  1966. }
  1967. },
  1968. onPrevious: function(tab, navigation, index) {
  1969. success.hide();
  1970. error.hide();
  1971. handleTitle(tab, navigation, index);
  1972. },
  1973. onTabShow: function(tab, navigation, index) {
  1974. var total = navigation.find('li').length;
  1975. var current = index + 1;
  1976. var $percent = (current / total) * 100;
  1977. $('#formWizard').find('.progress-bar').css({
  1978. width: $percent + '%'
  1979. });
  1980. handleTitle(tab, navigation, index);
  1981. }
  1982. });
  1983.  
  1984. $('#formWizard').find('.button-previous').hide();
  1985. $('#formWizard .button-submit').click(function() {
  1986. showLoading();
  1987. submitGrievance();
  1988. }).hide();
  1989. });
  1990. </script>
  1991. </body>
  1992. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement