System Administration

Choose an Interest Group to Modify


//Main Global variable definition. These constants and literals are //used throughout the application var scrolltable = "interest"; var blankalpha = ""; var zeronum = 0; var prevlabel = "Page Up"; var nextlabel = "Page Dn"; var result = 0; var toplabel = "Top of List"; // end globals //The following code determins if the user has pressed page up, page down, or top // and sets intpagenum, which scrolls, accordingly. if (request.prevbutt == prevlabel) {client.intpagenum = request.prevpagenum} if(request.nextbutt==nextlabel) {client.intpagenum = request.nextpagenum} if (request.prevbutt == toplabel) {client.intpagenum = 1} function CursorMaster_SA04() //this is the cursor SELECT statement executed by a user with System Administration // authority. { // This first SELECT gets the scroll keys from the scroll key table temppage3 = new TopPage(client.userid, scrolltable, client.intpagenum, blankalpha, blankalpha, zeronum, zeronum); temppage3.sel_scroll(); //Once the starting point on the page has been determined, // the cursor for the application specific data can be selected // The value "1" is not included in the query, because this is the interest group if for the group ALL, which //includes all users. This group should not be removed, therefore it doesn't show up in the list. IntGroup = database.cursor('SELECT interestgroup, interestgroupid, description FROM interestgroup WHERE interestgroupid <> 1 and interestgroup >= "' + temppage3.alphakey1 + '" ORDER BY interestgroup'); } function BuildTableHeader_SA04() // Building the column headers for the table { write("
"); write(""); write(""); write(""); write(""); write(""); write(""); } function BuildTableData_SA04() // Building the selected data and inserting it into the table. Buttons // Are added for modify/delete functionality { var keepfetching = "true"; var indx=1; var printhead = "false"; while(keepfetching == "true") { if(IntGroup.next()) { if(printhead=="false") {BuildTableHeader_SA04(); printhead="true";} if(indx < 11) {write(""); write(""); write(""); write(""); indx++; } else {keepfetching = "false";} } else { keepfetching = "false"; indx = 10;} // the indx = 10 statement prevents page down button from appearing // at tend of list. }; // end WHILE loop // If no rows are found, a message is displayed to the user. if((printhead=="false") && (client.intpagenum==1)) { Print_No_Found();} // Since the table on the page contains 10 rows, the 11th row is saved. // The data from this row becomes the next entry in Scrollkey, and will tell // the application where to start when the user presses "Page Dn" if(indx == 11) { var nextpage = 0; nextpage = parseInt(client.intpagenum) + 1; var insintgroup = ""+IntGroup.interestgroup+""; IntGroup.close() temppage1 = new TopPage(client.userid, scrolltable, nextpage, insintgroup, blankalpha, zeronum, zeronum); newpageresult = temppage1.ins_scroll(); // If this row already exists, alpha or numeric key data is updated in case // a row has been updated since the user last accessed the page. if(newpageresult !=0) {temppage1.upd_scroll();}; } else {IntGroup.close()}; write("
Existing Interest Groups, Page " + client.intpagenum + "
ModDelInterest GroupDescription
" + IntGroup.interestgroup + "" + IntGroup.description + "

"); return indx; } function DeterminePaging_SA04() // Determine which buttons will appear at the bottom of the page. { write("

"); write(""); // The Top button is displayed if the user in page > 2 if (client.intpagenum > 2) {CreateTopButton_SA04()}; // The previous button is not displayed if the user in on page 1 if (client.intpagenum != 1) {CreatePrevButton_SA04()}; // The next button is not displayed if there is no more data to display if(indx == 11) {CreateNextButton_SA04()}; } function CreateTopButton_SA04() { // the page number is set back to one when the user presses Top of List write(""); } function CreatePrevButton_SA04() { // the page number is set back one value when the user presses "Page Up" var prevpage = parseInt(client.intpagenum) - 1; write(""); } function CreateNextButton_SA04() { // the page number is set forward one value when the user presses "Page Dn" var newpage = parseInt(client.intpagenum) + 1; write(""); } if((client.intpagenum == "null")||(client.intpagenum == null)) { // Creating the initial Scrollkey value for the first page client.intpagenum = 1 temppage2 = new TopPage(client.userid, scrolltable, 1, blankalpha, blankalpha, zeronum, zeronum); pageoneresult = temppage2.ins_scroll(); if(pageoneresult !=0) {temppage2.upd_scroll();} }; CursorMaster_SA04() indx = BuildTableData_SA04(); DeterminePaging_SA04();
"); write(""); write("
"); write(""); write(""); write("
"); write(""); write(""); write("