Location: PHPKode > projects > Simple SMS Site Software > simple-sms-site-software/user_adjust_credit.php
<?php
/******************************************************************************
************** Simple SMS Site Software *********************************
************** SSSSv1.0*****************************************************
************** by (aq) limited http://aql.com *******************************
************** All Rights Reserved ******************************************
************** Please read COPYRIGHT file prior to modification********
********************************************************************************/

session_start();

$user = $_SESSION['user'];
$pass = $_SESSION['pass'];

include("inc/header.inc.php");

if ($access == "admin") { 
	?>
	<form method="POST" name="credit_form" action="user_adjust_credit2.php">
	<table class=tableborder>
	    <tr>
	      <td>
	        <h1>Adjust User Credits</h1>
	      </td>
	    </tr>
	    <tr>
	      <td>
	        <h2>Select User</h2>
	        <select size="1" name="D1">		
		<?
	
		$query = "SELECT username FROM users";
		$result = mysql_query($query);
		if (!$result) {
	   	echo 'Could not run query: ' . mysql_error();
	  	 exit;
		}

		$row_count = mysql_num_rows($result); // count number of results (i.e no of users)
		for($i = 0; $i < $row_count; $i++)
		{
		     $row = mysql_fetch_row($result); // add each user to an array
		     foreach ($row as $x) {
		     $userArray[] = $x;;
		     } 
		}

		sort ($userArray); // sort array of users
		$row_count = count($userArray);
		for($i = 0; $i < $row_count; $i++) // cycle through list, add each element as an option
		{
		     ?><option><?echo $userArray[$i]?></option><?;
		}
		 
		?>
          	</select>
	      </td>
	    </tr>
	    <tr>
	      <td>
	        <input type="submit" value="Select" name="B1">
		</form>
	    </tr>
	</table>    
    <?
}
else {
	include("inc/restricted.inc.php");
}
include("inc/footer.inc.php");
?>
Return current item: Simple SMS Site Software