Location: PHPKode > projects > Simple SMS Site Software > simple-sms-site-software/user_send.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'];
$pass_number = $_GET['numbers'];

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

if ($access == "forbidden") {
	include("inc/restricted.inc.php");
}
elseif ($access == "locked") {
	include("inc/restricted.inc.php");
}
else {	

	$query = "SELECT credits FROM users WHERE username = '$user'"; 
	$result = mysql_query($query);
	
	if (!$result) {
	   echo 'Could not run query: ' . mysql_error();
	   exit;
	}
	$credits = mysql_fetch_row($result);
	$remaining = $credits[0];

	$query = mysql_query("SELECT name,value FROM config");

	while ($row = mysql_fetch_array($query))
          $config[$row['name']] = $row['value'];
	
	if ($config['allow_concat'] == 'yes') {
		if ($config['max_concats'] == 1) {
			$max_chars = 160;
			$use_concat = 'no';
		}
		else {
			$max_chars = 151 * $config['max_concats'];
			$use_concat = 'yes';
		}
	}
	else {
		$max_chars = 160;
		$use_concat = 'no';
	}
	  
	?>
		<form method="POST" name="sender_form" action="confirm_send.php">
		<table width=400>
	        <tr>
		  <td>
                    <input type="hidden" name="theType" value="SMS">
		    <input type="hidden" name="max_char" value="<?echo $max_chars;?>">
		    <input type="hidden" name="concat_use" value="<?echo $use_concat;?>">
		  
		    <h1>Send Message</h1>
		    Please ensure all recipient numbers are in international format and are
	            separated by commas <br>e.g 441234567890,449876543210,44...

		    <h2>Flash Message? <input type="checkbox" class="checkbox" name="theFlash" value="1"></h2>
		    A flash message appears on the recipients screen when the message is recieved.<br>
		    The message is not stored on the phone.
		    
		    <h2>Delivery Report? <input type="checkbox" class="checkbox" name="theRep" value="1"></h2>
		    Receive delivery notifications.<br>	

		    <?
		    if ($allow_https == "yes") {
		    ?> 
		    <h2>Secure Message? <input type="checkbox" class="checkbox" name="secure" value="1"></h2>
		    Send message using secure gateway.<br>
		    <?
		    }
		    else {
	            ?>
		    <h2>Secure Message? <input type="checkbox" class="checkbox" name="secure" value="1" DISABLED></h2>
		    Send message using secure gateway. (disabled)<br>
		    <?
		    }
	    	    ?>	
		    
	            <h2>Originator</h2>
	            <input type="text" name="theOriginator" size="20">
		    
		    <h2>Recipients</h2>
		    <input type="text" name="theRecipients" size="20" value="<?echo $pass_number?>">

		    <h2>Message Contents</h2>
	   	    Remaining Characters <input type="text" name="CNT" value="<?echo $max_chars?>" size="3"> of <?echo $max_chars?><br>
	    <textarea name="theMessage" rows="5" cols="40" wrap="virtual" onChange="checkmsg(this,<?echo $max_chars?>)" onFocus="checkmsg(this,<?echo $max_chars?>)" onKeyDown="checkmsg(this,<?echo $max_chars?>)"></textarea>
		    <br>	
	            You have <?echo $remaining;?> credits remaining
	            <br>
		    <input type="submit" value="Submit" name="B1">
		    <input type="reset" value="Clear" name="B2">

		  </td>
	        </tr>
	       </form>
   	       </table>	       
<?
}
include("inc/footer.inc.php");
?>              
Return current item: Simple SMS Site Software