Category: + <% + String categoryid = request.getParameter("categoryid"); + out.print(func.getCategoryName(categoryid)); + %> + +
++ Attach file:
+ Deadline,
+ Date:
+ Time:
+ Asignee:
+ Tag: +
GET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+
+ // GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ PrintWriter out = response.getWriter();
+ PersistenceManager pm = PMF.get().getPersistenceManager();
+ try {
+ String asignee = request.getParameter("asignee");
+ String [] asigneepieces = asignee.split(",");
+ ListGET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+
+ // GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ PrintWriter out = response.getWriter();
+ PersistenceManager pm = PMF.get().getPersistenceManager();
+ try {
+ /* TODO output your page here. You may use following sample code. */
+ String deadlinetime = request.getParameter("deadlinetime")+":00";
+ String taskid = request.getParameter("taskid");
+
+ Query q = pm.newQuery(Task.class);
+ q.setFilter("taskid == param");
+ q.declareParameters("int param");
+
+ Task task = (Task) q.execute(taskid);
+ task.deadline = deadlinetime;
+
+ out.print("Deadline : "+deadlinetime);
+ q.closeAll();
+ pm.close();
+ } catch(Exception exc){
+ System.out.println("Error : "+exc.toString());
+ }finally {
+ out.close();
+ }
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }// GET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+
+ // GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ PrintWriter out = response.getWriter();
+ PersistenceManager pm = PMF.get().getPersistenceManager();
+ try {
+ String newpass = request.getParameter("newpass");
+ String userid = request.getParameter("userid");
+
+ Query q = pm.newQuery(User.class);
+ q.setFilter("username == param");
+ q.declareParameters("int param");
+
+ User user = (User) q.execute(userid);
+ user.password = newpass;
+
+ System.out.println("Succes Update");
+ q.closeAll();
+ pm.close();
+ }catch(Exception ex){
+ System.out.println(ex.toString());
+ } finally {
+ out.close();
+ }
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }// GET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+
+ // GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ PrintWriter out = response.getWriter();
+ PersistenceManager pm = PMF.get().getPersistenceManager();
+ try {
+ String emailinput = request.getParameter("emailinput");
+
+ Query q = pm.newQuery("SELECT FROM " + User.class.getName() + " WHERE email == '" + emailinput +"'");
+ ListGET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+
+ // GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ PrintWriter out = response.getWriter();
+ PersistenceManager pm = PMF.get().getPersistenceManager();
+ try {
+ String idinput = request.getParameter("idinput");
+
+ Query q = pm.newQuery("SELECT FROM " + User.class.getName() + " WHERE username == '" + idinput +"'");
+ ListGET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+
+ // GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ PrintWriter out = response.getWriter();
+ PersistenceManager pm = PMF.get().getPersistenceManager();
+ try {
+ String username = request.getParameter("id");
+ String pass = request.getParameter("pass");
+
+ Query q = pm.newQuery("SELECT FROM " + User.class.getName() + " WHERE username == '" + username + "' AND password='" +pass + "'");
+ ListGET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+
+ // GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ PrintWriter out = response.getWriter();
+ PersistenceManager pm = PMF.get().getPersistenceManager();
+ try {
+ Function func = new Function();
+ String userActive = "";
+ if(request.getSession().getAttribute("userlistapp")!=null){
+ userActive = request.getSession().getAttribute("userlistapp").toString();
+ }
+
+ String commentid = request.getParameter("commentid");
+ String taskid = request.getParameter("taskid");
+ int index = Integer.parseInt(request.getParameter("index"));
+
+ Query q1 = pm.newQuery(Comment.class);
+ q1.setFilter("commentid == param");
+ q1.declareParameters("int param");
+
+ pm.deletePersistent((Comment) q1.execute(commentid));
+
+ int numpage;
+ if (Integer.parseInt(func.GetNComment(taskid))%5 == 0) {
+ numpage = (Integer.parseInt(func.GetNComment(taskid))/5);
+ }
+ else {
+ numpage = (Integer.parseInt(func.GetNComment(taskid))/5)+1;
+ }
+
+ Query q2 = pm.newQuery("SELECT FROM " + Comment.class.getName() + " WHERE taskid == " + taskid + " limit " + index + ",5");
+ List"+func.GetNComment(taskid) +" Comment
"); + out.print("GET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+
+ // GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ PrintWriter out = response.getWriter();
+ PersistenceManager pm = PMF.get().getPersistenceManager();
+ try {
+ String categoryid = request.getParameter("id");
+
+ Query q1 = pm.newQuery(Category.class);
+ q1.setFilter("categoryid == param");
+ q1.declareParameters("int param");
+
+ pm.deletePersistent((Category) q1.execute(categoryid));
+
+ response.sendRedirect("dashboard.jsp");
+
+ q1.closeAll();
+ pm.close();
+ } catch(Exception e){
+ } finally {
+ out.close();
+ }
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }// GET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+
+ // GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ PrintWriter out = response.getWriter();
+ PersistenceManager pm = PMF.get().getPersistenceManager();
+ try {
+ /* TODO output your page here. You may use following sample code. */
+ String taskid = request.getParameter("taskid");
+ Query q1 = pm.newQuery("SELECT filename FROM " + Attachment.class.getName() + " WHERE taskid=" + taskid);
+ ListGET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+ PrintWriter out = response.getWriter();
+ try {
+// /* TODO output your page here. You may use following sample code. */
+// Boolean isMultipartContent = ServletFileUpload.isMultipartContent(request);
+// if(!isMultipartContent){
+// out.print("you not gona upload file!!");
+// return;
+// }else{
+// out.print("you try to upload file!!");
+// }
+//
+// String userActive = "";
+// if(request.getSession().getAttribute("userlistapp")!=null){
+// userActive = request.getSession().getAttribute("userlistapp").toString();
+// }
+// FileItemFactory factory = new DiskFileItemFactory();
+// ServletFileUpload upload = new ServletFileUpload(factory);
+// ListGET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }// GET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+
+ // GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ PrintWriter out = response.getWriter();
+ PersistenceManager pm = PMF.get().getPersistenceManager();
+ try {
+ /* TODO output your page here. You may use following sample code. */
+
+ String content = request.getParameter("content");
+ int mode = Integer.parseInt(request.getParameter("idx"));
+ int filter = Integer.parseInt(request.getParameter("filter"));
+
+ ListGET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+
+ // GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ doPost(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ PrintWriter out = response.getWriter();
+
+ DatastoreService iseng = DatastoreServiceFactory.getDatastoreService();
+
+ PersistenceManager pm = PMF.get().getPersistenceManager();
+
+ try {
+
+ String username = request.getParameter("username");
+
+ String namecategory = request.getParameter("newCategory");//$_POST['newCategory'];
+ String listAssignee = request.getParameter("listAssignee");//$_POST['listAssignee'];
+
+ Date dateFormat = new Date();
+ Date date = new Date();
+ String [] Assignee = listAssignee.split(",");
+
+ // insert categori
+ Category cat = new Category(1, namecategory, username, date);
+ try {
+ pm.makePersistent(cat);
+ }
+ catch (Exception e) {
+ out.print("Data Insert FAIL");
+ } finally {
+
+ }
+
+ Query q = pm.newQuery("select categoryid from "+Category.class.getName());
+ ListGET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+ PrintWriter out = response.getWriter();
+ try {
+// Boolean isMultipartContent = ServletFileUpload.isMultipartContent(request);
+// if(!isMultipartContent){
+// out.print("you not gona upload file!!");
+// }else{
+// out.print("you try to upload file!!");
+// }
+//
+// String taskName = "";
+// String deadline = "";
+// String timeDeadline = "";
+// String listAssignee = "";
+// String listTag = "";
+// String taskId = (new Function()).GetNextTaskId();
+// String userActive = "";
+// String categoryId = request.getParameter("categoryid");
+//
+// if(request.getSession().getAttribute("userlistapp")!=null){
+// userActive = request.getSession().getAttribute("userlistapp").toString();
+// }
+//
+// DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+// Date date = new Date();
+// String createdDateTime = dateFormat.format(date);
+//
+//
+// GetConnection getCon = new GetConnection();
+// Connection conn = getCon.getConnection();
+// String query = "INSERT INTO `task` " +
+// "(`taskid`, `taskname`, `username`, `createddate`, `deadline`, `status`, `categoryid`) VALUES "+
+// "("+taskId+", 'aaa', '"+userActive+"', '1111-11-11 11:11:11', '1111-11-11 11:11:11', 'UNCOMPLETE', "+categoryId+")";
+// Statement stt = conn.createStatement();
+// stt.execute(query);
+//
+// FileItemFactory factory = new DiskFileItemFactory();
+// ServletFileUpload upload = new ServletFileUpload(factory);
+// ListGET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }// GET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+ PrintWriter out = response.getWriter();
+ try {
+ /* TODO output your page here. You may use following sample code. */
+ Function func = new Function();
+ String userActive = "";
+ if(request.getSession().getAttribute("userlistapp")!=null){
+ userActive = request.getSession().getAttribute("userlistapp").toString();
+ }
+
+ String taskid = request.getParameter("taskid");
+ int index = Integer.parseInt(request.getParameter("index"))+5;
+
+ int numpage;
+ if (Integer.parseInt(func.GetNComment(taskid))%5 == 0) {
+ numpage = (Integer.parseInt(func.GetNComment(taskid))/5);
+ }
+ else {
+ numpage = (Integer.parseInt(func.GetNComment(taskid))/5)+1;
+ }
+
+ PersistenceManager pm = PMF.get().getPersistenceManager();
+
+ Query q = pm.newQuery(Comment.class);
+ q.setFilter("taskid == idtask");
+ q.declareParameters("int idtask");
+ q.setRange(index, index+5);
+
+ List"+func.GetNComment(taskid) +" Comment
"); + out.print(""); + out.print(v.message); + out.print("
"); + out.print("GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }// GET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+ PrintWriter out = response.getWriter();
+ try {
+ /* TODO output your page here. You may use following sample code. */
+ Function func = new Function();
+ String userActive = "";
+ if(request.getSession().getAttribute("userlistapp")!=null){
+ userActive = request.getSession().getAttribute("userlistapp").toString();
+ }
+
+ String taskid = request.getParameter("taskid");
+ int index = Integer.parseInt(request.getParameter("index"))-5;
+
+ int numpage;
+ if (Integer.parseInt(func.GetNComment(taskid))%5 == 0) {
+ numpage = (Integer.parseInt(func.GetNComment(taskid))/5);
+ }
+ else {
+ numpage = (Integer.parseInt(func.GetNComment(taskid))/5)+1;
+ }
+
+ PersistenceManager pm = PMF.get().getPersistenceManager();
+
+ Query q = pm.newQuery(Comment.class);
+ q.setFilter("taskid == idtask");
+ q.declareParameters("int idtask");
+ q.setRange(index, index+5);
+
+ List"+func.GetNComment(taskid) +" Comment
"); + out.print(""); + out.print(v.message); + out.print("
"); + out.print("GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }// GET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+ PrintWriter out = response.getWriter();
+ try {
+// Boolean isMultipartContent = ServletFileUpload.isMultipartContent(request);
+// if(!isMultipartContent){
+// out.print("you not gona upload file!!");
+// return;
+// }else{
+// out.print("you try to upload file!!");
+// }
+//
+// String username = "";
+// String password = "";
+// String fullname = "";
+// String birthday = "";
+// String email = "";
+// String avatar = "";
+//
+// FileItemFactory factory = new DiskFileItemFactory();
+// ServletFileUpload upload = new ServletFileUpload(factory);
+// ListGET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }// GET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+ PrintWriter out = response.getWriter();
+ try {
+ /* TODO output your page here. You may use following sample code. */
+ HttpSession session = request.getSession();
+ if(session!=null){
+ session.invalidate();
+ }
+ response.sendRedirect("index.jsp");
+ } finally {
+ out.close();
+ }
+ }
+
+ // GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }// GET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+ PrintWriter out = response.getWriter();
+ try {
+ /* TODO output your page here. You may use following sample code. */
+ String aboutme = request.getParameter("aboutme");
+ String userid = request.getParameter("userid");
+
+ PersistenceManager pm = PMF.get().getPersistenceManager();
+
+ Query q = pm.newQuery(User.class);
+ q.setFilter("username == userid");
+ q.declareParameters("String userid");
+
+ User results = (User)q.execute(userid);
+ results.aboutme = aboutme;
+
+ q.closeAll();
+ pm.close();
+
+ System.out.println("Succes Update");
+ out.print(aboutme);
+ }catch(Exception ex){
+ System.out.println(ex.toString());
+ } finally {
+ out.close();
+ }
+ }
+
+ // GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }// GET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+ PrintWriter out = response.getWriter();
+ try {
+ /* TODO output your page here. You may use following sample code. */
+ String birthday = request.getParameter("birthday");
+ String userid = request.getParameter("userid");
+
+ PersistenceManager pm = PMF.get().getPersistenceManager();
+
+ Query q = pm.newQuery(User.class);
+ q.setFilter("username == userid");
+ q.declareParameters("String userid");
+
+ User results = (User)q.execute(userid);
+ results.birthday = birthday;
+
+ q.closeAll();
+ pm.close();
+
+ System.out.println("Succes Update");
+ out.print(birthday);
+ }catch(Exception ex){
+ System.out.println(ex.toString());
+ } finally {
+ out.close();
+ }
+ }
+
+ // GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }// GET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+ PrintWriter out = response.getWriter();
+ try {
+ /* TODO output your page here. You may use following sample code. */
+ String email = request.getParameter("email");
+ String userid = request.getParameter("userid");
+
+ PersistenceManager pm = PMF.get().getPersistenceManager();
+
+ Query q = pm.newQuery(User.class);
+ q.setFilter("username == userid");
+ q.declareParameters("String userid");
+
+ User results = (User)q.execute(userid);
+ results.email = email;
+
+ q.closeAll();
+ pm.close();
+
+ System.out.println("Succes Update");
+ out.print(email);
+ }catch(Exception ex){
+ System.out.println(ex.toString());
+ } finally {
+ out.close();
+ }
+ }
+
+ // GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }// GET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+ PrintWriter out = response.getWriter();
+ try {
+ /* TODO output your page here. You may use following sample code. */
+ String name = request.getParameter("name");
+ String userid = request.getParameter("userid");
+
+ PersistenceManager pm = PMF.get().getPersistenceManager();
+
+ Query q = pm.newQuery(User.class);
+ q.setFilter("username == userid");
+ q.declareParameters("String userid");
+
+ User results = (User)q.execute(userid);
+ results.fullname = name;
+
+ q.closeAll();
+ pm.close();
+
+ System.out.println("Succes Update");
+ out.print(name);
+ }catch(Exception ex){
+ System.out.println(ex.toString());
+ } finally {
+ out.close();
+ }
+ }
+
+ // GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }// GET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+ PrintWriter out = response.getWriter();
+ try {
+ /* TODO output your page here. You may use following sample code. */
+ String listAssignee = request.getParameter("listAssigne");
+ String taskid = request.getParameter("taskid");
+
+ PersistenceManager pm = PMF.get().getPersistenceManager();
+
+ Query q = pm.newQuery(Assignee.class);
+ q.setFilter("taskid == idtask");
+ q.declareParameters("int idtask");
+
+ Assignee results = (Assignee)q.execute(Integer.parseInt(taskid));
+ pm.deletePersistent(results);
+
+ String userActive = "";
+ if(request.getSession().getAttribute("userlistapp")!=null){
+ userActive = request.getSession().getAttribute("userlistapp").toString();
+ }
+
+ HashMapGET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }// GET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+ PrintWriter out = response.getWriter();
+ try {
+ /* TODO output your page here. You may use following sample code. */
+ Function func = new Function();
+
+ String listTag = request.getParameter("tag");
+ String taskid = request.getParameter("taskid");
+
+ PersistenceManager pm = PMF.get().getPersistenceManager();
+
+ Query q = pm.newQuery(Task_Tag.class);
+ q.setFilter("taskid == idtask");
+ q.declareParameters("int idtask");
+
+ Task_Tag result = (Task_Tag)q.execute(taskid);
+ pm.deletePersistent(result);
+
+ String [] tag = listTag.split(",");
+ for(int i = 0; i < tag.length ; i++){
+ String tagId = func.GetTagId(tag[i]);
+ System.out.println(i);
+ System.out.println(tag[i]);
+ System.out.println(">>"+tagId+"<<");
+
+ Task_Tag t = new Task_Tag(Integer.parseInt(taskid), Integer.parseInt(tagId));
+ pm.makePersistent(t);
+ }
+
+ q = pm.newQuery("select tagid from " + Task_Tag.class.getName());
+ q.setFilter("taskid == idtask");
+ q.declareParameters("int idtask");
+
+ ListGET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }// GET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+ PrintWriter out = response.getWriter();
+ try {
+ /* TODO output your page here. You may use following sample code. */
+ Function func = new Function();
+ String userActive = "";
+ if(request.getSession().getAttribute("userlistapp")!=null){
+ userActive = request.getSession().getAttribute("userlistapp").toString();
+ }
+
+ int commentid = Integer.parseInt(func.getNextCommentId());
+ String taskid = request.getParameter("taskid");
+ String comment = request.getParameter("comment");
+
+ DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+ Date date = new Date();
+ String createdate = dateFormat.format(date);
+
+ PersistenceManager pm = PMF.get().getPersistenceManager();
+
+ Comment c = new Comment(commentid, createdate, comment, userActive, Integer.parseInt(taskid));
+ pm.makePersistent(c);
+
+ int numpage;
+ if (Integer.parseInt(func.GetNComment(taskid))%5 == 0) {
+ numpage = (Integer.parseInt(func.GetNComment(taskid))/5);
+ }
+ else {
+ numpage = (Integer.parseInt(func.GetNComment(taskid))/5)+1;
+ }
+ int index = 5*(numpage-1);
+
+ Query q = pm.newQuery(Comment.class);
+ q.setFilter("taskid == idtask");
+ q.declareParameters("int idtask");
+ q.setRange(index, index+5);
+
+ List"+func.GetNComment(taskid) +" Comment
"); + out.print(""); + out.print(v.message); + out.print("
"); + out.print("GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }// GET
and
+ * POST
methods.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ response.setContentType("text/html;charset=UTF-8");
+ PrintWriter out = response.getWriter();
+ try {
+ /* TODO output your page here. You may use following sample code. */
+ String status = request.getParameter("status");
+ String taskid = request.getParameter("taskid");
+
+ PersistenceManager pm = PMF.get().getPersistenceManager();
+
+ Query q;
+ if(status.equals("UNCOMPLETE")){
+ q = pm.newQuery(Task.class);
+ q.setFilter("taskid == idtask");
+ q.declareParameters("int idtask");
+
+ Task results = (Task)q.execute(taskid);
+ results.status = "COMPLETE";
+
+ out.print("COMPLETE");
+ }else{
+ q = pm.newQuery(Task.class);
+ q.setFilter("taskid == idtask");
+ q.declareParameters("int idtask");
+
+ Task results = (Task)q.execute(taskid);
+ results.status = "UNCOMPLETE";
+
+ out.print("UNCOMPLETE");
+ }
+ q.closeAll();
+ pm.close();
+ } catch(Exception e){
+ }finally {
+ out.close();
+ }
+ }
+
+ // GET
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Handles the HTTP
+ * POST
method.
+ *
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ *
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }// << Prev | '; + html += 'Next >> | '; + html += '
' + getMonthName(popUpCal.selectedMonth) + ' ' + popUpCal.selectedYear + ' | '; + html += '||||||
---|---|---|---|---|---|---|
' + weekDays[j] + ' | '; + } + + var daysInMonth = getDaysInMonth(popUpCal.selectedYear, popUpCal.selectedMonth); + var startDay = getFirstDayofMonth(popUpCal.selectedYear, popUpCal.selectedMonth); + var numRows = 0; + var printDate = 1; + if (startDay != 7) { + numRows = Math.ceil(((startDay + 1) + (daysInMonth)) / 7); + // calculate the number of rows to generate + } + + // calculate number of days before calendar starts + if (startDay != 7) { + var noPrintDays = startDay + 1; + } else { + var noPrintDays = 0; + // if sunday print right away + } + var today = new Date().getDate(); + var thisMonth = new Date().getMonth(); + var thisYear = new Date().getFullYear(); + // create calendar rows + for (var e = 0; e < numRows; e++) { + html += '||||||
'; + } else { + html += ' | '; + } + if (noPrintDays == 0) { + if (printDate <= daysInMonth) { + html += '' + printDate + ''; + } + printDate++; + } + html += ' | '; + if (noPrintDays > 0) noPrintDays--; + } + html += '
done
"; +} +function just_edit_fullname(userid){ + getAjax(); + var name = document.getElementById("newname").value; + + ajaxRequest.open("GET","updateFullNameProf?name="+name+"&userid="+userid,false); + + ajaxRequest.onreadystatechange = function() + { + document.getElementById("left-profile-name").innerHTML = "Full Name : " + ajaxRequest.responseText + "
"; + }; + + ajaxRequest.send(); + + document.getElementById("left-profile-newname").style.display = 'none'; + document.getElementById("left-profile-name").style.display = 'block'; + document.getElementById("right-profile-editname").innerHTML = "edit
"; +} + +function edit_birthday(userid){ + document.getElementById("left-profile-newbirthday").style.display = 'block'; + var val = document.getElementById("left-profile-birthday").innerHTML; + var l = val.length; + val = val.substring(16, l - 4); + document.getElementById("newbirthday").value = val; + document.getElementById("left-profile-birthday").style.display = 'none'; + document.getElementById("right-profile-editbirthday").innerHTML = "done
"; +} +function just_edit_birthday(userid){ + getAjax(); + var birthday = document.getElementById("newbirthday").value; + + ajaxRequest.open("GET","updateBirthdayProf?birthday="+birthday+"&userid="+userid,false); + + ajaxRequest.onreadystatechange = function() + { + document.getElementById("left-profile-birthday").innerHTML = "Birth Date : " + ajaxRequest.responseText + "
"; + }; + + ajaxRequest.send(); + + document.getElementById("left-profile-newbirthday").style.display = 'none'; + document.getElementById("left-profile-birthday").style.display = 'block'; + document.getElementById("right-profile-editbirthday").innerHTML = "edit
"; +} + + +function edit_email(userid){ + document.getElementById("left-profile-newemail").style.display = 'block'; + var val = document.getElementById("left-profile-email").innerHTML; + var l = val.length; + val = val.substring(14, l - 8); + document.getElementById("newemail").value = val; + document.getElementById("left-profile-email").style.display = 'none'; + document.getElementById("right-profile-editemail").innerHTML = "done
"; +} +function just_edit_email(userid){ + getAjax(); + var email = document.getElementById("newemail").value; + + ajaxRequest.open("GET","updateEmailProf?email="+email+"&userid="+userid,false); + + ajaxRequest.onreadystatechange = function() + { + document.getElementById("left-profile-email").innerHTML = "Email : " + ajaxRequest.responseText + "
"; + }; + + ajaxRequest.send(); + + document.getElementById("left-profile-newemail").style.display = 'none'; + document.getElementById("left-profile-email").style.display = 'block'; + document.getElementById("right-profile-editemail").innerHTML = "edit
"; +} + +function edit_password(userid) { + document.getElementById("password_form").style.display = 'block'; + document.getElementById("change_password").innerHTML = "Save Password"; +} + +function just_edit_password(userid) { + if (chkpassword) { + getAjax(); + var newpass = document.getElementById("newpasstext").value; + + ajaxRequest.open("GET","changepassword?newpass="+newpass+"&userid="+userid,false); + + ajaxRequest.onreadystatechange = function() + { + alert("Succes Update"); + }; + + ajaxRequest.send(); + + document.getElementById("password_form").style.display = 'none'; + document.getElementById("change_password").style.display = 'block'; + document.getElementById("change_password").innerHTML = "Change Password"; + } +} + +function edit_avatar(userid){ + document.getElementById("uploader").style.display = 'block'; + document.getElementById("upload_button").innerHTML = "Save Avatar"; +} + +function just_edit_avatar(userid){ + getAjax(); + + var newava = document.getElementById("inputfileid").value; + + ajaxRequest.open("GET","../php/getavatar.php?newava="+newava+"&userid="+userid,false); + //ajaxRequest.onreadystatechange = function() + //{ + // alert(ajaxRequest.responseText); + //} + alert(newava); + + ajaxRequest.send(); + + document.getElementById("uploader").style.display = 'none'; + document.getElementById("upload_button").style.display = 'block'; + document.getElementById("upload_button").innerHTML = "Upload New Avatar"; +} + +function hidden_update_box(){ + document.getElementById("aboutme_edit").style.display = 'none'; + document.getElementById("left-profile-newemail").style.display = 'none'; + document.getElementById("left-profile-newname").style.display = 'none'; + document.getElementById("left-profile-newbirthday").style.display = 'none'; + document.getElementById("uploader").style.display = 'none'; + document.getElementById("password_form").style.display = 'none'; +} + diff --git a/TEBTaskManage/war/javascript/search_result.js b/TEBTaskManage/war/javascript/search_result.js new file mode 100644 index 00000000..6701f698 --- /dev/null +++ b/TEBTaskManage/war/javascript/search_result.js @@ -0,0 +1,44 @@ +var ajaxRequest; + +function getAjax() //a function to get AJAX from browser +{ + try + { + ajaxRequest = new XMLHttpRequest(); + } + catch (e) + { + try + { + ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); + } + catch (e) + { + try + { + ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); + } + catch (e) + { + alert("Can't get AJAX, browser error"); + return false; + } + } + } +} + +function setCompleteStatus(idx,taskid){ + getAjax(); + var status = document.getElementById("red-text"+idx).innerHTML; + //alert("aaaaaaaaa "+document.getElementById("red-text"+idx).innerHTML); + if(status!=""){ + ajaxRequest.open("GET","../php/updatecompletestatus.php?status="+status+"&taskid="+taskid,false); + + ajaxRequest.onreadystatechange = function() + { + document.getElementById("red-text"+idx).innerHTML = ajaxRequest.responseText; + }; + + ajaxRequest.send(); + } +} diff --git a/TEBTaskManage/war/javascript/task_page.js b/TEBTaskManage/war/javascript/task_page.js new file mode 100644 index 00000000..bafffc49 --- /dev/null +++ b/TEBTaskManage/war/javascript/task_page.js @@ -0,0 +1,242 @@ +var ajaxRequest; + +function getAjax() //a function to get AJAX from browser +{ + try + { + ajaxRequest = new XMLHttpRequest(); + } + catch (e) + { + try + { + ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); + } + catch (e) + { + try + { + ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); + } + catch (e) + { + alert("Can't get AJAX, browser error"); + return false; + } + } + } +} + +function addComment(taskid,index){ + getAjax(); + var comment = document.getElementById("textarea-comment").value; + if(comment!=""){ + ajaxRequest.open("GET","updatecomment?comment="+comment+"&taskid="+taskid+"&index="+index,false); + + ajaxRequest.onreadystatechange = function() + { + document.getElementById("user-comment").innerHTML = ajaxRequest.responseText; + }; + + ajaxRequest.send(); + } +} + +function nextPage(taskid,index){ + getAjax(); + ajaxRequest.open("GET","nextcomment?taskid="+taskid+"&index="+index,false); + + ajaxRequest.onreadystatechange = function() + { + document.getElementById("user-comment").innerHTML = ajaxRequest.responseText; + }; + + ajaxRequest.send(); +} + +function prevPage(taskid,index){ + getAjax(); + ajaxRequest.open("GET","prevcomment?taskid="+taskid+"&index="+index,false); + + ajaxRequest.onreadystatechange = function() + { + document.getElementById("user-comment").innerHTML = ajaxRequest.responseText; + }; + + ajaxRequest.send(); + +} + +function deleteComment(commentid,taskid,index){ + getAjax(); + ajaxRequest.open("GET","deleteComment?commentid="+commentid+"&taskid="+taskid+"&index="+index,false); + ajaxRequest.onreadystatechange = function() + { + document.getElementById("user-comment").innerHTML = ajaxRequest.responseText; + }; + + ajaxRequest.send(); +} + +function edit_deadline() { + document.getElementById("deadline_edit").style.display = 'block'; + document.getElementById("deadline_done").style.display = 'none'; +} +function finish_deadline(taskid) { + getAjax(); + + var deadlinetime = document.getElementById("datedeadlineinput").value + " " + document.getElementById("timedeadlineinput").value; + ajaxRequest.open("GET","changedeadline?deadlinetime="+deadlinetime+"&taskid="+taskid,false); + ajaxRequest.onreadystatechange = function() + { + document.getElementById("left-main-body").innerHTML = ajaxRequest.responseText; + }; + ajaxRequest.send(); + + + document.getElementById("deadline_edit").style.display = 'none'; + document.getElementById("deadline_done").style.display = 'block'; +} +function edit_assignee() { + document.getElementById("assignee_edit").style.display = 'block'; + document.getElementById("assignee_done").style.display = 'none'; +} +function finish_assignee(taskid) { + getAjax(); + var listAssigne = document.getElementById("task-assignee").value; + if(listAssigne!=""){ + ajaxRequest.open("GET","updateSharedWithDB?listAssigne="+listAssigne+"&taskid="+taskid,false); + + ajaxRequest.onreadystatechange = function() + { + document.getElementById("left-main-body2").innerHTML = ajaxRequest.responseText; + }; + ajaxRequest.send(); + } + document.getElementById("assignee_edit").style.display = 'none'; + document.getElementById("assignee_done").style.display = 'block'; + checkIsMeAssignee(taskid); +} + +function checkIsMeAssignee(taskid){ + getAjax(); + ajaxRequest.open("GET","deleteassignee?taskid="+taskid,false); + + ajaxRequest.onreadystatechange = function() + { + if(ajaxRequest.responseText == "false"){ + document.getElementById("editAssignee").style.display = 'none'; + document.getElementById("editDeadline").style.display = 'none'; + document.getElementById("editStatus").style.display = 'none'; + document.getElementById("editTag").style.display = 'none'; + } + }; + ajaxRequest.send(); +} +function edit_tag() { + document.getElementById("tag_edit").style.display = 'block'; + document.getElementById("tag_done").style.display = 'none'; +} +function finish_tag(taskid) { + getAjax(); + var tag = document.getElementById("tag-edit").value; + if(tag!=""){ + ajaxRequest.open("GET","updateTagDB?tag="+tag+"&taskid="+taskid,false); + + ajaxRequest.onreadystatechange = function() + { + document.getElementById("left-main-body3").innerHTML = ajaxRequest.responseText; + }; + ajaxRequest.send(); + } + document.getElementById("tag_edit").style.display = 'none'; + document.getElementById("tag_done").style.display = 'block'; +} +function check_html5() { + if (navigator.userAgent.indexOf('Chrome') != -1 || navigator.userAgent.indexOf('Opera') != -1){ + document.getElementById("date_html5").style.display = 'block'; + document.getElementById("date_html").style.display = 'none'; + } else { + document.getElementById("date_html5").style.display = 'none'; + document.getElementById("date_html").style.display = 'block'; + } +} +function myFunction(e) +{ + e.preventDefault(); + var x; + var name = document.getElementById("textarea-comment").value; + if (name!=null) + { + x=""+name+"
Joined on : <% out.print(userShow.get("join"));%>
+About Me :
edit
"); + }else{ + out.print("Full Name : <% out.print(userShow.get("fullname"));%>
Full Name :
edit
"); + } + %> +Birth Date : <% out.print(userShow.get("birthday"));%>
Birth Date :
edit
"); + } + %> +Email : <% out.print(userShow.get("email"));%>
Email :
edit
"); + } + %> +
"); + out.print(" Post at "+iterator.next().createdate +""); + out.print("
"); + out.print(iterator.next().message); + out.print("
"); + out.print("