<?php
include "scrinit.php";

	require_once 'soapClient.class.php';
	$ws=new WebsmsClient($cfg);
	
	$sp=mysqli_query($con,"select smsname from sysset");
	$row=mysqli_fetch_array($sp);
	$sender = $row['smsname'];
	$des=$_SESSION['tel'];
	$mes=$_SESSION['sms1'];
	echo "Μήνυμα: ".$mes;
	echo "<br>";
	$i=0;
	foreach ($des as $t)
	{
		$i++;
		echo $i.". ".$t."<br>";
	    $res=$ws->submitSM($sender,$t,$mes,"GSM");
	}
	echo "<br>";
	echo "ΕΧΟΥΝ ΣΤΑΛΕΙ ".$i."΄ΜΗΝΥΜΑΤΑ";
	$credits=$ws->getCredits();
	echo "<br>";
	echo "ΥΠΟΛΟΙΠΟΜΕΝΕΣ ΜΟΝΑΔΕΣ:".$credits;
	
	
	//$batch=$ws->getBatch($batchid);
	//var_dump($batch);
	
	
	//Function calls
	/*
	$ws=new WebsmsClient($cfg);
	$credits=$ws->getCredits();
	var_dump($credits);
	
	*/
	
?>
<br />
<a  href=<?php echo $menu;?> style="color:blue "  > <button> Επιστροφή στο Μενού   </a>
</body>
</html>