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

50 lines
1.2 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <%@page import="java.sql.*"%>
  2. <%
  3. try{
  4. String action = request.getParameter("action");
  5. String from_date = request.getParameter("from_date");
  6. String to_date = request.getParameter("to_date");
  7. String action1 = "getCount";
  8. //out.println("if");
  9. String sql;
  10. String zone = (String)session.getAttribute("zone");
  11. sql = "select * from APPOINTMENT_DTL where app_date >= TO_DATE('"+from_date+"','YYYY-MM-DD') and app_date <= TO_DATE('"+to_date+"', 'YYYY-MM-DD') and app_property_id like '"+zone+"-%'";
  12. //out.println(sql);
  13. Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@10.1.0.14:1521:chncorp","erp","erp");
  14. Statement stmt = conn.createStatement();
  15. ResultSet rs = stmt.executeQuery(sql);
  16. int appointments[];
  17. appointments = new int[100];
  18. String salary[];
  19. %>[<%
  20. while(rs.next()){
  21. String app_property_id = rs.getString("app_property_id");
  22. String a[] = app_property_id.split("-");
  23. // out.println(a[1]);
  24. String key = a[0]+"tt"+a[1];
  25. //out.println(key);
  26. %>
  27. {"app_property_id" :"<%= app_property_id %>", "pending":"<%= rs.getString("pending") %>" },
  28. <%
  29. }
  30. %>{}]<%
  31. response.setContentType("application/json");
  32. }catch(SQLException e){
  33. out.println(e);
  34. }
  35. %>