Merge branch 'unicef_dghs' of bitbucket.org:mpowersocial/ha-dashboard into feature
This commit is contained in:
commit
da7b878d2f
@ -0,0 +1,58 @@
|
||||
package org.opensrp.core.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class SbkCenterDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Long id;
|
||||
|
||||
private String division;
|
||||
private String district;
|
||||
private String upazila;
|
||||
private String ReferralFacility;
|
||||
private String code;
|
||||
private String mobile;
|
||||
public String getDivision() {
|
||||
return division;
|
||||
}
|
||||
public void setDivision(String division) {
|
||||
this.division = division;
|
||||
}
|
||||
public String getDistrict() {
|
||||
return district;
|
||||
}
|
||||
public void setDistrict(String district) {
|
||||
this.district = district;
|
||||
}
|
||||
public String getReferralFacility() {
|
||||
return ReferralFacility;
|
||||
}
|
||||
public void setReferralFacility(String referralFacility) {
|
||||
ReferralFacility = referralFacility;
|
||||
}
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
public String getMobile() {
|
||||
return mobile;
|
||||
}
|
||||
public void setMobile(String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
public String getUpazila() {
|
||||
return upazila;
|
||||
}
|
||||
public void setUpazila(String upazila) {
|
||||
this.upazila = upazila;
|
||||
}
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,139 @@
|
||||
package org.opensrp.core.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
import org.hibernate.annotations.CreationTimestamp;
|
||||
import org.hibernate.annotations.UpdateTimestamp;
|
||||
import org.hibernate.validator.constraints.NotEmpty;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
|
||||
@Entity
|
||||
@Table(name = "sbk_center", schema = "core")
|
||||
public class SbkCenter implements Serializable{
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sbk_center_seq")
|
||||
@SequenceGenerator(name = "sbk_center_seq", sequenceName = "sbk_center_seq", allocationSize = 1)
|
||||
private int id;
|
||||
|
||||
@Column(name = "referral_facility")
|
||||
private String ReferralFacility;
|
||||
|
||||
private String division;
|
||||
private String district;
|
||||
private String upazila;
|
||||
private String code;
|
||||
@Column(name = "division_id")
|
||||
private Integer divisionId;
|
||||
@Column(name = "district_id")
|
||||
private Integer districtId;
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Column(name = "CREATED_DATE", updatable = false)
|
||||
@CreationTimestamp
|
||||
private Date created = new Date();
|
||||
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
@Column(name = "MODIFIED_DATE", insertable = true, updatable = true)
|
||||
@UpdateTimestamp
|
||||
private Date updated = new Date();
|
||||
|
||||
private String mobile;
|
||||
|
||||
@Column(name = "server_version")
|
||||
private Long ServerVersion;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getReferralFacility() {
|
||||
return ReferralFacility;
|
||||
}
|
||||
|
||||
public void setReferralFacility(String referralFacility) {
|
||||
ReferralFacility = referralFacility;
|
||||
}
|
||||
|
||||
public String getDivision() {
|
||||
return division;
|
||||
}
|
||||
|
||||
public void setDivision(String division) {
|
||||
this.division = division;
|
||||
}
|
||||
|
||||
public String getDistrict() {
|
||||
return district;
|
||||
}
|
||||
|
||||
public void setDistrict(String district) {
|
||||
this.district = district;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public Integer getDivisionId() {
|
||||
return divisionId;
|
||||
}
|
||||
|
||||
public void setDivisionId(Integer divisionId) {
|
||||
this.divisionId = divisionId;
|
||||
}
|
||||
|
||||
public Integer getDistrictId() {
|
||||
return districtId;
|
||||
}
|
||||
|
||||
public void setDistrictId(Integer districtId) {
|
||||
this.districtId = districtId;
|
||||
}
|
||||
|
||||
public String getMobile() {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public void setMobile(String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public String getUpazila() {
|
||||
return upazila;
|
||||
}
|
||||
|
||||
public void setUpazila(String upazila) {
|
||||
this.upazila = upazila;
|
||||
}
|
||||
|
||||
public Long getServerVersion() {
|
||||
return ServerVersion;
|
||||
}
|
||||
|
||||
public void setServerVersion(Long serverVersion) {
|
||||
ServerVersion = serverVersion;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,166 @@
|
||||
package org.opensrp.core.service;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.math.BigInteger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.query.Query;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.opensrp.core.dto.OutreachDTO;
|
||||
import org.opensrp.core.dto.SbkCenterDTO;
|
||||
import org.opensrp.core.entity.Location;
|
||||
import org.opensrp.core.entity.Outreach;
|
||||
import org.opensrp.core.entity.PostOffice;
|
||||
import org.opensrp.core.entity.SbkCenter;
|
||||
import org.opensrp.core.entity.User;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class SbkCenterService extends CommonService {
|
||||
|
||||
@Autowired
|
||||
private LocationService locationService;
|
||||
|
||||
@Transactional
|
||||
public void saveAll(SbkCenterDTO dto) throws Exception {
|
||||
Session session = getSessionFactory();
|
||||
SbkCenterDTO sbk = findById(dto.getId(), "id", Outreach.class);
|
||||
if (sbk == null) {
|
||||
sbk = new SbkCenterDTO();
|
||||
}
|
||||
//outreach = outreachMapper.map(dto, outreach);
|
||||
session.saveOrUpdate(sbk);
|
||||
}
|
||||
|
||||
@SuppressWarnings("resource")
|
||||
@Transactional
|
||||
public String uploadCamp(HttpSession session, File csvFile)
|
||||
throws Exception {
|
||||
BufferedReader br = null;
|
||||
String cvsSplitBy = ",";
|
||||
String msg = "";
|
||||
String line = "";
|
||||
|
||||
int position = 0;
|
||||
Authentication auth = SecurityContextHolder.getContext()
|
||||
.getAuthentication();
|
||||
User user = (User) auth.getPrincipal();
|
||||
br = new BufferedReader(new FileReader(csvFile));
|
||||
|
||||
while ((line = br.readLine()) != null) {
|
||||
String[] row = line.split(cvsSplitBy);
|
||||
if (position == 0) {
|
||||
position++;
|
||||
continue;
|
||||
} else {
|
||||
String division = row[0].trim();
|
||||
System.err.println("div "+ division+"\n");
|
||||
|
||||
String district = row[1].trim();
|
||||
System.err.println("dis "+ district+"\n");
|
||||
System.err.println(division.toUpperCase()+""+ district);
|
||||
String upazila = row[2].trim();
|
||||
String ReferralFacility = row[3].trim();
|
||||
String code = row[4].trim();
|
||||
String mobile = row[5].trim();
|
||||
|
||||
Location findDivision = locationService.findByKey(division.toUpperCase(), "name", Location.class);
|
||||
Location findDistrict = locationService.findByKey(district.toUpperCase(), "name", Location.class);
|
||||
|
||||
if (findDivision == null || findDistrict == null) {
|
||||
msg += "Division or district not found for row " + position + ". ";
|
||||
position++;
|
||||
continue;
|
||||
}
|
||||
|
||||
SbkCenter sbkcenter=findByKey(code, "code", SbkCenter.class);
|
||||
if(sbkcenter==null){
|
||||
sbkcenter = new SbkCenter();
|
||||
}
|
||||
sbkcenter.setDivision(division);
|
||||
sbkcenter.setDivisionId(findDivision.getId());
|
||||
sbkcenter.setDistrict(district);
|
||||
sbkcenter.setDistrictId(findDistrict.getId());
|
||||
sbkcenter.setReferralFacility(ReferralFacility);
|
||||
sbkcenter.setCode(code);
|
||||
// sbkcenter.setUpazila(upazila);
|
||||
if (upazila != null && !upazila.isEmpty()) {
|
||||
sbkcenter.setUpazila(upazila);
|
||||
} else {
|
||||
sbkcenter.setUpazila(""); // Handle as needed
|
||||
}
|
||||
sbkcenter.setMobile(mobile);
|
||||
sbkcenter.setServerVersion(System.currentTimeMillis());
|
||||
getSessionFactory().save(sbkcenter);
|
||||
|
||||
}
|
||||
position++;
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Transactional
|
||||
public List<String> getPostList(JSONObject jo) {
|
||||
Session session = getSessionFactory();
|
||||
List<String> campList = new ArrayList<String>();
|
||||
String hql = "select * from core.sbk_center_list('" + jo + "')";
|
||||
Query query = session.createSQLQuery(hql);
|
||||
campList = query.list();
|
||||
return campList;
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Transactional
|
||||
public int getPostCount(JSONObject jo) {
|
||||
|
||||
Session session = getSessionFactory();
|
||||
BigInteger total = null;
|
||||
|
||||
String hql = "select * from core.get_sbk_center_list_count('" + jo + "')";
|
||||
Query query = session.createSQLQuery(hql);
|
||||
total = (BigInteger) query.uniqueResult();
|
||||
|
||||
return total.intValue();
|
||||
}
|
||||
|
||||
public JSONObject drawPostDataTable(Integer draw, int total, List<String> dtos, int start) throws JSONException {
|
||||
JSONObject response = new JSONObject();
|
||||
response.put("draw", draw + 1);
|
||||
response.put("recordsTotal", total);
|
||||
response.put("recordsFiltered", total);
|
||||
JSONArray array = new JSONArray();
|
||||
|
||||
int i = 1;
|
||||
for (String string : dtos) {
|
||||
|
||||
JSONArray tableData = new JSONArray();
|
||||
JSONObject json = new JSONObject(string);
|
||||
tableData.put(start + i);
|
||||
tableData.put(json.get("division"));
|
||||
tableData.put(json.get("district"));
|
||||
tableData.put(json.get("upazila"));
|
||||
tableData.put(json.get("referral_facility"));
|
||||
tableData.put(json.get("code"));
|
||||
tableData.put(json.get("mobile"));
|
||||
array.put(tableData);
|
||||
i++;
|
||||
}
|
||||
|
||||
response.put("data", array);
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,113 @@
|
||||
package org.opensrp.web.controller;
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.opensrp.core.service.PostOfficeService;
|
||||
import org.opensrp.core.service.SbkCenterService;
|
||||
import org.opensrp.core.service.UserService;
|
||||
import org.opensrp.web.util.SearchUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "admin")
|
||||
public class SbkCenterController {
|
||||
@Autowired
|
||||
private SbkCenterService sbkcenterService;
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
@Autowired
|
||||
private SearchUtil searchUtil;
|
||||
@Value("#{opensrp['submenu.selected.color']}")
|
||||
private String submenuSelectedColor;
|
||||
|
||||
@RequestMapping(value = "/sbkcenter.html", method = RequestMethod.GET)
|
||||
public String campList(HttpServletRequest request, HttpSession session, Model model, Locale locale) {
|
||||
model.addAttribute("locale", locale);
|
||||
model.addAttribute("providers", userService.getUserList());
|
||||
searchUtil.setDivisionAttribute(session);
|
||||
|
||||
model.addAttribute("camp", submenuSelectedColor);
|
||||
|
||||
return "sbk-center/index";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/upload_sbkcenter.html", method = RequestMethod.GET)
|
||||
public String userUpload(Model model, HttpSession session, Locale locale) throws JSONException {
|
||||
model.addAttribute("locale", locale);
|
||||
model.addAttribute("camp", submenuSelectedColor);
|
||||
|
||||
return "sbk-center/uploads";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/upload/sbkcenter.html", method = RequestMethod.POST)
|
||||
public ModelAndView uploadCamp(HttpSession session, @RequestParam MultipartFile file, HttpServletRequest request,
|
||||
ModelMap model, Locale locale) throws Exception {
|
||||
|
||||
if (file.isEmpty()) {
|
||||
model.put("msg", "Failed to upload the file because it is empty");
|
||||
model.addAttribute("msg", "Failed to upload the file because it is empty");
|
||||
return new ModelAndView("/camp/uploads");
|
||||
}
|
||||
|
||||
String rootPath = request.getSession().getServletContext().getRealPath("/");
|
||||
|
||||
File dir = new File(rootPath + File.separator + "uploadedfile");
|
||||
if (!dir.exists()) {
|
||||
dir.mkdirs();
|
||||
}
|
||||
|
||||
File csvFile = new File(dir.getAbsolutePath() + File.separator + file.getOriginalFilename());
|
||||
|
||||
try {
|
||||
try (InputStream is = file.getInputStream();
|
||||
BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(csvFile))) {
|
||||
int i;
|
||||
|
||||
while ((i = is.read()) != -1) {
|
||||
stream.write(i);
|
||||
}
|
||||
stream.flush();
|
||||
}
|
||||
}
|
||||
catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
model.put("msg", "failed to process file because : " + e.getMessage());
|
||||
return new ModelAndView("/sbk-center/uploads");
|
||||
}
|
||||
|
||||
String msg = "";
|
||||
try {
|
||||
sbkcenterService.uploadCamp(session, csvFile);
|
||||
|
||||
}
|
||||
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
msg = e.getMessage();
|
||||
}
|
||||
if (!msg.isEmpty()) {
|
||||
model.put("msg", msg);
|
||||
return new ModelAndView("/sbk-center/uploads");
|
||||
}
|
||||
return new ModelAndView("redirect:/admin/sbkcenter.html?lang=" + locale);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package org.opensrp.web.rest.controller;
|
||||
|
||||
import static org.springframework.http.HttpStatus.OK;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.opensrp.core.dto.OutreachDTO;
|
||||
import org.opensrp.core.dto.SbkCenterDTO;
|
||||
import org.opensrp.core.service.PostOfficeService;
|
||||
import org.opensrp.core.service.SbkCenterService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonParseException;
|
||||
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||
import com.google.gson.Gson;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("rest/api/v1/sbkcenter")
|
||||
public class SbkCenterRestController {
|
||||
@Autowired
|
||||
private SbkCenterService sbkcenterService;
|
||||
|
||||
@RequestMapping(value = "/save-update", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<String> save(@RequestBody SbkCenterDTO dto)
|
||||
throws Exception {
|
||||
|
||||
JSONObject response = new JSONObject();
|
||||
|
||||
try {
|
||||
sbkcenterService.saveAll(dto);
|
||||
response.put("status", "SUCCESS");
|
||||
response.put("msg", "you have updated successfully");
|
||||
|
||||
return new ResponseEntity<>(new Gson().toJson(response.toString()),
|
||||
OK);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
response.put("status", "FAILED");
|
||||
response.put("msg", e.getMessage());
|
||||
return new ResponseEntity<>(new Gson().toJson(response.toString()),
|
||||
OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
public ResponseEntity<String> camplist(
|
||||
HttpServletRequest request, HttpSession session)
|
||||
throws JSONException, JsonParseException, JsonMappingException,
|
||||
IOException {
|
||||
Integer start = Integer.valueOf(request.getParameter("start"));
|
||||
Integer length = Integer.valueOf(request.getParameter("length"));
|
||||
Integer draw = Integer.valueOf(request.getParameter("draw"));
|
||||
|
||||
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
|
||||
jo.put("division", request.getParameter("division"));
|
||||
jo.put("district", request.getParameter("district"));
|
||||
|
||||
|
||||
jo.put("offset", start);
|
||||
jo.put("limit", length);
|
||||
|
||||
int totalRecords = Integer.parseInt(request
|
||||
.getParameter("totalRecords"));
|
||||
List<String> data = sbkcenterService.getPostList(jo);
|
||||
|
||||
int total = 0;
|
||||
if (start == 0) {
|
||||
total = sbkcenterService.getPostCount(jo);
|
||||
} else {
|
||||
total = totalRecords;
|
||||
}
|
||||
|
||||
JSONObject response = sbkcenterService.drawPostDataTable(draw, total, data,
|
||||
start);
|
||||
return new ResponseEntity<>(response.toString(), OK);
|
||||
}
|
||||
|
||||
}
|
@ -55,6 +55,8 @@
|
||||
<value>org.opensrp.core.entity.CenterInformation</value>
|
||||
<value>org.opensrp.core.entity.Microplan</value>
|
||||
<value>org.opensrp.core.entity.MicroplanReview</value>
|
||||
<value>org.opensrp.core.entity.SbkCenter</value>
|
||||
|
||||
|
||||
</list>
|
||||
</property>
|
||||
|
@ -190,6 +190,7 @@ font-size: 18px;
|
||||
boolean MEMBER_APPROVAL = AuthenticationManagerUtil.isPermitted("MEMBER_APPROVAL");
|
||||
boolean camp = AuthenticationManagerUtil.isPermitted("OUTREACH");
|
||||
boolean postoffice = AuthenticationManagerUtil.isPermitted("POSTOFFICE");
|
||||
boolean sbkcenter = AuthenticationManagerUtil.isPermitted("SBKCENTER");
|
||||
boolean IMMUNIZATION_AGGREAGTE = AuthenticationManagerUtil.isPermitted("IMMUNIZATION_AGGREAGTE");
|
||||
boolean IMMUNIZATION_DETAILS = AuthenticationManagerUtil.isPermitted("IMMUNIZATION_DETAILS");
|
||||
boolean vaccineStatus= false;
|
||||
@ -519,6 +520,13 @@ font-size: 18px;
|
||||
</li>
|
||||
<%} %>
|
||||
|
||||
<% if(AuthenticationManagerUtil.isPermitted("postoffice")){ %>
|
||||
<li class="start " >
|
||||
<a class="nav-link mr-lg-2" id="languageDropdown" href="<c:url value="/admin/sbkcenter.html"/>"><i class="fa fa-home"></i> SBK Center </a>
|
||||
|
||||
</li>
|
||||
<%} %>
|
||||
|
||||
<% if(AuthenticationManagerUtil.isPermitted("BDRIS")){ %>
|
||||
<li class="start " >
|
||||
<a class="nav-link mr-lg-2" id="languageDropdown" href="<c:url value="/admin/bdris.html"/>"><i class="fa fa-home"></i> BDRIS Report </a>
|
||||
|
222
opensrp-web/src/main/webapp/WEB-INF/views/sbk-center/index.jsp
Normal file
222
opensrp-web/src/main/webapp/WEB-INF/views/sbk-center/index.jsp
Normal file
@ -0,0 +1,222 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="ISO-8859-1"%>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||
<%@ taglib prefix="security"
|
||||
uri="http://www.springframework.org/security/tags"%>
|
||||
<%@page import="org.opensrp.web.util.AuthenticationManagerUtil"%>
|
||||
<%@page import="java.util.List"%>
|
||||
<%@page import="java.util.Map"%>
|
||||
<%@page import="org.opensrp.core.entity.Team"%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>SBK Center</title>
|
||||
<jsp:include page="/WEB-INF/views/header.jsp" />
|
||||
</head>
|
||||
|
||||
<jsp:include page="/WEB-INF/views/dataTablecss.jsp" />
|
||||
|
||||
<c:url var="saveUrl" value="/role/add" />
|
||||
<c:url var="get_url" value="/rest/api/v1/sbkcenter/list" />
|
||||
<%
|
||||
List<Object[]> divisions = (List<Object[]>) session.getAttribute("divisions");
|
||||
|
||||
%>
|
||||
|
||||
<div class="page-content-wrapper">
|
||||
<div class="page-content">
|
||||
<ul class="page-breadcrumb breadcrumb">
|
||||
<li>
|
||||
<i class="fa fa-star" id="size_star" aria-hidden="true"></i> <span class="sub-menu-title"><strong>SBK Center list:</strong> </span> <a href="<c:url value="/admin/admin-dashboard"/>">Home</a>
|
||||
|
||||
|
||||
<li class="pull-right" style="padding-right: 15px">
|
||||
<% if(AuthenticationManagerUtil.isPermitted("PERM_WRITE_TEAM")){ %>
|
||||
<a href="<c:url value="/admin/upload_sbkcenter.html?lang=${locale}"/>"> <strong>Upload SBK Center</strong></a> <%} %>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet box blue-madison">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-edit"></i>Shishu Bikash Kendra Center List
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="portlet-body">
|
||||
<div class="card mb-3">
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<div class="form-group row ">
|
||||
<div class="col-sm-3">
|
||||
<label><spring:message code="lbl.division"/></label>
|
||||
<select class="form-control mx-sm-3" id="divisionId"
|
||||
name="divisionId">
|
||||
<option value=""><spring:message code="lbl.selectDivision"/>
|
||||
</option>
|
||||
<%
|
||||
for (Object[] objects : divisions) {
|
||||
%>
|
||||
<option value="<%=objects[1]%>"><%=objects[0]%></option>
|
||||
<%
|
||||
|
||||
}
|
||||
%>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<label><spring:message code="lbl.district"/></label>
|
||||
<select class="form-control mx-sm-3" id="districtId"
|
||||
name="districtId">
|
||||
<option value=""><spring:message code="lbl.selectDistrict"/></option>
|
||||
<option value=""></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-sm-6 text-left" style="padding-top: 22px">
|
||||
|
||||
<button name="search" onclick="filter()" type="submit" id="bth-search"
|
||||
class="btn btn-primary" value="search">
|
||||
<spring:message code="lbl.search" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="card-footer small text-muted"></div>
|
||||
</div>
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<b>Outreach List</b>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered" id="dataTable">
|
||||
<thead>
|
||||
<tr><th>SI</th>
|
||||
<th>Division</th>
|
||||
<th>District</th>
|
||||
<th>GAVI/CBE/REMEN</th>
|
||||
<th>Referral Facility</th>
|
||||
<th>code</th>
|
||||
<th>Mobile</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer small text-muted"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<jsp:include page="/WEB-INF/views/footer.jsp" />
|
||||
<jsp:include page="/WEB-INF/views/dataTablejs.jsp" />
|
||||
<script src="<c:url value='/resources/js/dataTables.fixedColumns.min.js'/>"></script>
|
||||
<jsp:include page="/WEB-INF/views/commonjs.jsp" />
|
||||
<script type="text/javascript">
|
||||
/* var dateToday = new Date();
|
||||
var dates = $(".date").datepicker({
|
||||
dateFormat: 'yy-mm-dd',
|
||||
|
||||
});
|
||||
var d = new Date();
|
||||
var startDate = $.datepicker.formatDate('yy-mm-dd', new Date(d.getFullYear(), d.getMonth(), 1));
|
||||
|
||||
$("#from").datepicker('setDate', startDate);
|
||||
$("#to").datepicker('setDate', new Date()); */
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
window.totalRecords = 0;
|
||||
|
||||
filter();
|
||||
});
|
||||
function filter() {
|
||||
let division = $('#divisionId').val() || "";
|
||||
let district =$('#districtId').val() || "";
|
||||
|
||||
|
||||
stockList = $('#dataTable').DataTable({
|
||||
bFilter : false,
|
||||
serverSide : true,
|
||||
processing : true,
|
||||
//scrollY : "300px",
|
||||
//scrollX : true,
|
||||
//scrollCollapse : true,
|
||||
/* fixedColumns : {
|
||||
leftColumns : 2,
|
||||
rightColumns: 1
|
||||
}, */
|
||||
"ordering" : false,
|
||||
ajax : {
|
||||
url : "${get_url}",
|
||||
timeout : 300000,
|
||||
data : function(data) {
|
||||
/* data.from=$('#from').val();
|
||||
data.to = $('#to').val();
|
||||
data.provider=$('#provider').val(); */
|
||||
data.division = division;
|
||||
data.district = district;
|
||||
|
||||
data.totalRecords = totalRecords;
|
||||
|
||||
},
|
||||
dataSrc : function(json) {
|
||||
totalRecords = json.recordsTotal;
|
||||
if (json.data) {
|
||||
//$("#dtime").html(dateTimeHeader);
|
||||
return json.data;
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
complete : function() {
|
||||
},
|
||||
type : 'GET'
|
||||
},
|
||||
bInfo : true,
|
||||
destroy : true,
|
||||
language : {
|
||||
searchPlaceholder : ""
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
133
opensrp-web/src/main/webapp/WEB-INF/views/sbk-center/uploads.jsp
Normal file
133
opensrp-web/src/main/webapp/WEB-INF/views/sbk-center/uploads.jsp
Normal file
@ -0,0 +1,133 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="ISO-8859-1"%>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||
<%@page import="org.opensrp.common.util.CheckboxHelperUtil"%>
|
||||
|
||||
<%@page import="java.util.List"%>
|
||||
<%@page import="java.util.Map"%>
|
||||
<%@page import="org.opensrp.core.entity.Role"%>
|
||||
<c:url var="baseURL" value="/" />
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<%
|
||||
|
||||
|
||||
Integer selectedPersonId = (Integer)session.getAttribute("selectedPersonId");
|
||||
String locationList = (String)session.getAttribute("locationList");
|
||||
String selectedLocationList = (String)session.getAttribute("selectedLocationList");
|
||||
List<Object[]> upazilaList = (List<Object[]>) session.getAttribute("upazilaList");
|
||||
Map<Integer, String> teams = (Map<Integer, String>)session.getAttribute("teams");
|
||||
|
||||
String selectedPersonName = (String)session.getAttribute("personName");
|
||||
|
||||
Integer selectetTeamId = (Integer)session.getAttribute("selectetTeamId");
|
||||
|
||||
int roleIdCHCP = -1;
|
||||
int roleIdProvider = -1;
|
||||
int roleIdUHFPO = -1;
|
||||
int roleIdEATL = -1;
|
||||
|
||||
|
||||
|
||||
%>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link type="text/css" href="<c:url value="/resources/css/magicsuggest-min.css"/>" rel="stylesheet">
|
||||
<meta name="_csrf" content="${_csrf.token}"/>
|
||||
<!-- default header name is X-CSRF-TOKEN -->
|
||||
<meta name="_csrf_header" content="${_csrf.headerName}"/>
|
||||
<title><spring:message code="lbl.addUserTitle"/></title>
|
||||
|
||||
<jsp:include page="/WEB-INF/views/css.jsp" />
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
<c:url var="saveUrl" value="/admin/upload/sbkcenter.html" />
|
||||
<c:url var="cancelUrl" value="/admin/sbkcenter.html" />
|
||||
|
||||
<jsp:include page="/WEB-INF/views/header.jsp" />
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="page-content-wrapper">
|
||||
<div class="page-content">
|
||||
<ul class="page-breadcrumb breadcrumb">
|
||||
<li>
|
||||
<i class="fa fa-star" id="size_star" aria-hidden="true"></i> <span class="sub-menu-title"><strong>SBK Center list</strong> </span> <a href="<c:url value="/"/>">Home</a>
|
||||
</li>
|
||||
<li>
|
||||
</li>
|
||||
<li><a href="${cancelUrl }">Back</a></li>
|
||||
|
||||
</ul>
|
||||
<!-- END PAGE BREADCRUMB -->
|
||||
<!-- END PAGE HEADER-->
|
||||
<!-- BEGIN PAGE CONTENT-->
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<!-- BEGIN EXAMPLE TABLE PORTLET-->
|
||||
<div class="portlet box blue-madison">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-edit"></i>Upload SBK Center
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="portlet-body">
|
||||
<form:form method="POST" action="${saveUrl}?${_csrf.parameterName}=${_csrf.token}" modelAttribute="location" enctype="multipart/form-data">
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">File<span class="required">* </span> </label>
|
||||
<input id="file" type="file" name="file" />
|
||||
<span class="text-red">${msg}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="dotted">
|
||||
<div class="form-group row ">
|
||||
<div class="col-sm-6">
|
||||
</div>
|
||||
<div class="col-sm-6 text-right">
|
||||
<a class="btn btn-info" href="${cancelUrl}">Cancel</a>
|
||||
<button type="submit" id="submit-form" class="btn btn-primary" name="signup" value="Validate">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form:form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- END PAGE CONTENT-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- END CONTENT -->
|
||||
</div>
|
||||
|
||||
<jsp:include page="/WEB-INF/views/footer.jsp" />
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user