Browse Source
PGR & Admin Module Added
PGR & Admin Module Added
Based on local & Server some configuration Change's added. New module Admin & PGR added.main
87 changed files with 6406 additions and 201 deletions
-
BIN.DS_Store
-
BINsrc/.DS_Store
-
BINsrc/main/.DS_Store
-
BINsrc/main/java/.DS_Store
-
BINsrc/main/java/in/.DS_Store
-
BINsrc/main/java/in/gov/.DS_Store
-
BINsrc/main/java/in/gov/chennaicorporation/.DS_Store
-
BINsrc/main/java/in/gov/chennaicorporation/gccoffice/.DS_Store
-
3src/main/java/in/gov/chennaicorporation/gccoffice/GccOfficeApplication.java
-
6src/main/java/in/gov/chennaicorporation/gccoffice/configuration/AppConfig.java
-
13src/main/java/in/gov/chennaicorporation/gccoffice/configuration/DataSourceConfig.java
-
22src/main/java/in/gov/chennaicorporation/gccoffice/configuration/SecurityConfig.java
-
8src/main/java/in/gov/chennaicorporation/gccoffice/configuration/ThymeleafConfig.java
-
10src/main/java/in/gov/chennaicorporation/gccoffice/configuration/WebMvcConfig.java
-
329src/main/java/in/gov/chennaicorporation/gccoffice/controller/APIController.java
-
167src/main/java/in/gov/chennaicorporation/gccoffice/controller/AdminController.java
-
3src/main/java/in/gov/chennaicorporation/gccoffice/controller/MainController.java
-
6src/main/java/in/gov/chennaicorporation/gccoffice/controller/MenuController.java
-
5src/main/java/in/gov/chennaicorporation/gccoffice/controller/login.java
-
5src/main/java/in/gov/chennaicorporation/gccoffice/entity/AppModuleAccessEntity.java
-
6src/main/java/in/gov/chennaicorporation/gccoffice/entity/AppUserEntity.java
-
5src/main/java/in/gov/chennaicorporation/gccoffice/entity/MenuItemAccessEntity.java
-
3src/main/java/in/gov/chennaicorporation/gccoffice/entity/MenuItemEntity.java
-
9src/main/java/in/gov/chennaicorporation/gccoffice/entity/SubMenuItemAccessEntity.java
-
5src/main/java/in/gov/chennaicorporation/gccoffice/entity/SubMenuItemEntity.java
-
56src/main/java/in/gov/chennaicorporation/gccoffice/entity/UserActivityLog.java
-
38src/main/java/in/gov/chennaicorporation/gccoffice/interceptor/AppInterceptor.java
-
2src/main/java/in/gov/chennaicorporation/gccoffice/mtm/controller/APIController.java
-
2src/main/java/in/gov/chennaicorporation/gccoffice/mtm/controller/MainController.java
-
2src/main/java/in/gov/chennaicorporation/gccoffice/mtm/controller/MayorController.java
-
2src/main/java/in/gov/chennaicorporation/gccoffice/mtm/controller/OfficerController.java
-
94src/main/java/in/gov/chennaicorporation/gccoffice/pgr/controller/APIController.java
-
57src/main/java/in/gov/chennaicorporation/gccoffice/pgr/controller/MainController.java
-
1src/main/java/in/gov/chennaicorporation/gccoffice/pgr/controller/package-info.java
-
35src/main/java/in/gov/chennaicorporation/gccoffice/pgr/data/Departments.java
-
1src/main/java/in/gov/chennaicorporation/gccoffice/pgr/data/package-info.java
-
1src/main/java/in/gov/chennaicorporation/gccoffice/pgr/package-info.java
-
470src/main/java/in/gov/chennaicorporation/gccoffice/pgr/service/PGRCommon.java
-
1src/main/java/in/gov/chennaicorporation/gccoffice/pgr/service/package-info.java
-
2src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/controller/APIController.java
-
2src/main/java/in/gov/chennaicorporation/gccoffice/qrassetfeedback/controller/MainController.java
-
14src/main/java/in/gov/chennaicorporation/gccoffice/repository/AppModuleAccessRepository.java
-
17src/main/java/in/gov/chennaicorporation/gccoffice/repository/AppUserGroupRepository.java
-
9src/main/java/in/gov/chennaicorporation/gccoffice/repository/AppUserRepository.java
-
13src/main/java/in/gov/chennaicorporation/gccoffice/repository/MenuItemAccessRepository.java
-
13src/main/java/in/gov/chennaicorporation/gccoffice/repository/SubMenuItemAccessRepository.java
-
16src/main/java/in/gov/chennaicorporation/gccoffice/repository/UserActivityLogRepository.java
-
18src/main/java/in/gov/chennaicorporation/gccoffice/service/CustomUserDetailsService.java
-
29src/main/java/in/gov/chennaicorporation/gccoffice/service/UserActivityService.java
-
25src/main/java/in/gov/chennaicorporation/gccoffice/service/UserActivityTimelineService.java
-
13src/main/java/in/gov/chennaicorporation/gccoffice/taxcollection/controller/MainController.java
-
3src/main/java/in/gov/chennaicorporation/gccoffice/taxcollection/controller/TaxCollectionRestController.java
-
BINsrc/main/resources/.DS_Store
-
1src/main/resources/application-local.properties
-
1src/main/resources/application-production.properties
-
31src/main/resources/application.properties
-
BINsrc/main/resources/static/.DS_Store
-
BINsrc/main/resources/static/assets/.DS_Store
-
BINsrc/main/resources/static/assets/images/hi_robo.gif
-
BINsrc/main/resources/static/assets/images/search_ani.gif
-
2src/main/resources/static/assets/node_modules/datatable/DataTables-1.13.6/css/jquery.dataTables.min.css
-
BINsrc/main/resources/templates/.DS_Store
-
4src/main/resources/templates/error-403.html
-
4src/main/resources/templates/error-404.html
-
4src/main/resources/templates/error-500.html
-
53src/main/resources/templates/fragments/modules/admin/modal-box.html
-
100src/main/resources/templates/fragments/modules/base/head.html
-
4src/main/resources/templates/fragments/modules/base/header.html
-
2src/main/resources/templates/fragments/modules/base/menu.html
-
109src/main/resources/templates/fragments/modules/base/script.html
-
22src/main/resources/templates/fragments/modules/mtm/script.html
-
68src/main/resources/templates/fragments/modules/pgr/modal-box.html
-
275src/main/resources/templates/fragments/modules/pgr/script.html
-
19src/main/resources/templates/fragments/modules/pgr/search_form.html
-
6src/main/resources/templates/login.html
-
92src/main/resources/templates/modules/admin/index.html
-
272src/main/resources/templates/modules/admin/user-group-access.html
-
183src/main/resources/templates/modules/admin/user-group-list.html
-
226src/main/resources/templates/modules/admin/user-list.html
-
284src/main/resources/templates/modules/pgr/all-list.html
-
792src/main/resources/templates/modules/pgr/index.html
-
299src/main/resources/templates/modules/pgr/qa-qc-list.html
-
648src/main/resources/templates/modules/pgr/zone-wise-with-reopen.html
-
646src/main/resources/templates/modules/pgr/zone-wise-without-reopen.html
-
6src/main/resources/templates/modules/taxcollection/index.html
-
100src/main/resources/templates/modules/taxcollection/request-create.html
-
813src/main/resources/templates/modules/taxcollection/request-list.html
@ -1,10 +1,337 @@ |
|||||
package in.gov.chennaicorporation.gccoffice.controller; |
package in.gov.chennaicorporation.gccoffice.controller; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.time.LocalDateTime; |
||||
|
import java.time.format.DateTimeFormatter; |
||||
|
|
||||
|
import org.hibernate.dialect.identity.GetGeneratedKeysDelegate; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||
import org.springframework.web.bind.annotation.RestController; |
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
@RequestMapping("/api") |
|
||||
|
import in.gov.chennaicorporation.gccoffice.entity.AppModuleAccessEntity; |
||||
|
import in.gov.chennaicorporation.gccoffice.entity.AppModuleEntity; |
||||
|
import in.gov.chennaicorporation.gccoffice.entity.AppUserEntity; |
||||
|
import in.gov.chennaicorporation.gccoffice.entity.MenuItemAccessEntity; |
||||
|
import in.gov.chennaicorporation.gccoffice.entity.MenuItemEntity; |
||||
|
import in.gov.chennaicorporation.gccoffice.entity.SubMenuItemAccessEntity; |
||||
|
import in.gov.chennaicorporation.gccoffice.entity.SubMenuItemEntity; |
||||
|
import in.gov.chennaicorporation.gccoffice.entity.UserActivityLog; |
||||
|
import in.gov.chennaicorporation.gccoffice.repository.AppModuleAccessRepository; |
||||
|
import in.gov.chennaicorporation.gccoffice.repository.AppModuleRepository; |
||||
|
import in.gov.chennaicorporation.gccoffice.repository.AppUserGroupRepository; |
||||
|
import in.gov.chennaicorporation.gccoffice.repository.AppUserRepository; |
||||
|
import in.gov.chennaicorporation.gccoffice.repository.MenuItemAccessRepository; |
||||
|
import in.gov.chennaicorporation.gccoffice.repository.MenuItemRepository; |
||||
|
import in.gov.chennaicorporation.gccoffice.repository.SubMenuItemAccessRepository; |
||||
|
import in.gov.chennaicorporation.gccoffice.repository.SubMenuItemRepository; |
||||
|
import in.gov.chennaicorporation.gccoffice.repository.UserActivityLogRepository; |
||||
|
import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo; |
||||
|
|
||||
|
@RequestMapping("/gcc/api") |
||||
@RestController |
@RestController |
||||
public class APIController { |
public class APIController { |
||||
|
|
||||
|
List<AppUserEntity> getAppUserEntities; |
||||
|
@Autowired |
||||
|
private AppUserRepository appUserRepository; |
||||
|
|
||||
|
List<UserActivityLog> getActivityLogs; |
||||
|
@Autowired |
||||
|
private UserActivityLogRepository userActivityLogRepository; |
||||
|
|
||||
|
List<AppModuleAccessEntity> getAppModuleAccessEntities; |
||||
|
List<MenuItemAccessEntity> getMenuItemAccessEntities; |
||||
|
List<SubMenuItemAccessEntity> getSubMenuItemAccessEntities; |
||||
|
|
||||
|
@Autowired |
||||
|
private AppModuleAccessRepository appModuleAccessRepository; |
||||
|
@Autowired |
||||
|
private MenuItemAccessRepository menuItemAccessRepository; |
||||
|
@Autowired |
||||
|
private SubMenuItemAccessRepository subMenuItemAccessRepository; |
||||
|
|
||||
|
List<AppModuleEntity> getAppModuleEntities; |
||||
|
List<MenuItemEntity> getMenuItemEntities; |
||||
|
List<SubMenuItemEntity> getSubMenuItemEntities; |
||||
|
|
||||
|
@Autowired |
||||
|
private AppModuleRepository appModuleRepository; |
||||
|
@Autowired |
||||
|
private MenuItemRepository menuItemRepository; |
||||
|
@Autowired |
||||
|
private SubMenuItemRepository subMenuItemRepository; |
||||
|
|
||||
|
@Autowired |
||||
|
public APIController( |
||||
|
AppModuleRepository appModuleRepository, |
||||
|
MenuItemRepository menuItemRepository, |
||||
|
SubMenuItemRepository subMenuItemRepository, |
||||
|
AppModuleAccessRepository appModuleAccessRepository, |
||||
|
MenuItemAccessRepository menuItemAccessRepository, |
||||
|
SubMenuItemAccessRepository subMenuItemAccessRepository, |
||||
|
UserActivityLogRepository userActivityLogRepository) { |
||||
|
|
||||
|
this.appModuleRepository = appModuleRepository; |
||||
|
this.menuItemRepository = menuItemRepository; |
||||
|
this.subMenuItemRepository = subMenuItemRepository; |
||||
|
|
||||
|
this.appModuleAccessRepository = appModuleAccessRepository; |
||||
|
this.menuItemAccessRepository = menuItemAccessRepository; |
||||
|
this.subMenuItemAccessRepository = subMenuItemAccessRepository; |
||||
|
this.userActivityLogRepository = userActivityLogRepository; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@GetMapping(value="/getAccessTree") |
||||
|
public String getAccessTreeHTML(@RequestParam String groupId,@RequestParam String groupName) { |
||||
|
|
||||
|
getAppModuleEntities = appModuleRepository.showAll(); |
||||
|
|
||||
|
String accessHTML = ""; |
||||
|
String accessTableHTML = ""; |
||||
|
String MenuHTML = ""; |
||||
|
String isSelected = ""; |
||||
|
//String subMenuHTML = ""; |
||||
|
|
||||
|
String groupNameHTML = "<span class=\"badge badge-pill badge-primary mb-1\">"+groupName+"</span>"; |
||||
|
for (AppModuleEntity moduleName : getAppModuleEntities) { |
||||
|
|
||||
|
// ID to check |
||||
|
Integer desiredId = moduleName.getId(); |
||||
|
|
||||
|
// Check if the ID exists in the list of entities |
||||
|
getAppModuleAccessEntities = appModuleAccessRepository.findByAll(groupId,desiredId.toString()); |
||||
|
// Check Module Id Access |
||||
|
if (getAppModuleAccessEntities != null && !getAppModuleAccessEntities.isEmpty()) { isSelected = "checked"; } else { isSelected = ""; } |
||||
|
|
||||
|
accessHTML = accessHTML+"<li><input id=\"m"+moduleName.getId()+"\" type=\"checkbox\" data-type=\"parent\" value=\"m_"+desiredId+"\" "+isSelected+"/> <label for=\"m"+moduleName.getId()+"\" style=\"background-color:#000;color:#fff;\"> <i class=\""+moduleName.getIcon()+"\"></i> "+moduleName.getName()+" </label>"; |
||||
|
|
||||
|
|
||||
|
getMenuItemEntities = menuItemRepository.getMenuItemByModuleId(moduleName.getId()); |
||||
|
|
||||
|
String subMenuHTML = ""; |
||||
|
for (MenuItemEntity menuItem : getMenuItemEntities) { |
||||
|
|
||||
|
String mmid = desiredId+"_"+menuItem.getId(); |
||||
|
// Check if the ID exists in the list of entities |
||||
|
getMenuItemAccessEntities = menuItemAccessRepository.findByAll(groupId, desiredId.toString(),menuItem.getId().toString()); |
||||
|
// Check Module Id Access |
||||
|
if (getMenuItemAccessEntities != null && !getMenuItemAccessEntities.isEmpty()) { isSelected = "checked"; } else { isSelected = ""; } |
||||
|
|
||||
|
if(menuItem.getHasSub()) { |
||||
|
|
||||
|
getSubMenuItemEntities = subMenuItemRepository.getSubMenuItemByMenuItemId(menuItem.getId()); |
||||
|
String subSubMenuHTML = ""; |
||||
|
for (SubMenuItemEntity subMenuItem : getSubMenuItemEntities) { |
||||
|
String isSelected2 = ""; |
||||
|
String smid = desiredId+"_"+menuItem.getId()+"_"+subMenuItem.getId(); |
||||
|
// Check if the ID exists in the list of entities |
||||
|
getSubMenuItemAccessEntities = subMenuItemAccessRepository.findByAll(groupId, desiredId.toString(),menuItem.getId().toString(),subMenuItem.getId().toString()); |
||||
|
// Check Module Id Access |
||||
|
if (getSubMenuItemAccessEntities != null && !getSubMenuItemAccessEntities.isEmpty()) { isSelected2 = "checked"; } else { isSelected2 = ""; } |
||||
|
|
||||
|
subSubMenuHTML = subSubMenuHTML+"<li><input id=\"sm"+subMenuItem.getId()+"\" type=\"checkbox\" data-type=\"sub-child\" value=\"sm_"+smid+"\" "+isSelected2+"/> <label for=\"sm"+subMenuItem.getId()+"\"><i class=\""+subMenuItem.getIcon()+"\"></i> "+subMenuItem.getName()+"</label></li>"; |
||||
|
} |
||||
|
if(subSubMenuHTML.equals("")) |
||||
|
{ |
||||
|
subMenuHTML = subMenuHTML+"<li><input id=\"mm"+menuItem.getId()+"\" type=\"checkbox\" data-type=\"child\" value=\"mm_"+mmid+"\" "+isSelected+"/> <label for=\"mm"+menuItem.getId()+"\"><i class=\""+menuItem.getIcon()+"\"></i> "+menuItem.getName()+"</label></li>"; |
||||
|
} |
||||
|
else { |
||||
|
subMenuHTML = subMenuHTML+"<li><input id=\"mm"+menuItem.getId()+"\" type=\"checkbox\" data-type=\"child\" value=\"mm_"+mmid+"\" "+isSelected+"/> <label for=\"mm"+menuItem.getId()+"\"> <i class=\""+menuItem.getIcon()+"\"></i> "+menuItem.getName()+"</label> <ul>"+subSubMenuHTML+"</ul></li>"; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
else { |
||||
|
subMenuHTML = subMenuHTML+"<li><input id=\"mm"+menuItem.getId()+"\" type=\"checkbox\" data-type=\"child\" value=\"mm_"+mmid+"\" "+isSelected+"/> <label for=\"mm"+menuItem.getId()+"\"><i class=\""+menuItem.getIcon()+"\"></i> "+menuItem.getName()+"</label></li>"; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
accessHTML = accessHTML+"<ul>"+subMenuHTML+"</ul></li>"; |
||||
|
subMenuHTML = ""; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
accessTableHTML = groupNameHTML+"<ul id=\"tree\" class=\"checktree\" style=\"padding-left:25px;\" >"+accessHTML+"</ul>"; |
||||
|
|
||||
|
return accessTableHTML; |
||||
|
} |
||||
|
|
||||
|
@PostMapping("/saveGroupAccessData") |
||||
|
public String saveGroupAccessData(@RequestBody Map<String, Object> requestBody) { |
||||
|
@SuppressWarnings("unchecked") |
||||
|
List<String> checkedData = (List<String>) requestBody.get("checkedData"); |
||||
|
String groupId = (String) requestBody.get("groupId"); |
||||
|
String dataType[]= {"","", "module","menu","submenu"}; |
||||
|
if (groupId != null) { |
||||
|
System.out.println("groupid value: " + groupId); |
||||
|
|
||||
|
// Set isActive = false based on groupId |
||||
|
appModuleAccessRepository.updateActiveStatus(false,groupId); |
||||
|
menuItemAccessRepository.updateActiveStatus(false,groupId); |
||||
|
subMenuItemAccessRepository.updateActiveStatus(false,groupId); |
||||
|
|
||||
|
// Now update as per input data |
||||
|
if (checkedData != null) { |
||||
|
for (String data : checkedData) { |
||||
|
System.out.println(data); |
||||
|
|
||||
|
// m_x -> Module Value (moduleId) -> 2 |
||||
|
// mm_x_x -> Menu Value (moduleId,menuId) ->3 |
||||
|
// sm_x_x_x -> SubMenu Value (moduleId, menuId, submenuId) ->4 |
||||
|
|
||||
|
String[] dataValue = data.split("_"); |
||||
|
Integer dataLength = dataValue.length; |
||||
|
System.out.println(dataLength +" ==> "+dataType[dataLength]); |
||||
|
|
||||
|
if(dataValue.length==2) { // Module |
||||
|
// Check if the ID exists in the list of entities |
||||
|
getAppModuleAccessEntities = appModuleAccessRepository.findByAll(groupId, dataValue[1]); |
||||
|
if (getAppModuleAccessEntities != null && !getAppModuleAccessEntities.isEmpty()) { |
||||
|
appModuleAccessRepository.update(true,groupId,dataValue[1]); |
||||
|
} |
||||
|
else { |
||||
|
appModuleAccessRepository.insert(groupId,dataValue[1]); |
||||
|
} |
||||
|
} |
||||
|
else if(dataValue.length==3) { // Menu |
||||
|
// Check if the ID exists in the list of entities |
||||
|
getMenuItemAccessEntities = menuItemAccessRepository.findByAll(groupId, dataValue[1], dataValue[2]); |
||||
|
if (getMenuItemAccessEntities != null && !getMenuItemAccessEntities.isEmpty()) { |
||||
|
menuItemAccessRepository.update(true,groupId,dataValue[1],dataValue[2]); |
||||
|
} |
||||
|
else { |
||||
|
menuItemAccessRepository.insert(groupId,dataValue[1],dataValue[2]); |
||||
|
} |
||||
|
} |
||||
|
else if(dataValue.length==4) { // SubMenu |
||||
|
// Check if the ID exists in the list of entities |
||||
|
getSubMenuItemAccessEntities = subMenuItemAccessRepository.findByAll(groupId, dataValue[1], dataValue[2], dataValue[3]); |
||||
|
if (getSubMenuItemAccessEntities != null && !getSubMenuItemAccessEntities.isEmpty()) { |
||||
|
subMenuItemAccessRepository.update(true,groupId,dataValue[1],dataValue[2],dataValue[3]); |
||||
|
} |
||||
|
else { |
||||
|
subMenuItemAccessRepository.insert(groupId,dataValue[1],dataValue[2],dataValue[3]); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
return ""; |
||||
|
} |
||||
|
|
||||
|
@GetMapping(value="/getUserProfile") |
||||
|
public String getUserProfile(@RequestParam String userId) { |
||||
|
String userHtml =""; |
||||
|
String userProfileHtml =""; |
||||
|
String userProfileTimelineHtml =""; |
||||
|
getAppUserEntities = appUserRepository.showById(userId); |
||||
|
for (AppUserEntity appUserEntity : getAppUserEntities) { |
||||
|
|
||||
|
userProfileHtml = "" |
||||
|
+ " <div class='col-lg-4 col-md-5'>" |
||||
|
+ " <div class='card mb-1'>" |
||||
|
+ " <div class='card-body'>" |
||||
|
+ " <div class='text-center'>" |
||||
|
+ " <img src='/assets/images/users/user.jpg' class='rounded' width='150'>\n" |
||||
|
+ " <h4 class='card-title mt-10'>"+appUserEntity.getUserid().getName()+"</h4>\n" |
||||
|
+ " <p class='text-muted'>Front End Developer</p>\n" |
||||
|
+ " </div>\n" |
||||
|
+ " </div>" |
||||
|
+ " <hr class='mb-0 mt-0'> \n" |
||||
|
+ " <div class='card-body'> \n" |
||||
|
+ " <small class='text-muted d-block'>Email address </small>\n" |
||||
|
+ " <h8>"+appUserEntity.getUserid().getEmail()+"</h8> \n" |
||||
|
+ " <small class='text-muted d-block pt-10'>Phone</small>\n" |
||||
|
+ " <h8>"+appUserEntity.getUserid().getPhone()+"</h8> \n" |
||||
|
+ " <small class='text-muted d-block pt-10'>Role</small>\n" |
||||
|
+ " <h8>"+appUserEntity.getRoles()+"</h8>\n" |
||||
|
+ " <small class='text-muted d-block pt-10'>Access Group</small>\n" |
||||
|
+ " <h8>"+appUserEntity.getUsergroup_id().getName()+"</h8>\n" |
||||
|
+ " </div>\n" |
||||
|
+ " </div>\n" |
||||
|
+ " </div>"; |
||||
|
|
||||
|
userProfileTimelineHtml = "" |
||||
|
+ "<div class='col-lg-8 col-md-7'>" |
||||
|
+ " <div class='card'>" |
||||
|
+ " <ul class='nav nav-pills custom-pills' id='pills-tab' role='tablist'>" |
||||
|
+ " <li class='nav-item'>" |
||||
|
+ " <a class='nav-link active' id='pills-timeline-tab' data-toggle='pill' href='#current-month' role='tab' aria-controls='pills-timeline' aria-selected='true'>Timeline</a>" |
||||
|
+ " </li>" |
||||
|
+ " <li class='nav-item'>" |
||||
|
+ " <a class='nav-link' id='pills-profile-tab' data-toggle='pill' href='#last-month' role='tab' aria-controls='pills-profile' aria-selected='false'>Profile</a>" |
||||
|
+ " </li>" |
||||
|
+ " </ul>" |
||||
|
+ " <div class='tab-content' id='pills-tabContent'>" |
||||
|
+ " <div class='tab-pane fade active show' id='current-month' role='tabpanel' aria-labelledby='pills-timeline-tab'>" |
||||
|
+ userTimeLine(appUserEntity.getUserid().getUserid().toString(),appUserEntity.getUserid().getName(),"user.jpg") |
||||
|
+ " </div>" |
||||
|
+ " </div>" |
||||
|
+ " </div>" |
||||
|
+ "</div>"; |
||||
|
|
||||
|
userHtml ="<div class='row'>" + userProfileHtml + userProfileTimelineHtml + "</div>"; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
return userHtml; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
public String userTimeLine(String userid, String userName, String img) { |
||||
|
|
||||
|
|
||||
|
String userTimeLineHTML = ""; |
||||
|
|
||||
|
getActivityLogs = userActivityLogRepository.findByUserIdOrderByTimestampDesc(userid); |
||||
|
for (UserActivityLog userActivityLog : getActivityLogs) { |
||||
|
userTimeLineHTML += "" |
||||
|
+ " <div class='sl-item'>" |
||||
|
+ " <div class='sl-left'> " |
||||
|
+ " <img src='/assets/images/users/"+img+"' alt='user' class='rounded-circle'> " |
||||
|
+ " </div>" |
||||
|
+ " <div class='sl-right'>" |
||||
|
+ " <div>" |
||||
|
+ " <a href='javascript:void(0)' class='link'>"+userName+"</a> " |
||||
|
+ " <span class='sl-date'>"+dateFormat(userActivityLog.getTimestamp().toString())+"</span>" |
||||
|
+ " <blockquote class='mt-10'>" |
||||
|
+ " "+userActivityLog.getActivityType() |
||||
|
+ " </blockquote>" |
||||
|
+ " </div>" |
||||
|
+ " </div>" |
||||
|
+ " </div><hr>"; |
||||
|
} |
||||
|
userTimeLineHTML = "" |
||||
|
+ "<div class='card-body'>" |
||||
|
+ " <div class='profiletimeline mt-0'>" |
||||
|
+ userTimeLineHTML |
||||
|
+ " </div>" |
||||
|
+ "</div>"; |
||||
|
|
||||
|
return userTimeLineHTML; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
public String dateFormat(String timestampString) { |
||||
|
//String timestampString = "2023-12-28T16:21:24"; |
||||
|
LocalDateTime timestamp = LocalDateTime.parse(timestampString, DateTimeFormatter.ISO_DATE_TIME); |
||||
|
|
||||
|
// Define the desired date-time format |
||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy hh:mm a"); |
||||
|
|
||||
|
// Format the timestamp |
||||
|
String formattedTimestamp = timestamp.format(formatter); |
||||
|
|
||||
|
//System.out.println(formattedTimestamp); |
||||
|
return formattedTimestamp.toUpperCase(); |
||||
|
} |
||||
} |
} |
||||
@ -0,0 +1,167 @@ |
|||||
|
package in.gov.chennaicorporation.gccoffice.controller; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.ui.Model; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
|
||||
|
import in.gov.chennaicorporation.gccoffice.entity.AppModuleAccessEntity; |
||||
|
import in.gov.chennaicorporation.gccoffice.entity.AppModuleEntity; |
||||
|
import in.gov.chennaicorporation.gccoffice.entity.AppUserEntity; |
||||
|
import in.gov.chennaicorporation.gccoffice.entity.AppUserGroupEntity; |
||||
|
import in.gov.chennaicorporation.gccoffice.entity.MenuItemAccessEntity; |
||||
|
import in.gov.chennaicorporation.gccoffice.entity.MenuItemEntity; |
||||
|
import in.gov.chennaicorporation.gccoffice.entity.SubMenuItemAccessEntity; |
||||
|
import in.gov.chennaicorporation.gccoffice.entity.SubMenuItemEntity; |
||||
|
import in.gov.chennaicorporation.gccoffice.qrassetfeedback.data.AssetCategory; |
||||
|
import in.gov.chennaicorporation.gccoffice.repository.AppModuleAccessRepository; |
||||
|
import in.gov.chennaicorporation.gccoffice.repository.AppModuleRepository; |
||||
|
import in.gov.chennaicorporation.gccoffice.repository.AppUserGroupRepository; |
||||
|
import in.gov.chennaicorporation.gccoffice.repository.AppUserRepository; |
||||
|
import in.gov.chennaicorporation.gccoffice.repository.MenuItemAccessRepository; |
||||
|
import in.gov.chennaicorporation.gccoffice.repository.MenuItemRepository; |
||||
|
import in.gov.chennaicorporation.gccoffice.repository.SubMenuItemAccessRepository; |
||||
|
import in.gov.chennaicorporation.gccoffice.repository.SubMenuItemRepository; |
||||
|
import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo; |
||||
|
|
||||
|
@RequestMapping("/gcc/admin") |
||||
|
@Controller("gccAdminController") |
||||
|
public class AdminController { |
||||
|
private final LoginUserInfo loginUserInfo; |
||||
|
|
||||
|
private final AppUserRepository appUserRepository; |
||||
|
private final AppUserGroupRepository appUserGroupRepository; |
||||
|
|
||||
|
private final AppModuleRepository appModuleRepository; |
||||
|
private final MenuItemRepository menuItemRepository; |
||||
|
private final SubMenuItemRepository subMenuItemRepository; |
||||
|
|
||||
|
private final AppModuleAccessRepository appModuleAccessRepository; |
||||
|
private final MenuItemAccessRepository menuItemAccessRepository; |
||||
|
private final SubMenuItemAccessRepository subMenuItemAccessRepository; |
||||
|
|
||||
|
@Autowired |
||||
|
public AdminController(LoginUserInfo loginUserInfo, |
||||
|
AppUserRepository appUserRepository, |
||||
|
AppUserGroupRepository appUserGroupRepository, |
||||
|
AppModuleRepository appModuleRepository, |
||||
|
MenuItemRepository menuItemRepository, |
||||
|
SubMenuItemRepository subMenuItemRepository, |
||||
|
AppModuleAccessRepository appModuleAccessRepository, |
||||
|
MenuItemAccessRepository menuItemAccessRepository, |
||||
|
SubMenuItemAccessRepository subMenuItemAccessRepository) { |
||||
|
|
||||
|
this.loginUserInfo = loginUserInfo; |
||||
|
|
||||
|
this.appUserRepository = appUserRepository; |
||||
|
this.appUserGroupRepository = appUserGroupRepository; |
||||
|
|
||||
|
this.appModuleRepository = appModuleRepository; |
||||
|
this.menuItemRepository = menuItemRepository; |
||||
|
this.subMenuItemRepository = subMenuItemRepository; |
||||
|
|
||||
|
this.appModuleAccessRepository = appModuleAccessRepository; |
||||
|
this.menuItemAccessRepository = menuItemAccessRepository; |
||||
|
this.subMenuItemAccessRepository = subMenuItemAccessRepository; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@GetMapping({"", "/", "/index"}) |
||||
|
public String main(Model model) { |
||||
|
String userId = LoginUserInfo.getLoginUserId(); |
||||
|
if (userId != null && !userId.isEmpty()) { |
||||
|
System.out.println("String UserID: " + userId); |
||||
|
} |
||||
|
return "modules/admin/index"; |
||||
|
} |
||||
|
|
||||
|
@GetMapping("/user-list") |
||||
|
public String userList(Model model) { |
||||
|
model.addAttribute("userlist",getUser()); |
||||
|
return "modules/admin/user-list"; |
||||
|
} |
||||
|
|
||||
|
@GetMapping("/user-group-list") |
||||
|
public String userGroupList(Model model) { |
||||
|
model.addAttribute("userGroupList",getUserGroup()); |
||||
|
return "modules/admin/user-group-list"; |
||||
|
} |
||||
|
|
||||
|
@GetMapping("/user-group-access") |
||||
|
public String userGroupAccess(Model model) { |
||||
|
String accessTableHTML = getAccessTreeHTML(); |
||||
|
model.addAttribute("userGroupList",getUserGroup()); |
||||
|
model.addAttribute("accessHTML",accessTableHTML); |
||||
|
return "modules/admin/user-group-access"; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
//////////////////////////////////////// (Functions) //////////////////////////////////////// |
||||
|
|
||||
|
public List<AppUserEntity> getUser() { |
||||
|
List<AppUserEntity> appUserEntities; |
||||
|
appUserEntities = appUserRepository.showAll(); |
||||
|
return appUserEntities; |
||||
|
} |
||||
|
|
||||
|
public List<AppUserGroupEntity> getUserGroup() { |
||||
|
List<AppUserGroupEntity> appUserGroupEntities; |
||||
|
appUserGroupEntities = appUserGroupRepository.findAll(); |
||||
|
return appUserGroupEntities; |
||||
|
} |
||||
|
|
||||
|
public String getAccessTreeHTML() { |
||||
|
|
||||
|
List<AppModuleAccessEntity> getAppModuleAccessEntities; |
||||
|
List<AppModuleEntity> getAppModuleEntities; |
||||
|
|
||||
|
getAppModuleEntities = appModuleRepository.showAll(); |
||||
|
|
||||
|
String accessHTML = ""; |
||||
|
String accessTableHTML = ""; |
||||
|
String MenuHTML = ""; |
||||
|
//String subMenuHTML = ""; |
||||
|
for (AppModuleEntity moduleName : getAppModuleEntities) { |
||||
|
|
||||
|
accessHTML = accessHTML+"<li><input id=\"m"+moduleName.getId()+"\" type=\"checkbox\" data-type=\"parent\" value=\"\"/> <label for=\"m"+moduleName.getId()+"\" style=\"background-color:#000;color:#fff;\"> <i class=\""+moduleName.getIcon()+"\"></i> "+moduleName.getName()+" </label>"; |
||||
|
|
||||
|
List<MenuItemEntity> getMenuItems; |
||||
|
getMenuItems = menuItemRepository.getMenuItemByModuleId(moduleName.getId()); |
||||
|
|
||||
|
String subMenuHTML = ""; |
||||
|
for (MenuItemEntity menuItem : getMenuItems) { |
||||
|
|
||||
|
if(menuItem.getHasSub()) { |
||||
|
|
||||
|
List<SubMenuItemEntity> getMenuSubItems = subMenuItemRepository.getSubMenuItemByMenuItemId(menuItem.getId()); |
||||
|
String subSubMenuHTML = ""; |
||||
|
for (SubMenuItemEntity subMenuItem : getMenuSubItems) { |
||||
|
subSubMenuHTML = subSubMenuHTML+"<li><input id=\"sm"+subMenuItem.getId()+"\" type=\"checkbox\" data-type=\"sub-child\"/> <label for=\"sm"+subMenuItem.getId()+"\"><i class=\""+subMenuItem.getIcon()+"\"></i> "+subMenuItem.getName()+"</label></li>"; |
||||
|
} |
||||
|
if(subSubMenuHTML.equals("")) |
||||
|
{ |
||||
|
subMenuHTML = subMenuHTML+"<li><input id=\"mm"+menuItem.getId()+"\" type=\"checkbox\" data-type=\"child\" /> <label for=\"mm"+menuItem.getId()+"\"><i class=\""+menuItem.getIcon()+"\"></i> "+menuItem.getName()+"</label></li>"; |
||||
|
} |
||||
|
else { |
||||
|
subMenuHTML = subMenuHTML+"<li><input id=\"mm"+menuItem.getId()+"\" type=\"checkbox\" data-type=\"child\"/> <label for=\"mm"+menuItem.getId()+"\"><i class=\""+menuItem.getIcon()+"\"></i> "+menuItem.getName()+"</label> <ul>"+subSubMenuHTML+"</ul></li>"; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
else { |
||||
|
subMenuHTML = subMenuHTML+"<li><input id=\"mm"+menuItem.getId()+"\" type=\"checkbox\" data-type=\"child\"/> <label for=\"mm"+menuItem.getId()+"\"><i class=\""+menuItem.getIcon()+"\"></i> "+menuItem.getName()+"</label></li>"; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
accessHTML = accessHTML+"<ul>"+subMenuHTML+"</ul></li>"; |
||||
|
subMenuHTML = ""; |
||||
|
} |
||||
|
|
||||
|
accessTableHTML = "<ul id=\"tree\" class=\"checktree\">"+accessHTML+"</ul>"; |
||||
|
|
||||
|
return accessTableHTML; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,56 @@ |
|||||
|
package in.gov.chennaicorporation.gccoffice.entity; |
||||
|
|
||||
|
import javax.persistence.*; |
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
@Entity |
||||
|
@Table(name = "user_activity_log") |
||||
|
public class UserActivityLog { |
||||
|
|
||||
|
@Id |
||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY) |
||||
|
private Long id; |
||||
|
|
||||
|
private String userId; |
||||
|
|
||||
|
private String activityType; |
||||
|
|
||||
|
private LocalDateTime timestamp; |
||||
|
|
||||
|
public UserActivityLog() { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public Long getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(Long id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getUserId() { |
||||
|
return userId; |
||||
|
} |
||||
|
|
||||
|
public void setUserId(String userId) { |
||||
|
this.userId = userId; |
||||
|
} |
||||
|
|
||||
|
public String getActivityType() { |
||||
|
return activityType; |
||||
|
} |
||||
|
|
||||
|
public void setActivityType(String activityType) { |
||||
|
this.activityType = activityType; |
||||
|
} |
||||
|
|
||||
|
public LocalDateTime getTimestamp() { |
||||
|
return timestamp; |
||||
|
} |
||||
|
|
||||
|
public void setTimestamp(LocalDateTime timestamp) { |
||||
|
this.timestamp = timestamp; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,94 @@ |
|||||
|
package in.gov.chennaicorporation.gccoffice.pgr.controller; |
||||
|
|
||||
|
import java.net.URLDecoder; |
||||
|
import java.io.UnsupportedEncodingException; |
||||
|
import java.util.List; |
||||
|
|
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import in.gov.chennaicorporation.gccoffice.pgr.service.PGRCommon; |
||||
|
import in.gov.chennaicorporation.gccoffice.repository.UserActivityLogRepository; |
||||
|
|
||||
|
@RequestMapping("/gcc/api/pgr") |
||||
|
@RestController("pgrRest") |
||||
|
public class APIController { |
||||
|
|
||||
|
private PGRCommon pgrCommon; |
||||
|
|
||||
|
@Autowired |
||||
|
public APIController(PGRCommon pgrCommon) { |
||||
|
|
||||
|
this.pgrCommon = pgrCommon; |
||||
|
} |
||||
|
|
||||
|
@GetMapping(value="/getDepartments") |
||||
|
public List getDepartmentList() { |
||||
|
return pgrCommon.getDeaprtmentList(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping(value="/getPendingComplaintCount") |
||||
|
public List getPendingComplaintCount() { |
||||
|
return pgrCommon.getPendingComplanitCount(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping(value="/getZoneWisePendingComplaintCount") |
||||
|
public List getZoneWisePendingComplaintCount() { |
||||
|
return pgrCommon.getZoneWisePendingComplanitCount(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping(value="/getZoneWiseReopenComplaintCount") |
||||
|
public List getZoneWiseReopenComplaintCount() { |
||||
|
return pgrCommon.getZoneWiseReopenComplanitCount(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping(value="/getComplaintsList") |
||||
|
public List getComplaintsList() { |
||||
|
return pgrCommon.getComplaintsList(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping(value="/getQaQcList") |
||||
|
public List getQaQcList() { |
||||
|
return pgrCommon.getQaQcList(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping(value="/getZoneWiseComplaintCountList") |
||||
|
public List getZoneWiseComplaintList() { |
||||
|
return pgrCommon.getZoneWiseComplaintCountList(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping(value="/getZoneWiseWithoutReopenComplaintList") |
||||
|
public List getZoneWiseWithoutReopenComplaintList() { |
||||
|
return pgrCommon.getZoneWiseWithoutReopenComplaintCountList(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping(value="/getComplaintDetails") |
||||
|
public List getComplaintDetails(@RequestParam("complaintNumber") String complaintNumber) { |
||||
|
return pgrCommon.getComplaintDetails(complaintNumber); |
||||
|
} |
||||
|
|
||||
|
// For Sub Pages |
||||
|
@GetMapping(value="/getZoneWiseOfficerComplaintCountList") |
||||
|
public List getZoneWiseOfficerComplaintCountList(@RequestParam("deptid") String deptid, @RequestParam("complainttype") String complainttype) { |
||||
|
return pgrCommon.getZoneWiseOfficerComplaintCountList(deptid, complainttype); |
||||
|
} |
||||
|
|
||||
|
@GetMapping(value="/getZoneWiseOfficerComplaintList") |
||||
|
public List getZoneWiseOfficerComplaintList(@RequestParam("deptid") String deptid, @RequestParam("complainttype") String complainttype, @RequestParam("iduser") String iduser) { |
||||
|
return pgrCommon.getZoneWiseOfficerComplaintList(deptid, complainttype,iduser); |
||||
|
} |
||||
|
|
||||
|
@GetMapping(value="/getZoneWiseOfficerWithoutReopenComplaintCountList") |
||||
|
public List getZoneWiseOfficerWithoutReopenComplaintCountList(@RequestParam("deptid") String deptid, @RequestParam("complainttype") String complainttype) { |
||||
|
return pgrCommon.getZoneWiseOfficerWithoutReopenComplaintCountList(deptid, complainttype); |
||||
|
} |
||||
|
|
||||
|
@GetMapping(value="/getZoneWiseOfficerWithoutReopenComplaintList") |
||||
|
public List getZoneWiseOfficerWithoutReopenComplaintList(@RequestParam("deptid") String deptid, @RequestParam("complainttype") String complainttype, @RequestParam("iduser") String iduser) { |
||||
|
return pgrCommon.getZoneWiseOfficerWithoutReopenComplaintList(deptid, complainttype,iduser); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,57 @@ |
|||||
|
package in.gov.chennaicorporation.gccoffice.pgr.controller; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.ui.Model; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
|
||||
|
import in.gov.chennaicorporation.gccoffice.pgr.service.PGRCommon; |
||||
|
import in.gov.chennaicorporation.gccoffice.service.LoginUserInfo; |
||||
|
|
||||
|
@RequestMapping("/gcc/pgr") |
||||
|
@Controller("pgrController") |
||||
|
public class MainController { |
||||
|
private final LoginUserInfo loginUserInfo; |
||||
|
private final PGRCommon dashboards; |
||||
|
|
||||
|
@Autowired |
||||
|
public MainController(LoginUserInfo loginUserInfo, |
||||
|
PGRCommon dashboards) { |
||||
|
this.loginUserInfo = loginUserInfo; |
||||
|
this.dashboards = dashboards; |
||||
|
} |
||||
|
|
||||
|
@GetMapping({"", "/", "/index"}) |
||||
|
public String main(Model model) { |
||||
|
String userId = LoginUserInfo.getLoginUserId(); |
||||
|
if (userId != null && !userId.isEmpty()) { |
||||
|
System.out.println("String UserID: " + userId); |
||||
|
} |
||||
|
return "modules/pgr/index"; |
||||
|
} |
||||
|
|
||||
|
@GetMapping("/all-list") |
||||
|
public String allList(Model model) { |
||||
|
return "modules/pgr/all-list"; |
||||
|
} |
||||
|
|
||||
|
@GetMapping("/qa-qc-list") |
||||
|
public String qaqcList(Model model) { |
||||
|
return "modules/pgr/qa-qc-list"; |
||||
|
} |
||||
|
|
||||
|
@GetMapping("/zone-wise-with-reopen") |
||||
|
public String zoneWiseWithReopnList(Model model) { |
||||
|
return "modules/pgr/zone-wise-with-reopen"; |
||||
|
} |
||||
|
|
||||
|
@GetMapping("/zone-wise-without-reopen") |
||||
|
public String zoneWiseWithoutReopnList(Model model) { |
||||
|
return "modules/pgr/zone-wise-without-reopen"; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1 @@ |
|||||
|
package in.gov.chennaicorporation.gccoffice.pgr.controller; |
||||
@ -0,0 +1,35 @@ |
|||||
|
package in.gov.chennaicorporation.gccoffice.pgr.data; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonCreator; |
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
|
||||
|
public class Departments { |
||||
|
|
||||
|
private String id; |
||||
|
private String name; |
||||
|
|
||||
|
@JsonCreator |
||||
|
public Departments( |
||||
|
@JsonProperty("id") String id, |
||||
|
@JsonProperty("name") String name |
||||
|
) { |
||||
|
this.id = id; |
||||
|
this.name = name; |
||||
|
} |
||||
|
|
||||
|
public String getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(String id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public void setName(String name) { |
||||
|
this.name = name; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1 @@ |
|||||
|
package in.gov.chennaicorporation.gccoffice.pgr.data; |
||||
@ -0,0 +1 @@ |
|||||
|
package in.gov.chennaicorporation.gccoffice.pgr; |
||||
@ -0,0 +1,470 @@ |
|||||
|
package in.gov.chennaicorporation.gccoffice.pgr.service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
import javax.sql.DataSource; |
||||
|
import javax.transaction.Transactional; |
||||
|
|
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.beans.factory.annotation.Qualifier; |
||||
|
import org.springframework.jdbc.core.JdbcTemplate; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
@Service |
||||
|
public class PGRCommon { |
||||
|
private JdbcTemplate jdbcTemplate; |
||||
|
|
||||
|
@Autowired |
||||
|
public void setDataSource(@Qualifier("oracleDataSource") DataSource dataSource) { |
||||
|
this.jdbcTemplate = new JdbcTemplate(dataSource); |
||||
|
} |
||||
|
|
||||
|
@Transactional |
||||
|
public List<Map<String, Object>> getDeaprtmentList() { |
||||
|
|
||||
|
String SqlQuery = ""; |
||||
|
|
||||
|
SqlQuery="SELECT Distinct id_dept,dept_name " |
||||
|
+ "FROM EG_DEPARTMENT@ERP " |
||||
|
+ "WHERE NVL(dept_name, '0') NOT LIKE 'F%' AND dept_name IS NOT NULL " |
||||
|
+ "ORDER BY id_dept"; |
||||
|
|
||||
|
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
@Transactional |
||||
|
public List<Map<String, Object>> getZoneList() { |
||||
|
|
||||
|
String SqlQuery = ""; |
||||
|
|
||||
|
SqlQuery="SELECT Distinct id_dept,dept_name " |
||||
|
+ "FROM EG_DEPARTMENT@ERP " |
||||
|
+ "WHERE NVL(dept_name, '0') NOT LIKE 'F%' AND dept_name IS NOT NULL AND (id_dept >= 32 AND id_dept <= 46)" |
||||
|
+ "ORDER BY id_dept"; |
||||
|
|
||||
|
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
@Transactional |
||||
|
public List<Map<String, Object>> getPendingComplanitCount() { |
||||
|
|
||||
|
String SqlQuery = ""; |
||||
|
|
||||
|
SqlQuery = "SELECT c.dept_name, a.deptid, a.days_90, a.days_90_pen, a.days_90_reopen, " |
||||
|
+ "a.days_61_90, a.days_61_90_pen, a.days_61_90_reopen, " |
||||
|
+ "a.days_31_60, a.days_31_60_pen, a.days_31_60_reopen, " |
||||
|
+ "a.days_16_30, a.days_16_30_pen, a.days_16_30_reopen, " |
||||
|
+ "a.days_0_15, a.days_0_15_pen, a.days_0_15_reopen, " |
||||
|
+ "a.Total, a.Total_pen, a.Total_reopen " |
||||
|
+ "FROM ( " |
||||
|
+ "SELECT " |
||||
|
+ "a.deptid, " |
||||
|
+ "nvl(sum(case when sysdate - a.complaintdate > 90 then 1 end), '0') AS days_90, " |
||||
|
+ "nvl(sum(case when sysdate - a.complaintdate > 90 AND b.COMPLAINTSTATUSID IN (2, 3, 4) then 1 end), '0') AS days_90_pen, " |
||||
|
+ "nvl(sum(case when sysdate - a.complaintdate > 90 AND b.COMPLAINTSTATUSID IN (9) then 1 end), '0') AS days_90_reopen, " |
||||
|
+ "nvl(sum(case when sysdate - a.complaintdate > 60 AND sysdate - a.complaintdate <= 90 then 1 end), '0') AS days_61_90, " |
||||
|
+ "nvl(sum(case when sysdate - a.complaintdate > 60 AND sysdate - a.complaintdate <= 90 AND b.COMPLAINTSTATUSID IN (2, 3, 4) then 1 end), '0') AS days_61_90_pen, " |
||||
|
+ "nvl(sum(case when sysdate - a.complaintdate > 60 AND sysdate - a.complaintdate <= 90 AND b.COMPLAINTSTATUSID IN (9) then 1 end), '0') AS days_61_90_reopen, " |
||||
|
+ "nvl(sum(case when sysdate - a.complaintdate > 30 AND sysdate - a.complaintdate <= 60 then 1 end), '0') AS days_31_60, " |
||||
|
+ "nvl(sum(case when sysdate - a.complaintdate > 30 AND sysdate - a.complaintdate <= 60 AND b.COMPLAINTSTATUSID IN (2, 3, 4) then 1 end), '0') AS days_31_60_pen, " |
||||
|
+ "nvl(sum(case when sysdate - a.complaintdate > 30 AND sysdate - a.complaintdate <= 60 AND b.COMPLAINTSTATUSID IN (9) then 1 end), '0') AS days_31_60_reopen, " |
||||
|
+ "nvl(sum(case when sysdate - a.complaintdate > 15 AND sysdate - a.complaintdate <= 30 then 1 end), '0') AS days_16_30, " |
||||
|
+ "nvl(sum(case when sysdate - a.complaintdate > 15 AND sysdate - a.complaintdate <= 30 AND b.COMPLAINTSTATUSID IN (2, 3, 4) then 1 end), '0') AS days_16_30_pen, " |
||||
|
+ "nvl(sum(case when sysdate - a.complaintdate > 15 AND sysdate - a.complaintdate <= 30 AND b.COMPLAINTSTATUSID IN (9) then 1 end), '0') AS days_16_30_reopen, " |
||||
|
+ "nvl(sum(case when sysdate - a.complaintdate > 0 AND sysdate - a.complaintdate <= 15 then 1 end), '0') AS days_0_15, " |
||||
|
+ "nvl(sum(case when sysdate - a.complaintdate > 0 AND sysdate - a.complaintdate <= 15 AND b.COMPLAINTSTATUSID IN (2, 3, 4) then 1 end), '0') AS days_0_15_pen, " |
||||
|
+ "nvl(sum(case when sysdate - a.complaintdate > 0 AND sysdate - a.complaintdate <= 15 AND b.COMPLAINTSTATUSID IN (9) then 1 end), '0') AS days_0_15_reopen, " |
||||
|
+ "nvl(count(*), '0') AS Total, " |
||||
|
+ "nvl(count(case when b.COMPLAINTSTATUSID IN (2, 3, 4) then 1 end), '0') AS Total_pen, " |
||||
|
+ "nvl(count(case when b.COMPLAINTSTATUSID IN (9) then 1 end), '0') AS Total_reopen " |
||||
|
+ "FROM eggr_complaintdetails@erp a, eggr_redressaldetails@erp b " |
||||
|
+ "WHERE a.complaintid = b.complaintid "; |
||||
|
//25-oct-2010 |
||||
|
SqlQuery += " AND a.complaintdate >= '25-oct-2010' GROUP BY a.deptid) a, EG_DEPARTMENT@ERP c " |
||||
|
+ "WHERE a.deptid = c.id_dept AND (NVL(DEPT_NAME, 0) NOT LIKE 'F%' AND DEPT_NAME IS NOT NULL)"; |
||||
|
|
||||
|
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
@Transactional |
||||
|
public List<Map<String, Object>> getZoneWisePendingComplanitCount() { |
||||
|
|
||||
|
String SqlQuery = ""; |
||||
|
|
||||
|
SqlQuery = "SELECT deptid, DEPT_NAME" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype IN (52,146) THEN 1 END), 0) AS NonBURSTLT" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype IN (1,97) THEN 1 END), 0) AS REOFGAR" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype IN (22,32,57,59,70,113,114,130,145) THEN 1 END), 0) AS ROAD" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype IN (18,118) THEN 1 END), 0) AS MOSQUITE" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype IN (69,138) THEN 1 END), 0) AS WATER" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype IN (7,99) THEN 1 END), 0) AS REOFDEB" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype IN (71,152) THEN 1 END), 0) AS TREE" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype IN (19,119) THEN 1 END), 0) AS DOGS" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype IN (75,181) THEN 1 END), 0) AS ENCMTN" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype IN (58,112) THEN 1 END), 0) AS POT" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype IN (43,166) THEN 1 END), 0) AS PTAX" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype NOT IN (52,146,1,97,22,32,57,59,70,113,114,130,145,18,118,69,138,7,99,71,152,19,119,75,181,58,112,43,166) THEN 1 END), 0) AS OTHERS" |
||||
|
+ ", COUNT(*) AS Total FROM " |
||||
|
+ "eggr_complaintdetails@erp a" |
||||
|
+ ", eggr_redressaldetails@erp b" |
||||
|
+ ", EG_DEPARTMENT@ERP c " |
||||
|
+ "WHERE a.complaintdate >= '01-apr-2009' " |
||||
|
+ "AND a.complaintid = b.complaintid " |
||||
|
+ "AND b.COMPLAINTSTATUSID IN (2,3,4,9) " |
||||
|
+ "AND a.deptid = c.id_dept " |
||||
|
+ "AND (NVL(DEPT_NAME, 0) NOT LIKE 'F%' " |
||||
|
+ "AND DEPT_NAME IS NOT NULL) " |
||||
|
+ "GROUP BY a.deptid,c.DEPT_NAME ORDER BY a.deptid"; |
||||
|
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
@Transactional |
||||
|
public List<Map<String, Object>> getZoneWiseReopenComplanitCount() { |
||||
|
|
||||
|
String SqlQuery = ""; |
||||
|
|
||||
|
SqlQuery = "SELECT deptid, DEPT_NAME" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype IN (52,146) THEN 1 END), 0) AS NonBURSTLT" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype IN (1,97) THEN 1 END), 0) AS REOFGAR" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype IN (22,32,57,59,70,113,114,130,145) THEN 1 END), 0) AS ROAD" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype IN (18,118) THEN 1 END), 0) AS MOSQUITE" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype IN (69,138) THEN 1 END), 0) AS WATER" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype IN (7,99) THEN 1 END), 0) AS REOFDEB" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype IN (71,152) THEN 1 END), 0) AS TREE" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype IN (19,119) THEN 1 END), 0) AS DOGS" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype IN (75,181) THEN 1 END), 0) AS ENCMTN" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype IN (58,112) THEN 1 END), 0) AS POT" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype IN (43,166) THEN 1 END), 0) AS PTAX" |
||||
|
+ ", NVL(SUM(CASE WHEN complainttype NOT IN (52,146,1,97,22,32,57,59,70,113,114,130,145,18,118,69,138,7,99,71,152,19,119,75,181,58,112,43,166) THEN 1 END), 0) AS OTHERS" |
||||
|
+ ", COUNT(*) AS Total FROM " |
||||
|
+ "eggr_complaintdetails@erp a" |
||||
|
+ ", eggr_redressaldetails@erp b" |
||||
|
+ ", EG_DEPARTMENT@ERP c " |
||||
|
+ "WHERE a.complaintdate >= '01-apr-2009' " |
||||
|
+ "AND a.complaintid = b.complaintid " |
||||
|
+ "AND b.COMPLAINTSTATUSID IN (9) " |
||||
|
+ "AND a.deptid = c.id_dept " |
||||
|
+ "AND (NVL(DEPT_NAME, 0) NOT LIKE 'F%' " |
||||
|
+ "AND DEPT_NAME IS NOT NULL) " |
||||
|
+ "GROUP BY a.deptid,c.DEPT_NAME ORDER BY a.deptid"; |
||||
|
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
@Transactional |
||||
|
public List<Map<String, Object>> getComplaintsList() { |
||||
|
|
||||
|
String SqlQuery = ""; |
||||
|
|
||||
|
SqlQuery ="SELECT z.name AS zone_name, " |
||||
|
+ " dn.name AS division_name, " |
||||
|
+ " location.name AS location, " |
||||
|
+ " d.dept_name, " |
||||
|
+ " TO_CHAR(cd.complaintdate, 'dd-mm-yyyy') AS COMPDATE, " |
||||
|
+ " TO_CHAR(cd.complaintdate, 'HH24:MI:SS') AS Time, " |
||||
|
+ " cs.statusname AS status, " |
||||
|
+ " usr.user_name, " |
||||
|
+ " cd.complaintnumber, " |
||||
|
+ " COALESCE(ct.complainttypename, 'Unspecified') AS complainttypename, " |
||||
|
+ " cg.complaintgroupname " |
||||
|
+ "FROM eggr_complaintdetails@erp cd " |
||||
|
+ "INNER JOIN eggr_redressaldetails@erp rd ON cd.complaintid = rd.complaintid " |
||||
|
+ "INNER JOIN eggr_complaintstatus@erp cs ON rd.complaintstatusid = cs.complaintstatusid " |
||||
|
+ "INNER JOIN eggr_complainttypes@erp ct ON TRIM(cd.complainttype) = ct.complainttypeid " |
||||
|
+ "INNER JOIN eg_user@erp usr ON rd.redressalofficerid = usr.id_user " |
||||
|
+ "INNER JOIN eg_department@erp d ON cd.deptid = d.id_dept " |
||||
|
+ "INNER JOIN eggr_complaintgroup@erp cg ON cg.id_complaintgroup = ct.complaintgroup_id " |
||||
|
+ "INNER JOIN eg_boundary@erp dn ON dn.id_bndry = cd.bndry " |
||||
|
+ "INNER JOIN eg_boundary@erp z ON dn.parent = z.id_bndry " |
||||
|
+ "INNER JOIN eg_boundary@ERP location ON location.id_bndry = cd.locbndryid " |
||||
|
+ "WHERE (cd.deptid IS NULL OR (cd.deptid < 21 OR cd.deptid > 30)) " |
||||
|
+ " AND cd.complaintdate >= TO_DATE('2024-02-23', 'yyyy-MM-dd') " |
||||
|
+ " AND cd.complaintdate < (TO_DATE('2024-02-23', 'yyyy-MM-dd') + 1) " |
||||
|
+ "ORDER BY zone_name, division_name, cd.complaintdate" |
||||
|
+ ""; |
||||
|
|
||||
|
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
@Transactional |
||||
|
public List<Map<String, Object>> getQaQcList() { |
||||
|
|
||||
|
String SqlQuery = ""; |
||||
|
|
||||
|
SqlQuery ="select cd.COMPLAINTNUMBER, " |
||||
|
+ "dep.DEPT_NAME,ct.COMPLAINTTYPENAME, " |
||||
|
+ "TO_CHAR(cd.COMPLAINTDATE,'DD-MM-RRRR') COMPLAINTDATE, " |
||||
|
+ "TO_CHAR(cd.COMPLAINTDATE,'HH:MI:SS AM') COMPLAINTTIME, " |
||||
|
+ "cd.COMPLAINTDETAILS,cd.COMPLAINANTFIRSTNAME, " |
||||
|
+ "cd.MOBILENUMBER AS COMPLAINANTMOBILENUMBER, usr.USER_NAME, usr.extrafield2 as Mobile_number, " |
||||
|
+ "TO_CHAR(c.compl_date,'DD-MM-RRRR HH:MI:SS AM') as COMPLAINTCOMPLETIONDATE, DECODE ( qa.STATUS,null,'Not Attended','Attended') STATUS " |
||||
|
+ "from EGGR_COMPLAINTDETAILS@erp cd , " |
||||
|
+ "eg_department@erp dep, " |
||||
|
+ "EGGR_COMPLAINTTYPES@erp ct, " |
||||
|
+ "eg_user@erp usr, " |
||||
|
+ "eggr_qams_store@erp qa, " |
||||
|
+ "EGGR_REDRESSALDETAILS@erp rd, " |
||||
|
+ "(SELECT c.redressalid, MAX(c.TIMESTAMP) compl_date " |
||||
|
+ "FROM eggr_status_tracker@erp c,eggr_redressaldetails@ERP d " |
||||
|
+ "WHERE c.statusid in(5,10) " |
||||
|
+ "AND TRUNC(c.TIMESTAMP) between TO_DATE('2024-02-23', 'yyyy-MM-dd') and TO_DATE('2024-02-24', 'yyyy-MM-dd') " |
||||
|
+ "AND d.COMPLAINTSTATUSID in(5,10) " |
||||
|
+ "AND d.REDRESSALID=c.redressalid " |
||||
|
+ "GROUP BY c.redressalid) c " |
||||
|
+ "where cd.DEPTID=dep.ID_DEPT " |
||||
|
+ "and cd.COMPLAINTTYPE=ct.COMPLAINTTYPEID " |
||||
|
+ "AND rd.COMPLAINTID =cd.COMPLAINTID " |
||||
|
+ "AND rd.REDRESSALOFFICERID =usr.id_user " |
||||
|
+ "and qa.FDBK_OBJ_REF =cd.COMPLAINTID(+) " |
||||
|
+ "and rd.COMPLAINTSTATUSID not in(2,3,4,9) and rd.redressalid=c.redressalid(+) and " |
||||
|
+ "TRUNC(cd.COMPLAINTDATE) between TO_DATE('2024-02-23', 'yyyy-MM-dd') and TO_DATE('2024-02-24', 'yyyy-MM-dd') " |
||||
|
+ "order by dept_name"; |
||||
|
|
||||
|
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
@Transactional |
||||
|
public List<Map<String, Object>> getZoneWiseComplaintCountList() { |
||||
|
|
||||
|
String SqlQuery = ""; |
||||
|
|
||||
|
SqlQuery ="select * from (SELECT deptid , " |
||||
|
+ "nvl(sum( case when complainttype in (52,146) then 1 end),0) as \"NonBURSTLT\" , " |
||||
|
+ "nvl(sum( case when complainttype in (1,97) then 1 end),0) as \"REOFGAR\" ," |
||||
|
+ "nvl(sum( case when complainttype in (22,32,57,59,70,113,114,130,145) then 1 end),0) as \"ROAD\" ," |
||||
|
+ "nvl(sum( case when complainttype in (18,118) then 1 end),0) as \"MOSQUITE\" , " |
||||
|
+ "nvl(sum( case when complainttype in (69,138) then 1 end),0) as \"WATER\" , " |
||||
|
+ "nvl(sum( case when complainttype in (7,99) then 1 end),0) as \"REOFDEB\" ," |
||||
|
+ "nvl(sum( case when complainttype in (71,152) then 1 end),0) as \"TREE\" , " |
||||
|
+ "nvl(sum( case when complainttype in (19,119) then 1 end),0) as \"DOGS\" , " |
||||
|
+ "nvl(sum( case when complainttype in (75,181) then 1 end),0) as \"ENCMTN\" ," |
||||
|
+ "nvl(sum( case when complainttype in (58,112) then 1 end),0) as \"POT\" , " |
||||
|
+ "nvl(sum( case when complainttype in (43,166) then 1 end),0) as \"PTAX\" , " |
||||
|
+ "nvl(sum( case when complainttype not in (52,1,22,32,57,59,70,18,69,7,71,19,75,58,43,146,97,113,114,130,145,118,138,99,152,119,181,112,166) then 1 end),0) as \"OTHERS\" , " |
||||
|
+ "COUNT(*) Total FROM eggr_complaintdetails@erp a, eggr_redressaldetails@erp b " |
||||
|
+ "WHERE a.complaintid=b.complaintid " |
||||
|
+ "and b.COMPLAINTSTATUSID IN(2,3,4,9) " |
||||
|
+ "group by a.deptid ) a " |
||||
|
+ "inner join EG_DEPARTMENT@ERP c on a.deptid=c.id_dept " |
||||
|
+ "left outer join ( SELECT deptid , " |
||||
|
+ "nvl(sum( case when sysdate-complaintdate>90 and b.COMPLAINTSTATUSID IN(2,3,4,9) then 1 end),'0') as days_90_pen , " |
||||
|
+ "nvl(sum( case when sysdate-complaintdate>60 and sysdate-complaintdate<=90 and b.COMPLAINTSTATUSID IN(2,3,4,9) then 1 end),'0') as days_61_90_pen ," |
||||
|
+ "nvl(sum( case when sysdate-complaintdate>30 and sysdate-complaintdate<=60 and b.COMPLAINTSTATUSID IN(2,3,4,9) then 1 end),'0') as days_31_60_pen , " |
||||
|
+ "nvl(sum( case when sysdate-complaintdate>15 and sysdate-complaintdate<=30 and b.COMPLAINTSTATUSID IN(2,3,4,9) then 1 end),'0') as days_16_30_pen , " |
||||
|
+ "nvl(sum( case when sysdate-complaintdate<=15 and b.COMPLAINTSTATUSID IN(2,3,4,9) then 1 end),'0') as days_0_15_pen , " |
||||
|
+ "nvl(count(case when b.COMPLAINTSTATUSID IN(2,3,4,9) then 1 end),'0') as Total_pen " |
||||
|
+ "FROM eggr_complaintdetails@erp a, eggr_redressaldetails@erp b " |
||||
|
+ " WHERE a.complaintid=b.complaintid " |
||||
|
+ "AND EXISTS (SELECT 1 FROM EG_DEPARTMENT@ERP c " |
||||
|
+ "WHERE a.deptid = c.id_dept " |
||||
|
+ "AND (NVL(c.id_dept, 0) NOT LIKE 'F%' " |
||||
|
+ "AND c.id_dept IS NOT NULL)) group by a.deptid ) d on d.deptid=c.id_dept " |
||||
|
+ "where (NVL(DEPT_NAME,0) NOT LIKE 'F%' AND DEPT_NAME IS NOT NULL) AND (a.deptid>=32 AND a.deptid<=46)" |
||||
|
+ "order by a.deptid"; |
||||
|
|
||||
|
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
@Transactional |
||||
|
public List<Map<String, Object>> getZoneWiseOfficerComplaintCountList(String deptid, String complainttype) { |
||||
|
|
||||
|
String SqlQuery = ""; |
||||
|
String where_1=""; |
||||
|
if(!complainttype.equals("all")) { |
||||
|
where_1 = "and cd.complainttype in ("+complainttype+") "; |
||||
|
} |
||||
|
|
||||
|
SqlQuery ="Select c.dept_name,a.iduser,a.user_name,nvl(b.extrafield2,' ') MOBILENO,a.nos,a.deptid from " |
||||
|
+ "(SELECT cd.deptid, u.user_name, COUNT (cd.complaintid) nos, max(u.id_user) iduser " |
||||
|
+ "FROM eggr_complaintdetails@erp cd, eggr_redressaldetails@erp rd, eg_user@erp u " |
||||
|
+ "WHERE cd.complaintid = rd.complaintid " |
||||
|
+ "AND rd.redressalofficerid = u.id_user and complaintdate >= '25-oct-2010' " |
||||
|
+ "and rd.COMPLAINTSTATUSID IN(2,3,4,9) " |
||||
|
+ where_1 +"" |
||||
|
+ "AND cd.deptid = "+deptid+" " |
||||
|
+ "GROUP BY cd.deptid, u.user_name " |
||||
|
+ "ORDER BY cd.deptid,u.user_name) a , eg_user@erp b,eg_department@erp c " |
||||
|
+ "where a.deptid="+deptid+" AND(a.deptid=c.id_dept(+) and a.user_name=b.user_name ) " |
||||
|
+ "order by c.dept_name,a.user_name"; |
||||
|
|
||||
|
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
@Transactional |
||||
|
public List<Map<String, Object>> getZoneWiseOfficerComplaintList(String deptid, String complainttype, String redressalofficerid) { |
||||
|
|
||||
|
String SqlQuery = ""; |
||||
|
String where_1=""; |
||||
|
if(!complainttype.equals("all")) { |
||||
|
where_1 = "and a.complainttype in ("+complainttype+") "; |
||||
|
} |
||||
|
|
||||
|
SqlQuery ="SELECT a.*, NVL(TO_CHAR(a.complaintdate, 'dd-mm-rrrr'), ' ') compdate,c.DEPT_NAME, u.user_name, ct.COMPLAINTTYPEName " |
||||
|
+ "FROM eggr_complaintdetails@erp a, " |
||||
|
+ "EG_DEPARTMENT@ERP c, " |
||||
|
+ "eggr_redressaldetails@erp b, " |
||||
|
+ "eg_user@erp u, " |
||||
|
+ "EGGR_COMPLAINTTYPES@erp ct " |
||||
|
+ "WHERE a.deptid = c.id_dept " |
||||
|
+ "AND a.complainttype = ct.COMPLAINTTYPEID " |
||||
|
+ "AND (NVL(DEPT_NAME, '0') NOT LIKE 'F%' AND DEPT_NAME IS NOT NULL) AND a.complaintid = b.complaintid " |
||||
|
+ "AND complaintdate >= TO_DATE('25-Oct-2010', 'DD-Mon-YYYY') " |
||||
|
+ "AND u.id_user = b.redressalofficerid " |
||||
|
+ "AND b.COMPLAINTSTATUSID IN (2, 3, 4, 9) " |
||||
|
+ where_1 +"" |
||||
|
+ "AND a.deptid = "+deptid+" " |
||||
|
+ "AND b.redressalofficerid = "+redressalofficerid+" " |
||||
|
+ "ORDER BY user_name, a.complaintdate"; |
||||
|
|
||||
|
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery); |
||||
|
|
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Transactional |
||||
|
public List<Map<String, Object>> getZoneWiseWithoutReopenComplaintCountList() { |
||||
|
|
||||
|
String SqlQuery = ""; |
||||
|
|
||||
|
SqlQuery ="select * from (SELECT deptid , " |
||||
|
+ "nvl(sum( case when complainttype in (52,146) then 1 end),0) as \"NonBURSTLT\" , " |
||||
|
+ "nvl(sum( case when complainttype in (1,97) then 1 end),0) as \"REOFGAR\" ," |
||||
|
+ "nvl(sum( case when complainttype in (22,32,57,59,70,113,114,130,145) then 1 end),0) as \"ROAD\" ," |
||||
|
+ "nvl(sum( case when complainttype in (18,118) then 1 end),0) as \"MOSQUITE\" , " |
||||
|
+ "nvl(sum( case when complainttype in (69,138) then 1 end),0) as \"WATER\" , " |
||||
|
+ "nvl(sum( case when complainttype in (7,99) then 1 end),0) as \"REOFDEB\" ," |
||||
|
+ "nvl(sum( case when complainttype in (71,152) then 1 end),0) as \"TREE\" , " |
||||
|
+ "nvl(sum( case when complainttype in (19,119) then 1 end),0) as \"DOGS\" , " |
||||
|
+ "nvl(sum( case when complainttype in (75,181) then 1 end),0) as \"ENCMTN\" ," |
||||
|
+ "nvl(sum( case when complainttype in (58,112) then 1 end),0) as \"POT\" , " |
||||
|
+ "nvl(sum( case when complainttype in (43,166) then 1 end),0) as \"PTAX\" , " |
||||
|
+ "nvl(sum( case when complainttype not in (52,1,22,32,57,59,70,18,69,7,71,19,75,58,43,146,97,113,114,130,145,118,138,99,152,119,181,112,166) then 1 end),0) as \"OTHERS\" , " |
||||
|
+ "COUNT(*) Total FROM eggr_complaintdetails@erp a, eggr_redressaldetails@erp b " |
||||
|
+ "WHERE a.complaintid=b.complaintid " |
||||
|
+ "and b.COMPLAINTSTATUSID IN(2,3,4) " |
||||
|
+ "group by a.deptid ) a " |
||||
|
+ "inner join EG_DEPARTMENT@ERP c on a.deptid=c.id_dept " |
||||
|
+ "left outer join ( SELECT deptid , " |
||||
|
+ "nvl(sum( case when sysdate-complaintdate>90 and b.COMPLAINTSTATUSID IN(2,3,4) then 1 end),'0') as days_90_pen , " |
||||
|
+ "nvl(sum( case when sysdate-complaintdate>60 and sysdate-complaintdate<=90 and b.COMPLAINTSTATUSID IN(2,3,4) then 1 end),'0') as days_61_90_pen ," |
||||
|
+ "nvl(sum( case when sysdate-complaintdate>30 and sysdate-complaintdate<=60 and b.COMPLAINTSTATUSID IN(2,3,4) then 1 end),'0') as days_31_60_pen , " |
||||
|
+ "nvl(sum( case when sysdate-complaintdate>15 and sysdate-complaintdate<=30 and b.COMPLAINTSTATUSID IN(2,3,4) then 1 end),'0') as days_16_30_pen , " |
||||
|
+ "nvl(sum( case when sysdate-complaintdate<=15 and b.COMPLAINTSTATUSID IN(2,3,4) then 1 end),'0') as days_0_15_pen , " |
||||
|
+ "nvl(count(case when b.COMPLAINTSTATUSID IN(2,3,4) then 1 end),'0') as Total_pen " |
||||
|
+ "FROM eggr_complaintdetails@erp a, eggr_redressaldetails@erp b " |
||||
|
+ " WHERE a.complaintid=b.complaintid " |
||||
|
+ "AND EXISTS (SELECT 1 FROM EG_DEPARTMENT@ERP c " |
||||
|
+ "WHERE a.deptid = c.id_dept " |
||||
|
+ "AND (NVL(c.id_dept, 0) NOT LIKE 'F%' " |
||||
|
+ "AND c.id_dept IS NOT NULL)) group by a.deptid ) d on d.deptid=c.id_dept " |
||||
|
+ "where (NVL(DEPT_NAME,0) NOT LIKE 'F%' AND DEPT_NAME IS NOT NULL) AND (a.deptid>=32 AND a.deptid<=46)" |
||||
|
+ "order by a.deptid"; |
||||
|
|
||||
|
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
@Transactional |
||||
|
public List<Map<String, Object>> getZoneWiseOfficerWithoutReopenComplaintCountList(String deptid, String complainttype) { |
||||
|
|
||||
|
String SqlQuery = ""; |
||||
|
String where_1=""; |
||||
|
if(!complainttype.equals("all")) { |
||||
|
where_1 = "and cd.complainttype in ("+complainttype+") "; |
||||
|
} |
||||
|
|
||||
|
SqlQuery ="Select c.dept_name,a.iduser,a.user_name,nvl(b.extrafield2,' ') MOBILENO,a.nos,a.deptid from " |
||||
|
+ "(SELECT cd.deptid, u.user_name, COUNT (cd.complaintid) nos, max(u.id_user) iduser " |
||||
|
+ "FROM eggr_complaintdetails@erp cd, eggr_redressaldetails@erp rd, eg_user@erp u " |
||||
|
+ "WHERE cd.complaintid = rd.complaintid " |
||||
|
+ "AND rd.redressalofficerid = u.id_user and complaintdate >= '25-oct-2010' " |
||||
|
+ "and rd.COMPLAINTSTATUSID IN(2,3,4) " |
||||
|
+ where_1 +"" |
||||
|
+ "AND cd.deptid = "+deptid+" " |
||||
|
+ "GROUP BY cd.deptid, u.user_name " |
||||
|
+ "ORDER BY cd.deptid,u.user_name) a , eg_user@erp b,eg_department@erp c " |
||||
|
+ "where a.deptid="+deptid+" AND(a.deptid=c.id_dept(+) and a.user_name=b.user_name ) " |
||||
|
+ "order by c.dept_name,a.user_name"; |
||||
|
|
||||
|
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
@Transactional |
||||
|
public List<Map<String, Object>> getZoneWiseOfficerWithoutReopenComplaintList(String deptid, String complainttype, String redressalofficerid) { |
||||
|
|
||||
|
String SqlQuery = ""; |
||||
|
String where_1=""; |
||||
|
if(!complainttype.equals("all")) { |
||||
|
where_1 = "and a.complainttype in ("+complainttype+") "; |
||||
|
} |
||||
|
|
||||
|
SqlQuery ="SELECT a.*, NVL(TO_CHAR(a.complaintdate, 'dd-mm-rrrr'), ' ') compdate,c.DEPT_NAME, u.user_name, ct.COMPLAINTTYPEName " |
||||
|
+ "FROM eggr_complaintdetails@erp a, " |
||||
|
+ "EG_DEPARTMENT@ERP c, " |
||||
|
+ "eggr_redressaldetails@erp b, " |
||||
|
+ "eg_user@erp u, " |
||||
|
+ "EGGR_COMPLAINTTYPES@erp ct " |
||||
|
+ "WHERE a.deptid = c.id_dept " |
||||
|
+ "AND a.complainttype = ct.COMPLAINTTYPEID " |
||||
|
+ "AND (NVL(DEPT_NAME, '0') NOT LIKE 'F%' AND DEPT_NAME IS NOT NULL) AND a.complaintid = b.complaintid " |
||||
|
+ "AND complaintdate >= TO_DATE('25-Oct-2010', 'DD-Mon-YYYY') " |
||||
|
+ "AND u.id_user = b.redressalofficerid " |
||||
|
+ "AND b.COMPLAINTSTATUSID IN (2, 3, 4) " |
||||
|
+ where_1 +"" |
||||
|
+ "AND a.deptid = "+deptid+" " |
||||
|
+ "AND b.redressalofficerid = "+redressalofficerid+" " |
||||
|
+ "ORDER BY user_name, a.complaintdate"; |
||||
|
|
||||
|
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery); |
||||
|
|
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
@Transactional |
||||
|
public List<Map<String, Object>> getComplaintDetails(String complaintNumber) { |
||||
|
|
||||
|
String SqlQuery = ""; |
||||
|
|
||||
|
SqlQuery ="SELECT a.*, NVL(TO_CHAR(a.complaintdate, 'dd-mm-rrrr'), ' ') compdate,c.DEPT_NAME, u.user_name, ct.COMPLAINTTYPEName " |
||||
|
+ "FROM eggr_complaintdetails@erp a, " |
||||
|
+ "EG_DEPARTMENT@ERP c, " |
||||
|
+ "eggr_redressaldetails@erp b, " |
||||
|
+ "eg_user@erp u, " |
||||
|
+ "EGGR_COMPLAINTTYPES@erp ct " |
||||
|
+ "WHERE a.deptid = c.id_dept " |
||||
|
+ "AND a.complainttype = ct.COMPLAINTTYPEID " |
||||
|
+ "AND (NVL(DEPT_NAME, '0') NOT LIKE 'F%' AND DEPT_NAME IS NOT NULL) AND a.complaintid = b.complaintid " |
||||
|
+ "AND complaintdate >= TO_DATE('25-Oct-2010', 'DD-Mon-YYYY') " |
||||
|
+ "AND u.id_user = b.redressalofficerid " |
||||
|
+ "AND a.COMPLAINTNUMBER = '"+complaintNumber+"' " |
||||
|
+ "ORDER BY user_name, a.complaintdate"; |
||||
|
|
||||
|
List<Map<String, Object>> result = jdbcTemplate.queryForList(SqlQuery); |
||||
|
|
||||
|
// Iterate over the result list |
||||
|
for (Map<String, Object> row : result) { |
||||
|
// Iterate over each key-value pair in the map |
||||
|
for (Map.Entry<String, Object> entry : row.entrySet()) { |
||||
|
// Check if the value is null |
||||
|
if (entry.getValue() == null) { |
||||
|
// If the value is null, replace it with an empty string |
||||
|
entry.setValue(""); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1 @@ |
|||||
|
package in.gov.chennaicorporation.gccoffice.pgr.service; |
||||
@ -0,0 +1,17 @@ |
|||||
|
package in.gov.chennaicorporation.gccoffice.repository; |
||||
|
|
||||
|
import javax.transaction.Transactional; |
||||
|
|
||||
|
import org.springframework.data.jpa.repository.JpaRepository; |
||||
|
import org.springframework.data.jpa.repository.Query; |
||||
|
import org.springframework.stereotype.Repository; |
||||
|
|
||||
|
import in.gov.chennaicorporation.gccoffice.entity.AppUserEntity; |
||||
|
import in.gov.chennaicorporation.gccoffice.entity.AppUserGroupEntity; |
||||
|
|
||||
|
@Repository |
||||
|
@Transactional |
||||
|
public interface AppUserGroupRepository extends JpaRepository<AppUserGroupEntity, Integer>{ |
||||
|
@Query(value = "SELECT LAST_INSERT_ID()", nativeQuery = true) |
||||
|
Integer getLastInsertedId(); |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
package in.gov.chennaicorporation.gccoffice.repository; |
||||
|
|
||||
|
import org.springframework.data.jpa.repository.JpaRepository; |
||||
|
import org.springframework.stereotype.Repository; |
||||
|
|
||||
|
import in.gov.chennaicorporation.gccoffice.entity.UserActivityLog; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
import javax.transaction.Transactional; |
||||
|
|
||||
|
@Repository |
||||
|
@Transactional |
||||
|
public interface UserActivityLogRepository extends JpaRepository<UserActivityLog, Long> { |
||||
|
List<UserActivityLog> findByUserIdOrderByTimestampDesc(String userId); |
||||
|
} |
||||
@ -0,0 +1,29 @@ |
|||||
|
package in.gov.chennaicorporation.gccoffice.service; |
||||
|
|
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import in.gov.chennaicorporation.gccoffice.entity.UserActivityLog; |
||||
|
import in.gov.chennaicorporation.gccoffice.repository.UserActivityLogRepository; |
||||
|
|
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
@Service |
||||
|
public class UserActivityService { |
||||
|
|
||||
|
private final UserActivityLogRepository userActivityLogRepository; |
||||
|
|
||||
|
@Autowired |
||||
|
public UserActivityService(UserActivityLogRepository userActivityLogRepository) { |
||||
|
this.userActivityLogRepository = userActivityLogRepository; |
||||
|
} |
||||
|
|
||||
|
public void logUserActivity(String userId, String activityType) { |
||||
|
UserActivityLog userActivityLog = new UserActivityLog(); |
||||
|
userActivityLog.setUserId(userId); |
||||
|
userActivityLog.setActivityType(activityType); |
||||
|
userActivityLog.setTimestamp(LocalDateTime.now()); |
||||
|
|
||||
|
userActivityLogRepository.save(userActivityLog); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
package in.gov.chennaicorporation.gccoffice.service; |
||||
|
|
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import in.gov.chennaicorporation.gccoffice.entity.UserActivityLog; |
||||
|
import in.gov.chennaicorporation.gccoffice.repository.UserActivityLogRepository; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Service |
||||
|
public class UserActivityTimelineService { |
||||
|
|
||||
|
private final UserActivityLogRepository userActivityLogRepository; |
||||
|
|
||||
|
@Autowired |
||||
|
public UserActivityTimelineService(UserActivityLogRepository userActivityLogRepository) { |
||||
|
this.userActivityLogRepository = userActivityLogRepository; |
||||
|
} |
||||
|
|
||||
|
public List<UserActivityLog> getUserActivityTimeline(String userId) { |
||||
|
return userActivityLogRepository.findByUserIdOrderByTimestampDesc(userId); |
||||
|
} |
||||
|
} |
||||
|
|
||||
@ -0,0 +1 @@ |
|||||
|
assets.base-url=/assets/ |
||||
@ -0,0 +1 @@ |
|||||
|
assets.base-url=/gcc/assets/ |
||||
|
After Width: 600 | Height: 600 | Size: 2.9 MiB |
|
After Width: 512 | Height: 512 | Size: 95 KiB |
2
src/main/resources/static/assets/node_modules/datatable/DataTables-1.13.6/css/jquery.dataTables.min.css
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,53 @@ |
|||||
|
<div class="modal fade" id="viewUserDetails" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="staticBackdropLabel" aria-hidden="true"> |
||||
|
<div class="modal-dialog modal-xl" role="document"> |
||||
|
<div class="modal-content"> |
||||
|
|
||||
|
<div class="modal-header"> |
||||
|
<h6 class="modal-title m-0" id="exampleModalDefaultLabel">Exploring User Details:</h6> |
||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
||||
|
</div><!--end modal-header--> |
||||
|
<div class="modal-body pb-1"> |
||||
|
<div id="profilehtml"> |
||||
|
</div> |
||||
|
</div><!--end modal-body--> |
||||
|
|
||||
|
<div class="modal-footer bg-body"> |
||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> |
||||
|
</div><!--end modal-footer--> |
||||
|
|
||||
|
</div><!--end modal-content--> |
||||
|
</div><!--end modal-dialog--> |
||||
|
</div><!--end modal--> |
||||
|
<!-- END Page Content --> |
||||
|
|
||||
|
<div class="modal fade" id="petitionStatus" tabindex="-1" role="dialog" aria-labelledby="otpFormLabel" aria-hidden="true"> |
||||
|
<div class="modal-dialog modal-xl" role="document"> |
||||
|
<div class="modal-content"> |
||||
|
<div class="modal-header"> |
||||
|
<h6 class="modal-title m-0" id="exampleModalDefaultLabel">புகார் நிலை / Complaint Status</h6> |
||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
||||
|
</div><!--end modal-header--> |
||||
|
<div class="modal-body"> |
||||
|
<div class="row"> |
||||
|
<div class="col-sm-6 col-xl-6"> |
||||
|
<div class="block block-rounded d-flex flex-column h-100 mb-0" id="petitionStatusForm" style="font-size:12px;"> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-sm-6 col-xl-6"> |
||||
|
<div class="block block-rounded d-flex flex-column h-100 mb-0" id="petitionUpdateForm" style="font-size:12px;"> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div><!--end row--> |
||||
|
</div><!--end modal-body--> |
||||
|
<div class="modal-footer bg-body"> |
||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> |
||||
|
</div><!--end modal-footer--> |
||||
|
|
||||
|
</div><!--end modal-content--> |
||||
|
</div><!--end modal-dialog--> |
||||
|
</div><!--end modal--> |
||||
|
|
||||
@ -0,0 +1,68 @@ |
|||||
|
<!-- Box 1 --> |
||||
|
<div class="modal fade" id="pgrModalBox" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="staticBackdropLabel" aria-hidden="true"> |
||||
|
<div class="modal-dialog modal-xl" role="document"> |
||||
|
<div class="modal-content"> |
||||
|
|
||||
|
<div class="modal-header"> |
||||
|
<h6 class="modal-title m-0" id="modalTitle">Modal Title</h6> |
||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
||||
|
</div><!--end modal-header--> |
||||
|
<div class="modal-body"> |
||||
|
<div id="modalBody"> |
||||
|
</div> |
||||
|
</div><!--end modal-body--> |
||||
|
|
||||
|
<div class="modal-footer bg-body"> |
||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> |
||||
|
</div><!--end modal-footer--> |
||||
|
|
||||
|
</div><!--end modal-content--> |
||||
|
</div><!--end modal-dialog--> |
||||
|
</div><!--end modal--> |
||||
|
<!-- END Page Content --> |
||||
|
|
||||
|
<!-- Box 2 --> |
||||
|
<div class="modal fade" id="pgrModalBox_2" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="staticBackdropLabel" aria-hidden="true"> |
||||
|
<div class="modal-dialog modal-xl" role="document"> |
||||
|
<div class="modal-content"> |
||||
|
|
||||
|
<div class="modal-header"> |
||||
|
<h6 class="modal-title m-0" id="modalTitle_2">Modal Box 2 Title</h6> |
||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
||||
|
</div><!--end modal-header--> |
||||
|
<div class="modal-body"> |
||||
|
<div id="modalBody_2"> |
||||
|
</div> |
||||
|
</div><!--end modal-body--> |
||||
|
|
||||
|
<div class="modal-footer bg-body"> |
||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> |
||||
|
</div><!--end modal-footer--> |
||||
|
|
||||
|
</div><!--end modal-content--> |
||||
|
</div><!--end modal-dialog--> |
||||
|
</div><!--end modal--> |
||||
|
<!-- END Page Content --> |
||||
|
|
||||
|
<!-- Box 3 --> |
||||
|
<div class="modal fade" id="pgrModalBox_3" data-backdrop="static" tabindex="-1" role="dialog" aria-labelledby="staticBackdropLabel" aria-hidden="true"> |
||||
|
<div class="modal-dialog modal-lg" role="document"> |
||||
|
<div class="modal-content"> |
||||
|
|
||||
|
<div class="modal-header" style="background-color: #28a745 !important;"> |
||||
|
<h6 class="modal-title m-0" id="modalTitle_3">Complaint Details</h6> |
||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
||||
|
</div><!--end modal-header--> |
||||
|
<div class="modal-body"> |
||||
|
<div id="modalBody_3"> |
||||
|
</div> |
||||
|
</div><!--end modal-body--> |
||||
|
|
||||
|
<div class="modal-footer bg-body"> |
||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> |
||||
|
</div><!--end modal-footer--> |
||||
|
|
||||
|
</div><!--end modal-content--> |
||||
|
</div><!--end modal-dialog--> |
||||
|
</div><!--end modal--> |
||||
|
<!-- END Page Content --> |
||||
@ -0,0 +1,275 @@ |
|||||
|
<script th:inline="javascript"> |
||||
|
var nodata = `<center><img src="/assets/images/nodata_ani.gif" width="40%"><br><p class="text-warning">Data are not availble at this moment please check later</p></center>`; |
||||
|
|
||||
|
var baseURL = "/gcc/pgr/"; |
||||
|
|
||||
|
/* Department List */ |
||||
|
function get_department_list() { |
||||
|
|
||||
|
var apiUrl = '/gcc/api/pgr/getDepartments'; |
||||
|
// Return a Promise |
||||
|
return new Promise(function(resolve, reject) { |
||||
|
$.ajax({ |
||||
|
url: apiUrl, |
||||
|
type: 'GET', |
||||
|
dataType: 'json', |
||||
|
success: function(jsonResponse) { |
||||
|
// Resolve the Promise with the department list |
||||
|
resolve(jsonResponse); |
||||
|
}, |
||||
|
error: function(xhr, status, error) { |
||||
|
// Reject the Promise with the error message |
||||
|
reject(error); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/* Event Id Search */ |
||||
|
function callReSetEventId(eventid){ |
||||
|
$.ajax({ |
||||
|
type: "GET", |
||||
|
url: '/gcc/api/mtm/setEventId', |
||||
|
data: { |
||||
|
'eventid': eventid |
||||
|
}, |
||||
|
}).done(function(response) { |
||||
|
location.reload(); |
||||
|
}).fail(function(jqXHR, textStatus, errorThrown) { |
||||
|
/* |
||||
|
// Log the error and any relevant information |
||||
|
console.error("Error sending request: " + textStatus + " " + errorThrown); |
||||
|
*/ |
||||
|
}); |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
function complaintTypes() { |
||||
|
var complaintList = { |
||||
|
"NonBURSTLT": "Street Light not burning", |
||||
|
"REOFGAR": "Removal of Garbage", |
||||
|
"ROAD": "Road Damaged", |
||||
|
"MOSQUITE": "Mosquito Nuisance", |
||||
|
"WATER": "Water Stagnation", |
||||
|
"REOFDEB": "Removal of Debris", |
||||
|
"TREE": "Tree Fallen", |
||||
|
"DOGS": "Dog Menace", |
||||
|
"ENCMTN": "Encroachment", |
||||
|
"POT": "Pothole", |
||||
|
"PTAX": "Property Tax", |
||||
|
"OTHERS": "Others" |
||||
|
}; |
||||
|
|
||||
|
return complaintList; |
||||
|
} |
||||
|
|
||||
|
function complaintTypeId() { |
||||
|
var complaintIdList = { |
||||
|
"NonBURSTLT": "52,146", |
||||
|
"REOFGAR": "1,97", |
||||
|
"ROAD": "22,32,57,59,70,113,114,130,145", |
||||
|
"MOSQUITE": "18,118", |
||||
|
"WATER": "69,138", |
||||
|
"REOFDEB": "7,99", |
||||
|
"TREE": "71,152", |
||||
|
"DOGS": "19,119", |
||||
|
"ENCMTN": "75,181", |
||||
|
"POT": "58,112", |
||||
|
"PTAX": "43,166", |
||||
|
"OTHERS": "52,146,1,97,22,32,57,59,70,113,114,130,145,18,118,69,138,7,99,71,152,19,119,75,181,58,112,43,166" |
||||
|
}; |
||||
|
return complaintIdList; |
||||
|
} |
||||
|
|
||||
|
/////////////////////////////////////// Common Modal Box - 3 /////////////////////////////////////// |
||||
|
|
||||
|
var model_box_3 = "#pgrModalBox_3"; |
||||
|
|
||||
|
function viewComplaintDetails(complaintNumber) |
||||
|
{ |
||||
|
|
||||
|
get_table_list_modal_box_3(complaintNumber); |
||||
|
/* |
||||
|
var dept_name_txt = dept_name.split("-"); |
||||
|
|
||||
|
if(dept_name_txt.length<=1){ |
||||
|
dept_name_txt[0] = "-"; |
||||
|
} |
||||
|
|
||||
|
dept_name_txt[1] = dept_name_txt[1].charAt(0).toUpperCase() + dept_name_txt[1].slice(1).toLowerCase(); |
||||
|
|
||||
|
$('#modalTitle_2').html("Officer`s Pending Report Of "+dept_name_txt[1]+" Zone ("+dept_name_txt[0]+")"); // Box title |
||||
|
*/ |
||||
|
loading_text_msg = getLoadingMessage(); // get Loading random text |
||||
|
|
||||
|
$('#modalBody_3').html(searchinfo("<b>"+loading_text_msg+"</b>")); // Box content (Body) |
||||
|
|
||||
|
$(model_box_3).modal({ |
||||
|
backdrop: 'static', |
||||
|
keyboard: false |
||||
|
}); // Show Modal Box |
||||
|
|
||||
|
//$(model_box_2).modal('show'); // Show Modal Box |
||||
|
|
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
/* Get Data of Main Page 1 */ |
||||
|
function get_modal_box_3_table_data(complaintNumber){ |
||||
|
var apiUrl = '/gcc/api/pgr/getComplaintDetails'; |
||||
|
// Return a Promise |
||||
|
return new Promise(function(resolve, reject) { |
||||
|
$.ajax({ |
||||
|
url: apiUrl, |
||||
|
type: 'GET', |
||||
|
data: { |
||||
|
'complaintNumber': complaintNumber, |
||||
|
}, |
||||
|
dataType: 'json', |
||||
|
success: function(jsonResponse) { |
||||
|
// Resolve the Promise with the department list |
||||
|
//console.log('Response list:', jsonResponse); |
||||
|
resolve(jsonResponse); |
||||
|
}, |
||||
|
error: function(xhr, status, error) { |
||||
|
// Reject the Promise with the error message |
||||
|
reject(error); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/* Get Complaints List */ |
||||
|
function get_table_list_modal_box_3(complaintNumber){ |
||||
|
get_modal_box_3_table_data(complaintNumber).then(function(complaintDetails) { |
||||
|
// Handle the data list |
||||
|
//console.log('Response list:', complaintList); |
||||
|
//$('#modalBody_3').html(get_modal_box_3_table_html()); // Box content (Body) |
||||
|
|
||||
|
generate_table_modal_box_3(complaintDetails); |
||||
|
|
||||
|
//$(model_box_3).modal('show'); // Show Modal Box |
||||
|
|
||||
|
}).catch(function(error) { |
||||
|
// Handle errors |
||||
|
console.error('Error fetching department list:', error); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/* Call Complaints Details function */ |
||||
|
function generate_table_modal_box_3(data){ |
||||
|
|
||||
|
var complaintDetailsHTML = ""; |
||||
|
|
||||
|
$.each(data, function(index, row) { |
||||
|
complaintDetailsHTML = `<table class="table table-bordered table-vcenter p-0 m-0" style="font-size:12px;"> |
||||
|
<thead> |
||||
|
<tr> |
||||
|
<th colspan="4">Complaint Information:</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
<tr> |
||||
|
<th style="padding: 0.45rem 0.45rem;">Complaint No: </th> |
||||
|
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"> |
||||
|
`+row["COMPLAINTNUMBER"]+` |
||||
|
</td> |
||||
|
|
||||
|
<th style="padding: 0.45rem 0.45rem;">Department: </th> |
||||
|
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"> |
||||
|
`+row["DEPT_NAME"]+` |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<th style="padding: 0.45rem 0.45rem;">Complaint Date: </th> |
||||
|
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"> |
||||
|
`+row["COMPDATE"]+` |
||||
|
</td> |
||||
|
|
||||
|
<th style="padding: 0.45rem 0.45rem;">Complaint Type:</th> |
||||
|
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"> |
||||
|
`+row["COMPLAINTTYPENAME"]+` |
||||
|
</td> |
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<th style="padding: 0.45rem 0.45rem;">Complaint Title: </th> |
||||
|
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"> |
||||
|
`+row["COMPLAINTTITLE"]+` |
||||
|
</td> |
||||
|
|
||||
|
<th style="padding: 0.45rem 0.45rem; background-color:#fbffe0;">Officer ID:</th> |
||||
|
<td class="fw-semibold" style="padding: 0.45rem 0.45rem; background-color:#fbffe0;"> |
||||
|
`+row["USER_NAME"]+` |
||||
|
</td> |
||||
|
</tr> |
||||
|
|
||||
|
<tr> |
||||
|
<th style="padding: 0.45rem 0.45rem;">Details of Complaint:</th> |
||||
|
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;" colspan="3"> |
||||
|
`+row["COMPLAINTDETAILS"]+` |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<th style="padding: 0.45rem 0.45rem;">Complaint Location:</th> |
||||
|
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;" colspan="3"> |
||||
|
`+row["COMPLAINTLOCATION"]+` |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<th style="padding: 0.45rem 0.45rem;">Complaint Specific Location:</th> |
||||
|
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;" colspan="3"> |
||||
|
`+row["COMPLAINTLANDMARK"]+` |
||||
|
</td> |
||||
|
</tr> |
||||
|
</tbody> |
||||
|
</table>`; |
||||
|
|
||||
|
complaintDetailsHTML +=`<br> |
||||
|
<table class="table table-bordered table-vcenter p-0 m-0" style="font-size:12px;"> |
||||
|
<thead> |
||||
|
<tr> |
||||
|
<th colspan="4">Complaining Person\'s Details:</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
<tr> |
||||
|
<th style="padding: 0.45rem 0.45rem;">Person Name: </th> |
||||
|
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"> |
||||
|
`+row["COMPLAINANTFIRSTNAME"]+` |
||||
|
</td> |
||||
|
|
||||
|
<th style="padding: 0.45rem 0.45rem;">Email: </th> |
||||
|
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"> |
||||
|
`+row["COMPLAINANTEMAIL"]+` |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<th style="padding: 0.45rem 0.45rem;">Phone Number: </th> |
||||
|
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"> |
||||
|
`+row["COMPLAINANTTELEPHONE"]+` |
||||
|
</td> |
||||
|
|
||||
|
<th style="padding: 0.45rem 0.45rem;">Mobile Number: </th> |
||||
|
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"> |
||||
|
`+row["MOBILENUMBER"]+` |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<th style="padding: 0.45rem 0.45rem;">Address: </th> |
||||
|
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"> |
||||
|
`+row["COMPLAINANTADDRESS"]+` |
||||
|
</td> |
||||
|
|
||||
|
<th style="padding: 0.45rem 0.45rem;">Pincode: </th> |
||||
|
<td class="fw-semibold" style="padding: 0.45rem 0.45rem;"> |
||||
|
`+row["PINCODE"]+` |
||||
|
</td> |
||||
|
</tr> |
||||
|
</tbody> |
||||
|
</table>`; |
||||
|
}); |
||||
|
|
||||
|
$('#modalBody_3').html(complaintDetailsHTML); // Box content (Body) |
||||
|
} |
||||
|
</script> |
||||
@ -0,0 +1,19 @@ |
|||||
|
<div class="row"> |
||||
|
<div class="col-12 mb-2"> |
||||
|
<div class="input-group mb-0"> |
||||
|
<span class="input-group-prepend"> |
||||
|
<button type="button" id="filter_reset_btn" class="btn btn-success" onclick="callReSetEventId(0);" data-toggle="tooltip" data-animation="true" data-placement="top" data-original-title="Reset" title="Reset"> |
||||
|
<i class="ik ik-refresh-ccw"></i> |
||||
|
</button> |
||||
|
</span> |
||||
|
<select class="form-control" id="search_department_id" name="search_department_id"> |
||||
|
<option value="0">All Department`s</option> |
||||
|
</select> |
||||
|
<span class="input-group-append"> |
||||
|
<button type="button" id="filter_search_btn" class="btn btn-success" onclick="callSetEventId();" data-toggle="tooltip" data-animation="true" data-placement="top" data-original-title="Search" title="Search"> |
||||
|
<i class="ik ik-search me-1"></i> Search |
||||
|
</button> |
||||
|
</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
@ -0,0 +1,92 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="en" dir=""> |
||||
|
<html xmlns:th="http://www.thymeleaf.org"> |
||||
|
<head th:replace="~{fragments/modules/base/head :: head}"></head> |
||||
|
<body> |
||||
|
<!--[if lt IE 8]> |
||||
|
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> |
||||
|
<![endif]--> |
||||
|
|
||||
|
<div class="wrapper"> |
||||
|
<!-- header top menu Start --> |
||||
|
<header th:replace="~{fragments/modules/base/header :: header}"></header> |
||||
|
<!-- header top menu end --> |
||||
|
|
||||
|
<div class="page-wrap"> |
||||
|
<!--=============== Left Menu side Start ================--> |
||||
|
<div th:replace="~{fragments/modules/base/menu :: menu}"></div> |
||||
|
<!--=============== Left side End ================--> |
||||
|
<div class="main-content"> |
||||
|
<div class="container-fluid"> |
||||
|
<div class="page-header"> |
||||
|
<div class="row align-items-end"> |
||||
|
<div class="col-lg-8"> |
||||
|
<div class="page-header-title"> |
||||
|
<i class="ik ik-bar-chart-2 bg-blue"></i> |
||||
|
<div class="d-inline"> |
||||
|
<h5>User List</h5> |
||||
|
<span>GCC Application Admin (Configuration Page)</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-lg-4"> |
||||
|
<nav class="breadcrumb-container" aria-label="breadcrumb"> |
||||
|
<ol class="breadcrumb"> |
||||
|
<li class="breadcrumb-item"> |
||||
|
<a href="index"><i class="ik ik-home"></i></a> |
||||
|
</li> |
||||
|
<li class="breadcrumb-item active" aria-current="page">Admin</li> |
||||
|
</ol> |
||||
|
</nav> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="row"> |
||||
|
<div class="col-md-12"> |
||||
|
<div class="card"> |
||||
|
<div class="card-header"> |
||||
|
<h3>Page Title</h3> |
||||
|
</div> |
||||
|
<div class="card-body"> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="row"> |
||||
|
<div class="col-md-12"> |
||||
|
<div class="card"> |
||||
|
<div class="card-header"> |
||||
|
<h3>Datatable Test</h3> |
||||
|
</div> |
||||
|
<div class="card-body"> |
||||
|
<div class="col-sm-12"><table id="example" class="table table-striped table-bordered table-hover nowrap dataTable" role="grid" aria-describedby="simpletable_info"> |
||||
|
<thead class="thead-dark"> |
||||
|
<tr role="row"><th class="sorting_asc" tabindex="0" aria-controls="simpletable" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Name: activate to sort column descending" style="width: 178.258px;">Name</th><th class="sorting" tabindex="0" aria-controls="simpletable" rowspan="1" colspan="1" aria-label="Position: activate to sort column ascending" style="width: 268.727px;">Position</th><th class="sorting" tabindex="0" aria-controls="simpletable" rowspan="1" colspan="1" aria-label="Office: activate to sort column ascending" style="width: 129.852px;">Office</th><th class="sorting" tabindex="0" aria-controls="simpletable" rowspan="1" colspan="1" aria-label="Age: activate to sort column ascending" style="width: 72.1875px;">Age</th><th class="sorting" tabindex="0" aria-controls="simpletable" rowspan="1" colspan="1" aria-label="Start date: activate to sort column ascending" style="width: 135.57px;">Start date</th><th class="sorting" tabindex="0" aria-controls="simpletable" rowspan="1" colspan="1" aria-label="Salary: activate to sort column ascending" style="width: 96.4062px;">Salary</th></tr> |
||||
|
</theadclass="thead-dark"> |
||||
|
<tbody> |
||||
|
|
||||
|
</tbody> |
||||
|
<tfoot class="thead-dark"> |
||||
|
<tr><th rowspan="1" colspan="1">Name</th><th rowspan="1" colspan="1">Position</th><th rowspan="1" colspan="1">Office</th><th rowspan="1" colspan="1">Age</th><th rowspan="1" colspan="1">Start date</th><th rowspan="1" colspan="1">Salary</th></tr> |
||||
|
</tfoot> |
||||
|
</table></div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div> |
||||
|
|
||||
|
<script th:replace="~{fragments/modules/base/script :: script}"></script> |
||||
|
|
||||
|
</body> |
||||
|
</html> |
||||
@ -0,0 +1,272 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="en" xmlns:th="http://www.thymeleaf.org"> |
||||
|
<head th:replace="~{fragments/modules/base/head :: head}"></head> |
||||
|
<body> |
||||
|
<!--[if lt IE 8]> |
||||
|
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> |
||||
|
<![endif]--> |
||||
|
|
||||
|
<div class="wrapper"> |
||||
|
<!-- header top menu Start --> |
||||
|
<header th:replace="~{fragments/modules/base/header :: header}"></header> |
||||
|
<!-- header top menu end --> |
||||
|
|
||||
|
<div class="page-wrap"> |
||||
|
<!--=============== Left Menu side Start ================--> |
||||
|
<div th:replace="~{fragments/modules/base/menu :: menu}"></div> |
||||
|
<!--=============== Left side End ================--> |
||||
|
<div class="main-content"> |
||||
|
<div class="container-fluid"> |
||||
|
<div class="page-header"> |
||||
|
<div class="row align-items-end"> |
||||
|
<div class="col-lg-8"> |
||||
|
<div class="page-header-title"> |
||||
|
<i class="fa fa-id-badge bg-blue"></i> |
||||
|
<div class="d-inline"> |
||||
|
<h5>User Group Access</h5> |
||||
|
<span>GCC Application Configuration</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-lg-4"> |
||||
|
<nav class="breadcrumb-container" aria-label="breadcrumb"> |
||||
|
<ol class="breadcrumb"> |
||||
|
<li class="breadcrumb-item"> |
||||
|
<a href="index"><i class="ik ik-home"></i></a> |
||||
|
</li> |
||||
|
<li class="breadcrumb-item" aria-current="page">Admin</li> |
||||
|
<li class="breadcrumb-item active" aria-current="page">User Group Access</li> |
||||
|
</ol> |
||||
|
</nav> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<p></p> |
||||
|
<div class="row"> |
||||
|
<div class="col-md-12"> |
||||
|
<div class="card"> |
||||
|
<div class="card-header"> |
||||
|
|
||||
|
<div class="row"> |
||||
|
<div class="col-md-12"></div> |
||||
|
<div class="input-group col-md-12 mb-0"> |
||||
|
|
||||
|
<label for="search_groupid" class="pt-2"> User Group: </label> |
||||
|
|
||||
|
<select class="form-control select2" id="search_groupid" name="search_groupid"> |
||||
|
<option value="">Please choose a User Group Name to retrieve data.</option> |
||||
|
<option th:each="userGroup: ${userGroupList}" th:value="${userGroup.id}" th:text="${userGroup.name}">-</option> |
||||
|
</select> |
||||
|
<span class="input-group-append"> |
||||
|
<button type="button" id="groupSearchbtn" class="btn btn-success" onclick="showAccessTree();" data-toggle="tooltip" data-animation="true" data-placement="top" data-original-title="Search" title=""> |
||||
|
<i class="ik ik-search me-1"></i> Search |
||||
|
</button> |
||||
|
</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="card-body"> |
||||
|
<div class="col-sm-12"> |
||||
|
<div id="loadaccesstree"></div> |
||||
|
<!-- <div th:utext="${accessHTML}"></div> --> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="card-footer"> |
||||
|
<div class="col-sm-12 text-right"> |
||||
|
<button type="reset" class="btn btn-secondary btn-sm" data-dismiss="modal" onclick="return closeModel();"><i class="ik ik-x-square"></i>Close</button> |
||||
|
<button type="submit" class="btn btn-success btn-sm" id="savebtn" onclick="return getCheckedData()"><i class="ik ik-save"></i>Save</button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div> |
||||
|
|
||||
|
<script th:replace="~{fragments/modules/base/script :: script}"></script> |
||||
|
|
||||
|
<script> |
||||
|
(function($){ |
||||
|
$.fn.extend({ |
||||
|
// Tree Check By Paranet (Check All) |
||||
|
checktree: function(){ |
||||
|
$(this) |
||||
|
.addClass('checktree-root') |
||||
|
.on('change', 'input[type="checkbox"]', function(e){ |
||||
|
e.stopPropagation(); |
||||
|
e.preventDefault(); |
||||
|
|
||||
|
checkParents($(this)); |
||||
|
checkChildren($(this)); |
||||
|
}) |
||||
|
; |
||||
|
|
||||
|
var checkParents = function (c) |
||||
|
{ |
||||
|
var parentLi = c.parents('ul:eq(0)').parents('li:eq(0)'); |
||||
|
|
||||
|
if (parentLi.length) |
||||
|
{ |
||||
|
var siblingsChecked = parseInt($('input[type="checkbox"]:checked', c.parents('ul:eq(0)')).length), |
||||
|
rootCheckbox = parentLi.find('input[type="checkbox"]:eq(0)') |
||||
|
; |
||||
|
|
||||
|
if (c.is(':checked')) |
||||
|
rootCheckbox.prop('checked', true) |
||||
|
else if (siblingsChecked === 0) |
||||
|
rootCheckbox.prop('checked', false); |
||||
|
|
||||
|
checkParents(rootCheckbox); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
var checkChildren = function (c) |
||||
|
{ |
||||
|
var childLi = $('ul li input[type="checkbox"]', c.parents('li:eq(0)')); |
||||
|
|
||||
|
if (childLi.length) |
||||
|
childLi.prop('checked', c.is(':checked')); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
}); |
||||
|
})(jQuery); |
||||
|
|
||||
|
callMenuTreeAccess = function(groupId,groupName){ |
||||
|
|
||||
|
const loadaccesstree = $("#loadaccesstree"); |
||||
|
const searchBtn = $("#groupSearchbtn"); |
||||
|
const savebtn = $("#savebtn"); |
||||
|
const apiUrl = "/gcc/api/getAccessTree?groupId="+groupId+"&groupName="+groupName; |
||||
|
|
||||
|
$.ajax({ |
||||
|
url: apiUrl, |
||||
|
type: 'GET', |
||||
|
dataType: 'text', |
||||
|
success: function(Response) { |
||||
|
// Handle the API response data here |
||||
|
//console.log('Data from API:', Response); |
||||
|
|
||||
|
// Parse the JSON response into a JavaScript object |
||||
|
var data = Response; |
||||
|
if(data.ResultStatus=="False") |
||||
|
{ |
||||
|
loadaccesstree.html("<center>"+nodata(data.Message)+"</center>"); |
||||
|
searchBtn.prop("disabled", false); |
||||
|
searchBtn.html('<i class="ik ik-search me-1"></i> Search'); |
||||
|
} |
||||
|
else{ |
||||
|
|
||||
|
loadaccesstree.html(data); |
||||
|
$('#tree').checktree(); |
||||
|
// Enable the button |
||||
|
searchBtn.prop("disabled", false); |
||||
|
searchBtn.html('<i class="ik ik-search me-1"></i> Search'); |
||||
|
savebtn.prop("disabled", false); |
||||
|
} |
||||
|
}, |
||||
|
error: function(xhr, status, error) { |
||||
|
// Handle errors here |
||||
|
console.error('Error fetching data:', xhr.status, error); |
||||
|
if (xhr.status == 404) { |
||||
|
// Handle 404 error specifically |
||||
|
loadaccesstree.html(nodata("<b>Unable to fetch data. Please try again later.<br>Error 404: Resource not found. Please check the URL.</b>")); |
||||
|
} else { |
||||
|
// Handle other errors |
||||
|
loadaccesstree.html(nodata("<b>Error: Unable to fetch data. Please try again later.</b>")); |
||||
|
} |
||||
|
// Enable the button |
||||
|
searchBtn.prop("disabled", false); |
||||
|
searchBtn.html('<i class="ik ik-search me-1"></i> Search'); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
// Load Access Tree |
||||
|
showAccessTree = function(){ |
||||
|
|
||||
|
const loadaccesstree = $("#loadaccesstree"); |
||||
|
const selectedGroup = $('#search_groupid'); |
||||
|
const selectedGroupId = selectedGroup.val(); |
||||
|
const selectedGroupName = selectedGroup.find('option:selected').text(); |
||||
|
const searchBtn = $("#groupSearchbtn"); |
||||
|
const savebtn = $("#savebtn"); |
||||
|
|
||||
|
call_loading('loadaccesstree','start'); |
||||
|
savebtn.prop("disabled", true); // Stop Save button |
||||
|
|
||||
|
if(selectedGroupId>0){ |
||||
|
// Disable the button to prevent multiple clicks |
||||
|
searchBtn.prop("disabled", true); |
||||
|
// Show the loading icon on the button |
||||
|
searchBtn.html('<i class="fas fa-spinner fa-spin"></i>'); |
||||
|
|
||||
|
callMenuTreeAccess(selectedGroupId,selectedGroupName); |
||||
|
} |
||||
|
else{ |
||||
|
loadaccesstree.html(searchinfo("<b>Please select and search for a User Group to continue.</b>")); |
||||
|
} |
||||
|
} |
||||
|
showAccessTree(); |
||||
|
|
||||
|
|
||||
|
var getCheckedData = function() { |
||||
|
var checkedData = []; |
||||
|
$('input[type="checkbox"]:checked', "#tree").each(function() { |
||||
|
checkedData.push($(this).val()); |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
// Push Group ID |
||||
|
const selectedGroup = $('#search_groupid'); |
||||
|
const selectedGroupId = selectedGroup.val();; |
||||
|
|
||||
|
console.log(checkedData); |
||||
|
|
||||
|
submitCheckedData(checkedData,selectedGroupId); |
||||
|
|
||||
|
return false;//checkedData; |
||||
|
}; |
||||
|
|
||||
|
var submitCheckedData = function(checkedData, groupId) { |
||||
|
// Perform your AJAX request here using checkedData |
||||
|
// Replace the URL and other options with your actual API endpoint and data |
||||
|
const apiUrl = "/api/saveGroupAccessData"; |
||||
|
|
||||
|
const selectedGroup = $('#search_groupid'); |
||||
|
const selectedGroupName = selectedGroup.find('option:selected').text(); |
||||
|
|
||||
|
$.ajax({ |
||||
|
url: apiUrl, |
||||
|
type: 'POST', |
||||
|
contentType: 'application/json', |
||||
|
data: JSON.stringify({ checkedData: checkedData, groupId: groupId }), |
||||
|
success: function(response) { |
||||
|
// Handle the success response |
||||
|
console.log('API response:', response); |
||||
|
Swal.fire( |
||||
|
'User Group Access!', |
||||
|
'Access has been successfully mapped to the User Group (' + selectedGroupName + ')!', |
||||
|
'success' |
||||
|
).then(() => { |
||||
|
location.reload(); |
||||
|
}); |
||||
|
}, |
||||
|
error: function(error) { |
||||
|
// Handle the error response |
||||
|
console.error('API error:', error); |
||||
|
} |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
</body> |
||||
|
</html> |
||||
@ -0,0 +1,183 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="en" xmlns:th="http://www.thymeleaf.org"> |
||||
|
<head th:replace="~{fragments/modules/base/head :: head}"></head> |
||||
|
<body> |
||||
|
<!--[if lt IE 8]> |
||||
|
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> |
||||
|
<![endif]--> |
||||
|
|
||||
|
<div class="wrapper"> |
||||
|
<!-- header top menu Start --> |
||||
|
<header th:replace="~{fragments/modules/base/header :: header}"></header> |
||||
|
<!-- header top menu end --> |
||||
|
|
||||
|
<div class="page-wrap"> |
||||
|
<!--=============== Left Menu side Start ================--> |
||||
|
<div th:replace="~{fragments/modules/base/menu :: menu}"></div> |
||||
|
<!--=============== Left side End ================--> |
||||
|
<div class="main-content"> |
||||
|
<div class="container-fluid"> |
||||
|
<div class="page-header"> |
||||
|
<div class="row align-items-end"> |
||||
|
<div class="col-lg-6"> |
||||
|
<div class="page-header-title"> |
||||
|
<i class="fa fa-users bg-blue"></i> |
||||
|
<div class="d-inline"> |
||||
|
<h5>User Group List</h5> |
||||
|
<span>GCC Application Configuration</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-lg-6"> |
||||
|
<nav class="breadcrumb-container" aria-label="breadcrumb"> |
||||
|
<ol class="breadcrumb"> |
||||
|
<li class="breadcrumb-item"> |
||||
|
<a href="/index"><i class="ik ik-home"></i></a> |
||||
|
</li> |
||||
|
<li class="breadcrumb-item">Admin </li> |
||||
|
<li class="breadcrumb-item active" aria-current="page">User Group List</li> |
||||
|
</ol> |
||||
|
</nav> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<hr> |
||||
|
<div class="row"> |
||||
|
<div class="col-md-12"> |
||||
|
<div class="card"> |
||||
|
|
||||
|
<div class="card-block"> |
||||
|
|
||||
|
<div> |
||||
|
<table id="assetDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%"> |
||||
|
<thead class="thead-dark"> |
||||
|
<tr class="table-bordered"> |
||||
|
<th class="text-center no-sort">S.No</th> |
||||
|
<th class="text-center">Petition No.</th> |
||||
|
<th class="text-center">Name</th> |
||||
|
<th class="text-center">Mobile</th> |
||||
|
<th class="text-center">Address</th> |
||||
|
<th class="text-center">Postal code</th> |
||||
|
<th class="text-center">Type of complaint</th> |
||||
|
<th class="text-center" width="10%">Status</th> |
||||
|
<th class="text-center" width="10%">Action</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
<tr th:each="petition, i : ${petitionlist}" class="${petitionlist}"> |
||||
|
<td th:utext="${i.count}">0</td> |
||||
|
<td th:utext="${petition.petitionNumber}"></td> |
||||
|
<td th:utext="${petition.petitionerName}" class="text-center"></td> |
||||
|
<td th:text="${petition.petitionerMobile}"></td> |
||||
|
<td th:utext="${petition.petitionerAddress}"></td> |
||||
|
<td th:utext="${petition.petitionerPincode}"></td> |
||||
|
<td th:text="${petition.PetitionerComplaint_txt}"></td> |
||||
|
<td style="text-transform: capitalize;" class="text-center"><a href="#" th:onclick="return call_view_petition([[${petition.petitionNumber}]]);" th:utext="${petition.status}" class="text-warning"></a></td> |
||||
|
<td class="text-center"> |
||||
|
<a th:href="@{#}" th:onclick="return callViewFiles( [[${petition.petitionId}]],[[${petition.petitionNumber}]] );" data-toggle="tooltip" data-animation="true" data-placement="top" title="View Files" data-original-title="View Files"><i class="ik ik-file-text text-green" style="font-size: 18px;"></i></a> |
||||
|
<a th:href="@{/petition-ack/{petitionNumber}(petitionNumber=${petition.petitionNumber})}" |
||||
|
data-toggle="tooltip" data-animation="true" data-placement="top" title="View ACK" data-original-title="View ACK"> |
||||
|
<i class="far fa-thumbs-up" style="font-size: 18px;"></i> |
||||
|
</a> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</tbody> |
||||
|
<tfoot class="thead-dark"> |
||||
|
<tr> |
||||
|
<th class="text-center no-sort">S.No</th> |
||||
|
<th class="text-center">Petition No.</th> |
||||
|
<th class="text-center">Name</th> |
||||
|
<th class="text-center">Mobile</th> |
||||
|
<th class="text-center">Address</th> |
||||
|
<th class="text-center">Postal code</th> |
||||
|
<th class="text-center">Type of complaint</th> |
||||
|
<th class="text-center" width="10%">Status</th> |
||||
|
<th class="text-center" width="10%">Action</th> |
||||
|
</tr> |
||||
|
</tfoot> |
||||
|
</table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div th:replace="~{fragments/modules/mtm/modal-box :: div}"></div> |
||||
|
|
||||
|
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div> |
||||
|
|
||||
|
<script th:replace="~{fragments/modules/base/script :: script}"></script> |
||||
|
<script th:replace="~{fragments/modules/mtm/script :: script}"></script> |
||||
|
<script th:inline="javascript"> |
||||
|
//var qrAssetFeedbackApiUrl = "[[${qrAssetFeedbackApiUrl}]]"; |
||||
|
|
||||
|
$(document).ready(function() { |
||||
|
|
||||
|
// DataTables buttons configuration |
||||
|
var buttons = [ |
||||
|
{ |
||||
|
extend: 'pageLength', |
||||
|
className: 'btn btn-warning' |
||||
|
}, |
||||
|
{ |
||||
|
title: 'Data export', |
||||
|
extend: 'copyHtml5', |
||||
|
text: 'Copy', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'copyBtn' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'excelHtml5', |
||||
|
text: 'Excel', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'excelBtn', |
||||
|
title: 'Petition List' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'csvHtml5', |
||||
|
text: 'CSV', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'csvBtn', |
||||
|
title: 'Petition List' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'pdfHtml5', |
||||
|
text: 'PDF', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'pdfBtn', |
||||
|
title: 'Petition List' |
||||
|
} |
||||
|
]; |
||||
|
|
||||
|
$('#assetDatatable').DataTable( { |
||||
|
dom: 'Bftip', |
||||
|
columnDefs: [ |
||||
|
{ targets: 'no-sort', orderable: false } |
||||
|
], |
||||
|
lengthMenu: [ |
||||
|
[ 50, 100, 200, 500, -1 ], |
||||
|
[ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ] |
||||
|
], |
||||
|
scrollY: '50vh', |
||||
|
fixedColumns: { |
||||
|
left: 1, |
||||
|
right: 1 |
||||
|
}, |
||||
|
buttons: [buttons], |
||||
|
responsive: true, |
||||
|
searching: false, |
||||
|
select: false, |
||||
|
processing: false, |
||||
|
} ); |
||||
|
} ); |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
||||
@ -0,0 +1,226 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="en" xmlns:th="http://www.thymeleaf.org"> |
||||
|
<head th:replace="~{fragments/modules/base/head :: head}"></head> |
||||
|
<body> |
||||
|
<!--[if lt IE 8]> |
||||
|
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> |
||||
|
<![endif]--> |
||||
|
|
||||
|
<div class="wrapper"> |
||||
|
<!-- header top menu Start --> |
||||
|
<header th:replace="~{fragments/modules/base/header :: header}"></header> |
||||
|
<!-- header top menu end --> |
||||
|
|
||||
|
<div class="page-wrap"> |
||||
|
<!--=============== Left Menu side Start ================--> |
||||
|
<div th:replace="~{fragments/modules/base/menu :: menu}"></div> |
||||
|
<!--=============== Left side End ================--> |
||||
|
<div class="main-content"> |
||||
|
<div class="container-fluid"> |
||||
|
<div class="page-header"> |
||||
|
<div class="row align-items-end"> |
||||
|
<div class="col-lg-6"> |
||||
|
<div class="page-header-title"> |
||||
|
<i class="fa fa-user bg-blue"></i> |
||||
|
<div class="d-inline"> |
||||
|
<h5>User List</h5> |
||||
|
<span>GCC Application Configuration</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-lg-6"> |
||||
|
<nav class="breadcrumb-container" aria-label="breadcrumb"> |
||||
|
<ol class="breadcrumb"> |
||||
|
<li class="breadcrumb-item"> |
||||
|
<a href="/index"><i class="ik ik-home"></i></a> |
||||
|
</li> |
||||
|
<li class="breadcrumb-item">Admin</li> |
||||
|
<li class="breadcrumb-item active" aria-current="page">User List</li> |
||||
|
</ol> |
||||
|
</nav> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<hr> |
||||
|
<div class="row"> |
||||
|
<div class="col-md-12"> |
||||
|
<div class="card"> |
||||
|
|
||||
|
<div class="card-block"> |
||||
|
|
||||
|
<div> |
||||
|
<table id="assetDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%"> |
||||
|
<thead class="thead-dark"> |
||||
|
<tr class="table-bordered"> |
||||
|
<th class="text-center no-sort">S.No</th> |
||||
|
<th class="text-center">Name</th> |
||||
|
<th class="text-center">E-mail</th> |
||||
|
<th class="text-center">Mobile</th> |
||||
|
<th class="text-center">Username</th> |
||||
|
<th class="text-center">Role</th> |
||||
|
<th class="text-center">Access Group</th> |
||||
|
<th class="text-center" width="10%">Status</th> |
||||
|
<th class="text-center" width="10%">Action</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
<tr th:each="userlistData, i : ${userlist}" class="${userlist}"> |
||||
|
<td th:utext="${i.count}">0</td> |
||||
|
<td th:utext="${userlistData.userid.name}"></td> |
||||
|
<td th:utext="${userlistData.userid.email}"></td> |
||||
|
<td th:utext="${userlistData.userid.phone}"></td> |
||||
|
<td th:text="${userlistData.username}"></td> |
||||
|
<td th:utext="${userlistData.roles}" class="text-center"></td> |
||||
|
<td th:text="${userlistData.usergroup_id.name}"></td> |
||||
|
<td style="text-transform: capitalize;" th:utext="${userlistData.isActive} ? 'Active' : 'Inactive'" th:class="${userlistData.isActive} ? 'text-center text-green' : 'text-center text-red'"></td> |
||||
|
<td class="text-center"> |
||||
|
<a th:href="@{#}" th:onclick="return callUserDetails([[${userlistData.id}]]);" data-toggle="tooltip" data-animation="true" data-placement="top" title="View User Details" data-original-title="View User Details"><i class="ik ik-file-text text-green" style="font-size: 18px;"></i></a> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</tbody> |
||||
|
<tfoot class="thead-dark"> |
||||
|
<tr class="table-bordered"> |
||||
|
<th class="text-center no-sort">S.No</th> |
||||
|
<th class="text-center">Name</th> |
||||
|
<th class="text-center">E-mail</th> |
||||
|
<th class="text-center">Mobile</th> |
||||
|
<th class="text-center">Username</th> |
||||
|
<th class="text-center">Role</th> |
||||
|
<th class="text-center">Access Group</th> |
||||
|
<th class="text-center" width="10%">Status</th> |
||||
|
<th class="text-center" width="10%">Action</th> |
||||
|
</tr> |
||||
|
</tfoot> |
||||
|
</table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div th:replace="~{fragments/modules/admin/modal-box :: div}"></div> |
||||
|
|
||||
|
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div> |
||||
|
|
||||
|
<script th:replace="~{fragments/modules/base/script :: script}"></script> |
||||
|
<script th:inline="javascript"> |
||||
|
//var qrAssetFeedbackApiUrl = "[[${qrAssetFeedbackApiUrl}]]"; |
||||
|
|
||||
|
$(document).ready(function() { |
||||
|
var exportTitle = "GCC Application User List"; |
||||
|
// DataTables buttons configuration |
||||
|
var buttons = [ |
||||
|
{ |
||||
|
extend: 'pageLength', |
||||
|
className: 'btn btn-warning' |
||||
|
}, |
||||
|
{ |
||||
|
title: 'Data export', |
||||
|
extend: 'copyHtml5', |
||||
|
text: 'Copy', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'copyBtn' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'excelHtml5', |
||||
|
text: 'Excel', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'excelBtn', |
||||
|
title: exportTitle |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'csvHtml5', |
||||
|
text: 'CSV', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'csvBtn', |
||||
|
title: exportTitle |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'pdfHtml5', |
||||
|
text: 'PDF', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'pdfBtn', |
||||
|
title: exportTitle |
||||
|
} |
||||
|
]; |
||||
|
|
||||
|
$('#assetDatatable').DataTable( { |
||||
|
/* Disable initial sort */ |
||||
|
aaSorting: [], |
||||
|
columnDefs: [ |
||||
|
{ targets: 'no-sort', orderable: false } |
||||
|
], |
||||
|
dom: 'Bftip', |
||||
|
lengthMenu: [ |
||||
|
[ 50, 100, 200, 500, -1 ], |
||||
|
[ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ] |
||||
|
], |
||||
|
scrollY: '50vh', |
||||
|
fixedColumns: { |
||||
|
left: 1, |
||||
|
right: 1 |
||||
|
}, |
||||
|
buttons: [buttons], |
||||
|
responsive: true, |
||||
|
searching: false, |
||||
|
select: false, |
||||
|
processing: false, |
||||
|
} ); |
||||
|
} ); |
||||
|
|
||||
|
|
||||
|
// For view user details |
||||
|
function callUserDetails(userid){ |
||||
|
$("#profilehtml").html(searchinfo("<b>Retrieving Information, Please Wait...<div id=\"loadingimg\"></div></b>")); |
||||
|
call_loading("loadingimg","start"); |
||||
|
|
||||
|
$('#viewUserDetails').modal({ |
||||
|
backdrop: 'static', |
||||
|
keyboard: false |
||||
|
}) |
||||
|
$('#viewUserDetails').modal('show'); |
||||
|
|
||||
|
var userProfileHtml = ""; |
||||
|
|
||||
|
getUserDetails(userid).then(response => { |
||||
|
// Handle the success response |
||||
|
$("#profilehtml").html(response); |
||||
|
}) |
||||
|
.catch(error => { |
||||
|
// Handle the error response |
||||
|
$("#profilehtml").html(error); |
||||
|
}); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
function getUserDetails(userid){ |
||||
|
const apiUrl = "/api/getUserProfile"; |
||||
|
return new Promise((resolve, reject) => { |
||||
|
$.ajax({ |
||||
|
url: apiUrl, |
||||
|
type: 'GET', |
||||
|
dataType: 'text', |
||||
|
data: { userId: userid}, |
||||
|
success: function(response) { |
||||
|
// Handle the success response |
||||
|
resolve(response); |
||||
|
}, |
||||
|
error: function(error) { |
||||
|
// Handle the error response |
||||
|
console.error('API error:', error); |
||||
|
reject(error); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
||||
@ -0,0 +1,284 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="en" dir=""> |
||||
|
<html xmlns:th="http://www.thymeleaf.org"> |
||||
|
<head th:replace="~{fragments/modules/base/head :: head}"></head> |
||||
|
<body> |
||||
|
<!--[if lt IE 8]> |
||||
|
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> |
||||
|
<![endif]--> |
||||
|
|
||||
|
<div class="wrapper"> |
||||
|
<!-- header top menu Start --> |
||||
|
<header th:replace="~{fragments/modules/base/header :: header}"></header> |
||||
|
<!-- header top menu end --> |
||||
|
|
||||
|
<div class="page-wrap"> |
||||
|
<!--=============== Left Menu side Start ================--> |
||||
|
<div th:replace="~{fragments/modules/base/menu :: menu}"></div> |
||||
|
<!--=============== Left side End ================--> |
||||
|
<div class="main-content"> |
||||
|
<div class="container-fluid"> |
||||
|
<div class="page-header"> |
||||
|
<div class="row align-items-end"> |
||||
|
<div class="col-lg-6"> |
||||
|
<div class="page-header-title"> |
||||
|
<i class="far fa-list-alt bg-blue"></i> |
||||
|
<div class="d-inline"> |
||||
|
<h5>PGR - All Reports</h5> |
||||
|
<span>Public Grievance Redressal Reports</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-lg-6"> |
||||
|
<nav class="breadcrumb-container" aria-label="breadcrumb"> |
||||
|
<ol class="breadcrumb"> |
||||
|
<li class="breadcrumb-item"> |
||||
|
<a href="/index"><i class="ik ik-home"></i></a> |
||||
|
</li> |
||||
|
<li class="breadcrumb-item active" aria-current="page">All Reports</li> |
||||
|
</ol> |
||||
|
</nav> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<hr> |
||||
|
<div class="row"> |
||||
|
<div class="col-md-12"> |
||||
|
<div class="card"> |
||||
|
|
||||
|
<div class="card-block"> |
||||
|
<div th:replace="~{fragments/modules/pgr/search_form :: div}"></div> |
||||
|
<div id="tableLoading"></div> |
||||
|
<div> |
||||
|
<table id="complaintDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%"> |
||||
|
<thead class="thead-dark"> |
||||
|
<tr class="table-bordered"> |
||||
|
<th class="text-center no-sort">S.No</th> |
||||
|
<th class="text-center">Zone No.</th> |
||||
|
<th class="text-center">Div No.</th> |
||||
|
<th class="text-center">User Name</th> |
||||
|
<th class="text-center">Complaint No.</th> |
||||
|
<th class="text-center">Complaint Type</th> |
||||
|
<th class="text-center">Location</th> |
||||
|
<th class="text-center">Date</th> |
||||
|
<th class="text-center">Time</th> |
||||
|
<th class="text-center">Status</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
|
||||
|
</tbody> |
||||
|
<tfoot class="thead-dark"> |
||||
|
<tr> |
||||
|
<th class="text-center no-sort">S.No</th> |
||||
|
<th class="text-center">Zone No.</th> |
||||
|
<th class="text-center">Div No.</th> |
||||
|
<th class="text-center">User Name</th> |
||||
|
<th class="text-center">Complaint No.</th> |
||||
|
<th class="text-center">Complaint Type</th> |
||||
|
<th class="text-center">Location</th> |
||||
|
<th class="text-center">Date</th> |
||||
|
<th class="text-center">Time</th> |
||||
|
<th class="text-center">Status</th> |
||||
|
</tr> |
||||
|
</tfoot> |
||||
|
</table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div th:replace="~{fragments/modules/pgr/modal-box :: div}"></div> |
||||
|
|
||||
|
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div> |
||||
|
|
||||
|
<script th:replace="~{fragments/modules/base/script :: script}"></script> |
||||
|
<script th:replace="~{fragments/modules/pgr/script :: script}"></script> |
||||
|
<script th:inline="javascript"> |
||||
|
|
||||
|
var loading_text_msg = getLoadingMessage(); // get Random loading message from base/script |
||||
|
|
||||
|
// Loading Div id |
||||
|
const loading = $("#tableLoading"); |
||||
|
|
||||
|
// DataTables buttons configuration |
||||
|
var buttons = [ |
||||
|
{ |
||||
|
extend: 'pageLength', |
||||
|
className: 'btn btn-warning' |
||||
|
}, |
||||
|
{ |
||||
|
title: 'Data export', |
||||
|
extend: 'copyHtml5', |
||||
|
text: 'Copy', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'copyBtn' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'excelHtml5', |
||||
|
text: 'Excel', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'excelBtn', |
||||
|
title: 'Petition List' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'csvHtml5', |
||||
|
text: 'CSV', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'csvBtn', |
||||
|
title: 'Petition List' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'pdfHtml5', |
||||
|
text: 'PDF', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'pdfBtn', |
||||
|
title: 'Petition List' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'print', |
||||
|
text: 'Print', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'printBtn', |
||||
|
title: 'Petition List' |
||||
|
} |
||||
|
]; |
||||
|
|
||||
|
|
||||
|
function call_loading(){ |
||||
|
$("#filter_reset_btn").prop("disabled", true); |
||||
|
$("#filter_search_btn").prop("disabled", true); |
||||
|
loading.html(searchinfo("<b>"+loading_text_msg+"</b>")); |
||||
|
} |
||||
|
|
||||
|
function remove_loading(){ |
||||
|
$("#filter_reset_btn").prop("disabled", false); |
||||
|
$("#filter_search_btn").prop("disabled", false); |
||||
|
loading.html(""); |
||||
|
} |
||||
|
|
||||
|
/* Get Department Data */ |
||||
|
function get_department_data(){ |
||||
|
|
||||
|
get_department_list().then(function(departments) { |
||||
|
// Handle the department list |
||||
|
departmentlist = departments; |
||||
|
|
||||
|
// Iterate through the department list and add options to the select element |
||||
|
$.each(departmentlist, function(index, department) { |
||||
|
// Create an option element |
||||
|
var option = $('<option>', { |
||||
|
value: department.ID_DEPT, // case-sensitive as per object |
||||
|
text: department.DEPT_NAME |
||||
|
}); |
||||
|
// Append the option to the select element |
||||
|
$('#search_department_id').append(option); |
||||
|
}); |
||||
|
|
||||
|
}).catch(function(error) { |
||||
|
// Handle errors |
||||
|
console.error('Error fetching department list:', error); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/* Get Complaints Data */ |
||||
|
function get_complaints_data(){ |
||||
|
var apiUrl = '/gcc/api/pgr/getComplaintsList'; |
||||
|
// Return a Promise |
||||
|
return new Promise(function(resolve, reject) { |
||||
|
$.ajax({ |
||||
|
url: apiUrl, |
||||
|
type: 'GET', |
||||
|
dataType: 'json', |
||||
|
success: function(jsonResponse) { |
||||
|
// Resolve the Promise with the department list |
||||
|
resolve(jsonResponse); |
||||
|
}, |
||||
|
error: function(xhr, status, error) { |
||||
|
// Reject the Promise with the error message |
||||
|
reject(error); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/* Get Complaints List */ |
||||
|
function get_complaints_list(){ |
||||
|
get_complaints_data().then(function(complaintList) { |
||||
|
// Handle the department list |
||||
|
generate_table(complaintList); |
||||
|
|
||||
|
}).catch(function(error) { |
||||
|
// Handle errors |
||||
|
console.error('Error fetching department list:', error); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/* Call DataTable function */ |
||||
|
function generate_table(data){ |
||||
|
|
||||
|
var table = $('#complaintDatatable').DataTable( { |
||||
|
dom: 'Bftip', |
||||
|
columnDefs: [ |
||||
|
{ targets: 'no-sort', orderable: false } |
||||
|
], |
||||
|
lengthMenu: [ |
||||
|
[ 50, 100, 200, 500, -1 ], |
||||
|
[ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ] |
||||
|
], |
||||
|
scrollY: '50vh', |
||||
|
fixedColumns: { |
||||
|
left: 1, |
||||
|
right: 1 |
||||
|
}, |
||||
|
buttons: [buttons], |
||||
|
responsive: true, |
||||
|
searching: false, |
||||
|
select: false, |
||||
|
processing: false, |
||||
|
} ); |
||||
|
|
||||
|
// Clearn Table data |
||||
|
table.clear().draw(); |
||||
|
|
||||
|
// Add rows to DataTable |
||||
|
var rowNum = 1; |
||||
|
$.each(data, function(index, row) { |
||||
|
table.row.add([ |
||||
|
rowNum++, |
||||
|
row['ZONE_NAME'], |
||||
|
row['DIVISION_NAME'], |
||||
|
row['USER_NAME'], |
||||
|
"<a href=\"#\" onclick=\"return viewComplaintDetails('"+row['COMPLAINTNUMBER']+"')\" class=\"link\">"+row['COMPLAINTNUMBER']+"</a>", |
||||
|
row['COMPLAINTTYPENAME'], |
||||
|
row['LOCATION'], |
||||
|
row['COMPDATE'], |
||||
|
row['TIME'], |
||||
|
row['STATUS'] |
||||
|
]).draw(false); |
||||
|
}); |
||||
|
|
||||
|
// Now call for Filter |
||||
|
get_department_data(); |
||||
|
|
||||
|
remove_loading(); // remove Loading |
||||
|
} |
||||
|
|
||||
|
$(document).ready(function() { |
||||
|
call_loading(); |
||||
|
get_complaints_list(); |
||||
|
|
||||
|
}); |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
||||
@ -0,0 +1,792 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="en" dir=""> |
||||
|
<html xmlns:th="http://www.thymeleaf.org"> |
||||
|
<head th:replace="~{fragments/modules/base/head :: head}"></head> |
||||
|
<body> |
||||
|
<link rel="stylesheet" href="/assets/node_modules/amcharts3/amcharts/plugins/export/export.css" type="text/css" media="all" /> |
||||
|
<!--[if lt IE 8]> |
||||
|
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> |
||||
|
<![endif]--> |
||||
|
|
||||
|
<div class="wrapper"> |
||||
|
<!-- header top menu Start --> |
||||
|
<header th:replace="~{fragments/modules/base/header :: header}"></header> |
||||
|
<!-- header top menu end --> |
||||
|
|
||||
|
<div class="page-wrap"> |
||||
|
<!--=============== Left Menu side Start ================--> |
||||
|
<div th:replace="~{fragments/modules/base/menu :: menu}"></div> |
||||
|
<!--=============== Left side End ================--> |
||||
|
<div class="main-content"> |
||||
|
<div class="container-fluid"> |
||||
|
<div class="page-header mb-2"> |
||||
|
<div class="row align-items-end"> |
||||
|
<div class="col-lg-8"> |
||||
|
<div class="page-header-title"> |
||||
|
<i class="ik ik-bar-chart-2 bg-blue"></i> |
||||
|
<div class="d-inline"> |
||||
|
<h5>PGR</h5> |
||||
|
<span>Public Grievance Redressal Reports</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-lg-4"> |
||||
|
<nav class="breadcrumb-container" aria-label="breadcrumb"> |
||||
|
<ol class="breadcrumb"> |
||||
|
<li class="breadcrumb-item"> |
||||
|
<a href="index"><i class="ik ik-home"></i></a> |
||||
|
</li> |
||||
|
<li class="breadcrumb-item active" aria-current="page">Dashboard</li> |
||||
|
</ol> |
||||
|
</nav> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- <h4 class="h4 text-right text-mute" style="font-size: 12px;">Auot refresh in <font id="refresh-countdown">00</font> seconds</h4> --> |
||||
|
<div class="row"> |
||||
|
<div class="col-md-12"> |
||||
|
<div class="card sale-card"> |
||||
|
<div class="card-header"> |
||||
|
<i class="fas fa-chart-pie pr-2"></i><h3>OverAll Complaint Age Analysis</h3> |
||||
|
<div class="card-header-right"> |
||||
|
<i id="update_pie_loading"></i> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="card-block text-center" id=""> |
||||
|
<h3 id="pie_card" style="font-size:12px"></h3> |
||||
|
<div id="pie_content_html"> |
||||
|
|
||||
|
<h6>OverAll Pending</h6> |
||||
|
<h3 id="pie_pending" class="chart-shadow" style="height:350px; font-size:12px;border-bottom: 1px solid #dee2e6;">0</h3> |
||||
|
|
||||
|
<h6>OverAll Reopen</h6> |
||||
|
<h3 id="pie_reopen_pending" class="chart-shadow" style="height:350px; font-size:12px">0</h3> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="col-md-12"> |
||||
|
<div class="card sale-card"> |
||||
|
<div class="card-header"> |
||||
|
<i class="fas fa-chart-bar pr-2"></i><h3>Complaint`s Type Wise Pending Count`s</h3> |
||||
|
</div> |
||||
|
<div class="card-block"> |
||||
|
<div id="deal-analytic-chart" class="chart-shadow" style="height:300px"></div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div> |
||||
|
|
||||
|
<script th:replace="~{fragments/modules/base/script :: script}"></script> |
||||
|
<script th:replace="~{fragments/modules/pgr/script :: script}"></script> |
||||
|
|
||||
|
<script src="/assets/node_modules/amcharts3/amcharts/amcharts.js"></script> |
||||
|
<script src="/assets/node_modules/amcharts3/amcharts/serial.js"></script> |
||||
|
<script src="/assets/node_modules/amcharts3/amcharts/plugins/export/export.min.js"></script> |
||||
|
<script src="/assets/node_modules/amcharts3/amcharts/pie.js"></script> |
||||
|
<script src="/assets/node_modules/amcharts3/amcharts/themes/light.js"></script> |
||||
|
<!-- <script src="/assets/node_modules/fullcalendar/dist/fullcalendar.min.js"></script>--> |
||||
|
<script src="/assets/node_modules/tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.min.js"></script> |
||||
|
|
||||
|
<script> |
||||
|
var loading_text_msg = getLoadingMessage(); // get Random loading message from base/script |
||||
|
|
||||
|
const loading = $("#pie_card"); |
||||
|
var pie_data = ""; |
||||
|
var departmentlist = ""; |
||||
|
|
||||
|
function callPieFilter(){ |
||||
|
var filter = $("#search_id").val(); |
||||
|
pass_pie_data(filter); |
||||
|
pass_bar_data(filter); |
||||
|
} |
||||
|
|
||||
|
function callReSetPieFilter(){ |
||||
|
var filter = 0; |
||||
|
$("#search_id").val(filter); |
||||
|
pass_pie_data(filter); |
||||
|
pass_bar_data(filter); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
function get_department_data(){ |
||||
|
|
||||
|
get_department_list().then(function(departments) { |
||||
|
// Handle the department list |
||||
|
//console.log('Department list:', departmentlist); |
||||
|
departmentlist = departments; |
||||
|
fetchPie_Data(0); // Dropdown fileter value |
||||
|
fetchData_Bar(0); // Dropdown fileter value |
||||
|
|
||||
|
}).catch(function(error) { |
||||
|
// Handle errors |
||||
|
console.error('Error fetching department list:', error); |
||||
|
}); |
||||
|
/* |
||||
|
var apiUrl = '/gcc/api/pgr/getDepartments'; |
||||
|
$.ajax({ |
||||
|
url: apiUrl, |
||||
|
type: 'GET', |
||||
|
dataType: 'json', |
||||
|
success: function(jsonResponse) { |
||||
|
// Handle the API response data here |
||||
|
console.log('Data from API:', jsonResponse); |
||||
|
departmentlist = jsonResponse; |
||||
|
|
||||
|
fetchPie_Data(0); // Dropdown fileter value |
||||
|
fetchData_Bar(0); // Dropdown fileter value |
||||
|
}, |
||||
|
error: function(xhr, status, error) { |
||||
|
// Handle errors here |
||||
|
console.error('Error fetching data:', status, error); |
||||
|
} |
||||
|
}); |
||||
|
*/ |
||||
|
} |
||||
|
|
||||
|
function fetchPie_Data(deptid){ |
||||
|
|
||||
|
var pie_option = ""; |
||||
|
|
||||
|
for (var i = 0; i < departmentlist.length; i++) { |
||||
|
pie_option +='<option value="'+departmentlist[i]["ID_DEPT"]+'">'+departmentlist[i]["DEPT_NAME"]+'</option>'; |
||||
|
} |
||||
|
|
||||
|
call_loading('update_pie_loading','start'); |
||||
|
|
||||
|
var apiUrl = '/gcc/api/pgr/getPendingComplaintCount'; |
||||
|
$.ajax({ |
||||
|
url: apiUrl, |
||||
|
type: 'GET', |
||||
|
dataType: 'json', |
||||
|
success: function(jsonResponse) { |
||||
|
// Handle the API response data here |
||||
|
console.log('Data from API:', jsonResponse); |
||||
|
|
||||
|
pie_data = jsonResponse; |
||||
|
|
||||
|
$("#pie_content_html").html('' + |
||||
|
'<div class="row">' + |
||||
|
'<div class="col-12 mb-2">' + |
||||
|
'<div class="input-group mb-0">' + |
||||
|
'<span class="input-group-prepend">' + |
||||
|
'<button type="button" class="btn btn-success" onclick="callReSetPieFilter(0);" data-toggle="tooltip" data-animation="true" data-placement="top" data-original-title="Reset" title="Reset">' + |
||||
|
'<i class="ik ik-refresh-ccw"></i>' + |
||||
|
'</button>' + |
||||
|
'</span>' + |
||||
|
'<select class="form-control" id="search_id" name="search_id">' + |
||||
|
'<option value="0">All Departments</option>' + |
||||
|
'' + pie_option + |
||||
|
'</select>' + |
||||
|
'<span class="input-group-append">' + |
||||
|
'<button type="button" class="btn btn-success" onclick="callPieFilter();" data-toggle="tooltip" data-animation="true" data-placement="top" data-original-title="Search" title="Search">' + |
||||
|
'<i class="ik ik-search me-1"></i> Search' + |
||||
|
'</button>' + |
||||
|
'</span>' + |
||||
|
'</div>' + |
||||
|
'</div>' + |
||||
|
'</div>' + |
||||
|
'<h3 id="pie_pending" class="chart-shadow" style="height:350px; font-size:12px;border-bottom: 1px solid #dee2e6;">0</h3>' + |
||||
|
'<h3 id="pie_reopen_pending" class="chart-shadow" style="height:350px; font-size:12px">0</h3>' |
||||
|
); |
||||
|
|
||||
|
pass_pie_data(0); |
||||
|
}, |
||||
|
error: function(xhr, status, error) { |
||||
|
// Handle errors here |
||||
|
console.error('Error fetching data:', status, error); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
/* |
||||
|
let refreshInterval; |
||||
|
let remainingTime = 60; // Initial countdown time in seconds |
||||
|
|
||||
|
function updateCountdown() { |
||||
|
let remainingTimetxt = remainingTime; |
||||
|
if(remainingTime<10){ |
||||
|
remainingTimetxt = "0"+remainingTime; |
||||
|
} |
||||
|
document.getElementById("refresh-countdown").textContent = remainingTimetxt; |
||||
|
remainingTime--; |
||||
|
|
||||
|
if (remainingTime < 0) { |
||||
|
clearInterval(refreshInterval); |
||||
|
remainingTime = 60; |
||||
|
fetchDashboardSummary_Pie(); |
||||
|
refreshInterval = setInterval(updateCountdown, 1000); |
||||
|
} |
||||
|
} |
||||
|
*/ |
||||
|
</script> |
||||
|
|
||||
|
<script> |
||||
|
|
||||
|
function pass_pie_data(filter){ |
||||
|
|
||||
|
jsonResponse = pie_data; |
||||
|
|
||||
|
// Initialize variables to store sums |
||||
|
var pending_title = "OverAll Pending Without Reopen"; |
||||
|
var pending_reoprn_title = "OverAll Reopen Pending"; |
||||
|
|
||||
|
var DAYS_90_PEN = 0; |
||||
|
var DAYS_90_REOPEN = 0; |
||||
|
var DAYS_61_90_PEN = 0; |
||||
|
var DAYS_61_90_REOPEN = 0; |
||||
|
var DAYS_31_60_PEN = 0; |
||||
|
var DAYS_31_60_REOPEN = 0; |
||||
|
var DAYS_16_30_PEN = 0; |
||||
|
var DAYS_16_30_REOPEN = 0; |
||||
|
var DAYS_0_15_PEN = 0; |
||||
|
var DAYS_0_15_REOPEN = 0; |
||||
|
|
||||
|
var filterSearch = []; |
||||
|
// Loop through the jsonResponse array |
||||
|
for (var i = 0; i < jsonResponse.length; i++) { |
||||
|
// Accumulate values for each data |
||||
|
if(filter>0){ |
||||
|
/* |
||||
|
if(filter==48){ // Regional Office North (48) |
||||
|
//Zones Under 48: NA-THIRUVOTTIYR ID -32 || NB-MANALI ID- 33 || NC-MADHAVARAM ID- 34 || ND-TONDIARPET ID- 35 || NE-ROYAPURAM ID- 36 |
||||
|
filterSearch = [32, 33, 34, 35, 36]; |
||||
|
} |
||||
|
|
||||
|
else if(filter==50){ //Regional Office Central (50) |
||||
|
//Zones Under 50: NF-THIRU-VI-KA-NAGAR ID- 37 || NG-AMBATTUR ID- 38 || NH-ANNA NAGAR ID- 39 || NJ-TEYNAMPET ID- 40 || NK-KODAMBAKKAM ID- 41 |
||||
|
filterSearch = [37, 38, 39, 40, 41]; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
else if(filter==49){ //Regional Office South (49) |
||||
|
//Zones Under 49: NA-VALASARAVAKKAM ID - 42 || NM-ALANDUR ID- 43 || NN-ADYAR ID - 44 || NP-PERUNGUDI ID- 45 || NQ-SHOZHINGANALLUR - 46 |
||||
|
filterSearch = [42, 43, 44, 45, 46]; |
||||
|
} |
||||
|
else{ |
||||
|
filterSearch =[filter]; |
||||
|
} |
||||
|
|
||||
|
console.log(filterSearch); |
||||
|
*/ |
||||
|
//if (filterSearch.includes(jsonResponse[i]["DEPTID"])) { // Only Seleted Departments or Zone |
||||
|
if(jsonResponse[i]["DEPTID"]==filter){ |
||||
|
//alert(filter); |
||||
|
pending_title = "OverAll Pending Witout Reopen of "+jsonResponse[i]["DEPT_NAME"]; |
||||
|
pending_reoprn_title = "OverAll Reopen Pending of "+jsonResponse[i]["DEPT_NAME"]; |
||||
|
|
||||
|
DAYS_90_PEN += jsonResponse[i]["DAYS_90_PEN"]; |
||||
|
DAYS_90_REOPEN += jsonResponse[i]["DAYS_90_REOPEN"]; |
||||
|
DAYS_61_90_PEN += jsonResponse[i]["DAYS_61_90_PEN"]; |
||||
|
DAYS_61_90_REOPEN += jsonResponse[i]["DAYS_61_90_REOPEN"]; |
||||
|
DAYS_31_60_PEN += jsonResponse[i]["DAYS_31_60_PEN"]; |
||||
|
DAYS_31_60_REOPEN += jsonResponse[i]["DAYS_31_60_REOPEN"]; |
||||
|
DAYS_16_30_PEN += jsonResponse[i]["DAYS_16_30_PEN"]; |
||||
|
DAYS_16_30_REOPEN += jsonResponse[i]["DAYS_16_30_REOPEN"]; |
||||
|
DAYS_0_15_PEN += jsonResponse[i]["DAYS_0_15_PEN"]; |
||||
|
DAYS_0_15_REOPEN += jsonResponse[i]["DAYS_0_15_REOPEN"]; |
||||
|
} |
||||
|
} |
||||
|
else{ |
||||
|
// All data |
||||
|
DAYS_90_PEN += jsonResponse[i]["DAYS_90_PEN"]; |
||||
|
DAYS_90_REOPEN += jsonResponse[i]["DAYS_90_REOPEN"]; |
||||
|
DAYS_61_90_PEN += jsonResponse[i]["DAYS_61_90_PEN"]; |
||||
|
DAYS_61_90_REOPEN += jsonResponse[i]["DAYS_61_90_REOPEN"]; |
||||
|
DAYS_31_60_PEN += jsonResponse[i]["DAYS_31_60_PEN"]; |
||||
|
DAYS_31_60_REOPEN += jsonResponse[i]["DAYS_31_60_REOPEN"]; |
||||
|
DAYS_16_30_PEN += jsonResponse[i]["DAYS_16_30_PEN"]; |
||||
|
DAYS_16_30_REOPEN += jsonResponse[i]["DAYS_16_30_REOPEN"]; |
||||
|
DAYS_0_15_PEN += jsonResponse[i]["DAYS_0_15_PEN"]; |
||||
|
DAYS_0_15_REOPEN += jsonResponse[i]["DAYS_0_15_REOPEN"]; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
var pieData = [ |
||||
|
{ "title":"Above 90 Days", "color": "#F22613", "value": DAYS_90_PEN }, |
||||
|
{ "title":"61 - 90 Days", "color": "#F29D13", "value": DAYS_61_90_PEN }, |
||||
|
{ "title":"31 - 60 Days", "color": "#F2BA13", "value": DAYS_31_60_PEN }, |
||||
|
{ "title":"16 - 30 Days", "color": "#F2EB13", "value": DAYS_16_30_PEN }, |
||||
|
{ "title":"0 - 15 Days", "color": "#91F213", "value": DAYS_0_15_PEN } |
||||
|
]; |
||||
|
|
||||
|
var pieData_reoprn = [ |
||||
|
{ "title":"Above 90 Days", "color": "#F22613", "value": DAYS_90_REOPEN }, |
||||
|
{ "title":"61 - 90 Days", "color": "#F29D13", "value": DAYS_61_90_REOPEN }, |
||||
|
{ "title":"31 - 60 Days", "color": "#F2BA13", "value": DAYS_31_60_REOPEN }, |
||||
|
{ "title":"16 - 30 Days", "color": "#F2EB13", "value": DAYS_16_30_REOPEN }, |
||||
|
{ "title":"0 - 15 Days", "color": "#91F213", "value": DAYS_0_15_REOPEN } |
||||
|
]; |
||||
|
|
||||
|
|
||||
|
call_pending_pie(pieData,pending_title); |
||||
|
call_pending_reopen_pie(pieData_reoprn,pending_reoprn_title); |
||||
|
|
||||
|
loading.html(""); |
||||
|
|
||||
|
$("#update_pie_loading").html(""); |
||||
|
} |
||||
|
|
||||
|
function call_pending_pie(pieData,title){ |
||||
|
|
||||
|
var chart = AmCharts.makeChart("pie_pending", { |
||||
|
"type": "pie", |
||||
|
"theme": "light", |
||||
|
"dataProvider": pieData, |
||||
|
"valueField": "value", |
||||
|
"titleField": "title", |
||||
|
"colorField": "color", |
||||
|
"alpha": 0.8, |
||||
|
"outlineAlpha": 0.5, |
||||
|
//"depth3D": 25, |
||||
|
"balloonText": "[[[[title]]]]<br><span style='font-size:14px'><b>[[[[value]]]]</b> ([[[[percents]]]]%)</span>", |
||||
|
"angle": 45, |
||||
|
"export": { |
||||
|
"enabled": true, |
||||
|
"fileName": title |
||||
|
}, |
||||
|
"legend": { |
||||
|
"position": "right" |
||||
|
}, |
||||
|
"titles": [{ |
||||
|
"text": title, |
||||
|
"size": 15, |
||||
|
"marginBottom": 20 |
||||
|
}] |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
function call_pending_reopen_pie(pieData,title){ |
||||
|
|
||||
|
var chart = AmCharts.makeChart("pie_reopen_pending", { |
||||
|
"type": "pie", |
||||
|
"theme": "light", |
||||
|
"dataProvider": pieData, |
||||
|
"valueField": "value", |
||||
|
"titleField": "title", |
||||
|
"colorField": "color", |
||||
|
"alpha": 0.8, |
||||
|
"outlineAlpha": 0.5, |
||||
|
//"depth3D": 25, |
||||
|
"balloonText": "[[[[title]]]]<br><span style='font-size:14px'><b>[[[[value]]]]</b> ([[[[percents]]]]%)</span>", |
||||
|
"angle": 45, |
||||
|
"export": { |
||||
|
"enabled": true, |
||||
|
"fileName": title |
||||
|
}, |
||||
|
"legend": { |
||||
|
"position": "right" |
||||
|
}, |
||||
|
"titles": [{ |
||||
|
"text": title, |
||||
|
"size": 15, |
||||
|
"marginBottom": 20 |
||||
|
}] |
||||
|
}); |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<script> |
||||
|
var bar_data_1 = ""; |
||||
|
var bar_data_2 = ""; |
||||
|
var chart = ""; |
||||
|
|
||||
|
var pending_title = "OverAll Pending By Complaint`s Type"; |
||||
|
var pending_reopen_title = "OverAll Reopen By Complaint`s Type"; |
||||
|
|
||||
|
function fetchData_Bar(deptid){ |
||||
|
|
||||
|
call_loading('update_bar_loading','start'); |
||||
|
|
||||
|
var apiUrl = '/gcc/api/pgr/getZoneWisePendingComplaintCount'; |
||||
|
$.ajax({ |
||||
|
url: apiUrl, |
||||
|
type: 'GET', |
||||
|
dataType: 'json', |
||||
|
success: function(jsonResponse) { |
||||
|
// Handle the API response data here |
||||
|
console.log('Data from API:', jsonResponse); |
||||
|
|
||||
|
bar_data_1 = jsonResponse; |
||||
|
|
||||
|
fetch2Data_Bar(0); |
||||
|
|
||||
|
//loading.html(""); |
||||
|
|
||||
|
//$("#update_pie_loading").html(""); |
||||
|
}, |
||||
|
error: function(xhr, status, error) { |
||||
|
// Handle errors here |
||||
|
console.error('Error fetching data:', status, error); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
function fetch2Data_Bar(deptid){ |
||||
|
var apiUrl = '/gcc/api/pgr/getZoneWiseReopenComplaintCount'; |
||||
|
$.ajax({ |
||||
|
url: apiUrl, |
||||
|
type: 'GET', |
||||
|
dataType: 'json', |
||||
|
success: function(jsonResponse) { |
||||
|
// Handle the API response data here |
||||
|
console.log('Data from API:', jsonResponse); |
||||
|
|
||||
|
bar_data_2 = jsonResponse; |
||||
|
|
||||
|
pass_bar_data(0); |
||||
|
|
||||
|
//loading.html(""); |
||||
|
|
||||
|
//$("#update_pie_loading").html(""); |
||||
|
}, |
||||
|
error: function(xhr, status, error) { |
||||
|
// Handle errors here |
||||
|
console.error('Error fetching data:', status, error); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
function pass_bar_data(filter){ |
||||
|
|
||||
|
jsonResponse = bar_data_1; |
||||
|
jsonResponse2 = bar_data_2; |
||||
|
|
||||
|
// Initialize variables to store sums |
||||
|
|
||||
|
var NONBURSTLT = 0; |
||||
|
var REOFGAR = 0; |
||||
|
var ROAD = 0; |
||||
|
var MOSQUITE = 0; |
||||
|
var WATER = 0; |
||||
|
var REOFDEB = 0; |
||||
|
var TREE = 0; |
||||
|
var DOGS = 0; |
||||
|
var ENCMTN = 0; |
||||
|
var POT = 0; |
||||
|
var PTAX = 0; |
||||
|
var OTHERS = 0; |
||||
|
|
||||
|
var NONBURSTLT_REOPEN = 0; |
||||
|
var REOFGAR_REOPEN = 0; |
||||
|
var ROAD_REOPEN = 0; |
||||
|
var MOSQUITE_REOPEN = 0; |
||||
|
var WATER_REOPEN = 0; |
||||
|
var REOFDEB_REOPEN = 0; |
||||
|
var TREE_REOPEN = 0; |
||||
|
var DOGS_REOPEN = 0; |
||||
|
var ENCMTN_REOPEN = 0; |
||||
|
var POT_REOPEN = 0; |
||||
|
var PTAX_REOPEN = 0; |
||||
|
var OTHERS_REOPEN = 0; |
||||
|
|
||||
|
var filterSearch = []; |
||||
|
// Loop through the jsonResponse array |
||||
|
for (var i = 0; i < jsonResponse.length; i++) { |
||||
|
// Accumulate values for each data |
||||
|
if(filter>0){ |
||||
|
if(filter==48){ // Regional Office North (48) |
||||
|
//Zones Under 48: NA-THIRUVOTTIYR ID -32 || NB-MANALI ID- 33 || NC-MADHAVARAM ID- 34 || ND-TONDIARPET ID- 35 || NE-ROYAPURAM ID- 36 |
||||
|
filterSearch = [32, 33, 34, 35, 36]; |
||||
|
} |
||||
|
|
||||
|
else if(filter==50){ //Regional Office Central (50) |
||||
|
//Zones Under 50: NF-THIRU-VI-KA-NAGAR ID- 37 || NG-AMBATTUR ID- 38 || NH-ANNA NAGAR ID- 39 || NJ-TEYNAMPET ID- 40 || NK-KODAMBAKKAM ID- 41 |
||||
|
filterSearch = [37, 38, 39, 40, 41]; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
else if(filter==49){ //Regional Office South (49) |
||||
|
//Zones Under 49: NA-VALASARAVAKKAM ID - 42 || NM-ALANDUR ID- 43 || NN-ADYAR ID - 44 || NP-PERUNGUDI ID- 45 || NQ-SHOZHINGANALLUR - 46 |
||||
|
filterSearch = [42, 43, 44, 45, 46]; |
||||
|
} |
||||
|
else{ |
||||
|
filterSearch =[filter]; |
||||
|
} |
||||
|
|
||||
|
if (filterSearch.includes(jsonResponse[i]["DEPTID"])) { // Only Seleted Departments or Zone |
||||
|
|
||||
|
pending_title = "OverAll Pending of "+jsonResponse[i]["DEPT_NAME"]+" By Complaint`s Type"; |
||||
|
pending_reopen_title = "OverAll Reopen of "+jsonResponse[i]["DEPT_NAME"]+" By Complaint`s Type"; |
||||
|
|
||||
|
NONBURSTLT += jsonResponse[i]["NONBURSTLT"]; |
||||
|
REOFGAR += jsonResponse[i]["REOFGAR"]; |
||||
|
ROAD += jsonResponse[i]["ROAD"]; |
||||
|
MOSQUITE += jsonResponse[i]["MOSQUITE"]; |
||||
|
WATER += jsonResponse[i]["WATER"]; |
||||
|
REOFDEB += jsonResponse[i]["REOFDEB"]; |
||||
|
TREE += jsonResponse[i]["TREE"]; |
||||
|
DOGS += jsonResponse[i]["DOGS"]; |
||||
|
ENCMTN += jsonResponse[i]["ENCMTN"]; |
||||
|
POT += jsonResponse[i]["POT"]; |
||||
|
PTAX += jsonResponse[i]["PTAX"]; |
||||
|
OTHERS += jsonResponse[i]["OTHERS"]; |
||||
|
} |
||||
|
} |
||||
|
else{ |
||||
|
// All data |
||||
|
NONBURSTLT += jsonResponse[i]["NONBURSTLT"]; |
||||
|
REOFGAR += jsonResponse[i]["REOFGAR"]; |
||||
|
ROAD += jsonResponse[i]["ROAD"]; |
||||
|
MOSQUITE += jsonResponse[i]["MOSQUITE"]; |
||||
|
WATER += jsonResponse[i]["WATER"]; |
||||
|
REOFDEB += jsonResponse[i]["REOFDEB"]; |
||||
|
TREE += jsonResponse[i]["TREE"]; |
||||
|
DOGS += jsonResponse[i]["DOGS"]; |
||||
|
ENCMTN += jsonResponse[i]["ENCMTN"]; |
||||
|
POT += jsonResponse[i]["POT"]; |
||||
|
PTAX += jsonResponse[i]["PTAX"]; |
||||
|
OTHERS += jsonResponse[i]["OTHERS"]; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
// Loop through the jsonResponse array |
||||
|
for (var i = 0; i < jsonResponse2.length; i++) { |
||||
|
// Accumulate values for each data |
||||
|
if(filter>0){ |
||||
|
if(jsonResponse2[i]["DEPTID"]==filter){ // Only Seleted Departments or Zone |
||||
|
|
||||
|
pending_title = "OverAll Pending of "+jsonResponse2[i]["DEPT_NAME"]+" By Complaint`s Type"; |
||||
|
pending_reoprn_title = "OverAll Reopen of "+jsonResponse2[i]["DEPT_NAME"]+" By Complaint`s Type"; |
||||
|
|
||||
|
NONBURSTLT_REOPEN += jsonResponse2[i]["NONBURSTLT"]; |
||||
|
REOFGAR_REOPEN += jsonResponse2[i]["REOFGAR"]; |
||||
|
ROAD_REOPEN += jsonResponse2[i]["ROAD"]; |
||||
|
MOSQUITE_REOPEN += jsonResponse2[i]["MOSQUITE"]; |
||||
|
WATER_REOPEN += jsonResponse2[i]["WATER"]; |
||||
|
REOFDEB_REOPEN += jsonResponse2[i]["REOFDEB"]; |
||||
|
TREE_REOPEN += jsonResponse2[i]["TREE"]; |
||||
|
DOGS_REOPEN += jsonResponse2[i]["DOGS"]; |
||||
|
ENCMTN_REOPEN += jsonResponse2[i]["ENCMTN"]; |
||||
|
POT_REOPEN += jsonResponse2[i]["POT"]; |
||||
|
PTAX_REOPEN += jsonResponse2[i]["PTAX"]; |
||||
|
OTHERS_REOPEN += jsonResponse2[i]["OTHERS"]; |
||||
|
} |
||||
|
} |
||||
|
else{ |
||||
|
// All data |
||||
|
NONBURSTLT_REOPEN += jsonResponse2[i]["NONBURSTLT"]; |
||||
|
REOFGAR_REOPEN += jsonResponse2[i]["REOFGAR"]; |
||||
|
ROAD_REOPEN += jsonResponse2[i]["ROAD"]; |
||||
|
MOSQUITE_REOPEN += jsonResponse2[i]["MOSQUITE"]; |
||||
|
WATER_REOPEN += jsonResponse2[i]["WATER"]; |
||||
|
REOFDEB_REOPEN += jsonResponse2[i]["REOFDEB"]; |
||||
|
TREE_REOPEN += jsonResponse2[i]["TREE"]; |
||||
|
DOGS_REOPEN += jsonResponse2[i]["DOGS"]; |
||||
|
ENCMTN_REOPEN += jsonResponse2[i]["ENCMTN"]; |
||||
|
POT_REOPEN += jsonResponse2[i]["POT"]; |
||||
|
PTAX_REOPEN += jsonResponse2[i]["PTAX"]; |
||||
|
OTHERS_REOPEN += jsonResponse2[i]["OTHERS"]; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
var barData = [ |
||||
|
{ |
||||
|
"issueCategory": "Street Light<br>not burning", |
||||
|
"AllPendingwithReopen": NONBURSTLT, |
||||
|
"onlyReopen": NONBURSTLT_REOPEN |
||||
|
}, |
||||
|
{ |
||||
|
"issueCategory": "Removal of<br>Garbage", |
||||
|
"AllPendingwithReopen": REOFGAR, |
||||
|
"onlyReopen": REOFGAR_REOPEN |
||||
|
}, |
||||
|
{ |
||||
|
"issueCategory": "Road<br>Damaged", |
||||
|
"AllPendingwithReopen": ROAD, |
||||
|
"onlyReopen": ROAD_REOPEN |
||||
|
}, |
||||
|
{ |
||||
|
"issueCategory": "Mosquito<br>Nuisance", |
||||
|
"AllPendingwithReopen": MOSQUITE, |
||||
|
"onlyReopen": MOSQUITE_REOPEN |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
"issueCategory": "Water<br>Stagnation", |
||||
|
"AllPendingwithReopen": WATER, |
||||
|
"onlyReopen": WATER_REOPEN |
||||
|
}, |
||||
|
{ |
||||
|
"issueCategory": "Removal of<br>Debries", |
||||
|
"AllPendingwithReopen": REOFDEB, |
||||
|
"onlyReopen": REOFDEB_REOPEN |
||||
|
}, |
||||
|
{ |
||||
|
"issueCategory": "Tree<br>Fallen", |
||||
|
"AllPendingwithReopen": TREE, |
||||
|
"onlyReopen": TREE_REOPEN |
||||
|
}, |
||||
|
{ |
||||
|
"issueCategory": "Dog<br>Menace", |
||||
|
"AllPendingwithReopen": DOGS, |
||||
|
"onlyReopen": DOGS_REOPEN |
||||
|
}, |
||||
|
{ |
||||
|
"issueCategory": "Encroachment", |
||||
|
"AllPendingwithReopen": ENCMTN, |
||||
|
"onlyReopen": ENCMTN_REOPEN |
||||
|
}, |
||||
|
{ |
||||
|
"issueCategory": "Potshole", |
||||
|
"AllPendingwithReopen": POT, |
||||
|
"onlyReopen": POT_REOPEN |
||||
|
}, |
||||
|
{ |
||||
|
"issueCategory": "Property Tax", |
||||
|
"AllPendingwithReopen": PTAX, |
||||
|
"onlyReopen": PTAX_REOPEN |
||||
|
}, |
||||
|
{ |
||||
|
"issueCategory": "Others", |
||||
|
"AllPendingwithReopen": OTHERS, |
||||
|
"onlyReopen": OTHERS_REOPEN |
||||
|
}, |
||||
|
|
||||
|
]; |
||||
|
|
||||
|
call_zonewise_pending_bar(barData); |
||||
|
} |
||||
|
|
||||
|
function call_zonewise_pending_bar(chartData){ |
||||
|
|
||||
|
/* |
||||
|
var chartData = []; |
||||
|
var currentDate = new Date(); |
||||
|
var currentMonth = currentDate.getMonth() + 1; |
||||
|
var currentYear = currentDate.getFullYear(); |
||||
|
var daysInMonth = new Date(currentYear, currentMonth, 0).getDate(); |
||||
|
|
||||
|
// Generate random data for each date in the current month |
||||
|
for (var i = 1; i <= daysInMonth; i++) { |
||||
|
var randomValue1 = Math.floor(Math.random() * 100); // Replace 100 with the maximum value you want |
||||
|
var randomValue2 = Math.floor(Math.random() * 100); // Replace 100 with the maximum value you want |
||||
|
|
||||
|
var issueCategory = currentYear + '-' + (currentMonth < 10 ? '0' : '') + currentMonth + '-' + (i < 10 ? '0' : '') + i; |
||||
|
|
||||
|
var dataPoint = { |
||||
|
"issueCategory": issueCategory, |
||||
|
"AllPendingwithReopen": randomValue1, |
||||
|
"onlyReopen": randomValue2 |
||||
|
}; |
||||
|
chartData.push(dataPoint); |
||||
|
} |
||||
|
*/ |
||||
|
|
||||
|
// deal-analytic-chart |
||||
|
chart = AmCharts.makeChart("deal-analytic-chart", { |
||||
|
"type": "serial", |
||||
|
"theme": "light", |
||||
|
//"dataDateFormat": "YYYY-MM-DD", |
||||
|
//"precision": 2, |
||||
|
"valueAxes": [{ |
||||
|
"id": "v1", |
||||
|
"position": "left", |
||||
|
"autoGridCount": false, |
||||
|
"labelFunction": function(value) { |
||||
|
return "$" + Math.round(value) + "M"; |
||||
|
} |
||||
|
}, { |
||||
|
"id": "v2", |
||||
|
"gridAlpha": 0, |
||||
|
"autoGridCount": false |
||||
|
}], |
||||
|
"graphs": [{ |
||||
|
"id": "g1", |
||||
|
"valueAxis": "v2", |
||||
|
/*"bullet": "round", |
||||
|
"bulletBorderAlpha": 1, |
||||
|
"bulletColor": "#FFFFFF", |
||||
|
"bulletSize": 8, |
||||
|
"hideBulletsCount": 50, |
||||
|
"lineThickness": 3, |
||||
|
"lineColor": "#2ed8b6",*/ |
||||
|
"lineColor": "#2ed8b6", |
||||
|
"fillColors": "#2ed8b6", |
||||
|
"type": "column", |
||||
|
"fillAlphas": 0.3, |
||||
|
"columnWidth": 0.5, |
||||
|
"title": pending_title, |
||||
|
"useLineColorForBulletBorder": true, |
||||
|
"valueField": "AllPendingwithReopen", |
||||
|
"balloonText": "[[[[title]]]]<br /><b style='font-size: 130%'>[[[[value]]]]</b>" |
||||
|
}, { |
||||
|
"id": "g2", |
||||
|
"valueAxis": "v2", |
||||
|
//"bullet": "round", |
||||
|
//"bulletBorderAlpha": 1, |
||||
|
//"bulletColor": "#FFFFFF", |
||||
|
//"bulletSize": 8, |
||||
|
//"hideBulletsCount": 50, |
||||
|
//"lineThickness": 3, |
||||
|
//"lineColor": "#e95753", |
||||
|
"lineColor": "#F22613", |
||||
|
"fillColors": "#F22613", |
||||
|
"type": "column", |
||||
|
"fillAlphas": 0.3, |
||||
|
"columnWidth": 0.5, |
||||
|
"title": pending_reopen_title, |
||||
|
"useLineColorForBulletBorder": true, |
||||
|
"valueField": "onlyReopen", |
||||
|
"balloonText": "[[[[title]]]]<br /><b style='font-size: 130%'>[[[[value]]]]</b>" |
||||
|
}], |
||||
|
"chartCursor": { |
||||
|
"pan": true, |
||||
|
"valueLineEnabled": true, |
||||
|
"valueLineBalloonEnabled": true, |
||||
|
"cursorAlpha": 0, |
||||
|
"valueLineAlpha": 0.2 |
||||
|
}, |
||||
|
"categoryField": "issueCategory", |
||||
|
"categoryAxis": { |
||||
|
//"parseDates": true, |
||||
|
"dashLength": 1, |
||||
|
"minorGridEnabled": true |
||||
|
}, |
||||
|
"legend": { |
||||
|
"useGraphSettings": true, |
||||
|
"position": "top" |
||||
|
}, |
||||
|
"balloon": { |
||||
|
"borderThickness": 1, |
||||
|
"shadowAlpha": 0 |
||||
|
}, |
||||
|
"export": { |
||||
|
"enabled": true, |
||||
|
"fileName": "Complaint`s Type Wise Pending Count`s" |
||||
|
}, |
||||
|
"dataProvider": chartData, |
||||
|
}); |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<script> |
||||
|
$(document).ready(function() { |
||||
|
|
||||
|
//loading.html(searchinfo("<b>Please wait as I'm trying to fetch the data. It will take less than 30 seconds.</b>")); |
||||
|
loading.html(searchinfo("<b>"+loading_text_msg+"</b>")); |
||||
|
call_loading('deal-analytic-chart','start'); |
||||
|
|
||||
|
$("#pie_content_html").html(""); |
||||
|
|
||||
|
// Initial fetch and countdown start |
||||
|
get_department_data(); // Dropdown fileter value |
||||
|
|
||||
|
//refreshInterval = setInterval(updateCountdown, 1000); |
||||
|
}); |
||||
|
</script> |
||||
|
|
||||
|
</body> |
||||
|
</html> |
||||
@ -0,0 +1,299 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="en" dir=""> |
||||
|
<html xmlns:th="http://www.thymeleaf.org"> |
||||
|
<head th:replace="~{fragments/modules/base/head :: head}"></head> |
||||
|
<body> |
||||
|
<!--[if lt IE 8]> |
||||
|
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> |
||||
|
<![endif]--> |
||||
|
|
||||
|
<div class="wrapper"> |
||||
|
<!-- header top menu Start --> |
||||
|
<header th:replace="~{fragments/modules/base/header :: header}"></header> |
||||
|
<!-- header top menu end --> |
||||
|
|
||||
|
<div class="page-wrap"> |
||||
|
<!--=============== Left Menu side Start ================--> |
||||
|
<div th:replace="~{fragments/modules/base/menu :: menu}"></div> |
||||
|
<!--=============== Left side End ================--> |
||||
|
<div class="main-content"> |
||||
|
<div class="container-fluid"> |
||||
|
<div class="page-header"> |
||||
|
<div class="row align-items-end"> |
||||
|
<div class="col-lg-6"> |
||||
|
<div class="page-header-title"> |
||||
|
<i class="ik ik-thumbs-up bg-blue"></i> |
||||
|
<div class="d-inline"> |
||||
|
<h5>QA AND QC Report</h5> |
||||
|
<span>Public Grievance Redressal Reports</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-lg-6"> |
||||
|
<nav class="breadcrumb-container" aria-label="breadcrumb"> |
||||
|
<ol class="breadcrumb"> |
||||
|
<li class="breadcrumb-item"> |
||||
|
<a href="/index"><i class="ik ik-home"></i></a> |
||||
|
</li> |
||||
|
<li class="breadcrumb-item active" aria-current="page">All Reports</li> |
||||
|
</ol> |
||||
|
</nav> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<hr> |
||||
|
<div class="row"> |
||||
|
<div class="col-md-12"> |
||||
|
<div class="card"> |
||||
|
|
||||
|
<div class="card-block"> |
||||
|
<div th:replace="~{fragments/modules/pgr/search_form :: div}"></div> |
||||
|
<div id="tableLoading"></div> |
||||
|
<div> |
||||
|
<table id="complaintDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%"> |
||||
|
<thead class="thead-dark"> |
||||
|
<tr class="table-bordered"> |
||||
|
<th class="text-center no-sort">S.No</th> |
||||
|
<th class="text-center">Complaint No.</th> |
||||
|
<th class="text-center">Department</th> |
||||
|
<th class="text-center">Complaint Type</th> |
||||
|
<th class="text-center">Date</th> |
||||
|
<th class="text-center">Time</th> |
||||
|
<th class="text-center">Complaint Details</th> |
||||
|
<th class="text-center">Reporter Name</th> |
||||
|
<th class="text-center">Reporter Mobile</th> |
||||
|
<th class="text-center">Officer ID</th> |
||||
|
<th class="text-center">Officer Mobile</th> |
||||
|
<th class="text-center">Completion Date</th> |
||||
|
<th class="text-center">Status</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
|
||||
|
</tbody> |
||||
|
<tfoot class="thead-dark"> |
||||
|
<tr> |
||||
|
<th class="text-center no-sort">S.No</th> |
||||
|
<th class="text-center">Complaint No.</th> |
||||
|
<th class="text-center">Department</th> |
||||
|
<th class="text-center">Complaint Type</th> |
||||
|
<th class="text-center">Date</th> |
||||
|
<th class="text-center">Time</th> |
||||
|
<th class="text-center">Complaint Details</th> |
||||
|
<th class="text-center">Reporter Name</th> |
||||
|
<th class="text-center">Reporter Mobile</th> |
||||
|
<th class="text-center">Officer ID</th> |
||||
|
<th class="text-center">Officer Mobile</th> |
||||
|
<th class="text-center">Completion Date</th> |
||||
|
<th class="text-center">Status</th> |
||||
|
</tr> |
||||
|
</tfoot> |
||||
|
</table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div th:replace="~{fragments/modules/pgr/modal-box :: div}"></div> |
||||
|
|
||||
|
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div> |
||||
|
|
||||
|
<script th:replace="~{fragments/modules/base/script :: script}"></script> |
||||
|
<script th:replace="~{fragments/modules/pgr/script :: script}"></script> |
||||
|
<script th:inline="javascript"> |
||||
|
|
||||
|
var loading_text_msg = getLoadingMessage(); // get Random loading message from base/script |
||||
|
|
||||
|
// Loading Div id |
||||
|
const loading = $("#tableLoading"); |
||||
|
|
||||
|
// DataTables buttons configuration |
||||
|
var buttons = [ |
||||
|
{ |
||||
|
extend: 'pageLength', |
||||
|
className: 'btn btn-warning' |
||||
|
}, |
||||
|
{ |
||||
|
title: 'Data export', |
||||
|
extend: 'copyHtml5', |
||||
|
text: 'Copy', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'copyBtn' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'excelHtml5', |
||||
|
text: 'Excel', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'excelBtn', |
||||
|
title: 'Petition List' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'csvHtml5', |
||||
|
text: 'CSV', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'csvBtn', |
||||
|
title: 'Petition List' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'pdfHtml5', |
||||
|
text: 'PDF', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'pdfBtn', |
||||
|
title: 'Petition List' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'print', |
||||
|
text: 'Print', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'printBtn', |
||||
|
title: 'Petition List' |
||||
|
} |
||||
|
]; |
||||
|
|
||||
|
|
||||
|
function call_loading(){ |
||||
|
$("#filter_reset_btn").prop("disabled", true); |
||||
|
$("#filter_search_btn").prop("disabled", true); |
||||
|
loading.html(searchinfo("<b>"+loading_text_msg+"</b>")); |
||||
|
} |
||||
|
|
||||
|
function remove_loading(){ |
||||
|
$("#filter_reset_btn").prop("disabled", false); |
||||
|
$("#filter_search_btn").prop("disabled", false); |
||||
|
loading.html(""); |
||||
|
} |
||||
|
|
||||
|
/* Get Department Data */ |
||||
|
function get_department_data(){ |
||||
|
|
||||
|
get_department_list().then(function(departments) { |
||||
|
// Handle the department list |
||||
|
departmentlist = departments; |
||||
|
|
||||
|
// Iterate through the department list and add options to the select element |
||||
|
$.each(departmentlist, function(index, department) { |
||||
|
// Create an option element |
||||
|
var option = $('<option>', { |
||||
|
value: department.ID_DEPT, // case-sensitive as per object |
||||
|
text: department.DEPT_NAME |
||||
|
}); |
||||
|
// Append the option to the select element |
||||
|
$('#search_department_id').append(option); |
||||
|
}); |
||||
|
|
||||
|
}).catch(function(error) { |
||||
|
// Handle errors |
||||
|
console.error('Error fetching department list:', error); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/* Get QaQc Data */ |
||||
|
function get_qaqc_data(){ |
||||
|
var apiUrl = '/gcc/api/pgr/getQaQcList'; |
||||
|
// Return a Promise |
||||
|
return new Promise(function(resolve, reject) { |
||||
|
$.ajax({ |
||||
|
url: apiUrl, |
||||
|
type: 'GET', |
||||
|
dataType: 'json', |
||||
|
success: function(jsonResponse) { |
||||
|
// Resolve the Promise with the department list |
||||
|
console.log('Response list:', jsonResponse); |
||||
|
resolve(jsonResponse); |
||||
|
}, |
||||
|
error: function(xhr, status, error) { |
||||
|
// Reject the Promise with the error message |
||||
|
reject(error); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/* Get Complaints List */ |
||||
|
function get_qaqc_list(){ |
||||
|
get_qaqc_data().then(function(complaintList) { |
||||
|
// Handle the department list |
||||
|
generate_table(complaintList); |
||||
|
|
||||
|
}).catch(function(error) { |
||||
|
// Handle errors |
||||
|
console.error('Error fetching department list:', error); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/* Call DataTable function */ |
||||
|
function generate_table(data){ |
||||
|
|
||||
|
// Check for mobile |
||||
|
var isMobile = window.innerWidth <= 768; // Adjust the breakpoint as needed |
||||
|
|
||||
|
|
||||
|
var table = $('#complaintDatatable').DataTable( { |
||||
|
dom: 'Bftip', |
||||
|
columnDefs: [ |
||||
|
{ targets: 'no-sort', orderable: false } |
||||
|
], |
||||
|
lengthMenu: [ |
||||
|
[ 50, 100, 200, 500, -1 ], |
||||
|
[ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ] |
||||
|
], |
||||
|
scrollY: '50vh', |
||||
|
scrollX: '50vh', |
||||
|
fixedColumns: { |
||||
|
left: 0, |
||||
|
right: 0 |
||||
|
}, |
||||
|
buttons: [buttons], |
||||
|
responsive: isMobile, // Set responsive option based on device width |
||||
|
searching: false, |
||||
|
select: false, |
||||
|
processing: false, |
||||
|
} ); |
||||
|
|
||||
|
// Clearn Table data |
||||
|
table.clear().draw(); |
||||
|
|
||||
|
// Add rows to DataTable |
||||
|
var rowNum = 1; |
||||
|
$.each(data, function(index, row) { |
||||
|
table.row.add([ |
||||
|
rowNum++, |
||||
|
"<a href=\"#\" onclick=\"return viewComplaintDetails('"+row['COMPLAINTNUMBER']+"')\" class=\"link\">"+row['COMPLAINTNUMBER']+"</a>", |
||||
|
row['DEPT_NAME'], |
||||
|
row['COMPLAINTTYPENAME'], |
||||
|
row['COMPLAINTDATE'], |
||||
|
row['COMPLAINTTIME'], |
||||
|
row['COMPLAINTDETAILS'], |
||||
|
row['COMPLAINANTFIRSTNAME'], |
||||
|
row['COMPLAINANTMOBILENUMBER'], |
||||
|
row['USER_NAME'], |
||||
|
row['MOBILE_NUMBER'], |
||||
|
row['COMPLAINTCOMPLETIONDATE'], |
||||
|
row['STATUS'] |
||||
|
]).draw(false); |
||||
|
}); |
||||
|
|
||||
|
// Now call for Filter |
||||
|
get_department_data(); |
||||
|
|
||||
|
remove_loading(); // remove Loading |
||||
|
} |
||||
|
|
||||
|
$(document).ready(function() { |
||||
|
call_loading(); |
||||
|
get_qaqc_list(); |
||||
|
|
||||
|
}); |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
||||
@ -0,0 +1,648 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="en" dir=""> |
||||
|
<html xmlns:th="http://www.thymeleaf.org"> |
||||
|
<head th:replace="~{fragments/modules/base/head :: head}"></head> |
||||
|
<body> |
||||
|
<!--[if lt IE 8]> |
||||
|
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> |
||||
|
<![endif]--> |
||||
|
|
||||
|
<div class="wrapper"> |
||||
|
<!-- header top menu Start --> |
||||
|
<header th:replace="~{fragments/modules/base/header :: header}"></header> |
||||
|
<!-- header top menu end --> |
||||
|
|
||||
|
<div class="page-wrap"> |
||||
|
<!--=============== Left Menu side Start ================--> |
||||
|
<div th:replace="~{fragments/modules/base/menu :: menu}"></div> |
||||
|
<!--=============== Left side End ================--> |
||||
|
<div class="main-content"> |
||||
|
<div class="container-fluid"> |
||||
|
<div class="page-header"> |
||||
|
<div class="row align-items-end"> |
||||
|
<div class="col-lg-6"> |
||||
|
<div class="page-header-title"> |
||||
|
<i class="fas fa-street-view bg-blue"></i> |
||||
|
<div class="d-inline"> |
||||
|
<h5>Zone Wise With Reopen Report</h5> |
||||
|
<span>Public Grievance Redressal Reports</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-lg-6"> |
||||
|
<nav class="breadcrumb-container" aria-label="breadcrumb"> |
||||
|
<ol class="breadcrumb"> |
||||
|
<li class="breadcrumb-item"> |
||||
|
<a href="/index"><i class="ik ik-home"></i></a> |
||||
|
</li> |
||||
|
<li class="breadcrumb-item" aria-current="page">Zone Wise Report</li> |
||||
|
<li class="breadcrumb-item active" aria-current="page">With Reopen</li> |
||||
|
</ol> |
||||
|
</nav> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<hr> |
||||
|
<div class="row"> |
||||
|
<div class="col-md-12"> |
||||
|
<div class="card"> |
||||
|
|
||||
|
<div class="card-block"> |
||||
|
<div th:replace="~{fragments/modules/pgr/search_form :: div}"></div> |
||||
|
<div id="tableLoading"></div> |
||||
|
<div id="tableBody"></div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div th:replace="~{fragments/modules/pgr/modal-box :: div}"></div> |
||||
|
|
||||
|
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div> |
||||
|
|
||||
|
<script th:replace="~{fragments/modules/base/script :: script}"></script> |
||||
|
<script th:replace="~{fragments/modules/pgr/script :: script}"></script> |
||||
|
<script th:inline="javascript"> |
||||
|
|
||||
|
var loading_text_msg = getLoadingMessage(); // get Random loading message from base/script |
||||
|
|
||||
|
// Loading Div id |
||||
|
const loading = $("#tableLoading"); |
||||
|
|
||||
|
// DataTables buttons configuration |
||||
|
var buttons = [ |
||||
|
{ |
||||
|
extend: 'pageLength', |
||||
|
className: 'btn btn-warning' |
||||
|
}, |
||||
|
{ |
||||
|
title: 'Data export', |
||||
|
extend: 'copyHtml5', |
||||
|
text: 'Copy', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'copyBtn' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'excelHtml5', |
||||
|
text: 'Excel', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'excelBtn', |
||||
|
title: 'Petition List' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'csvHtml5', |
||||
|
text: 'CSV', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'csvBtn', |
||||
|
title: 'Petition List' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'pdfHtml5', |
||||
|
text: 'PDF', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'pdfBtn', |
||||
|
title: 'Petition List' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'print', |
||||
|
text: 'Print', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'printBtn', |
||||
|
title: 'Petition List' |
||||
|
} |
||||
|
]; |
||||
|
|
||||
|
// Complaint Config Array (See script page) |
||||
|
var complaintIds = complaintTypeId(); |
||||
|
|
||||
|
///////////////////////////// End /////////////////////////// |
||||
|
|
||||
|
|
||||
|
function call_loading(){ |
||||
|
loading_text_msg = getLoadingMessage(); |
||||
|
$("#filter_reset_btn").prop("disabled", true); |
||||
|
$("#filter_search_btn").prop("disabled", true); |
||||
|
loading.html(searchinfo("<b>"+loading_text_msg+"</b>")); |
||||
|
} |
||||
|
|
||||
|
function remove_loading(){ |
||||
|
$("#filter_reset_btn").prop("disabled", false); |
||||
|
$("#filter_search_btn").prop("disabled", false); |
||||
|
loading.html(""); |
||||
|
} |
||||
|
|
||||
|
/* Get Department Data */ |
||||
|
function get_department_data(){ |
||||
|
|
||||
|
get_department_list().then(function(departments) { |
||||
|
// Handle the department list |
||||
|
departmentlist = departments; |
||||
|
|
||||
|
// Iterate through the department list and add options to the select element |
||||
|
$.each(departmentlist, function(index, department) { |
||||
|
// Create an option element |
||||
|
var option = $('<option>', { |
||||
|
value: department.ID_DEPT, // case-sensitive as per object |
||||
|
text: department.DEPT_NAME |
||||
|
}); |
||||
|
// Append the option to the select element |
||||
|
$('#search_department_id').append(option); |
||||
|
}); |
||||
|
|
||||
|
}).catch(function(error) { |
||||
|
// Handle errors |
||||
|
console.error('Error fetching department list:', error); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/* Get Data of Main Page 1 */ |
||||
|
function get_table_data(){ |
||||
|
var apiUrl = '/gcc/api/pgr/getZoneWiseComplaintCountList'; |
||||
|
// Return a Promise |
||||
|
return new Promise(function(resolve, reject) { |
||||
|
$.ajax({ |
||||
|
url: apiUrl, |
||||
|
type: 'GET', |
||||
|
dataType: 'json', |
||||
|
success: function(jsonResponse) { |
||||
|
// Resolve the Promise with the department list |
||||
|
console.log('Response list:', jsonResponse); |
||||
|
resolve(jsonResponse); |
||||
|
}, |
||||
|
error: function(xhr, status, error) { |
||||
|
// Reject the Promise with the error message |
||||
|
reject(error); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/* Get Complaints List */ |
||||
|
function get_table_list(){ |
||||
|
get_table_data().then(function(complaintList) { |
||||
|
$('#tableBody').html(getPageTableBody()); // Call Table Html |
||||
|
// Handle the department list |
||||
|
generate_table(complaintList); |
||||
|
|
||||
|
}).catch(function(error) { |
||||
|
// Handle errors |
||||
|
console.error('Error fetching department list:', error); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/* Call DataTable function */ |
||||
|
function generate_table(data){ |
||||
|
|
||||
|
// Check for mobile |
||||
|
var isMobile = window.innerWidth <= 768; // Adjust the breakpoint as needed |
||||
|
|
||||
|
|
||||
|
var table = $('#complaintDatatable').DataTable( { |
||||
|
dom: 'Bftip', |
||||
|
columnDefs: [ |
||||
|
{ targets: 'no-sort', orderable: false } |
||||
|
], |
||||
|
lengthMenu: [ |
||||
|
[ 50, 100, 200, 500, -1 ], |
||||
|
[ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ] |
||||
|
], |
||||
|
scrollY: '50vh', |
||||
|
scrollX: '50vh', |
||||
|
fixedColumns: { |
||||
|
left: 0, |
||||
|
right: 0 |
||||
|
}, |
||||
|
buttons: [buttons], |
||||
|
responsive: isMobile, // Set responsive option based on device width |
||||
|
searching: false, |
||||
|
select: false, |
||||
|
processing: false, |
||||
|
} ); |
||||
|
|
||||
|
// Clearn Table data |
||||
|
table.clear().draw(); |
||||
|
|
||||
|
// Add rows to DataTable |
||||
|
var rowNum = 1; |
||||
|
$.each(data, function(index, row) { |
||||
|
table.row.add([ |
||||
|
rowNum++, |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", 'all','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['DEPT_NAME']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["NonBURSTLT"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['NonBURSTLT']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["REOFGAR"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['REOFGAR']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["ROAD"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['ROAD']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["MOSQUITE"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['MOSQUITE']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["WATER"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['WATER']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["REOFDEB"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['REOFDEB']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["TREE"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['TREE']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["DOGS"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['DOGS']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["ENCMTN"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['ENCMTN']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["POT"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['POT']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["PTAX"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['PTAX']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["OTHERS"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['OTHERS']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", 'all','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['TOTAL']+"</a>", |
||||
|
row['DAYS_90_PEN'], |
||||
|
row['DAYS_61_90_PEN'], |
||||
|
row['DAYS_31_60_PEN'], |
||||
|
row['DAYS_16_30_PEN'], |
||||
|
row['DAYS_0_15_PEN'] |
||||
|
]).draw(false); |
||||
|
}); |
||||
|
|
||||
|
// Now call for Filter |
||||
|
get_department_data(); |
||||
|
|
||||
|
remove_loading(); // remove Loading |
||||
|
} |
||||
|
|
||||
|
$(document).ready(function() { |
||||
|
call_loading(); |
||||
|
get_table_list(); |
||||
|
|
||||
|
}); |
||||
|
|
||||
|
function getPageTableBody(){ |
||||
|
var tableBodyHTML = ""; |
||||
|
|
||||
|
tableBodyHTML = `<table id="complaintDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%"> |
||||
|
<thead class="thead-dark"> |
||||
|
<tr class="table-bordered"> |
||||
|
<th class="text-center no-sort">S.No</th> |
||||
|
<th class="text-center">Zone Name</th> |
||||
|
<th class="text-center">Street Light not burning</th> |
||||
|
<th class="text-center">Removal of Garbage</th> |
||||
|
<th class="text-center">Road Damaged</th> |
||||
|
<th class="text-center">Mosquito Nuisance</th> |
||||
|
<th class="text-center">Water Stagnation</th> |
||||
|
<th class="text-center">Removal of Debries</th> |
||||
|
<th class="text-center">Tree Fallen</th> |
||||
|
<th class="text-center">Dog Menace</th> |
||||
|
<th class="text-center">Encroachment</th> |
||||
|
<th class="text-center">Potshole</th> |
||||
|
<th class="text-center">Property Tax</th> |
||||
|
<th class="text-center">Others</th> |
||||
|
<th class="text-center">Total</th> |
||||
|
<th class="text-center">> 90 Days</th> |
||||
|
<th class="text-center">61 - 90 Days</th> |
||||
|
<th class="text-center">31-60 days</th> |
||||
|
<th class="text-center">16-30 days</th> |
||||
|
<th class="text-center">0-15 days</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
|
||||
|
</tbody> |
||||
|
<tfoot class="thead-dark"> |
||||
|
<tr> |
||||
|
<th class="text-center no-sort">S.No</th> |
||||
|
<th class="text-center">Zone Name</th> |
||||
|
<th class="text-center">Street Light not burning</th> |
||||
|
<th class="text-center">Removal of Garbage</th> |
||||
|
<th class="text-center">Road Damaged</th> |
||||
|
<th class="text-center">Mosquito Nuisance</th> |
||||
|
<th class="text-center">Water Stagnation</th> |
||||
|
<th class="text-center">Removal of Debries</th> |
||||
|
<th class="text-center">Tree Fallen</th> |
||||
|
<th class="text-center">Dog Menace</th> |
||||
|
<th class="text-center">Encroachment</th> |
||||
|
<th class="text-center">Potshole</th> |
||||
|
<th class="text-center">Property Tax</th> |
||||
|
<th class="text-center">Others</th> |
||||
|
<th class="text-center">Total</th> |
||||
|
<th class="text-center">> 90 Days</th> |
||||
|
<th class="text-center">61 - 90 Days</th> |
||||
|
<th class="text-center">31-60 days</th> |
||||
|
<th class="text-center">16-30 days</th> |
||||
|
<th class="text-center">0-15 days</th> |
||||
|
</tr> |
||||
|
</tfoot> |
||||
|
</table>`; |
||||
|
|
||||
|
return tableBodyHTML; |
||||
|
} |
||||
|
|
||||
|
/////////////////////////////////////// Modal Box -1 /////////////////////////////////////// |
||||
|
|
||||
|
var model_box_1 = "#pgrModalBox"; |
||||
|
|
||||
|
function viewZoneWiseOfficerComplaintCountList(deptid, complainttype, dept_name) |
||||
|
{ |
||||
|
get_table_list_modal_box_1(deptid, complainttype); |
||||
|
|
||||
|
var dept_name_txt = dept_name.split("-"); |
||||
|
|
||||
|
if(dept_name_txt.length<=1){ |
||||
|
dept_name_txt[0] = "-"; |
||||
|
} |
||||
|
|
||||
|
dept_name_txt[1] = dept_name_txt[1].charAt(0).toUpperCase() + dept_name_txt[1].slice(1).toLowerCase(); |
||||
|
|
||||
|
$('#modalTitle').html("Officer`s Pending Report Of "+dept_name_txt[1]+" Zone ("+dept_name_txt[0]+")"); // Box title |
||||
|
|
||||
|
loading_text_msg = getLoadingMessage(); // get Loading random text |
||||
|
|
||||
|
$('#modalBody').html(searchinfo("<b>"+loading_text_msg+"</b>")); // Box content (Body) |
||||
|
|
||||
|
$(model_box_1).modal({ |
||||
|
backdrop: 'static', |
||||
|
keyboard: false |
||||
|
}); // Show Modal Box |
||||
|
|
||||
|
//$(model_box_1).modal('show'); // Show Modal Box |
||||
|
|
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
/* Get Data of Main Page 1 */ |
||||
|
function get_modal_box_1_table_data(deptid, complainttype){ |
||||
|
var apiUrl = '/gcc/api/pgr/getZoneWiseOfficerComplaintCountList'; |
||||
|
// Return a Promise |
||||
|
return new Promise(function(resolve, reject) { |
||||
|
$.ajax({ |
||||
|
url: apiUrl, |
||||
|
type: 'GET', |
||||
|
data: { |
||||
|
'deptid': deptid, |
||||
|
'complainttype': complainttype, |
||||
|
}, |
||||
|
dataType: 'json', |
||||
|
success: function(jsonResponse) { |
||||
|
// Resolve the Promise with the department list |
||||
|
//console.log('Response list:', jsonResponse); |
||||
|
resolve(jsonResponse); |
||||
|
}, |
||||
|
error: function(xhr, status, error) { |
||||
|
// Reject the Promise with the error message |
||||
|
reject(error); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/* Get Complaints List */ |
||||
|
function get_table_list_modal_box_1(deptid, complainttype){ |
||||
|
get_modal_box_1_table_data(deptid, complainttype).then(function(complaintList) { |
||||
|
// Handle the data list |
||||
|
//console.log('Response list:', complaintList); |
||||
|
$('#modalBody').html(get_modal_box_1_table_html()); // Box content (Body) |
||||
|
|
||||
|
generate_table_modal_box_1(complaintList,complainttype); |
||||
|
|
||||
|
$(model_box_1).modal('show'); // Show Modal Box |
||||
|
|
||||
|
}).catch(function(error) { |
||||
|
// Handle errors |
||||
|
console.error('Error fetching department list:', error); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/* Call DataTable function */ |
||||
|
function generate_table_modal_box_1(data,complainttype){ |
||||
|
|
||||
|
// Check for mobile |
||||
|
var isMobile = window.innerWidth <= 768; // Adjust the breakpoint as needed |
||||
|
|
||||
|
|
||||
|
var table = $('#modal_1_ComplaintDatatable').DataTable( { |
||||
|
dom: 'Bftip', |
||||
|
columnDefs: [ |
||||
|
{ targets: 'no-sort', orderable: false } |
||||
|
], |
||||
|
lengthMenu: [ |
||||
|
[ 50, 100, 200, 500, -1 ], |
||||
|
[ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ] |
||||
|
], |
||||
|
scrollY: '50vh', |
||||
|
scrollX: '50vh', |
||||
|
fixedColumns: { |
||||
|
left: 0, |
||||
|
right: 0 |
||||
|
}, |
||||
|
buttons: [buttons], |
||||
|
responsive: isMobile, // Set responsive option based on device width |
||||
|
searching: false, |
||||
|
select: false, |
||||
|
processing: false, |
||||
|
} ); |
||||
|
|
||||
|
// Clearn Table data |
||||
|
table.clear().draw(); |
||||
|
|
||||
|
// Add rows to DataTable |
||||
|
var rowNum = 1; |
||||
|
$.each(data, function(index, row) { |
||||
|
table.row.add([ |
||||
|
rowNum++, |
||||
|
row['DEPT_NAME'], |
||||
|
row['USER_NAME'], |
||||
|
row['MOBILENO'], |
||||
|
"<a href=\"#\" onclick=\"return viewOfficerBasedPendidngComplaintList("+row['DEPTID']+", '"+complainttype+"','"+row["IDUSER"]+"')\" class=\"link\">"+row['NOS']+"</a>" |
||||
|
]).draw(false); |
||||
|
}); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
function get_modal_box_1_table_html(){ |
||||
|
var modal_box_1_html=`<table id="modal_1_ComplaintDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%"> |
||||
|
<thead class="thead-dark"> |
||||
|
<tr class="table-bordered"> |
||||
|
<th class="text-center no-sort">S.No</th> |
||||
|
<th class="text-center">Department</th> |
||||
|
<th class="text-center">Officer ID</th> |
||||
|
<th class="text-center">Mobile Number</th> |
||||
|
<th class="text-center">No\`s</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
|
||||
|
</tbody> |
||||
|
<tfoot class="thead-dark"> |
||||
|
<tr> |
||||
|
<th class="text-center no-sort">S.No</th> |
||||
|
<th class="text-center">Department</th> |
||||
|
<th class="text-center">Officer ID</th> |
||||
|
<th class="text-center">Mobile Number</th> |
||||
|
<th class="text-center">No\`s</th> |
||||
|
</tr> |
||||
|
</tfoot> |
||||
|
</table>`; |
||||
|
|
||||
|
return modal_box_1_html |
||||
|
} |
||||
|
|
||||
|
/////////////////////////////////////// Modal Box - 2 /////////////////////////////////////// |
||||
|
|
||||
|
var model_box_2 = "#pgrModalBox_2"; |
||||
|
|
||||
|
function viewOfficerBasedPendidngComplaintList(deptid, complainttype, iduser) |
||||
|
{ |
||||
|
|
||||
|
get_table_list_modal_box_2(deptid, complainttype, iduser); |
||||
|
/* |
||||
|
var dept_name_txt = dept_name.split("-"); |
||||
|
|
||||
|
if(dept_name_txt.length<=1){ |
||||
|
dept_name_txt[0] = "-"; |
||||
|
} |
||||
|
|
||||
|
dept_name_txt[1] = dept_name_txt[1].charAt(0).toUpperCase() + dept_name_txt[1].slice(1).toLowerCase(); |
||||
|
|
||||
|
$('#modalTitle_2').html("Officer`s Pending Report Of "+dept_name_txt[1]+" Zone ("+dept_name_txt[0]+")"); // Box title |
||||
|
*/ |
||||
|
loading_text_msg = getLoadingMessage(); // get Loading random text |
||||
|
|
||||
|
$('#modalBody_2').html(searchinfo("<b>"+loading_text_msg+"</b>")); // Box content (Body) |
||||
|
|
||||
|
$(model_box_2).modal({ |
||||
|
backdrop: 'static', |
||||
|
keyboard: false |
||||
|
}); // Show Modal Box |
||||
|
|
||||
|
//$(model_box_2).modal('show'); // Show Modal Box |
||||
|
|
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
/* Get Data of Main Page 1 */ |
||||
|
function get_modal_box_2_table_data(deptid, complainttype, iduser){ |
||||
|
var apiUrl = '/gcc/api/pgr/getZoneWiseOfficerComplaintList'; |
||||
|
// Return a Promise |
||||
|
return new Promise(function(resolve, reject) { |
||||
|
$.ajax({ |
||||
|
url: apiUrl, |
||||
|
type: 'GET', |
||||
|
data: { |
||||
|
'deptid': deptid, |
||||
|
'complainttype': complainttype, |
||||
|
'iduser': iduser, |
||||
|
}, |
||||
|
dataType: 'json', |
||||
|
success: function(jsonResponse) { |
||||
|
// Resolve the Promise with the department list |
||||
|
//console.log('Response list:', jsonResponse); |
||||
|
resolve(jsonResponse); |
||||
|
}, |
||||
|
error: function(xhr, status, error) { |
||||
|
// Reject the Promise with the error message |
||||
|
reject(error); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/* Get Complaints List */ |
||||
|
function get_table_list_modal_box_2(deptid, complainttype, iduser){ |
||||
|
get_modal_box_2_table_data(deptid, complainttype, iduser).then(function(complaintList) { |
||||
|
// Handle the data list |
||||
|
//console.log('Response list:', complaintList); |
||||
|
$('#modalBody_2').html(get_modal_box_2_table_html()); // Box content (Body) |
||||
|
|
||||
|
generate_table_modal_box_2(complaintList); |
||||
|
|
||||
|
//$(model_box_2).modal('show'); // Show Modal Box |
||||
|
|
||||
|
}).catch(function(error) { |
||||
|
// Handle errors |
||||
|
console.error('Error fetching department list:', error); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/* Call DataTable function */ |
||||
|
function generate_table_modal_box_2(data){ |
||||
|
|
||||
|
// Check for mobile |
||||
|
var isMobile = window.innerWidth <= 768; // Adjust the breakpoint as needed |
||||
|
|
||||
|
|
||||
|
var table = $('#modal_2_ComplaintDatatable').DataTable( { |
||||
|
dom: 'Bftip', |
||||
|
columnDefs: [ |
||||
|
{ targets: 'no-sort', orderable: false } |
||||
|
], |
||||
|
lengthMenu: [ |
||||
|
[ 50, 100, 200, 500, -1 ], |
||||
|
[ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ] |
||||
|
], |
||||
|
scrollY: '50vh', |
||||
|
scrollX: '50vh', |
||||
|
fixedColumns: { |
||||
|
left: 0, |
||||
|
right: 0 |
||||
|
}, |
||||
|
buttons: [buttons], |
||||
|
responsive: isMobile, // Set responsive option based on device width |
||||
|
searching: false, |
||||
|
select: false, |
||||
|
processing: false, |
||||
|
} ); |
||||
|
|
||||
|
// Clearn Table data |
||||
|
table.clear().draw(); |
||||
|
|
||||
|
// Add rows to DataTable |
||||
|
var rowNum = 1; |
||||
|
$.each(data, function(index, row) { |
||||
|
table.row.add([ |
||||
|
rowNum++, |
||||
|
"<a href=\"#\" onclick=\"return viewComplaintDetails('"+row['COMPLAINTNUMBER']+"')\" class=\"link\">"+row['COMPLAINTNUMBER']+"</a>", |
||||
|
row['DEPT_NAME'], |
||||
|
row['COMPLAINTTYPENAME'], |
||||
|
row['COMPDATE'], |
||||
|
row['COMPLAINTDETAILS'], |
||||
|
row['COMPLAINANTFIRSTNAME'], |
||||
|
row['USER_NAME'] |
||||
|
]).draw(false); |
||||
|
}); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
function get_modal_box_2_table_html(){ |
||||
|
var modal_box_2_html=`<table id="modal_2_ComplaintDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%"> |
||||
|
<thead class="thead-dark"> |
||||
|
<tr class="table-bordered"> |
||||
|
<th class="text-center no-sort">S.No</th> |
||||
|
<th class="text-center">Complaint No.</th> |
||||
|
<th class="text-center">Department</th> |
||||
|
<th class="text-center">Complaint Type</th> |
||||
|
<th class="text-center">Complaint Date</th> |
||||
|
<th class="text-center">Complaint Details</th> |
||||
|
<th class="text-center">Person Name</th> |
||||
|
<th class="text-center">Officer ID</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
|
||||
|
</tbody> |
||||
|
<tfoot class="thead-dark"> |
||||
|
<tr> |
||||
|
<th class="text-center no-sort">S.No</th> |
||||
|
<th class="text-center">Complaint No.</th> |
||||
|
<th class="text-center">Department</th> |
||||
|
<th class="text-center">Complaint Type</th> |
||||
|
<th class="text-center">Complaint Date</th> |
||||
|
<th class="text-center">Complaint Details</th> |
||||
|
<th class="text-center">Person Name</th> |
||||
|
<th class="text-center">Officer ID</th> |
||||
|
</tr> |
||||
|
</tfoot> |
||||
|
</table>`; |
||||
|
|
||||
|
return modal_box_2_html |
||||
|
} |
||||
|
|
||||
|
/////////////////////////////////////// Modal Box - 3 /////////////////////////////////////// |
||||
|
|
||||
|
<!-- See Common Script page --> |
||||
|
|
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
||||
@ -0,0 +1,646 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="en" dir=""> |
||||
|
<html xmlns:th="http://www.thymeleaf.org"> |
||||
|
<head th:replace="~{fragments/modules/base/head :: head}"></head> |
||||
|
<body> |
||||
|
<!--[if lt IE 8]> |
||||
|
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> |
||||
|
<![endif]--> |
||||
|
|
||||
|
<div class="wrapper"> |
||||
|
<!-- header top menu Start --> |
||||
|
<header th:replace="~{fragments/modules/base/header :: header}"></header> |
||||
|
<!-- header top menu end --> |
||||
|
|
||||
|
<div class="page-wrap"> |
||||
|
<!--=============== Left Menu side Start ================--> |
||||
|
<div th:replace="~{fragments/modules/base/menu :: menu}"></div> |
||||
|
<!--=============== Left side End ================--> |
||||
|
<div class="main-content"> |
||||
|
<div class="container-fluid"> |
||||
|
<div class="page-header"> |
||||
|
<div class="row align-items-end"> |
||||
|
<div class="col-lg-6"> |
||||
|
<div class="page-header-title"> |
||||
|
<i class="ik ik-map-pin bg-blue"></i> |
||||
|
<div class="d-inline"> |
||||
|
<h5>Zone Wise Without Reopen Report</h5> |
||||
|
<span>Public Grievance Redressal Reports</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-lg-6"> |
||||
|
<nav class="breadcrumb-container" aria-label="breadcrumb"> |
||||
|
<ol class="breadcrumb"> |
||||
|
<li class="breadcrumb-item"> |
||||
|
<a href="/index"><i class="ik ik-home"></i></a> |
||||
|
</li> |
||||
|
<li class="breadcrumb-item" aria-current="page">Zone Wise Report</li> |
||||
|
<li class="breadcrumb-item active" aria-current="page">Without Reopen</li> |
||||
|
</ol> |
||||
|
</nav> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<hr> |
||||
|
<div class="row"> |
||||
|
<div class="col-md-12"> |
||||
|
<div class="card"> |
||||
|
|
||||
|
<div class="card-block"> |
||||
|
<div th:replace="~{fragments/modules/pgr/search_form :: div}"></div> |
||||
|
<div id="tableLoading"></div> |
||||
|
<div id="tableBody"></div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div th:replace="~{fragments/modules/pgr/modal-box :: div}"></div> |
||||
|
|
||||
|
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div> |
||||
|
|
||||
|
<script th:replace="~{fragments/modules/base/script :: script}"></script> |
||||
|
<script th:replace="~{fragments/modules/pgr/script :: script}"></script> |
||||
|
<script th:inline="javascript"> |
||||
|
|
||||
|
var loading_text_msg = getLoadingMessage(); // get Random loading message from base/script |
||||
|
|
||||
|
// Loading Div id |
||||
|
const loading = $("#tableLoading"); |
||||
|
|
||||
|
// DataTables buttons configuration |
||||
|
var buttons = [ |
||||
|
{ |
||||
|
extend: 'pageLength', |
||||
|
className: 'btn btn-warning' |
||||
|
}, |
||||
|
{ |
||||
|
title: 'Data export', |
||||
|
extend: 'copyHtml5', |
||||
|
text: 'Copy', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'copyBtn' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'excelHtml5', |
||||
|
text: 'Excel', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'excelBtn', |
||||
|
title: 'Petition List' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'csvHtml5', |
||||
|
text: 'CSV', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'csvBtn', |
||||
|
title: 'Petition List' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'pdfHtml5', |
||||
|
text: 'PDF', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'pdfBtn', |
||||
|
title: 'Petition List' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'print', |
||||
|
text: 'Print', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'printBtn', |
||||
|
title: 'Petition List' |
||||
|
} |
||||
|
]; |
||||
|
|
||||
|
// Complaint Config Array (See script page) |
||||
|
var complaintIds = complaintTypeId(); |
||||
|
|
||||
|
///////////////////////////// End /////////////////////////// |
||||
|
|
||||
|
|
||||
|
function call_loading(){ |
||||
|
loading_text_msg = getLoadingMessage(); |
||||
|
$("#filter_reset_btn").prop("disabled", true); |
||||
|
$("#filter_search_btn").prop("disabled", true); |
||||
|
loading.html(searchinfo("<b>"+loading_text_msg+"</b>")); |
||||
|
} |
||||
|
|
||||
|
function remove_loading(){ |
||||
|
$("#filter_reset_btn").prop("disabled", false); |
||||
|
$("#filter_search_btn").prop("disabled", false); |
||||
|
loading.html(""); |
||||
|
} |
||||
|
|
||||
|
/* Get Department Data */ |
||||
|
function get_department_data(){ |
||||
|
|
||||
|
get_department_list().then(function(departments) { |
||||
|
// Handle the department list |
||||
|
departmentlist = departments; |
||||
|
|
||||
|
// Iterate through the department list and add options to the select element |
||||
|
$.each(departmentlist, function(index, department) { |
||||
|
// Create an option element |
||||
|
var option = $('<option>', { |
||||
|
value: department.ID_DEPT, // case-sensitive as per object |
||||
|
text: department.DEPT_NAME |
||||
|
}); |
||||
|
// Append the option to the select element |
||||
|
$('#search_department_id').append(option); |
||||
|
}); |
||||
|
|
||||
|
}).catch(function(error) { |
||||
|
// Handle errors |
||||
|
console.error('Error fetching department list:', error); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/* Get Data of Main Page 1 */ |
||||
|
function get_table_data(){ |
||||
|
var apiUrl = '/gcc/api/pgr/getZoneWiseWithoutReopenComplaintList'; |
||||
|
// Return a Promise |
||||
|
return new Promise(function(resolve, reject) { |
||||
|
$.ajax({ |
||||
|
url: apiUrl, |
||||
|
type: 'GET', |
||||
|
dataType: 'json', |
||||
|
success: function(jsonResponse) { |
||||
|
// Resolve the Promise with the department list |
||||
|
console.log('Response list:', jsonResponse); |
||||
|
resolve(jsonResponse); |
||||
|
}, |
||||
|
error: function(xhr, status, error) { |
||||
|
// Reject the Promise with the error message |
||||
|
reject(error); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/* Get Complaints List */ |
||||
|
function get_table_list(){ |
||||
|
get_table_data().then(function(complaintList) { |
||||
|
$('#tableBody').html(getPageTableBody()); // Call Table Html |
||||
|
// Handle the department list |
||||
|
generate_table(complaintList); |
||||
|
|
||||
|
}).catch(function(error) { |
||||
|
// Handle errors |
||||
|
console.error('Error fetching department list:', error); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/* Call DataTable function */ |
||||
|
function generate_table(data){ |
||||
|
|
||||
|
// Check for mobile |
||||
|
var isMobile = window.innerWidth <= 768; // Adjust the breakpoint as needed |
||||
|
|
||||
|
|
||||
|
var table = $('#complaintDatatable').DataTable( { |
||||
|
dom: 'Bftip', |
||||
|
columnDefs: [ |
||||
|
{ targets: 'no-sort', orderable: false } |
||||
|
], |
||||
|
lengthMenu: [ |
||||
|
[ 50, 100, 200, 500, -1 ], |
||||
|
[ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ] |
||||
|
], |
||||
|
scrollY: '50vh', |
||||
|
scrollX: '50vh', |
||||
|
fixedColumns: { |
||||
|
left: 0, |
||||
|
right: 0 |
||||
|
}, |
||||
|
buttons: [buttons], |
||||
|
responsive: isMobile, // Set responsive option based on device width |
||||
|
searching: false, |
||||
|
select: false, |
||||
|
processing: false, |
||||
|
} ); |
||||
|
|
||||
|
// Clearn Table data |
||||
|
table.clear().draw(); |
||||
|
|
||||
|
// Add rows to DataTable |
||||
|
var rowNum = 1; |
||||
|
$.each(data, function(index, row) { |
||||
|
table.row.add([ |
||||
|
rowNum++, |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", 'all','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['DEPT_NAME']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["NonBURSTLT"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['NonBURSTLT']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["REOFGAR"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['REOFGAR']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["ROAD"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['ROAD']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["MOSQUITE"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['MOSQUITE']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["WATER"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['WATER']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["REOFDEB"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['REOFDEB']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["TREE"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['TREE']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["DOGS"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['DOGS']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["ENCMTN"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['ENCMTN']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["POT"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['POT']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["PTAX"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['PTAX']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", '"+complaintIds["OTHERS"]+"','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['OTHERS']+"</a>", |
||||
|
"<a href=\"#\" onclick=\"return viewZoneWiseOfficerComplaintCountList("+row['DEPTID']+", 'all','"+row["DEPT_NAME"]+"')\" class=\"link\">"+row['TOTAL']+"</a>", |
||||
|
row['DAYS_90_PEN'], |
||||
|
row['DAYS_61_90_PEN'], |
||||
|
row['DAYS_31_60_PEN'], |
||||
|
row['DAYS_16_30_PEN'], |
||||
|
row['DAYS_0_15_PEN'] |
||||
|
]).draw(false); |
||||
|
}); |
||||
|
|
||||
|
// Now call for Filter |
||||
|
get_department_data(); |
||||
|
|
||||
|
remove_loading(); // remove Loading |
||||
|
} |
||||
|
|
||||
|
$(document).ready(function() { |
||||
|
call_loading(); |
||||
|
get_table_list(); |
||||
|
|
||||
|
}); |
||||
|
|
||||
|
function getPageTableBody(){ |
||||
|
var tableBodyHTML = ""; |
||||
|
|
||||
|
tableBodyHTML = `<table id="complaintDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%"> |
||||
|
<thead class="thead-dark"> |
||||
|
<tr class="table-bordered"> |
||||
|
<th class="text-center no-sort">S.No</th> |
||||
|
<th class="text-center">Zone Name</th> |
||||
|
<th class="text-center">Street Light not burning</th> |
||||
|
<th class="text-center">Removal of Garbage</th> |
||||
|
<th class="text-center">Road Damaged</th> |
||||
|
<th class="text-center">Mosquito Nuisance</th> |
||||
|
<th class="text-center">Water Stagnation</th> |
||||
|
<th class="text-center">Removal of Debries</th> |
||||
|
<th class="text-center">Tree Fallen</th> |
||||
|
<th class="text-center">Dog Menace</th> |
||||
|
<th class="text-center">Encroachment</th> |
||||
|
<th class="text-center">Potshole</th> |
||||
|
<th class="text-center">Property Tax</th> |
||||
|
<th class="text-center">Others</th> |
||||
|
<th class="text-center">Total</th> |
||||
|
<th class="text-center">> 90 Days</th> |
||||
|
<th class="text-center">61 - 90 Days</th> |
||||
|
<th class="text-center">31-60 days</th> |
||||
|
<th class="text-center">16-30 days</th> |
||||
|
<th class="text-center">0-15 days</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
|
||||
|
</tbody> |
||||
|
<tfoot class="thead-dark"> |
||||
|
<tr> |
||||
|
<th class="text-center no-sort">S.No</th> |
||||
|
<th class="text-center">Zone Name</th> |
||||
|
<th class="text-center">Street Light not burning</th> |
||||
|
<th class="text-center">Removal of Garbage</th> |
||||
|
<th class="text-center">Road Damaged</th> |
||||
|
<th class="text-center">Mosquito Nuisance</th> |
||||
|
<th class="text-center">Water Stagnation</th> |
||||
|
<th class="text-center">Removal of Debries</th> |
||||
|
<th class="text-center">Tree Fallen</th> |
||||
|
<th class="text-center">Dog Menace</th> |
||||
|
<th class="text-center">Encroachment</th> |
||||
|
<th class="text-center">Potshole</th> |
||||
|
<th class="text-center">Property Tax</th> |
||||
|
<th class="text-center">Others</th> |
||||
|
<th class="text-center">Total</th> |
||||
|
<th class="text-center">> 90 Days</th> |
||||
|
<th class="text-center">61 - 90 Days</th> |
||||
|
<th class="text-center">31-60 days</th> |
||||
|
<th class="text-center">16-30 days</th> |
||||
|
<th class="text-center">0-15 days</th> |
||||
|
</tr> |
||||
|
</tfoot> |
||||
|
</table>`; |
||||
|
|
||||
|
return tableBodyHTML; |
||||
|
} |
||||
|
|
||||
|
/////////////////////////////////////// Modal Box -1 /////////////////////////////////////// |
||||
|
|
||||
|
var model_box_1 = "#pgrModalBox"; |
||||
|
|
||||
|
function viewZoneWiseOfficerComplaintCountList(deptid, complainttype, dept_name) |
||||
|
{ |
||||
|
get_table_list_modal_box_1(deptid, complainttype); |
||||
|
|
||||
|
var dept_name_txt = dept_name.split("-"); |
||||
|
|
||||
|
if(dept_name_txt.length<=1){ |
||||
|
dept_name_txt[0] = "-"; |
||||
|
} |
||||
|
|
||||
|
dept_name_txt[1] = dept_name_txt[1].charAt(0).toUpperCase() + dept_name_txt[1].slice(1).toLowerCase(); |
||||
|
|
||||
|
$('#modalTitle').html("Officer`s Pending Report Of "+dept_name_txt[1]+" Zone ("+dept_name_txt[0]+")"); // Box title |
||||
|
|
||||
|
loading_text_msg = getLoadingMessage(); // get Loading random text |
||||
|
|
||||
|
$('#modalBody').html(searchinfo("<b>"+loading_text_msg+"</b>")); // Box content (Body) |
||||
|
|
||||
|
$(model_box_1).modal({ |
||||
|
backdrop: 'static', |
||||
|
keyboard: false |
||||
|
}); // Show Modal Box |
||||
|
|
||||
|
//$(model_box_1).modal('show'); // Show Modal Box |
||||
|
|
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
/* Get Data of Main Page 1 */ |
||||
|
function get_modal_box_1_table_data(deptid, complainttype){ |
||||
|
var apiUrl = '/gcc/api/pgr/getZoneWiseOfficerWithoutReopenComplaintCountList'; |
||||
|
// Return a Promise |
||||
|
return new Promise(function(resolve, reject) { |
||||
|
$.ajax({ |
||||
|
url: apiUrl, |
||||
|
type: 'GET', |
||||
|
data: { |
||||
|
'deptid': deptid, |
||||
|
'complainttype': complainttype, |
||||
|
}, |
||||
|
dataType: 'json', |
||||
|
success: function(jsonResponse) { |
||||
|
// Resolve the Promise with the department list |
||||
|
//console.log('Response list:', jsonResponse); |
||||
|
resolve(jsonResponse); |
||||
|
}, |
||||
|
error: function(xhr, status, error) { |
||||
|
// Reject the Promise with the error message |
||||
|
reject(error); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/* Get Complaints List */ |
||||
|
function get_table_list_modal_box_1(deptid, complainttype){ |
||||
|
get_modal_box_1_table_data(deptid, complainttype).then(function(complaintList) { |
||||
|
// Handle the data list |
||||
|
//console.log('Response list:', complaintList); |
||||
|
$('#modalBody').html(get_modal_box_1_table_html()); // Box content (Body) |
||||
|
|
||||
|
generate_table_modal_box_1(complaintList,complainttype); |
||||
|
|
||||
|
$(model_box_1).modal('show'); // Show Modal Box |
||||
|
|
||||
|
}).catch(function(error) { |
||||
|
// Handle errors |
||||
|
console.error('Error fetching department list:', error); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/* Call DataTable function */ |
||||
|
function generate_table_modal_box_1(data,complainttype){ |
||||
|
|
||||
|
// Check for mobile |
||||
|
var isMobile = window.innerWidth <= 768; // Adjust the breakpoint as needed |
||||
|
|
||||
|
|
||||
|
var table = $('#modal_1_ComplaintDatatable').DataTable( { |
||||
|
dom: 'Bftip', |
||||
|
columnDefs: [ |
||||
|
{ targets: 'no-sort', orderable: false } |
||||
|
], |
||||
|
lengthMenu: [ |
||||
|
[ 50, 100, 200, 500, -1 ], |
||||
|
[ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ] |
||||
|
], |
||||
|
scrollY: '50vh', |
||||
|
scrollX: '50vh', |
||||
|
fixedColumns: { |
||||
|
left: 0, |
||||
|
right: 0 |
||||
|
}, |
||||
|
buttons: [buttons], |
||||
|
responsive: isMobile, // Set responsive option based on device width |
||||
|
searching: false, |
||||
|
select: false, |
||||
|
processing: false, |
||||
|
} ); |
||||
|
|
||||
|
// Clearn Table data |
||||
|
table.clear().draw(); |
||||
|
|
||||
|
// Add rows to DataTable |
||||
|
var rowNum = 1; |
||||
|
$.each(data, function(index, row) { |
||||
|
table.row.add([ |
||||
|
rowNum++, |
||||
|
row['DEPT_NAME'], |
||||
|
row['USER_NAME'], |
||||
|
row['MOBILENO'], |
||||
|
"<a href=\"#\" onclick=\"return viewOfficerBasedPendidngComplaintList("+row['DEPTID']+", '"+complainttype+"','"+row["IDUSER"]+"')\" class=\"link\">"+row['NOS']+"</a>" |
||||
|
]).draw(false); |
||||
|
}); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
function get_modal_box_1_table_html(){ |
||||
|
var modal_box_1_html=`<table id="modal_1_ComplaintDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%"> |
||||
|
<thead class="thead-dark"> |
||||
|
<tr class="table-bordered"> |
||||
|
<th class="text-center no-sort">S.No</th> |
||||
|
<th class="text-center">Department</th> |
||||
|
<th class="text-center">Officer ID</th> |
||||
|
<th class="text-center">Mobile Number</th> |
||||
|
<th class="text-center">No\`s</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
|
||||
|
</tbody> |
||||
|
<tfoot class="thead-dark"> |
||||
|
<tr> |
||||
|
<th class="text-center no-sort">S.No</th> |
||||
|
<th class="text-center">Department</th> |
||||
|
<th class="text-center">Officer ID</th> |
||||
|
<th class="text-center">Mobile Number</th> |
||||
|
<th class="text-center">No\`s</th> |
||||
|
</tr> |
||||
|
</tfoot> |
||||
|
</table>`; |
||||
|
|
||||
|
return modal_box_1_html |
||||
|
} |
||||
|
|
||||
|
/////////////////////////////////////// Modal Box - 2 /////////////////////////////////////// |
||||
|
|
||||
|
var model_box_2 = "#pgrModalBox_2"; |
||||
|
|
||||
|
function viewOfficerBasedPendidngComplaintList(deptid, complainttype, iduser) |
||||
|
{ |
||||
|
|
||||
|
get_table_list_modal_box_2(deptid, complainttype, iduser); |
||||
|
/* |
||||
|
var dept_name_txt = dept_name.split("-"); |
||||
|
|
||||
|
if(dept_name_txt.length<=1){ |
||||
|
dept_name_txt[0] = "-"; |
||||
|
} |
||||
|
|
||||
|
dept_name_txt[1] = dept_name_txt[1].charAt(0).toUpperCase() + dept_name_txt[1].slice(1).toLowerCase(); |
||||
|
|
||||
|
$('#modalTitle_2').html("Officer`s Pending Report Of "+dept_name_txt[1]+" Zone ("+dept_name_txt[0]+")"); // Box title |
||||
|
*/ |
||||
|
loading_text_msg = getLoadingMessage(); // get Loading random text |
||||
|
|
||||
|
$('#modalBody_2').html(searchinfo("<b>"+loading_text_msg+"</b>")); // Box content (Body) |
||||
|
|
||||
|
$(model_box_2).modal({ |
||||
|
backdrop: 'static', |
||||
|
keyboard: false |
||||
|
}); // Show Modal Box |
||||
|
|
||||
|
//$(model_box_2).modal('show'); // Show Modal Box |
||||
|
|
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
/* Get Data of Main Page 1 */ |
||||
|
function get_modal_box_2_table_data(deptid, complainttype, iduser){ |
||||
|
var apiUrl = '/gcc/api/pgr/getZoneWiseOfficerWithoutReopenComplaintList'; |
||||
|
// Return a Promise |
||||
|
return new Promise(function(resolve, reject) { |
||||
|
$.ajax({ |
||||
|
url: apiUrl, |
||||
|
type: 'GET', |
||||
|
data: { |
||||
|
'deptid': deptid, |
||||
|
'complainttype': complainttype, |
||||
|
'iduser': iduser, |
||||
|
}, |
||||
|
dataType: 'json', |
||||
|
success: function(jsonResponse) { |
||||
|
// Resolve the Promise with the department list |
||||
|
//console.log('Response list:', jsonResponse); |
||||
|
resolve(jsonResponse); |
||||
|
}, |
||||
|
error: function(xhr, status, error) { |
||||
|
// Reject the Promise with the error message |
||||
|
reject(error); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/* Get Complaints List */ |
||||
|
function get_table_list_modal_box_2(deptid, complainttype, iduser){ |
||||
|
get_modal_box_2_table_data(deptid, complainttype, iduser).then(function(complaintList) { |
||||
|
// Handle the data list |
||||
|
//console.log('Response list:', complaintList); |
||||
|
$('#modalBody_2').html(get_modal_box_2_table_html()); // Box content (Body) |
||||
|
|
||||
|
generate_table_modal_box_2(complaintList); |
||||
|
|
||||
|
//$(model_box_2).modal('show'); // Show Modal Box |
||||
|
|
||||
|
}).catch(function(error) { |
||||
|
// Handle errors |
||||
|
console.error('Error fetching department list:', error); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/* Call DataTable function */ |
||||
|
function generate_table_modal_box_2(data){ |
||||
|
|
||||
|
// Check for mobile |
||||
|
var isMobile = window.innerWidth <= 768; // Adjust the breakpoint as needed |
||||
|
|
||||
|
|
||||
|
var table = $('#modal_2_ComplaintDatatable').DataTable( { |
||||
|
dom: 'Bftip', |
||||
|
columnDefs: [ |
||||
|
{ targets: 'no-sort', orderable: false } |
||||
|
], |
||||
|
lengthMenu: [ |
||||
|
[ 50, 100, 200, 500, -1 ], |
||||
|
[ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ] |
||||
|
], |
||||
|
scrollY: '50vh', |
||||
|
scrollX: '50vh', |
||||
|
fixedColumns: { |
||||
|
left: 0, |
||||
|
right: 0 |
||||
|
}, |
||||
|
buttons: [buttons], |
||||
|
responsive: isMobile, // Set responsive option based on device width |
||||
|
searching: false, |
||||
|
select: false, |
||||
|
processing: false, |
||||
|
} ); |
||||
|
|
||||
|
// Clearn Table data |
||||
|
table.clear().draw(); |
||||
|
|
||||
|
// Add rows to DataTable |
||||
|
var rowNum = 1; |
||||
|
$.each(data, function(index, row) { |
||||
|
table.row.add([ |
||||
|
rowNum++, |
||||
|
"<a href=\"#\" onclick=\"return viewComplaintDetails('"+row['COMPLAINTNUMBER']+"')\" class=\"link\">"+row['COMPLAINTNUMBER']+"</a>", |
||||
|
row['DEPT_NAME'], |
||||
|
row['COMPLAINTTYPENAME'], |
||||
|
row['COMPDATE'], |
||||
|
row['COMPLAINTDETAILS'], |
||||
|
row['COMPLAINANTFIRSTNAME'], |
||||
|
row['USER_NAME'] |
||||
|
]).draw(false); |
||||
|
}); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
function get_modal_box_2_table_html(){ |
||||
|
var modal_box_2_html=`<table id="modal_2_ComplaintDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%"> |
||||
|
<thead class="thead-dark"> |
||||
|
<tr class="table-bordered"> |
||||
|
<th class="text-center no-sort">S.No</th> |
||||
|
<th class="text-center">Complaint No.</th> |
||||
|
<th class="text-center">Department</th> |
||||
|
<th class="text-center">Complaint Type</th> |
||||
|
<th class="text-center">Complaint Date</th> |
||||
|
<th class="text-center">Complaint Details</th> |
||||
|
<th class="text-center">Person Name</th> |
||||
|
<th class="text-center">Officer ID</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
|
||||
|
</tbody> |
||||
|
<tfoot class="thead-dark"> |
||||
|
<tr> |
||||
|
<th class="text-center no-sort">S.No</th> |
||||
|
<th class="text-center">Complaint No.</th> |
||||
|
<th class="text-center">Department</th> |
||||
|
<th class="text-center">Complaint Type</th> |
||||
|
<th class="text-center">Complaint Date</th> |
||||
|
<th class="text-center">Complaint Details</th> |
||||
|
<th class="text-center">Person Name</th> |
||||
|
<th class="text-center">Officer ID</th> |
||||
|
</tr> |
||||
|
</tfoot> |
||||
|
</table>`; |
||||
|
|
||||
|
return modal_box_2_html |
||||
|
} |
||||
|
|
||||
|
/////////////////////////////////////// Modal Box - 3 /////////////////////////////////////// |
||||
|
<!-- See Common Script page --> |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
||||
@ -0,0 +1,813 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="en" dir=""> |
||||
|
<html xmlns:th="http://www.thymeleaf.org"> |
||||
|
<head th:replace="~{fragments/modules/base/head :: head}"></head> |
||||
|
<body> |
||||
|
<link rel="stylesheet" type="text/css" href="node_modules/jquery.datetimepicker/jquery.datetimepicker.css"/ > |
||||
|
<!--[if lt IE 8]> |
||||
|
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> |
||||
|
<![endif]--> |
||||
|
|
||||
|
<div class="wrapper"> |
||||
|
<!-- header top menu Start --> |
||||
|
<header th:replace="~{fragments/modules/base/header :: header}"></header> |
||||
|
<!-- header top menu end --> |
||||
|
|
||||
|
<div class="page-wrap"> |
||||
|
<!--=============== Left Menu side Start ================--> |
||||
|
<div th:replace="~{fragments/modules/base/menu :: menu}"></div> |
||||
|
<!--=============== Left side End ================--> |
||||
|
<div class="main-content"> |
||||
|
<div class="container-fluid"> |
||||
|
<div class="page-header"> |
||||
|
<div class="row align-items-end"> |
||||
|
<div class="col-lg-8"> |
||||
|
<div class="page-header-title"> |
||||
|
<i class="fas fa-headset bg-blue"></i> |
||||
|
<div class="d-inline"> |
||||
|
<h5>Request List</h5> |
||||
|
<span>1913 Tax Collection Module</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-lg-4"> |
||||
|
<nav class="breadcrumb-container" aria-label="breadcrumb"> |
||||
|
<ol class="breadcrumb"> |
||||
|
<li class="breadcrumb-item"> |
||||
|
<a href="index"><i class="ik ik-home"></i></a> |
||||
|
</li> |
||||
|
<li class="breadcrumb-item" aria-current="page">1913 Tax Collection</li> |
||||
|
<li class="breadcrumb-item active" aria-current="page">Request List</li> |
||||
|
</ol> |
||||
|
</nav> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<hr> |
||||
|
<div class="row"> |
||||
|
|
||||
|
<div class="card"> |
||||
|
<div class="card-block"> |
||||
|
<div class="d-flex"> |
||||
|
<h4 class="card-title">Tax collection request list</h4> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
<div> |
||||
|
<table id="requestDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%"> |
||||
|
<thead class="thead-dark"> |
||||
|
<tr role="row"> |
||||
|
<th class="text-center no-sort" width="1%">S.No</th> |
||||
|
<th class="text-center" width="20%">Name</th> |
||||
|
<th class="text-center" width="20%">Property tax number</th> |
||||
|
<th class="text-center" width="20%">Mobile Number</th> |
||||
|
<th class="text-center" width="20%">Availability Date</th> |
||||
|
<th class="text-center" width="20%">User Type</th> |
||||
|
<th class="text-center" width="20%">Status</th> |
||||
|
<th class="text-center no-sort" style="width:50px;">Action</th> |
||||
|
</tr> |
||||
|
</theadclass="thead-dark"> |
||||
|
<tbody> |
||||
|
<tr th:each="taxCollectionRequestList, i : ${taxCollectionRequestEntities}" class="taxCollectionRequestList text-capitalize"> |
||||
|
<td th:text="${i.count}">0</td> |
||||
|
<td th:text="${taxCollectionRequestList.name}"></td> |
||||
|
<td th:text="${taxCollectionRequestList.ptax}"></td> |
||||
|
<td th:text="${taxCollectionRequestList.mobile}"></td> |
||||
|
<td th:text="${taxCollectionRequestList.availabilitydate}"></td> |
||||
|
<td th:text="${taxCollectionRequestList.usertype}"></td> |
||||
|
<td> |
||||
|
<a th:href="@{#}" th:text="${taxCollectionRequestList.status}" th:classappend="${taxCollectionRequestList.status == 'open'} ? 'badge badge-success mb-1' : 'badge badge-secondary mb-1'" th:onclick="return callStatusUpdate([[${taxCollectionRequestList.request_id}]])" data-animation="true" data-toggle="tooltip" data-placement="top" title="Update Current Status" data-original-title="Update Current Status"></a> |
||||
|
</td> |
||||
|
<td class="text-center"> |
||||
|
<a th:href="@{#}" th:onclick="return callView([[${taxCollectionRequestList.request_id}]])" data-animation="true" data-toggle="tooltip" data-placement="top" title="View Request Details" data-original-title="View Request Details"><i class="ik ik-eye f-16 text-blue"></i></a> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</tbody> |
||||
|
<tfoot class="thead-dark"> |
||||
|
<tr> |
||||
|
<th class="text-center">S.No</th> |
||||
|
<th class="text-center">Name</th> |
||||
|
<th class="text-center">Property tax number</th> |
||||
|
<th class="text-center">Mobile Number</th> |
||||
|
<th class="text-center">Availability Date</th> |
||||
|
<th class="text-center">User Type</th> |
||||
|
<th class="text-center">Status</th> |
||||
|
<th class="text-center">Action</th> |
||||
|
</tr> |
||||
|
</tfoot> |
||||
|
</table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="modal fade" id="taxCollectionRequestView" tabindex="-1" role="dialog" aria-labelledby="modalCenterLabel" aria-hidden="true"> |
||||
|
<div class="modal-dialog modal-dialog-centered modal-xl" role="document"> |
||||
|
<div class="modal-content"> |
||||
|
<div class="modal-header"> |
||||
|
<h5 class="modal-title" id="modalCenterLabel"><i class="ik ik-file-text text-primary"></i> Collection Request Details</h5> |
||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
||||
|
</div> |
||||
|
<div class="modal-body"> |
||||
|
<div class="row"> |
||||
|
|
||||
|
<div class="col-xl-6 col-md-6" id="requestDetails"> |
||||
|
|
||||
|
</div> |
||||
|
<div class="col-xl-6 col-md-6" style="border-left: 1px solid #dee2e6;" id="pTaxdetails"> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="modal-footer"> |
||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="ik ik-x-square"></i>Close</button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="modal fade" id="taxCollectionRequestUpdate" tabindex="-1" role="dialog" aria-labelledby="modalCenterLabel" aria-hidden="true"> |
||||
|
<div class="modal-dialog modal-dialog-centered modal-xl" role="document"> |
||||
|
<div class="modal-content"> |
||||
|
|
||||
|
<div class="modal-header"> |
||||
|
<h5 class="modal-title" id="modalCenterLabel"><i class="ik ik-file-text text-primary"></i> Collection Request Status Update Form</h5> |
||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
||||
|
</div> |
||||
|
<div class="modal-body"> |
||||
|
<div class="row"> |
||||
|
|
||||
|
<div class="col-xl-6 col-md-6" id="requestDetailsUpdate"> |
||||
|
|
||||
|
</div> |
||||
|
<div class="col-xl-6 col-md-6" style="border-left: 1px solid #dee2e6;" id="statusUpdateForm"> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
<div class="card table-card mb-0"> |
||||
|
|
||||
|
<h5 class="text-warning pl-10 text-center">Status History</h5> |
||||
|
|
||||
|
<div class="card-block pb-0"> |
||||
|
<div class="table-responsive"> |
||||
|
<table class="table table-hover mb-0"> |
||||
|
<thead> |
||||
|
<tr> |
||||
|
<th>Company</th> |
||||
|
<th>Start Date</th> |
||||
|
<th>End Date</th> |
||||
|
<th>Status</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
<tr> |
||||
|
<td>Apple Company</td> |
||||
|
<td>23/05/2017</td> |
||||
|
<td>04/08/2018</td> |
||||
|
<td><label class="badge badge-success">Paid</label></td> |
||||
|
</tr> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="modal-footer"> |
||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="ik ik-x-square"></i>Close</button> |
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div> |
||||
|
|
||||
|
<script th:replace="~{fragments/modules/base/script :: script}"></script> |
||||
|
<script src="node_modules/jquery.mask/1.14.16/jquery.mask.min.js"></script> |
||||
|
<script src="node_modules/amcharts3/amcharts/amcharts.js"></script> |
||||
|
<script src="node_modules/amcharts3/amcharts/serial.js"></script> |
||||
|
<script src="node_modules/amcharts3/amcharts/themes/light.js"></script> |
||||
|
<script src="node_modules/jquery.datetimepicker/jquery.datetimepicker.full.min.js"></script> |
||||
|
<script th:inline="javascript"> |
||||
|
var loginUserID = /*[[${LoginUserId}]]*/''; |
||||
|
$(document).ready(function() { |
||||
|
// Input masking for the desired format |
||||
|
$('#ptax').mask('00-000-00000-000'); |
||||
|
$('#mobileno').mask('0000000000'); |
||||
|
|
||||
|
// For datetime picker |
||||
|
jQuery('#availabilitydate').datetimepicker({ |
||||
|
minTime:'10:00', |
||||
|
maxTime:'18:01', |
||||
|
minDate: 0, // Today |
||||
|
//minDate:'-1970/01/2', |
||||
|
//maxDate:'+1970/01/2', |
||||
|
//timepicker:false, // Disable time picker |
||||
|
mask:false, |
||||
|
disabledWeekDays:[0], //[0,1,2,3,4,5,6] -> 0-Sunday .... 6-saturday |
||||
|
disabledDates:['2023/08/31','2023/08/11','2023/08/12'], // Disable date on holidays |
||||
|
/* |
||||
|
// Disable all weekends |
||||
|
onGenerate:function( ct ){ |
||||
|
jQuery(this).find('.xdsoft_date.xdsoft_weekend') |
||||
|
.addClass('xdsoft_disabled'); |
||||
|
} |
||||
|
*/ |
||||
|
}); |
||||
|
|
||||
|
}); |
||||
|
|
||||
|
function displayPtaxInfo(ptax){ |
||||
|
var inputElement = $('#ptax'); |
||||
|
|
||||
|
inputElement.removeClass('is-invalid'); |
||||
|
|
||||
|
// Disable the button to prevent multiple clicks |
||||
|
$("#ptaxsearchbtn").prop("disabled", true); |
||||
|
|
||||
|
// Show the loading icon on the button |
||||
|
$("#ptaxsearchbtn").html('<i class="fas fa-spinner fa-spin"></i>'); |
||||
|
|
||||
|
var ptax = inputElement.val(); |
||||
|
var formatRegex = /^\d{2}-\d{3}-\d{5}-\d{3}$/; //'04-042-03251-000'; |
||||
|
|
||||
|
// Check if the tax value is not null and follows the format |
||||
|
if (ptax !== null && formatRegex.test(ptax)) { |
||||
|
console.log('ptax value is valid:', ptax); |
||||
|
// Check if the tax value has the correct length as per the format (15 characters) |
||||
|
if (ptax.length === 16) { |
||||
|
console.log('ptax value length is correct.'); |
||||
|
getPtaxInfo(ptax); |
||||
|
} else { |
||||
|
console.log('ptax value length is incorrect.'); |
||||
|
|
||||
|
inputElement.addClass('is-invalid'); |
||||
|
|
||||
|
$("#ptaxsearchbtn").prop("disabled", false); |
||||
|
$("#ptaxsearchbtn").html('<i class="ik ik-search"></i>'); |
||||
|
} |
||||
|
} else { |
||||
|
console.log('ptax value is not valid or null.'); |
||||
|
|
||||
|
inputElement.addClass('is-invalid'); //Error |
||||
|
|
||||
|
$("#ptaxsearchbtn").prop("disabled", false); |
||||
|
$("#ptaxsearchbtn").html('<i class="ik ik-search"></i>'); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function getPtaxInfo(ptax){ |
||||
|
call_loading('ptaxPersonalInfo','start'); |
||||
|
//var ptax = '04-042-03251-000'; |
||||
|
var apiUrl = '/gcc/api/taxcollection/getPropertTaxPersonalDetails?ptax='+ptax; |
||||
|
$.ajax({ |
||||
|
url: apiUrl, |
||||
|
type: 'GET', |
||||
|
dataType: 'json', |
||||
|
success: function(jsonResponse) { |
||||
|
// Handle the API response data here |
||||
|
console.log('Data from API:', jsonResponse); |
||||
|
|
||||
|
// Parse the JSON response into a JavaScript object |
||||
|
var data = jsonResponse; |
||||
|
if(data.ResultStatus=="False") |
||||
|
{ |
||||
|
$("#ptaxPersonalInfo").html("<center>"+nodata(data.Message)+"</center>"); |
||||
|
$("#ptaxsearchbtn").prop("disabled", false); |
||||
|
$("#ptaxsearchbtn").html('<i class="ik ik-search"></i>'); |
||||
|
} |
||||
|
else{ |
||||
|
// Access the values |
||||
|
var owner = data.PROPTAX[0].Owner; |
||||
|
var address = data.PROPTAX[0].Address; |
||||
|
//var famCardNo = data.PROPTAX[0].Fam_Card_No; |
||||
|
var mobNo = data.PROPTAX[0].Mob_No; |
||||
|
var email = data.PROPTAX[0].Email_ID; |
||||
|
|
||||
|
// HTML content |
||||
|
var ptaxPersonalinfoHtml = '<table class="table table-borderless text-capitalize">' + |
||||
|
' <tbody>' + |
||||
|
' <tr>' + |
||||
|
' <td>Property tax number</td>' + |
||||
|
' <td class="font-medium">'+ptax+'</td>' + |
||||
|
' </tr>' + |
||||
|
' <tr>' + |
||||
|
' <td>Owner Name</td>' + |
||||
|
' <td class="font-medium">'+owner+'</td>' + |
||||
|
' </tr>' + |
||||
|
' <tr>' + |
||||
|
' <td>Address</td>' + |
||||
|
' <td class="font-medium">'+address+'</td>' + |
||||
|
' </tr>' + |
||||
|
' <tr>' + |
||||
|
' <td>Mobile No</td>' + |
||||
|
' <td class="font-medium">'+mobNo+'</td>' + |
||||
|
' </tr>' + |
||||
|
' </tbody>' + |
||||
|
'</table>'; |
||||
|
$("#ptaxPersonalInfo").html(ptaxPersonalinfoHtml); |
||||
|
// Enable the button |
||||
|
$("#ptaxsearchbtn").prop("disabled", false); |
||||
|
$("#ptaxsearchbtn").html('<i class="ik ik-search"></i>'); |
||||
|
} |
||||
|
}, |
||||
|
error: function(xhr, status, error) { |
||||
|
// Handle errors here |
||||
|
console.error('Error fetching data:', status, error); |
||||
|
// Enable the button |
||||
|
$("#ptaxsearchbtn").prop("disabled", false); |
||||
|
$("#ptaxsearchbtn").html('<i class="ik ik-search"></i>'); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
function saveRequest(){ |
||||
|
// Disable the button to prevent multiple clicks |
||||
|
$("#requestSubmitBtn").prop("disabled", true); |
||||
|
|
||||
|
// Show the loading icon on the button |
||||
|
$("#requestSubmitBtn").html('<i class="fas fa-spinner fa-spin"></i> Validating your request, please wait...'); |
||||
|
var name = $('#name').val(); |
||||
|
|
||||
|
var inputElement = $('#ptax'); |
||||
|
var ptax = inputElement.val(); |
||||
|
var formatRegex = /^\d{2}-\d{3}-\d{5}-\d{3}$/; //'04-042-03251-000'; |
||||
|
inputElement.removeClass('is-invalid'); |
||||
|
|
||||
|
var inputElementMobileNo = $('#mobileno'); |
||||
|
var mobileNo = inputElementMobileNo.val(); |
||||
|
var mobileFormatRegex = /^\d{10}$/; //'0000000000'; |
||||
|
inputElementMobileNo.removeClass('is-invalid'); |
||||
|
|
||||
|
var inputElementUsertype = $('#usertype'); |
||||
|
var usertype = inputElementUsertype.val(); |
||||
|
//inputElementUsertype.removeClass('is-invalid'); |
||||
|
|
||||
|
var inputElementAvailabilityDate = $('#availabilitydate'); |
||||
|
var availabilitydate = inputElementAvailabilityDate.val(); |
||||
|
|
||||
|
var selectedDateTime = new Date(availabilitydate); |
||||
|
var currentDateTime = new Date(); |
||||
|
|
||||
|
if (selectedDateTime < currentDateTime) { |
||||
|
alert('Selected date and time must be greater than or equal to the current date and time.'); |
||||
|
inputElementAvailabilityDate.addClass('is-invalid'); |
||||
|
$("#requestSubmitBtn").prop("disabled", false); |
||||
|
$("#requestSubmitBtn").html('<i class="ik ik-save"></i>Save'); |
||||
|
return false; // Prevent form submission |
||||
|
} |
||||
|
|
||||
|
var formData = new FormData(); |
||||
|
|
||||
|
// Check if the tax value is not null and follows the format |
||||
|
if (ptax !== null && formatRegex.test(ptax) && ptax.length == 16) { |
||||
|
|
||||
|
// Mobile number Check |
||||
|
if (mobileNo !== null && mobileFormatRegex.test(mobileNo) && mobileNo.length == 10) { |
||||
|
$("#requestSubmitBtn").html('<i class="fas fa-spinner fa-spin"></i> Submitting your request, please wait...'); |
||||
|
|
||||
|
formData.append('name',name); |
||||
|
formData.append('ptax', ptax ); |
||||
|
formData.append('mobile', mobileNo ); |
||||
|
formData.append('usertype', usertype ); |
||||
|
formData.append('availabilitydate', availabilitydate); |
||||
|
formData.append('created_by', loginUserID); |
||||
|
|
||||
|
submitSaveRequest(formData); |
||||
|
|
||||
|
$("#requestSubmitBtn").html('Your request has been successfully submitted!'); |
||||
|
} else { |
||||
|
inputElementMobileNo.addClass('is-invalid'); |
||||
|
$("#requestSubmitBtn").prop("disabled", false); |
||||
|
$("#requestSubmitBtn").html('<i class="ik ik-save"></i>Save'); |
||||
|
} |
||||
|
|
||||
|
} else { |
||||
|
console.log('ptax value is not valid or null.'); |
||||
|
|
||||
|
inputElement.addClass('is-invalid'); //Error |
||||
|
|
||||
|
$("#requestSubmitBtn").prop("disabled", false); |
||||
|
$("#requestSubmitBtn").html('<i class="ik ik-save"></i>Save'); |
||||
|
} |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
function submitSaveRequest(formData){ |
||||
|
$.ajax({ |
||||
|
type: "POST", |
||||
|
url: '/gcc/api/taxcollection/saveTaxCollectionRequest', |
||||
|
data: formData, |
||||
|
contentType: false, |
||||
|
processData: false, |
||||
|
}).done(function(response) { |
||||
|
Swal.fire( |
||||
|
'Complaint Status Update!', |
||||
|
'Complaint closed Successfully!', |
||||
|
'success' |
||||
|
).then(() => { |
||||
|
location.reload(); |
||||
|
}); |
||||
|
|
||||
|
}).fail(function(jqXHR, textStatus, errorThrown) { |
||||
|
$("#requestSubmitBtn").prop("disabled", false); |
||||
|
// Log the error and any relevant information |
||||
|
console.error("Error sending request: " + textStatus + " " + errorThrown); |
||||
|
|
||||
|
}); |
||||
|
} |
||||
|
</script> |
||||
|
<script> |
||||
|
$(document).ready(function() { |
||||
|
|
||||
|
// DataTables buttons configuration |
||||
|
var buttons = [ |
||||
|
{ |
||||
|
extend: 'pageLength', |
||||
|
className: 'btn btn-warning' |
||||
|
}, |
||||
|
{ |
||||
|
title: 'Data export', |
||||
|
extend: 'copyHtml5', |
||||
|
text: 'Copy', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'copyBtn' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'excelHtml5', |
||||
|
text: 'Excel', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'excelBtn' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'csvHtml5', |
||||
|
text: 'CSV', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'csvBtn' |
||||
|
}, |
||||
|
{ |
||||
|
extend: 'pdfHtml5', |
||||
|
text: 'PDF', |
||||
|
className: 'btn btn-secondary', |
||||
|
id: 'pdfBtn' |
||||
|
}, |
||||
|
|
||||
|
]; |
||||
|
|
||||
|
$('#requestDatatable').DataTable( { |
||||
|
dom: 'Bftip', |
||||
|
columnDefs: [ |
||||
|
{ targets: 'no-sort', orderable: false } |
||||
|
], |
||||
|
lengthMenu: [ |
||||
|
[ 50, 100, 200, 500, -1 ], |
||||
|
[ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ] |
||||
|
], |
||||
|
scrollY: '50vh', |
||||
|
fixedColumns: { |
||||
|
left: 1, |
||||
|
right: 1 |
||||
|
}, |
||||
|
buttons: [buttons], |
||||
|
fixedHeader: true, |
||||
|
autoWidth: true, |
||||
|
responsive: true, |
||||
|
searching: false, |
||||
|
select: false, |
||||
|
processing: false, |
||||
|
} ); |
||||
|
} ); |
||||
|
|
||||
|
function callView(request_id){ |
||||
|
$('#taxCollectionRequestView').modal({ |
||||
|
backdrop: 'static', |
||||
|
keyboard: false |
||||
|
}) |
||||
|
$('#taxCollectionRequestView').modal('show'); |
||||
|
|
||||
|
call_loading('requestDetails','start'); |
||||
|
getTaxCollectionRequestDetails(request_id); |
||||
|
call_loading('pTaxdetails','start'); |
||||
|
|
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
function getTaxCollectionRequestDetails(request_id){ |
||||
|
var apiUrl = '/gcc/api/taxcollection/getTaxCollectionRequestById?request_id='+request_id; |
||||
|
$.ajax({ |
||||
|
url: apiUrl, |
||||
|
type: 'GET', |
||||
|
dataType: 'json', |
||||
|
success: function(jsonResponse) { |
||||
|
// Handle the API response data here |
||||
|
console.log('Data from API:', jsonResponse); |
||||
|
// Parse the JSON response into a JavaScript object |
||||
|
var data = jsonResponse; |
||||
|
|
||||
|
// Access the values |
||||
|
var request_id = data.request_id; |
||||
|
var requestNo = data.requestNo; |
||||
|
var name = data.name; |
||||
|
var mobile = data.mobile; |
||||
|
var ptax = data.ptax; |
||||
|
var usertype = data.usertype; |
||||
|
var availabilitydate = data.availabilitydate; |
||||
|
var status = data.status; |
||||
|
var cdate = data.cDate; |
||||
|
|
||||
|
// HTML content |
||||
|
var ptaxPersonalinfoHtml = '<table class="table table-borderless text-capitalize">' + |
||||
|
' <tbody>' + |
||||
|
' <tr>' + |
||||
|
' <td>Name</td>' + |
||||
|
' <td class="font-medium">'+name+'</td>' + |
||||
|
' </tr>' + |
||||
|
' <tr>' + |
||||
|
' <td>Property tax number</td>' + |
||||
|
' <td class="font-medium font-weight-bold" id="pTaxVerification">'+ptax+'</td>' + |
||||
|
' </tr>' + |
||||
|
' <tr>' + |
||||
|
' <td>Mobile Number</td>' + |
||||
|
' <td class="font-medium">'+mobile+'</td>' + |
||||
|
' </tr>' + |
||||
|
' <tr>' + |
||||
|
' <td>Availability Date & Time</td>' + |
||||
|
' <td class="font-medium">'+availabilitydate+'</td>' + |
||||
|
' </tr>' + |
||||
|
' <tr>' + |
||||
|
' <td>User Type</td>' + |
||||
|
' <td class="font-medium">'+usertype+'</td>' + |
||||
|
' </tr>' + |
||||
|
' <tr>' + |
||||
|
' <td>Current Status</td>' + |
||||
|
' <td class="font-medium">'+status+'</td>' + |
||||
|
' </tr>' + |
||||
|
' <tr>' + |
||||
|
' <td>Request Created On</td>' + |
||||
|
' <td class="font-medium">'+cdate+'</td>' + |
||||
|
' </tr>' + |
||||
|
' </tbody>' + |
||||
|
'</table>'; |
||||
|
$("#requestDetails").html(ptaxPersonalinfoHtml); |
||||
|
getpTaxDetails(ptax); |
||||
|
}, |
||||
|
error: function(xhr, status, error) { |
||||
|
// Handle errors here |
||||
|
console.error('Error fetching collection reqtest data:', status, error); |
||||
|
|
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
function getpTaxDetails(ptax){ |
||||
|
|
||||
|
var apiUrl = '/gcc/api/taxcollection/getPropertTaxPersonalDetails?ptax='+ptax; |
||||
|
$.ajax({ |
||||
|
url: apiUrl, |
||||
|
type: 'GET', |
||||
|
dataType: 'json', |
||||
|
success: function(jsonResponse) { |
||||
|
// Handle the API response data here |
||||
|
console.log('Data from API:', jsonResponse); |
||||
|
// Parse the JSON response into a JavaScript object |
||||
|
var data = jsonResponse; |
||||
|
if (data.ResultStatus === "True") { |
||||
|
// Access the values |
||||
|
var owner = data.PROPTAX[0].Owner; |
||||
|
var address = data.PROPTAX[0].Address; |
||||
|
var mobNo = data.PROPTAX[0].Mob_No; |
||||
|
var email = data.PROPTAX[0].Email_ID; |
||||
|
|
||||
|
// HTML content |
||||
|
var ptaxPersonalinfoHtml = '<table class="table table-borderless">' + |
||||
|
' <tbody>' + |
||||
|
' <tr>' + |
||||
|
' <td>Property tax number</td>' + |
||||
|
' <td class="font-medium">'+ptax+'</td>' + |
||||
|
' </tr>' + |
||||
|
' <tr>' + |
||||
|
' <td>Owner Name</td>' + |
||||
|
' <td class="font-medium">'+owner+'</td>' + |
||||
|
' </tr>' + |
||||
|
' <tr>' + |
||||
|
' <td>Address</td>' + |
||||
|
' <td class="font-medium">'+address+'</td>' + |
||||
|
' </tr>' + |
||||
|
' <tr>' + |
||||
|
' <td>Mobile No</td>' + |
||||
|
' <td class="font-medium">'+mobNo+'</td>' + |
||||
|
' </tr>' + |
||||
|
' </tbody>' + |
||||
|
'</table>'; |
||||
|
$("#pTaxdetails").html(ptaxPersonalinfoHtml); |
||||
|
|
||||
|
// if Ptax data fetched then load valid message |
||||
|
var validPtax = ptax+' <font class="custom-tooltip-success"><a href="#" class="text-success" onclick="return false;" data-container=".custom-tooltip-success" data-toggle="tooltip" data-html="true" data-placement="top" title="Property tax number<br>cross-verify success" data-original-title="Property tax number cross-verify success"><i class="ik ik-check-circle"></i></font>'; |
||||
|
$("#pTaxVerification").html(validPtax); |
||||
|
} |
||||
|
else { |
||||
|
// No data found |
||||
|
console.log("Message: " + data.Message); |
||||
|
var inValidPtax = ptax+' <font class="custom-tooltip-warning"><a href="#" class="text-warning" onclick="return false;" data-container=".custom-tooltip-warning" data-toggle="tooltip" data-html="true" data-placement="top" title="Property tax number<br>cross-verify failed" data-original-title="Property tax number cross-verify failed"><i class="ik ik-alert-triangle"></i></font>'; |
||||
|
$("#pTaxVerification").html(inValidPtax); |
||||
|
|
||||
|
$("#pTaxdetails").html('<center><img src="images/nodata.png"></br>No Record Found</center>'); |
||||
|
} |
||||
|
// Enable tooltip for model page |
||||
|
$('[data-toggle="tooltip"]').tooltip(); |
||||
|
}, |
||||
|
error: function(xhr, status, error) { |
||||
|
// Handle errors here |
||||
|
console.error('Error fetching pTax data:', status, error); |
||||
|
|
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
function callStatusUpdate(request_id){ |
||||
|
$('#taxCollectionRequestUpdate').modal({ |
||||
|
backdrop: 'static', |
||||
|
keyboard: false |
||||
|
}) |
||||
|
$('#taxCollectionRequestUpdate').modal('show'); |
||||
|
|
||||
|
call_loading('requestDetailsUpdate','start'); |
||||
|
getTaxCollectionRequestUpdate(request_id); |
||||
|
call_loading('statusUpdateForm','start'); |
||||
|
|
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
function getTaxCollectionRequestUpdate(request_id){ |
||||
|
var apiUrl = '/gcc/api/taxcollection/getTaxCollectionRequestById?request_id='+request_id; |
||||
|
$.ajax({ |
||||
|
url: apiUrl, |
||||
|
type: 'GET', |
||||
|
dataType: 'json', |
||||
|
success: function(jsonResponse) { |
||||
|
// Handle the API response data here |
||||
|
console.log('Data from API:', jsonResponse); |
||||
|
// Parse the JSON response into a JavaScript object |
||||
|
var data = jsonResponse; |
||||
|
|
||||
|
// Access the values |
||||
|
var request_id = data.request_id; |
||||
|
var requestNo = data.requestNo; |
||||
|
var name = data.name; |
||||
|
var mobile = data.mobile; |
||||
|
var ptax = data.ptax; |
||||
|
var usertype = data.usertype; |
||||
|
var availabilitydate = data.availabilitydate; |
||||
|
var status = data.status; |
||||
|
var cdate = data.cDate; |
||||
|
|
||||
|
// HTML content |
||||
|
var ptaxPersonalinfoHtml = '<table class="table table-borderless text-capitalize">' + |
||||
|
' <tbody>' + |
||||
|
' <tr>' + |
||||
|
' <td>Name</td>' + |
||||
|
' <td class="font-medium">'+name+'</td>' + |
||||
|
' </tr>' + |
||||
|
' <tr>' + |
||||
|
' <td>Property tax number</td>' + |
||||
|
' <td class="font-medium font-weight-bold" id="pTaxVerification">'+ptax+'</td>' + |
||||
|
' </tr>' + |
||||
|
' <tr>' + |
||||
|
' <td>Mobile Number</td>' + |
||||
|
' <td class="font-medium">'+mobile+'</td>' + |
||||
|
' </tr>' + |
||||
|
' <tr>' + |
||||
|
' <td>Availability Date & Time</td>' + |
||||
|
' <td class="font-medium">'+availabilitydate+'</td>' + |
||||
|
' </tr>' + |
||||
|
' <tr>' + |
||||
|
' <td>User Type</td>' + |
||||
|
' <td class="font-medium">'+usertype+'</td>' + |
||||
|
' </tr>' + |
||||
|
' <tr>' + |
||||
|
' <td>Current Status</td>' + |
||||
|
' <td class="font-medium">'+status+'</td>' + |
||||
|
' </tr>' + |
||||
|
' <tr>' + |
||||
|
' <td>Request Created On</td>' + |
||||
|
' <td class="font-medium">'+cdate+'</td>' + |
||||
|
' </tr>' + |
||||
|
' </tbody>' + |
||||
|
'</table>'; |
||||
|
$("#requestDetailsUpdate").html(ptaxPersonalinfoHtml); |
||||
|
showStatusUpdateForm(request_id, status); |
||||
|
}, |
||||
|
error: function(xhr, status, error) { |
||||
|
// Handle errors here |
||||
|
console.error('Error fetching collection reqtest data:', status, error); |
||||
|
|
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
function showStatusUpdateForm(request_id, status){ |
||||
|
|
||||
|
var selectInput = `<select class="form-control" name="requestStatus" id="requestStatus" required> |
||||
|
<option value="open">Open</option> |
||||
|
<option value="close">Close</option> |
||||
|
</select>`; |
||||
|
|
||||
|
var textareaInput=`<textarea class="form-control" name="statusComments" id="statusComments" rows="4"></textarea>`; |
||||
|
|
||||
|
var ptaxPersonalinfoHtml = '<form class="request-form" id="request-form" onsubmit="return saveStatus();">' + |
||||
|
'<div class="card table-card mb-0"><div class="card-header" style="background-color: #ffe1003b !important;"><h3>Update Form</h3></div>' + |
||||
|
'<div class="card-block p-0">' + |
||||
|
'<table class="table table-borderless">' + |
||||
|
' <tbody>' + |
||||
|
' <tr>' + |
||||
|
' <td width="30%">Current Status</td>' + |
||||
|
' <td class="font-medium">'+selectInput+'</td>' + |
||||
|
' </tr>' + |
||||
|
' <tr>' + |
||||
|
' <td colspan="2">Status Comments' + textareaInput+'</td>' + |
||||
|
' </tr>' + |
||||
|
' </tbody>' + |
||||
|
'</table>' + |
||||
|
'</div><div class="card-footer text-center">' + |
||||
|
' <button type="reset" class="btn btn-secondary mr-2"><i class="ik ik-refresh-cw"></i>Reset</button>'+ |
||||
|
' <button type="submit" class="btn btn-success" id="requestSubmitBtn"><i class="ik ik-save"></i>Save</button>'+ |
||||
|
'</div></div></form>'; |
||||
|
|
||||
|
$("#statusUpdateForm").html(ptaxPersonalinfoHtml); |
||||
|
|
||||
|
|
||||
|
var apiUrl = '/gcc/api/taxcollection/getPropertTaxPersonalDetails?ptax='+ptax; |
||||
|
$.ajax({ |
||||
|
url: apiUrl, |
||||
|
type: 'GET', |
||||
|
dataType: 'json', |
||||
|
success: function(jsonResponse) { |
||||
|
// Handle the API response data here |
||||
|
console.log('Data from API:', jsonResponse); |
||||
|
// Parse the JSON response into a JavaScript object |
||||
|
var data = jsonResponse; |
||||
|
if (data.ResultStatus === "True") { |
||||
|
// Access the values |
||||
|
var owner = data.PROPTAX[0].Owner; |
||||
|
var address = data.PROPTAX[0].Address; |
||||
|
var mobNo = data.PROPTAX[0].Mob_No; |
||||
|
var email = data.PROPTAX[0].Email_ID; |
||||
|
|
||||
|
// HTML content |
||||
|
var ptaxPersonalinfoHtml = '<form class="request-form" id="request-form" onsubmit="return saveStatus();">' + |
||||
|
'<div class="card table-card"><div class="card-header"><h3>Update Form</h3></div>' + |
||||
|
'<div class="card-block">' + |
||||
|
'<table class="table table-borderless">' + |
||||
|
' <tbody>' + |
||||
|
' <tr>' + |
||||
|
' <td>Current Status</td>' + |
||||
|
' <td class="font-medium">'+ptax+'</td>' + |
||||
|
' </tr>' + |
||||
|
' <tr>' + |
||||
|
' <td>Status Comments</td>' + |
||||
|
' <td class="font-medium">'+owner+'</td>' + |
||||
|
' </tr>' + |
||||
|
' <tr>' + |
||||
|
' <td>Address</td>' + |
||||
|
' <td class="font-medium">'+ |
||||
|
|
||||
|
' </td>' + |
||||
|
' </tr>' + |
||||
|
' </tbody>' + |
||||
|
'</table>' + |
||||
|
'</div><div class="card-footer text-center">' + |
||||
|
' <button type="reset" class="btn btn-secondary mr-2"><i class="ik ik-refresh-cw"></i>Reset</button>'+ |
||||
|
' <button type="submit" class="btn btn-success" id="requestSubmitBtn"><i class="ik ik-save"></i>Save</button>'+ |
||||
|
'</div></div></form>'; |
||||
|
$("#statusUpdateForm").html(ptaxPersonalinfoHtml); |
||||
|
} |
||||
|
else { |
||||
|
// No data found |
||||
|
console.log("Status history: " + data.Message); |
||||
|
//$("#pTaxdetails").html('<center><img src="images/nodata.png"></br>No Record Found</center>'); |
||||
|
} |
||||
|
// Enable tooltip for model page |
||||
|
$('[data-toggle="tooltip"]').tooltip(); |
||||
|
}, |
||||
|
error: function(xhr, status, error) { |
||||
|
// Handle errors here |
||||
|
console.error('Error fetching Status history:', status, error); |
||||
|
|
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
function saveStatus(){ |
||||
|
return false; |
||||
|
} |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue