/* =================================================================
FUNCTION: addJob()
DESCRIPTION: gets the last JobID in the the table, increments it
by 1, and inserts a new row with that JobID.
=================================================================*/
function addJob(jobid)
{
if (jobid == 0) {
maxcursor = database.cursor ("select max(jobid) from jobs");
maxcursor.next(); // Initialize the cursor.
nextjobid = maxcursor[0] + 1; // Increment the cursor by one.
debug(nextjobid + " is my neat message.");
maxcursor.close();
jobcursor = database.cursor ("select * from jobs where jobid = '" + nextjobid + "'", true);
jobcursor.next();
jobcursor.jobid = nextjobid;
jobcursor.empid = client.userID;
jobcursor.insertRow("JOBS");
return(nextjobid);
} else return(request.jobid); // END IF
} // End addJob()
// Security check - make sure they've logged in. If not, send them
// to the LOGIN page.
securityCheck(client.valid, client.usertype, "employer", "../login.htm");
// Dynamically generate the body string according to the attributes in the
// configuration file specified as the argument of dynBody()
bodystr = dynBody("settings.cfg");
if(!dbCheck()) {
redirect("../error.htm?error=dbfail");
}
newjobid = addJob(request.jobid);
cursor = database.cursor("select * from jobs where jobid = '" + newjobid + "'", true);
cursor.next(); // Initialize the cursor.
Job Attributes for JobID write(cursor.jobid)