Location: PHPKode > scripts > PHP Online Invoice System > php-online-invoice-system/select_client.php
<?
/*
 * Exemplar Web hosting
 * http://www.exemplar.biz
 *
 * Title: PHP Online Invoice System
 * Version: 2.0
 * Author: Exemplar
 * Date: 01-01-2006
 *                 
*/

include('header.php');
?>
  <blockquote>
<? 
echo " <h1>Add invoice</h1>";

// create SQL statement
$sql8 = "SELECT * 
        FROM clients
        
        ORDER BY clientid ASC";

// execute SQL query and get result
$sql_result = mysql_query($sql8)
	or die("Couldn't execute query.");

// put data into drop-down list box
while ($dorow = mysql_fetch_array($sql_result)) {
        $cid  = $dorow["clientid"];
	    $name  = $dorow["name"];

        $option_block .= "<OPTION value=\"add_invoice.php?cid=$cid\">$cid | $name</OPTION>";
        
}
?>

Select Client:<br>
<form name="query">
&nbsp;<select name="client" size="1" onChange="gone()">
<? echo "$option_block"; ?>
</select>

<script language="javascript">
<!--

function gone()
{
location=document.query.client.options[document.query.client.selectedIndex].value
}
//-->
</script>

&nbsp;<input class=form-button type="button" name="edit" value="Select Client" onClick="gone()">

</form>
</blockquote>
<?
include "footer.php";
?>
Return current item: PHP Online Invoice System