Esempio n. 1
0
	
/*skip serve per mostrare tutto nel caso in cui i punti siano positivi*/
$skip=false;
if($points_to_add < 0){
	$skip=true;
	?>
	<br/> <h2>ERRORE: Non puoi aggiungere punti negativi</h2>
	<h4>Se si vuole rimuovere dei punti usare lo strumento <a href="#editCard">Modifica Card</a>		
<?}
$sq = new CardDb();
$error=1; //if <0 error is enable
if(!$skip){
			$error = $sq -> addPoints($card_number, $points_to_add);
	
		if($error >= 0){ 
		$result = $sq -> getPoints($card_number)?>
		
		<h2>Punti aggiunti con successo. <br/>Situazione aggiornata Card <?php echo $card_number?>:</h2>
			<table class="rwd-table">
			  <tr>
				<th>Numero Card</th>
				<th>Saldo Punti</th>
				<th>Buono Utilizzabile</th>
				<th>Nome</th>
				<th>Telefono</th>
				<th>Email</th>
			  </tr>
			<?php
			while($data = $result -> fetchArray()){
					$_SESSION['card-number']=$data['id'];
					$_SESSION['phone']=$data['phone'];
Esempio n. 2
0
<?php

session_start();
require "CardDb.php";
require "menu.html";
$card_number = $_SESSION['card-number'];
$new_points = $_POST['points'];
$new_user = $_POST['name'];
$new_phone = $_POST['phone'];
$new_mail = $_POST['mail'];
$sq = new CardDb();
$sq->updateAll($card_number, $new_points, $new_user, $new_phone, $new_mail);
$values = $sq->getPoints($card_number);
?>
<h2>Valori aggiornati correttamente.</h2>
	<table class="rwd-table">
	  <tr>
		<th>Numero Card</th>
		<th>Saldo Punti</th>
		<th>Buono Utilizzabile</th>
		<th>Nome</th>
		<th>Telefono</th>
		<th>eMail</th>
		<th></th>
	  </tr>
	<?php 
while ($data = $values->fetchArray()) {
    ?>
		  <tr><form method="POST" action="saveEdit.php">
			<td data-th="Numero Card"><?php 
    echo $data['id'];