$('body').on('click', '#addButton', function () {
if(counter>10){
alert("Only 10 textboxes allow");
return false;
}
var newTextBoxDiv = $(document.createElement('div'))
.attr("id", 'TextBoxDiv' + counter);
newTextBoxDiv.after().html('<label>Textbox #'+ counter + ' : </label>' +
'<input type="text" class="tur" name="textbox' + counter +
'" id="textbox' + counter + '" value="" >');
newTextBoxDiv.appendTo("#TextBoxesGroup");
counter++;
});
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// checks if the request actually contains upload file
if (!ServletFileUpload.isMultipartContent(request)) {
PrintWriter writer = response.getWriter();
writer.println("Request does not contain upload data");
writer.flush();
return;
}
// configures upload settings
DiskFileItemFactory factory = new DiskFileItemFactory();
factory.setSizeThreshold(THRESHOLD_SIZE);
factory.setRepository(new File(System.getProperty("java.io.tmpdir")));
ServletFileUpload upload = new ServletFileUpload(factory);
upload.setFileSizeMax(MAX_FILE_SIZE);
upload.setSizeMax(MAX_REQUEST_SIZE);
// constructs the directory path to store upload file
String uploadPath = getServletContext().getRealPath("")
+ File.separator + UPLOAD_DIRECTORY;
System.out.println("Upload Path = "+uploadPath);
// creates the directory if it does not exist
File uploadDir = new File(uploadPath);
if (!uploadDir.exists()) {
uploadDir.mkdir();
}
DateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
Date date = new Date();
System.out.println(dateFormat.format(date)); //2016/11/16 12:08:43
try {
// parses the request's content to extract file data
List<FileItem> formItems = upload.parseRequest(request);
Iterator<FileItem> iter = formItems.iterator();
// iterates over form's fields
while (iter.hasNext()) {
FileItem item = (FileItem) iter.next();
// processes only fields that are not form fields
if (!item.isFormField()) {
String fileName = new File(item.getName()).getName();
String filePath = uploadPath + File.separator + dateFormat.format(date) + fileName;
File storeFile = new File(filePath);
// saves the file on disk
item.write(storeFile);
String value = item.getString("firstname");
String value1 = item.getString("lastname");
}
}
request.setAttribute("message", "Upload has been done successfully!");
} catch (Exception ex) {
request.setAttribute("message", "There was an error: " + ex.getMessage());
}
getServletContext().getRequestDispatcher("/message.jsp").forward(request, response);
}
Front desk is clean 10;
Front Office Log There is a log where receptionists note all incidents and remarks each shift. 7
и тд
create table fofpms
(
id_question SERIAL,
report_table VARCHAR(30),
name_inreport VARCHAR(10),
fullreport_name VARCHAR(90),
name_question TEXT
);
create table answer_table
(
id_report SERIAL,
a VARCHAR(10),
b VARCHAR(10),
c VARCHAR(10),
d VARCHAR(10)
);
INSERT INTO fofpms (report_table, name_inreport, fullreport_name, name_question) VALUES
('fofpms', 'a', 'FRONT OFFICE ADMIN AUDIT', '1. Front desk is clean,'),
('fofpms', 'b', 'FRONT OFFICE ADMIN AUDIT', '2. Front Office Log There is a log where receptionists note all incidents and remarks each shift. '),
('fofpms', 'c', 'FRONT OFFICE ADMIN AUDIT', '3. Lost and Found Log Reception is using Lost'),
('fofpms', 'd', 'FRONT OFFICE ADMIN AUDIT', '4. Wake up call log Reception is using Wake up call function of Newhotel');