CINXE.COM
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <!-- TODO:: 1) Moifiy Stored Proc to check to see what committees the users is already associated with and not show them in the drop down list 3) Add color/graphics --> <head> <title></title> <style> .ashraetxt { font:normal 13px Arial, Helvetica, sans-serif; color:#333; } .descriptxt { font:normal 11px Arial, Helvetica, sans-serif; color:#333; } .redtb { background-color:red; } </style> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script> </head> <body> <table border="0"> <tr> <td> <img src="https://eweb.ashrae.org/eweb/images/TS_ProvisionalMember_Header.png" style="margin-left:-4px;margin-bottom:-8px;width:543px" /> </td> </tr> </table> <div style="border-style: solid; border-width:thin;width:542px"> <table border="0"> <tr> <td class="ashraetxt"> If you do not have an ASHRAE ID, not applying for ASHRAE membership, and are applying for a position that requires an ASHRAE bio to be on file, please <a href="javascript:void(0)" onclick="window.open('https://www.ashrae.org/emailverification', 'name', '')">click here</a> to request an ASHRAE ID. You may also use this link if you already have an ASHRAE ID as a non-member, but you no longer have a record of your number. </td> </tr> </table> </div> <div style="border-style: solid; border-width:thin;width:542px"> <table border="0"> <tr> <td> Please enter <font color="red"> BOTH </font>of the following: </td> </tr> <tr></tr> <tr> <td> ASHRAE ID </td> <td> <input type="text" id="tbUserId" onkeydown="return doClearEmail();"/> </td> </tr> <tr> <td> <font size="2" color="red">AND</font> </td> </tr> <tr> <td> Email Address Used In Bio </td> <td> <input type="text" id="tbEmail" onkeydown="return doClearASHRAEID();" /> </td> </tr> <tr></tr> <tr> <td> <input type="Button" id="bttn_get_info" value="Get My Info" onclick="return doOnClickGetUserInfo();" /> </td> </tr> </table> </div> <div style="border-style: solid; border-width:thin;width:542px"> <table> <tr> <td> <b>My Info</b> </td> </tr> <tr></tr> <tr></tr> <tr> <td> Name </td> <td> <input type="text" id="tbName" /> </td> </tr> <tr> <td> Address </td> <td> <input type="text" id="tbAddress1" /> </td> </tr> <tr> <td> </td> <td> <input type="text" id="tbAddress2" /> </td> </tr> <tr> <td> </td> <td> <input type="text" id="tbAddress3" /> </td> </tr> <tr> <td>City</td> <td> <input type="text" id="tbCity" /> </td> <td> State </td> <td> <input type="text" size="5" id="tbState" /> </td> <td> Zip </td> <td> <input type="text" size="10"id="tbZip"> </td> </tr> </table> </div> <div style="border-style: solid; border-width:thin;width:542px"> <table cols="2"> <tr> <td class="ashraetxt" colspan="2"> <b>Committee Selection</b> (You may select up to 3 Committees to serve on) </td> </tr> <tr></tr> <tr></tr> <tr> <!--1--> <td> <tr> <td> Available Committees </td> <td> Committee Description </td> </tr> <tr> <td id="pos_sel" colspan="1"></td> <td class="descriptxt"><label id="lblcommdesc" /></td> </tr> <tr> <td></td> <td align="left"><a id="myscope" href="#">Scope</a></td> </tr> <tr> <td colspan="1" height="50"> <input type="button" value="Add Selected" id="bttn_add_comm" onclick="return doOnClickAddCommToSelectedList();" /> </td> </tr> </td> <td> <div style="border-style: solid; border-width:thin;width:250px"> <table style="width:100%;" align="center" border="1" id="tblSelectedItems"> <tr> <th> My Selections </th> </tr> </table> </div> </td> </tr><!--1--> </table> <input type="hidden" id="selectedItems" /> <input type="hidden" id="CustomerID" /> </div> <div style="border-style: solid; border-width:thin;width:542px"> <table> <tr> <td class="ashraetxt"> Once you have added the committees you wish to join, please select the “Join Now” button below and you will immediately be appointed as a Provisional Corresponding Member. </td> </tr> <tr> <td class="ashraetxt"> The acceptance of provisional corresponding membership implies participation in committee activities through correspondence or in-person involvement. Provisional corresponding members serve 2 year terms. Although provisional corresponding members are not voting members, at the end of your term and based on participation in the committee, you may be considered for future voting membership. <br /><br />Some of your information may be made publicly available, such as name and company name. Please review the <a href="https://www.ashrae.org/privacy-policy" target="_blank">ASHRAE Privacy Policy</a> before joining. Questions regarding your privacy may be sent to <a href="mailto:GDPR@ashrae.org">GDPR@ashrae.org</a> <br /> <br /> Notification of acceptance to a TC is emailed upon completion. </td> </tr> <tr> <td height="30"></td> </tr> <tr> <td> <input type="button" id="bttnJoinCommittees" value="Join Now" onclick="return goJoinTheCommittees();"> </td> </tr> </table> </div> <div> <table border="0"> <tr> <td class="ashraetxt"> If you encounter any bugs, problems, or have any issues, please don't hesitate to Email<br /> Tara Thomas at <a href="mailto:TCStaff@ashrae.net">TCStaff@ashrae.net</a> </td> </tr> </table> </div> <table border="0"> <tr> <td> <img src="https://eweb.ashrae.org/eweb/images/TS_Prov_Member_Footer.png" style="margin-left:-4px;margin-top:-3px;width:543px" /> </td> </tr> </table> <script type="text/javascript"> var forselect = true; //generateCommitteeList(); disableDataFields(); disableButtons(); //this function should be called last function generateCommitteeList() { var retVal; var formData = ""; var excludeList = getCurrentSelectedItems(); var userID = $('#tbUserId').val(); $.ajax( { url: "TS_Provisional.aspx?Action=getCommitteeList&excludeList=" + excludeList + "&customerID="+userID, type: "GET", dataType: "xml", data: formData, async: false, success: function (data, textStatus, jqXHR) { // alert("hello"); retVal = createSelectionList(data, forselect); if (forselect) { $('#pos_sel').empty().append(retVal); $('#pos_sel').prop('selectedIndex', 0); } } , error: function (jqXHR, textStatus, errorThrown) { alert(errorThrown); } }); return retVal; } function doClearASHRAEID() { if($("#tbEmail").val().length==0) { $("#tbUserId").removeClass("redtb"); $("#tbEmail").removeClass("redtb"); } } function doClearEmail() { if ($("#tbUserId").val().length == 0) { $("#tbUserId").removeClass("redtb"); $("#tbEmail").removeClass("redtb"); } } function createSelectionList(data, forselect) { var retVal; var myData = $(data).text(); var tag_Ndx = '<index>'; var tag_Comm = '<comm>'; var pos = ''; var comm = ''; var first_comm = ''; var nLoc = 0; var ndx = 0; var nloopCnt = 0; retVal = '<select id="comm_list" onchange="return doGetCommitteeDesc();">'; var mnq_Count = 1; while (myData.indexOf('</index>') > 0) { nloc = myData.indexOf(GetEndTag(tag_Ndx)); pos = myData.substring(0, nloc + GetEndTag(tag_Ndx).length); pos = ExtractData(pos, tag_Ndx); myData = myData.substring(nloc + GetEndTag(tag_Ndx).length, myData.length); nloc = myData.indexOf(GetEndTag(tag_Comm)); comm = myData.substring(0, nloc + GetEndTag(tag_Comm).length); comm = ExtractData(comm, tag_Comm); myData = myData.substring(nloc + GetEndTag(tag_Comm).length, myData.length); if (first_comm == '') { first_comm = comm; //var scopeLink = generateWeblinkFromCommitteeName(first_comm); //$('#myscope').live("click", function (e) { // window.open(scopeLink, "yyyyy", "width=640,height=480,resizable=yes,toolbar=no,menubar=no,location=no,status=no"); // return false; //}); } retVal = retVal + '<option value=' + pos + '>' + comm + '</option>'; nloopCnt++; } retVal += '</select>'; doGetCommitteeDesc(first_comm); return retVal; } function generateWeblinkFromCommitteeName(committee) { //FROM: T-TAC-TC01.01 //TO: http://tc11.ashraetcs.org/ var working = committee; while(working.indexOf('-')>0) working = working.substring(working.indexOf('-')+1, working.length); working = working.replace('.', ''); while(working.indexOf('0')>0) working = working.replace('0', ''); working = 'http://' + working + '.ashraetcs.org/'; return working; } function doGetCommitteeDesc(first_comm) { var formData = ""; var commid = ""; // var excludeList = getCurrentSelectedItems(); if (first_comm == null) commid = $('#pos_sel option:selected').text(); else commid = first_comm; $.ajax( { url: "TS_Provisional.aspx?Action=getCommitteeDescription&commid=" + commid, type: "GET", dataType: "xml", data: formData, async: false, success: function (data, textStatus, jqXHR) { // alert("hello"); retVal = postCommitteeName(data); var scopeLink = generateWeblinkFromCommitteeName(commid); $('#myscope').live("click", function (e) { window.open(scopeLink, "yyyyy", "height=600,width=800,modal=yes,alwaysRaised=yes,scrollbars=1,resizable=1"); //"width=640,height=480,resizable=yes,toolbar=no,menubar=no,location=no,status=no" return false; }); } , error: function (jqXHR, textStatus, errorThrown) { alert(errorThrown); } }); } function postCommitteeName(data) { var commDesc = ''; var comm = ''; var myData = $(data).text(); var tag_CommDesc = '<commdesc>'; var nLoc = 0; nloc = myData.indexOf(GetEndTag(tag_CommDesc)); commDesc = myData.substring(0, nloc + GetEndTag(tag_CommDesc).length); commDesc = ExtractData(commDesc, tag_CommDesc); $("#lblcommdesc").text(commDesc); } function resetForm() { crearDataFields(); disableButtons(); clearSelectionList(); reloadCommitteeList(); disableDataFields(); $('#tblSelectedItems tr').not(function () { if ($(this).has('th').length) { return true } }).remove(); } function clearSelectionList() { var selItems = $('#selectedItems').val(); selItems = ''; $('#selectedItems').val(selItems); } function crearDataFields() { $('#tbName').val(''); $('#tbAddress1').val(''); $('#tbAddress2').val(''); $('#tbAddress3').val(''); $('#tbCity').val(''); $('#tbState').val(''); $('#tbZip').val(''); $('#comm_list').val(''); $('#tbUserId').val(''); $('#tbEmail').val(''); } function disableDataFields() { $('#tbName').attr("disabled", "disabled"); $('#tbAddress1').attr("disabled", "disabled"); $('#tbAddress2').attr("disabled", "disabled"); $('#tbAddress3').attr("disabled", "disabled"); $('#tbCity').attr("disabled", "disabled"); $('#tbState').attr("disabled", "disabled"); $('#tbZip').attr("disabled", "disabled"); $('#comm_list').attr("disabled", "disabled"); } function disableButtons() { disableSubmitButton(); disableCommSelectionButton(); } function disableSubmitButton() { $('#bttnJoinCommittees').attr("disabled", "disabled"); $('#bttn_add_comm').attr("disabled", "disabled"); } function disableCommSelectionButton() { $('#bttn_add_comm').attr("disabled", "disabled"); } function enableDataFields() { $('#comm_list').removeAttr("disabled"); } function enableButtons() { enableSubmitButton(); enableCommSelectionButton(); } function enableSubmitButton() { $('#bttnJoinCommittees').removeAttr('disabled'); } function enableCommSelectionButton() { $('#bttn_add_comm').removeAttr('disabled'); } function GetEndTag(tag) { return tag.replace('<', '</'); } function ExtractData(data, tag) { var start_tag = tag; var end_tag = tag.replace('<', '</'); data = data.replace(start_tag, ''); data = data.replace(end_tag, ''); return data } function doOnClickAddCommToSelectedList() { if (!canWeDoThis()) { alert("You can have only 3 committee selections.") return; } var selVal = $('#pos_sel option:selected').text(); addToSelectedList(selVal); addSelectdItem(selVal); } function addSelectdItem(selectedItem) { var req_id = createGuid(); html_for_row = ''; html_for_row += '<tr id = ' + req_id + '>'; html_for_row += '<td><label id=\"alt_pend_' + req_id + '\">' + selectedItem + '</label> <input type="button" value="Remove" id="cb_dc_' + req_id + '\" onclick="return removeSelectedItem(\'' + req_id + '\',' + '\'' + selectedItem + '\'' + ')"/></td>'; html_for_row += '</tr>'; $('#tblSelectedItems > tbody:last').append(html_for_row); reloadCommitteeList(); } function reloadCommitteeList() { generateCommitteeList(); //Get the list of items that are already selected var currSelect = getCurrentSelectedItems(); //Clear the list from the select //Get a new list without those already selected } function addToSelectedList(selectedItem) { var x = $('#selectedItems').val(); if ($('#selectedItems').val() == '') x = x + '\'' + selectedItem + '\''; else x = x + ',' + '\'' + selectedItem + '\''; $('#selectedItems').val(x); enableSubmitButton(); } function getCurrentSelectedItems() { return $('#selectedItems').val(); } function removeCurrentSelectedItem(selectedItem) { var x = $('#selectedItems').val(); x = x.replace(',' + '\'' + selectedItem + '\'', ''); x = x.replace('\'' + selectedItem + '\'' + ',', ''); x = x.replace('\'' + selectedItem + '\'', ''); x = x.replace(',,', ','); $('#selectedItems').val(x); if($('#selectedItems').val().length==0) disableSubmitButton(); } function canWeDoThis() { var rowCount = $('#tblSelectedItems tr').length; if (rowCount <= 3) return true; else return false; } function createGuid() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8); return v.toString(16); }); } function removeSelectedItem(selectedItem, itemName) { $('#' + selectedItem).remove(); removeCurrentSelectedItem(itemName); reloadCommitteeList(); } function goJoinTheCommittees() { var retVal; var formData = ""; var CommitteeList = getCurrentSelectedItems(); var CustomerID = $('#CustomerID').val(); $.ajax( { url: "TS_Provisional.aspx?Action=joinCommittees&CommitteeList=" + CommitteeList + "&CustomerID=" + CustomerID, type: "GET", dataType: "xml", data: formData, async: false, success: function (data, textStatus, jqXHR) { // alert("hello"); retVal = getResultFromJoin(data); if (forselect) { $('#pos_sel').empty().append(retVal); } } , error: function (jqXHR, textStatus, errorThrown) { alert(errorThrown); } }); alert('Congratulations, you have been registered as a Provisional Member for the committee\'s you have chosen.'); resetForm(); return retVal; } function doOnClickGetUserInfo() { var retVal; var formData = ""; var CommitteeList = getCurrentSelectedItems(); //Let check if we have two entries in the get my info textboxs... if we do then we need to alert and about the function if ($("#tbUserId").val() == '' || $("#tbEmail").val() == '') { alert("Both email address and member number are required to retrieve your information. ") $("#tbUserId").addClass("redtb"); $("#tbEmail").addClass("redtb"); return; } $.ajax( { url: "TS_Provisional.aspx?Action=getCustomerInfo&cstRecno=" + $('#tbUserId').val() + "&cstEmail=" + $('#tbEmail').val(), type: "GET", dataType: "xml", data: formData, async: false, success: function (data, textStatus, jqXHR) { // alert("hello"); //Returns Recno retVal = populateCustomerInfo(data); if (retVal != -1) { var excludeList = getCurrentSelectedItems(); $.ajax( { url: "TS_Provisional.aspx?Action=getCommitteeList&excludeList=" + excludeList + "&customerID=" + retVal, type: "GET", dataType: "xml", data: formData, async: false, success: function (data, textStatus, jqXHR) { // alert("hello"); retVal = createSelectionList(data, forselect); if (forselect) { $('#pos_sel').empty().append(retVal); } } , error: function (jqXHR, textStatus, errorThrown) { alert("goodbye"); } }); enableDataFields(); if (forselect) { $('#pos_sel').empty().append(retVal); } } } , error: function (jqXHR, textStatus, errorThrown) { alert("goodbye"); } }); return retVal; } function populateCustomerInfo(data) { var retVal; var myData = $(data).text(); var tag_Ndx = '<index>'; var tag_Name = '<Name>'; var tag_Line1 = '<Line1>'; var tag_Line2 = '<Line2>'; var tag_Line3 = '<Line3>'; var tag_City = '<City>'; var tag_State = '<State>'; var tag_Zip = '<Zip>'; var tag_Recno = '<Recno>' var tag_Email = '<Email>' var pos = ''; var name = ''; var line1 = ''; var line2 = ''; var line3 = ''; var city = ''; var state = ''; var zip = ''; var recno = ''; var email = ''; var nLoc = 0; var ndx = 0; var nloopCnt = 0; var mnq_Count = 1; while (myData.indexOf('</index>') > 0) { nloc = myData.indexOf(GetEndTag(tag_Ndx)); pos = myData.substring(0, nloc + GetEndTag(tag_Ndx).length); pos = ExtractData(pos, tag_Ndx); myData = myData.substring(nloc + GetEndTag(tag_Ndx).length, myData.length); //Name nloc = myData.indexOf(GetEndTag(tag_Name)); name = myData.substring(0, nloc + GetEndTag(tag_Name).length); name = ExtractData(name, tag_Name); myData = myData.substring(nloc + GetEndTag(tag_Name).length, myData.length); //Line1 nloc = myData.indexOf(GetEndTag(tag_Line1)); line1 = myData.substring(0, nloc + GetEndTag(tag_Line1).length); line1 = ExtractData(line1, tag_Line1); myData = myData.substring(nloc + GetEndTag(tag_Line1).length, myData.length); //Line2 nloc = myData.indexOf(GetEndTag(tag_Line2)); line2 = myData.substring(0, nloc + GetEndTag(tag_Line2).length); line2 = ExtractData(line2, tag_Line2); myData = myData.substring(nloc + GetEndTag(tag_Line2).length, myData.length); //Line3 nloc = myData.indexOf(GetEndTag(tag_Line3)); line3 = myData.substring(0, nloc + GetEndTag(tag_Line3).length); line3 = ExtractData(line3, tag_Line3); myData = myData.substring(nloc + GetEndTag(tag_Line3).length, myData.length); //City nloc = myData.indexOf(GetEndTag(tag_City)); city = myData.substring(0, nloc + GetEndTag(tag_City).length); city = ExtractData(city, tag_City); myData = myData.substring(nloc + GetEndTag(tag_City).length, myData.length); //State nloc = myData.indexOf(GetEndTag(tag_State)); state = myData.substring(0, nloc + GetEndTag(tag_State).length); state = ExtractData(state, tag_State); myData = myData.substring(nloc + GetEndTag(tag_State).length, myData.length); //Zip nloc = myData.indexOf(GetEndTag(tag_Zip)); zip = myData.substring(0, nloc + GetEndTag(tag_Zip).length); zip = ExtractData(zip, tag_Zip); myData = myData.substring(nloc + GetEndTag(tag_Zip).length, myData.length); //Recno nloc = myData.indexOf(GetEndTag(tag_Recno)); recno = myData.substring(0, nloc + GetEndTag(tag_Recno).length); recno = ExtractData(recno, tag_Recno); myData = myData.substring(nloc + GetEndTag(tag_Recno).length, myData.length); //Recno nloc = myData.indexOf(GetEndTag(tag_Email)); email = myData.substring(0, nloc + GetEndTag(tag_Email).length); email = ExtractData(email, tag_Email); myData = myData.substring(nloc + GetEndTag(tag_Email).length, myData.length); ndx++ } if (ndx < 1) { alert("Information not found using value given"); return -1; } $('#tbName').val(name); $('#tbAddress1').val(line1); $('#tbAddress2').val(line2); $('#tbAddress3').val(line3); $('#tbCity').val(city); $('#tbState').val(state); $('#tbZip').val(zip); $("#tbUserId").val(recno); $("#CustomerID").val(recno); $("#tbEmail").val(email); enableCommSelectionButton(); return recno; } function getResultFromJoin(data) { } </script> </body> </html>