/*------------------------------------------------------ This part of the script writes the data to a file. This data is ported to HTML table format so it can be easily read. Each REQUEST object is filtered through the nozero() function to rid the table of zero's. ------------------------------------------------------*/ htmlfile = new File(new_personaldir()); result = htmlfile.open("w"); htmlfile.write("

Expense Report Summary

"); htmlfile.write("
"); htmlfile.write("EMPLOYEE NAME:" + request.realname + ""); htmlfile.write("Dept:" + request.dept + "Date:" + request.date); htmlfile.write("
PURPOSE OF TRIP:" + request.purpose + "
"); htmlfile.write("
"); htmlfile.write(""); htmlfile.write(""); htmlfile.write(""); htmlfile. write(""); htmlfile.write(""); htmlfile.write(""); htmlfile.write(""); htmlfile.write(""); htmlfile.write(""); htmlfile.flush(); htmlfile.write("
MondayTuesdayWednesdayThursdayFridaySaturdaySundayTotal
Auto Rental" + nozero(request.units) + "" + nozero(request.tues) + "" + nozero(request.weds) + "" + nozero(request.thur) + "" + nozero(request.fri) + "" + nozero(request.sat) + "" + nozero(request.sun) + "" + nozero(request.auto) + "
Auto Personal" + nozero(request.monperson) + "" + nozero(request.tueperson) + "" + nozero(request.wedperson) + "" + nozero(request.thuperson) + "" + nozero(request.friperson) + "" + nozero(request.satperson) + "" + nozero(request.sunperson) + "" + nozero(request.autotravel) + "
Miscellaneous" + nozero(request.monmisc) + "" + nozero(request.tuemisc) + "" + nozero(request.wedmisc) + "" + nozero(request.thumisc) + "" + nozero(request.frimisc) + "" + nozero(request.satmisc) + "" + nozero(request.sunmisc) + "" + nozero(request.miscellaneous) + "
Employee Paid Airfare" + nozero(request.monair) + "" + nozero(request.tueair) + "" + nozero(request.wedair) + "" + nozero(request.thuair) + "" + nozero(request.friair) + "" + nozero(request.satair) + "" + nozero(request.sunair) + "" + nozero(request.paidairfare) + "
Lodging" + nozero(request.monlodging) + "" + nozero(request.tuelodging) + "" + nozero(request.wedlodging) + "" + nozero(request.thulodging) + "" + nozero(request.frilodging) + "" + nozero(request.satlodging) + "" + nozero(request.sunlodging) + "" + nozero(request.lodging) + "
Meals, Personal" + nozero(request.monmeals) + "" + nozero(request.tuemeals) + "" + nozero(request.wedmeals) + "" + nozero(request.thumeals) + "" + nozero(request.frimeals) + "" + nozero(request.satmeals) + "" + nozero(request.sunmeals) + "" + nozero(request.meals) + "
Telephone" + nozero(request.montelephone) + "" + nozero(request.tuetelephone) + "" + nozero(request.wedtelephone) + "" + nozero(request.thutelephone) + "" + nozero(request.fritelephone) + "" + nozero(request.sattelephone) + "" + nozero(request.suntelephone) + "" + nozero(request.telephone) + "
Misc Travel" + nozero(request.monmisctravel) + "" + nozero(request.tuemisctravel) + "" + nozero(request.wedmisctravel) + "" + nozero(request.thumisctravel) + "" + nozero(request.frimisctravel) + "" + nozero(request.satmisctravel) + "" + nozero(request.sunmisctravel) + "" + nozero(request.misctravel) + "
Business Meetings" + nozero(request.monmeeting) + "" + nozero(request.tuemeeting) + "" + nozero(request.wedmeeting) + "" + nozero(request.thumeeting) + "" + nozero(request.frimeeting) + "" + nozero(request.satmeeting) + "" + nozero(request.sunmeeting) + "" + nozero(request.meeting) + "
"); htmlfile.write(""); htmlfile.write("
Total Expenses: " + request.grandtotal + "
Additional Notes:
" + request.notes + "
"); htmlfile.flush(); htmlfile.close(); /*------------------------------------------------------ This part of the script writes the 1 line of TABLE ROW code to a file called data.txt located in the admin directory. In order for this work the file must set so it can be written to. ------------------------------------------------------*/ adminfile = new File("/admin/data.txt"); result = adminfile.open("a"); today = new Date(); month = today.getMonth()+1; adminfile.write(" " + request.realname + "" + request.grandtotal + ""+ month + "/" + today.getDate() + "/"+ today.getYear()+ "\n"); adminfile.flush(); adminfile.close();

Thank you!

A copy of your request has been sent to the Accounting Database. Please print out a copy of this for your records.


/*------------------------------------------------------ Finally step is to display the table that is being written to a file to the user. This will allow a cleaner looking form without any TEXT boxes. This can be customized so the user can get a require signature or to file this copy for his records. ------------------------------------------------------*/ write("

Expense Report Summary

"); write("
"); write("
"); write("EMPLOYEE NAME:" + request.realname + ""); write("Dept:" + request.dept + "Date:" + request.date); write("
PURPOSE OF TRIP:" + request.purpose + "
"); write(""); write(""); write(""); write(""); write(""); write(""); write(""); write(""); write(""); flush(); write("
MondayTuesdayWednesdayThursdayFridaySaturdaySundayTotal
Auto Rental" + nozero(request.units) + "" + nozero(request.tues) + "" + nozero(request.weds) + "" + nozero(request.thur) + "" + nozero(request.fri) + "" + nozero(request.sat) + "" + nozero(request.sun) + "" + nozero(request.auto) + "
Auto Personal" + nozero(request.monperson) + "" + nozero(request.tueperson) + "" + nozero(request.wedperson) + "" + nozero(request.thuperson) + "" + nozero(request.friperson) + "" + nozero(request.satperson) + "" + nozero(request.sunperson) + "" + nozero(request.autotravel) + "
Miscellaneous" + nozero(request.monmisc) + "" + nozero(request.tuemisc) + "" + nozero(request.wedmisc) + "" + nozero(request.thumisc) + "" + nozero(request.frimisc) + "" + nozero(request.satmisc) + "" + nozero(request.sunmisc) + "" + nozero(request.miscellaneous) + "
Employee Paid Airfare" + nozero(request.monair) + "" + nozero(request.tueair) + "" + nozero(request.wedair) + "" + nozero(request.thuair) + "" + nozero(request.friair) + "" + nozero(request.satair) + "" + nozero(request.sunair) + "" + nozero(request.paidairfare) + "
Lodging" + nozero(request.monlodging) + "" + nozero(request.tuelodging) + "" + nozero(request.wedlodging) + "" + nozero(request.thulodging) + "" + nozero(request.frilodging) + "" + nozero(request.satlodging) + "" + nozero(request.sunlodging) + "" + nozero(request.lodging) + "
Meals, Personal" + nozero(request.monmeals) + "" + nozero(request.tuemeals) + "" + nozero(request.wedmeals) + "" + nozero(request.thumeals) + "" + nozero(request.frimeals) + "" + nozero(request.satmeals) + "" + nozero(request.sunmeals) + "" + nozero(request.meals) + "
Telephone" + nozero(request.montelephone) + "" + nozero(request.tuetelephone) + "" + nozero(request.wedtelephone) + "" + nozero(request.thutelephone) + "" + nozero(request.fritelephone) + "" + nozero(request.sattelephone) + "" + nozero(request.suntelephone) + "" + nozero(request.telephone) + "
Misc Travel" + nozero(request.monmisctravel) + "" + nozero(request.tuemisctravel) + "" + nozero(request.wedmisctravel) + "" + nozero(request.thumisctravel) + "" + nozero(request.frimisctravel) + "" + nozero(request.satmisctravel) + "" + nozero(request.sunmisctravel) + "" + nozero(request.misctravel) + "
Business Meetings" + nozero(request.monmeeting) + "" + nozero(request.tuemeeting) + "" + nozero(request.wedmeeting) + "" + nozero(request.thumeeting) + "" + nozero(request.frimeeting) + "" + nozero(request.satmeeting) + "" + nozero(request.sunmeeting) + "" + nozero(request.meeting) + "
"); write(""); write("
Total Expenses: " + request.grandtotal + "
Additional Notes about
" + request.notes + "
"); flush();