예제 #1
0
        if ($profileOptionInfo['profilecategory_id'] == $row['profilecategory_id']) {
            $selectCat = "selected";
        }
        $catoptions .= "<option value='" . $row['profilecategory_id'] . "' " . $selectCat . ">" . $row['name'] . "</option>";
    }
    if ($result->num_rows == 0) {
        $catoptions = "<option value='none'>No Categories Added!</option>";
    }
    $profileCatObj->select($profileOptionInfo['profilecategory_id']);
    $arrOptions = $profileCatObj->getAssociateIDs("ORDER BY sortnum");
    $highestIndex = count($arrOptions) - 1;
    if ($arrOptions[$highestIndex] == $profileOptionInfo['profileoption_id']) {
        $afterSelected = "selected";
    }
    $selectSelected = "";
    if ($profileOptionInfo['optiontype'] == "select") {
        $selectSelected = "selected";
        $arrSelectValues = $profileOptionObj->getSelectValues();
        foreach ($arrSelectValues as $strSelectValue) {
            $tempArr[] = $strSelectValue;
        }
        $_SESSION['btProfileCache'] = $tempArr;
    }
    echo "\n\t<form action='console.php?cID=" . $cID . "&oID=" . $_GET['oID'] . "&action=edit' method='post'>\n\t<div class='formDiv'>\n\t";
    if ($dispError != "") {
        echo "\n\t\t<div class='errorDiv'>\n\t\t<strong>Unable to add new profile option because the following errors occurred:</strong><br><br>\n\t\t{$dispError}\n\t\t</div>\n\t\t";
    }
    echo "\n\tFill out the form below to edit the selected profile option.<br><br>\n\t\t\t\n\t\t\t<table class='formTable'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan='2' class='main'>\n\t\t\t\t\t\t<b>General Information</b>\n\t\t\t\t\t\t<div class='dottedLine' style='width: 90%; padding-top: 3px'></div>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='formLabel'>Option Name:</td>\n\t\t\t\t\t<td class='main'><input type='text' name='optionname' value='" . $profileOptionInfo['name'] . "' class='textBox' style='width: 250px'></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='formLabel'>Profile Category:</td>\n\t\t\t\t\t<td class='main'><select name='optioncategory' id='optioncategory' class='textBox' onchange='refreshProfileOrder()'>" . $catoptions . "</select></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='formLabel' valign='top'>Option Order:</td>\n\t\t\t\t\t<td class='main' valign='top'>\n\t\t\t\t\t\t<select name='beforeafter' class='textBox'><option value='before'>Before</option><option value='after' " . $afterSelected . ">After</option></select><br>\n\t\t\t\t\t\t<select name='optionorder' id='optionorder' class='textBox'>" . $orderoptions . "</select>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='formLabel'>Option Type: <a href='javascript:void(0)' onmouseover=\"showToolTip('An <b>input</b> option type will allow members to type whatever they want into a textbox.  A <b>select</b> option type only has a set number of choices to pick from that you can set below.')\" onmouseout='hideToolTip()'>(?)</a></td>\n\t\t\t\t\t<td class='main'>\n\t\t\t\t\t\t<select name='optiontype' id='optiontype' class='textBox' onchange='showMoreOptions()'><option value='input'>Input</option><option value='select' " . $selectSelected . ">Select</option></select>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<div id='moreOptions' style='display: none; margin-top: 5px'>\n\t\t\t\t<table class='formTable'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td colspan='3' class='main'>\n\t\t\t\t\t\t\t<b>Select Values</b>\n\t\t\t\t\t\t\t<div class='dottedLine' style='width: 90%; padding-top: 3px; margin-bottom: 5px'></div>\n\t\t\t\t\t\t\t<div style='padding-left: 3px; padding-right: 30px; padding-bottom: 15px'>\n\t\t\t\t\t\t\t\t<b><span style='text-decoration: underline'>NOTE:</span></b>  If you modify select values, your member's  currently saved information for this profile option will be reset.<br><br>Use this section to add or edit select values to the select box for this profile option.\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='formLabel'>\n\t\t\t\t\t\t\tNew Select Value:\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td class='main' style='width: 205px'>\n\t\t\t\t\t\t\t<input type='text' id='newSelectValue' class='textBox' style='width: 200px'>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td class='main'>\n\t\t\t\t\t\t\t<input type='button' value='Add' class='submitButton' onclick='addSelectValue()'>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t\t<div id='loadingSpiral' class='loadingSpiral'>\n\t\t\t\t\t<p align='center'>\n\t\t\t\t\t\t<img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/loading-spiral2.gif'><br>Loading\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t<div id='selectValueList' style='margin-top: 25px'>\n\t\t\t\t";
    include "include/admin/manageprofileoptions/cache/view.php";
    echo "\n\t\t\t\t</div>\n\t\t\t\t<br><br>\n\t\t\t</div>\n\t\t\t<p align='center'>\n\t\t\t\t<br>\n\t\t\t\t<input type='submit' name='submit' value='Edit Profile Option' class='submitButton' style='width: 140px'>\n\t\t\t</p>\n\t\t</div>\n\t</form>\n\t<div id='editValuePopup' style='display: none'></div>\n\t<script type='text/javascript'>\n\t\tfunction refreshProfileOrder() {\n\t\t\t\n\t\t\t\$(document).ready(function() {\n\t\t\t\n\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/admin/manageprofileoptions/profilelist.php', { oID: '" . $profileOptionInfo['profileoption_id'] . "', catID: \$('#optioncategory').val(), cID: '" . $cID . "' }, function(data) {\n\t\t\t\t\n\t\t\t\t\t\$('#optionorder').html(data);\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\n\t\t\t});\n\t\t\n\t\t}\n\t\t\n\t\tfunction showMoreOptions() {\n\t\t\tif(\$('#optiontype').val() == \"select\") {\n\t\t\t\t\$('#moreOptions').fadeIn(400);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t\$('#moreOptions').hide();\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tfunction addSelectValue() {\n\t\t\n\t\t\t\$(document).ready(function() {\n\t\t\t\n\t\t\t\t\$('#loadingSpiral').show();\n\t\t\t\t\$('#selectValueList').hide();\n\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/admin/manageprofileoptions/cache/add.php', { selectValue: \$('#newSelectValue').val() }, function(data) {\n\t\t\t\t\t\$('#newSelectValue').val('');\n\t\t\t\t\t\$('#selectValueList').html(data);\n\t\t\t\t\t\$('#loadingSpiral').hide();\n\t\t\t\t\t\$('#selectValueList').fadeIn(400);\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t});\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\tshowMoreOptions();\n\t\trefreshProfileOrder();\n\t</script>\n\t";
}