Sindbad~EG File Manager

Current Path : /usr/home/beeson/public_html/helpwithmath_old/italian/
Upload File :
Current File : /usr/home/beeson/public_html/helpwithmath_old/italian/AfterTransaction.php

<?php  // this page will receive the response from the payment gateway when the transaction is successful.
session_start();
require_once("GetSerialNumber.php");
require_once('DB.php');
require_once('query.php');
$OrderID = $_SESSION['OrderID'];
if(is_null($OrderID))
   { header("Location: index.php");  // do not pass Go, do not collect $200
   }
// First, get the CustomerID
$sql = "SELECT CustomerID, Status FROM Orders WHERE OrderID='$OrderID';";
$q = Query($sql);
$q->fetchInto($row);
$CustomerID = $row[0];
$OrderStatus = $row[1];
if($OrderStatus != "authorized")
   { header("Location: purchase.php");  // we didn't come from PaymentInfo.php, or it would have been authorized.
   }
// Maybe we got here as a result of a "Refresh".  In that case don't generate a new serial number:
$sql = "SELECT SerialNumber FROM Registered WHERE CustomerID='$CustomerID';";
$qr = Query($sql);
$qr->fetchInto($rowreg);
$RegisteredFlag = $qr->nrows == 0 ? false : true;
// if $RegisteredFlag is false, that means this is the first time on this page for this CustomerID  
// What product(s) did this customer order?  
$sql = "SELECT Products.ProductID, ProductName, Quantity FROM `Order Details`,Products WHERE OrderID='$OrderID' AND `Order Details`.ProductID=Products.ProductID;";
$q = Query($sql); 
$nitems = 0;
while($q->fetchInto($row2))
    { $ProductIDs[$nitems] = $row2[0];
      $ProductNames[$nitems] = $row2[1];
      $quantities[$nitems] = $row2[2];
	  if($row2[0] == 1 || $row2[0] == 4)
	    {  $WhichDisks[$nitems] =  7;
		}
	  else if ($row2[0] == 2 || $row2[0] == 5) 
	    {  $WhichDisks[$nitems] = 3;
		}
	  else
	    { $WhichDisks[$nitems] = 1;
		}
	  if($RegisteredFlag)
	     {  $SerialNumbers[$nitems] = $rowreg[0];
		 }
	  else
         { $SerialNumbers[$nitems] = getSerialNumber($WhichDisks[$nitems]);  // generate a new serial number	 
	       $SerialNumber = $SerialNumbers[$nitems];
	       $sql = "INSERT INTO Registered (SerialNumber,CustomerID) VALUES('$SerialNumber','$CustomerID');";
	       Query($sql);  // register the serial number to this customer	 
		 }
	  ++$nitems;
    }
if($nitems == 1)
   { $SerialNumber = $SerialNumbers[0];
   }	
if($RegisteredFlag == false)	
   { // Next send the customer a confirming email--one time only.
	 $from = "sales@HelpWithMath.com";
	 $sql = "SELECT Email FROM Customers WHERE CustomerID='$CustomerID';";
	 $q = Query($sql);
	 $q->fetchInto($rows);
     $to = $rows[0];
	 $subject = "Il tuo Serial Number di MathXpert";
	 if($nitems == 1)
	    { $message = "Grazie di aver acquistato il prodotto $ProductName all'indirizzo www.HelpWithMath.com. " .
	           "Per la tua copia, ecco il Serial Number ".
			   "che ti � stato assegnato dal sito web: " . $SerialNumber;
        }
	 else  // $nitems > 1  
	    { $message = "Grazie di aver acquistato il programma al sito www.HelpWithMath.com. ".
		            "Per le tue copie, ecco i serieal number che ti sono stati assegnati dal sito web: \n\n" ;
		  for($i=0; $i < $nitems; $i++)
		     { $message = $message . $ProductNames[$i] . "    " . $SerialNumbers[$i] . "\n";
			 }
	    }		
     mail("$to", "$subject", $message, "From: $from\nX-Mailer: PHP/ . $phpversion()", "-f $from");
	 // and send HelpWithMath an email including the referring page, so we can pay what we owe for click-throughs
	 $message = "La seguente vendit� � stata eseguita da $to:\n\n";
	 $message = $message . "Pagina di riferimento = " . $_SESSION['ReferringPage'] . "\n";	 
	 if($nitems == 1)
	    {  if($quantities[0] == 1)
		      $message = $message . "Una copia di " . $ProductNames[0] . "\n";
	       else
		      $message = $message . " " . $quantities[0] . " copie di " . $ProductNames[0] . "\n";
		}
     else
	    { for($i=0; $i < $nitems; $i++)
		     { if($quantities[$i] == 1)
		         $message = $message . "Una copia di " . $ProductNames[$i] . "\n";
	          else
		         $message = $message . " " . $quantities[$i] . " copie di " . $ProductNames[$i] . "\n";
	         }
	   }
	 mail("sales@HelpWithMath.com", "resoconto vendita", $message, "From: $from\nX-Mailer: PHP/ . $phpversion()", "-f $from");      	  
   }
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- DW6 -->
<?php 
include ('include/head.php'); 
?>
<body onmousemove="closesubnav(event);"> 
<?php include ('include/body.php'); ?>
  <div class="style1" id="pageName"> 
  <p></p>
  <h2> La transazione � stata accettata.  Ti ringraziamo per la scelta accordataci. </h2>
  <p>
    <h3>Riceverai una mail di conferma dal sistema di pagamento della tua carta di credito. </h3>
	<h3>Non usare il pulsante indietro del browser.  </h3>
	<h3>Usa i pulsanti di navigazione qui sopra per continuare ad esplorare il sito Help With Math.</h3>
	<?php if($nitems == 1) 
	         { echo	"<h3>Il tuo Serial Number � riportato qui sotto. </h3>";
			 }
      	  else
		     { echo "<h3>I tuoi Serial Number sono riportati qui sotto.</h3>";
			 }
	?>
        <p>Puoi usare questo Serial Number durante l'installazione di MathXpert, oppure lo puoi usare per attivare la versione dimostrativa,  
	      se ne avevi gi� installata una. Ti consigliamo di tagliare e incollare il Serial Number in un posto che sei sicuro di non perderlo.
		  Tuttavia, ti spediremo questo Serial Number anche per e-mail. Non puoi installare MathXpert senza usare un Serial Number.     
	   </p>
	   <p>Se avevi gi� installato una versione dimostrativa di MathXpert, ci� che ti rimane da fare � attivarla con questo 
	   Serial Number.   Altrimenti, se hai acquistato un CD, te lo spediremo entro 24 ore.   Quantunque tu abbia scelto
	   o meno di ricevere un CD,  puoi anche scaricare MathXpert adesso cliccando qui.  
	   </p>  
	   
	   <form action="Install/SaveOrRun.html" method="post" enctype="multipart/form-data" name="form1">
   <table width="500" border="0">
<?php if($nitems == 1) { ?>   
     <tr> 
	    <td width="250"> Copia e salva questo numero seriale:</td>
        <td width="250"> <input size="21" type="text" name="SerialNumber" value=<?php echo $SerialNumber ?>></td>
     </tr>	 
<?php  }
   else 
      { ?> <tr> <td width="250"> Copia e salva questi numeri seriali:</td><td width="250">  </td></tr>
	    <?php for($i=0; $i<$nitems; $i++)
	       {  ?> <tr>
		             <td width="250"> <?php echo $ProductNames[$i] ?> </td>
                     <td width="250"> <input size="21" type="text" name=<?php echo "SerialNumber".$i ?> value=<?php echo $SerialNumbers[$i] ?>></td>
                 </tr>
     <?php } 
	  }?>
   </table>   
   <p>
		Quanto utilizzerai un numero seriale per installare MathXpert,  avrai bisogno di copiare
		e incollare le tre parti separatamente. Questo � il modo in cui � stato progettato il programma di installazione
		InstallShield, quindi dobbiamo adeguarci al suo funzionamento, ma ti consiglio di incollare le tre parti
		separatamente, piuttosto che ridigitarle.
   </p>
   <p>  E' sempre una buona idea disattivare temporaneamente l'antivirus prima di far partire l'installazione del software.  
        In particolare se stai usando Norton Antivirus, devi quantomeno disattivare la funzione "Autodetect" mentre
	  installi MathXpert. 
		(Questo problema � capitato a due clienti perci� abbiamo messo questo avvertimento.)  Dopo di che sono avvenute
		centinaia di installazione senza problemi, ed un solo cliente ha avuto problemi lo stesso,
		ma se tu dovessi essere il secondo, per favore contattaci, ti aiuteremo a risolvere il problema.
   </p>
	  <p></p>
		<input type="submit" name="Submit" value="Download Now">         
		</p>
   </form>
	</p>
 </div>   
<?php include ('include/footer.php'); 
?>
</body>
</html>

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists