Location: PHPKode > projects > KSMS bulk sms manager > ksms-e1.2.35/my_notAutomaticSelect.inc
<?PHP
// -------------------------------------------------------------------------//
// KSMS ^ Short Message System Manager										//
// -------------------------------------------------------------------------//
// Based on "DBSMS" (C) 2002 Paolo Remonato									//
// Copyright (C) 2002-2006 Paolo Remonato									//
// KSMS-PROJECT HOME  :  http://ksms.sourceforge.net/						//
// -------------------------------------------------------------------------//
//   Please,do not delete these lines	^^^									//
// -------------------------------------------------------------------------//
/*
  This program is free software; you can redistribute it and/or modify it under the terms
  of the GNU General Public License as published by the Free Software Foundation.
  The software is provided "as is" without any express or implied warranty of any kind,
  Including warranties of noninfringement, merchantability, or fitness for a particular purpose.  
*/
###		@version 	: 2006-02-21,v1.2.35	kingmo
###		@last sing_upd 	: 
###		@filename 	: my_notAutomaticSelect.inc

define('IN_KSMS', true);

###	CREDITS-CHECK !!!!!!!!!!!! ################################################################

		//echo "<b>Total Numbers to send : ".$totcountnrs."</b><br>";
		//echo "<b>ID of organization : ".$idORG."</b><br>";
	if (!$orgsel3E = $db->Execute("SELECT * FROM credits_manager WHERE id_orgz='$idORG'")) {
      echo "<p class='tbl_error'>Database Error: " . $db->ErrorMsg() . "</p>";
	      		break;
   				   }
		$conxx = $orgsel3E->fields["connext_type"];
		$kstot = $orgsel3E->fields["smscredits_totalsum"];
		$ksrem = $orgsel3E->fields["smscredits_remain"];
		$kntot = $orgsel3E->fields["nrsms_totalsum"];
		$knrem = $orgsel3E->fields["nrsms_remain"];
		$cr_ac = $orgsel3E->fields["credit_activated"];
	if ($cr_ac == "Y") {
		if ($conxx == "fee") { $cust_credsrem = $ksrem; }
		 else if ($conxx == "oto") { $cust_credsrem = $knrem; }
		 else $cust_credsrem = 0;
		$totcountnrs_it = number_format($totcountnrs, 0, ',', '.'); // italian format numbers!!!
		$cust_credsrem_it = number_format($cust_credsrem, 0, ',', '.'); // italian format numbers (0 decim.)
			// echo "<b>Customer Credits Remain : ".$cust_credsrem."</b><br>";
		echo "<table class='tblsm' align='center' width='401' cellspacing='2' cellpadding='2' border='0'>";
		echo "<tr class='row_head'>";
		echo "<td rowspan='2'>&nbsp;<img src='images/pub/buttons/riepilogo.gif' alt='riepilogo''
		width='25' height='27' border='0' align='middle'>&nbsp;&nbsp;
		<font size='+1'>STAT</font>&nbsp;&nbsp;</td>";
		echo "<td>Numbers selected:</td>";
		echo "<td class='row_credits_notice' align='right'>".$totcountnrs_it."</td>";
		echo "</tr><tr>";
		echo "<td>Remain Credits:</td>";
		echo "<td class='row_credits_notice' align='right'>".$cust_credsrem_it."</td>";
		echo "</tr></table>";
		echo "<br>\n";
	// 
	if ($cust_credsrem < 0) {
			$aokk = 'CRinfZERO';
			echo "<table class='foottbl'><tr><td>
			CREDS < 0 ... PLEASE CONTACT YOUR PROVIDER!
			</td></tr></table>";
			  include("footer2.inc.php");
			 break;
			     }
			echo "\n";
	  if(!empty($cust_credsrem)) {
	  	if ($cust_credsrem < $totcountnrs) {        ### 
			$aokk = 'CRinfNR';
		  	echo "<table class='foottbl'><tr><td>
				YOU HAVEN'T SUFFICIENT CREDITS TO SEND MESSAGE!
			</td></tr></table>";
		if ($strsm == "CA" OR $strsm == "CL" OR $strsm == "GR" OR $strsm == "XG") {
	echo "<table class='foottbl' width='100%'><tr><td><div align='center'>";
echo "Max numbers that you can send : <font size='+1'>".$cust_credsrem_it."</font> ";
echo "<br> You can select AUTOMATIC o MANUAL!";
	echo "</b></div></td></tr></table>";
	echo "<table class='desc' width='100%'><tr><td><div align='center'>
	<tr><td>MANUAL: .......</td></tr>
<tr><td>AUTOMATIC:........</td></tr>
	</table>";
?>
<br>
<table class="tblsm" align="center" cellspacing="2" cellpadding="2" border="0">
	<form action="ne_SMS.php" name="formsel01" id="formsel01">
       <tr>
         <td><div align="center"> 
	<a href="ne_SMS.php?action=manualselect&smsid=<?php echo $smsid ?>"><img src="images/pub/bt_man_singleselect.gif" alt="manual self selection" width="82" height="31" border="0">
	</a>&nbsp;&nbsp;
		<img src="images/pub/bt_automaticselect.gif" alt="automatic selection" width="82" height="31" border="0" onClick="document.formsel01.submit();">
			</div></td>
      </tr>
	  
	  <input type="hidden" name="ccreds" value="<?php echo $cust_credsrem_it?>">
	  <input type="hidden" name="smsid" value="<?php echo $smsid ?>">
	  <input type="hidden" name="stream" value="<?php echo $smsgroupsel ?>">
	  <input type="hidden" name="action" value="automaticselect">
	 	</form>
   </table>
</form>
<?PHP

		include("footer2.inc.php");
		//break 1;
			exit();
		 	} 		// end if ($strsm == "CA" OR....
		 else {
			echo "<br>You must come back and select max <b><font size='+2'>".$cust_credsrem_it."</font></b> numbers.<br>";
		paint_table_manual_select($db, $smsid, $smopt);
			  include("footer2.inc.php");
			exit();
			      }
		}  // 	end 	if ($cust_credsrem < $totcountnrs
	// credito superiore (OK) ai numeri selezionati
		 if ($cust_credsrem > $totcountnrs) {
		  	echo "<table class='foottbl' width='100%'>";
			echo "<tr><td><div align='center'>";
		   	echo "There is [ <font size='+2' class='cell_of_evidence2'>".$totcountnrs_it." </font>] numbers that are waiting to send.";
			echo "</td></tr><tr><td><div align='center'>";
			echo "Now I'm Checking your credits......!";
			echo "</div></td></tr></table>";
			echo "\n";
			$aokk = 'OK_CRsupNR';
			}
	  }  //	  end  if(!empty($cust_credsrem))
		echo "\n";
		### CREDITO ESAURITO
		if ($cust_credsrem = 0) {
			$aokk = 'CR=ZERO';
			echo "<table class=\"notice\" width=\"100%\"><tr><td><div align='center'><b><font face='Verdana,Geneva,Arial,Helvetica,sans-serif' size='2' color='#ffffff'>CREDITS FINISHED!</font></b></div></td></tr></table>";
			  include("footer2.inc.php");
			 break;
			   }
	    } // end if ($cr_ac == "Y"...
	else {
			echo "<br>\n";
		  	echo "<table class='foottbl' width='100%'>";
			echo "<tr><td><div align='center'>";
			echo $klang_err['sendsms_user_notactivated'];
			echo "</div></td></tr></table>";
			echo "<br>\n";
			include("footer.inc.php");
			break;
		     }
# TESTING /////////
//	echo "<br>AOK <b>_-_-_- ".$aokk." _-_-_-_-_-</b>";

?>
Return current item: KSMS bulk sms manager