<%@page import="javax.jdo.*,java.util.Iterator,pc.*"%> <%@page isThreadSafe="false" errorPage="Exceptions.jsp"%> <%-- more efficient and safe in a website which is not too loaded --%> WELCOME TO THE SITE OF HEALTH
<%-- --%> <%-- --%> <%try{ PersistenceManager pm = WebAppMgr.getPersistenceManager(); boolean transfer="transfer".equals(request.getParameter("mode"));%>
WELCOME TO THE SITE OF HEALTH
<%} else{%> Click here to add a new program

<%}%>
<% Extent extent = pm.getExtent(Category.class,false); Iterator itr = extent.iterator(); Category first = (Category)itr.next(); while (itr.hasNext()) { Category Mycat = (Category)itr.next();%> <%if(transfer==true){%>

<%=Mycat.toString()%>
<%} else{%>

<%=Mycat.toString()%>
<% }%> <%} extent.close(itr); %>


 

Home Page

 
<% String CatName1= request.getParameter("CatName1"); String PogName = request.getParameter("PogName"); String pogV = request.getParameter("pogV"); String url1 = request.getParameter("url1"); String comName = request.getParameter("comName"); String des=request.getParameter("des"); String flag="no"; String CatName2= request.getParameter("CatName2"); String comUrl=request.getParameter("comUrl"); String temp_pad1 = request.getParameter("submit1"); String temp_pad2 = request.getParameter("submit2"); System.setProperty("proxySet", "true"); System.setProperty("proxyHost", "10.0.1.254"); System.setProperty("proxyPort", "8080"); if("Submit".equals(temp_pad1)) { if (CatName1!=null && !("".equals(pogV))&& !("".equals(comName)) && !("".equals(des)) && !("".equals(PogName))&& !("http://".equals(url1))) { Object id = pm.newObjectIdInstance(Category.class,CatName1); Category dir =(Category)pm.getObjectById(id, true); Item item1=new Item(null,url1,des,PogName,pogV,null,flag); pm.currentTransaction().begin(); pm.makePersistent(item1); dir.addItem(item1); pm.currentTransaction().commit(); } else{ %>

to add - you must fill all fields !!!

<%} } if("Submit".equals(temp_pad2)) { if (CatName2!=null && !("".equals(CatName2))&& !("http://".equals(comUrl))) { try{ Object id = pm.newObjectIdInstance(Category.class,CatName2); Category dir =(Category)pm.getObjectById(id, true); Item item=new Item(comUrl); item.Setflag(flag); pm.currentTransaction().begin(); dir.addItem(item); pm.currentTransaction().commit(); } catch(Exception x) {%>

it's not a Pad File !!!

<%} } else{ %>

to add - you must fill all fields !!!

<%} } %>

<%if(transfer==true){%> Click here to Mail Me

<% pm.close(); } catch(Exception x) {%>

Error:<%=x.getMessage()%>

<%}%>