All pastes #183045 Raw Edit

Someone

public text v1 · immutable
#183045 ·published 2006-09-26 15:25 UTC
rendered paste body
<div style="width: 550px; background-color: #cc9; border: 1px dotted #333; padding: 5px; margin: 0px auto";>
<form action="<?php print $_SERVER["PHP_SELF"]; ?>" method="POST" onSubmit="allSelect()">
<div style="float: left; width: 200px">
<select name="possible" size="6" multiple width=200 style="width: 200px">
<?php
        $targetGroup = 2;

        $selectSQL = "select * from Pager_Contact where ContactID not in ( select ContactID from Pager_GrpMembers where GroupID=$targetGroup )";

        $result = mysql_query( $selectSQL );

        while ( $contactRow = mysql_fetch_array( $result ) ) {
                $contactID = $contactRow["ContactID"];
                $contactName = $contactRow["ContactName"];

                print "<option value=\"$contactID\">$contactName</option>\n";
        }
?>
</select>
</div>
<div style="margin-left: 200px; margin-right: 200px; text-align: center">
<p>
<p>
<A HREF="javascript:copyToList('possible','chosen')"><button name="to">--></button></A><br>
<A HREF="javascript:copyToList('chosen','possible')"><button name="from"><--</button></A>
<p>
<p>
</div>
<div style="float: right; width: 200px">
<select name="chosen" size="6" multiple width=200 style="width: 200px">
<?php
        $selectSQL = "select a.* from Pager_Contact a, Pager_GrpMembers b where a.ContactID=b.ContactID and b.GroupID=$targetGroup";

        $result = mysql_query( $selectSQL );

        while ( $contactRow = mysql_fetch_array( $result ) ) {
                $contactID = $contactRow["ContactID"];
                $contactName = $contactRow["ContactName"];

                print "<option value=\"$contactID\">$contactName</option>\n";
        }
?>
</select>
</div>