| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
require_once("include/session.php"); |
|---|
| 38 |
|
|---|
| 39 |
function deleteList($listname){ |
|---|
| 40 |
global $dblink; |
|---|
| 41 |
|
|---|
| 42 |
$querystatement="DELETE FROM choices WHERE listname=\"".$listname."\" "; |
|---|
| 43 |
$queryresult=mysql_query($querystatement,$dblink); |
|---|
| 44 |
if(!$queryresult) |
|---|
| 45 |
reportError(100,"SQL Statement Could not be executed."); |
|---|
| 46 |
else |
|---|
| 47 |
echo "ok"; |
|---|
| 48 |
} |
|---|
| 49 |
|
|---|
| 50 |
function addToList($listname,$value){ |
|---|
| 51 |
global $dblink; |
|---|
| 52 |
|
|---|
| 53 |
$querystatement="INSERT INTO choices (listname,thevalue) VALUES(\"".$listname."\",\"".$value."\") "; |
|---|
| 54 |
$queryresult=mysql_query($querystatement,$dblink); |
|---|
| 55 |
if(!$querystatement) |
|---|
| 56 |
reportError(100,"SQL Statement Could not be executed."); |
|---|
| 57 |
else |
|---|
| 58 |
echo "ok"; |
|---|
| 59 |
} |
|---|
| 60 |
|
|---|
| 61 |
function displayList($queryresult,$blankvalue){ |
|---|
| 62 |
while($therecord=mysql_fetch_array($queryresult)){ |
|---|
| 63 |
$display=$therecord["thevalue"]; |
|---|
| 64 |
$theclass=""; |
|---|
| 65 |
if($therecord["thevalue"]==""){ |
|---|
| 66 |
$display="<".$blankvalue.">"; |
|---|
| 67 |
$theclass=" class=\"choiceListBlank\" "; |
|---|
| 68 |
} |
|---|
| 69 |
?><option value="<?php echo $therecord["thevalue"]?>" <?php echo $theclass?>><?php echo $display?></option><?php |
|---|
| 70 |
} |
|---|
| 71 |
|
|---|
| 72 |
} |
|---|
| 73 |
|
|---|
| 74 |
function displayBox($listname,$blankvalue,$listid){ |
|---|
| 75 |
global $dblink; |
|---|
| 76 |
|
|---|
| 77 |
$blankvalue=str_replace("<","",$blankvalue); |
|---|
| 78 |
$blankvalue=str_replace(">","",$blankvalue); |
|---|
| 79 |
|
|---|
| 80 |
$querystatement="SELECT thevalue FROM choices WHERE listname=\"".$listname."\" ORDER BY thevalue;"; |
|---|
| 81 |
$queryresult=mysql_query($querystatement,$dblink); |
|---|
| 82 |
if(!$querystatement) reportError(100,"SQL Statement Could not be executed."); |
|---|
| 83 |
?> |
|---|
| 84 |
<table width="100%" cellpadding="0" cellspacing="0"> |
|---|
| 85 |
<tr> |
|---|
| 86 |
<td valign="top"><select id="MLlist" name="MLList" size="12" style="width:230px;margin-right:10px;margin-bottom:10px;" onChange="updateML(this)"><?php displayList($queryresult,$blankvalue)?> |
|---|
| 87 |
</select></td> |
|---|
| 88 |
<td valign="top" style="width:100%"> |
|---|
| 89 |
<input type="button" id="MLDelete" name="MLDelete" value="delete" class="Buttons" style="width:50px;;margin-bottom:5px;" disabled onClick="delML()" /><br/> |
|---|
| 90 |
<input type="button" id="MLInsert" name="MLInsert" value="insert" class="Buttons" style="width:50px" onClick="insertML()"/> |
|---|
| 91 |
</td> |
|---|
| 92 |
<tr> |
|---|
| 93 |
<td valign="top"> |
|---|
| 94 |
<input name="MLaddedit" id="MLaddedit" type="text" style="width:220px;margin-right:10px;margin-bottom:5px;"/> |
|---|
| 95 |
<input name="MLblankvalue" id="MLblankvalue" type="hidden" value="<?php echo $blankvalue?>"/> |
|---|
| 96 |
</td> |
|---|
| 97 |
<td valign="top"><input type="button" id="MLaddeditbutton" name="MLaddeditbutton" value="add" class="Buttons" style="width:50px" onClick="addeditML('<?php echo $blankvalue?>')" /></td> |
|---|
| 98 |
</tr> |
|---|
| 99 |
</tr> |
|---|
| 100 |
</table> |
|---|
| 101 |
<div id="MLStatus" class="small" align="center"> </div> |
|---|
| 102 |
<div align="right"> |
|---|
| 103 |
<input type="button" id="MLok" name="MLok" value="ok" class="Buttons" style="width:75px;" onClick="clickOK('<?php echo $_SESSION["app_path"]?>','<?php echo $listid?>','<?php echo $listname?>')"/> |
|---|
| 104 |
<input type="button" id="MLcancel" name="MLcancel" value="cancel" class="Buttons" style="width:75px;" onClick="closeBox('<?php echo $listid?>');"/> |
|---|
| 105 |
</div> |
|---|
| 106 |
<?php } |
|---|
| 107 |
|
|---|
| 108 |
if(!isset($_GET["cm"])) |
|---|
| 109 |
$_GET["cm"]="shw"; |
|---|
| 110 |
|
|---|
| 111 |
if(!isset($_GET["ln"])) |
|---|
| 112 |
$_GET["ln"]="shippingmethod"; |
|---|
| 113 |
if(!isset($_GET["bv"])) |
|---|
| 114 |
$_GET["bv"]="none"; |
|---|
| 115 |
switch($_GET["cm"]){ |
|---|
| 116 |
case "shw": |
|---|
| 117 |
displayBox($_GET["ln"],$_GET["bv"],$_GET["lid"]); |
|---|
| 118 |
break; |
|---|
| 119 |
case "del": |
|---|
| 120 |
deleteList($_GET["ln"]); |
|---|
| 121 |
break; |
|---|
| 122 |
case "add": |
|---|
| 123 |
addToList($_GET["ln"],$_GET["val"]); |
|---|
| 124 |
break; |
|---|
| 125 |
} |
|---|
| 126 |
|
|---|
| 127 |
?> |
|---|