<div class="container">
<? session_start();
include ("inc/func.php");
$db = new ConnectDatabase();

if(isset($_SESSION["ospiteM"])){

    
    if(isset($_GET["s"]) && $_GET["s"]==1){
  
    $sql="select nascita,cellulare,ip,DATE_FORMAT(FROM_UNIXTIME(`timestamp`), '%d-%m-%Y  %H:%i:%s') as timestamp from campaign50_leads where email= '".$_SESSION['ospiteM']."'";
    $vettHead=["<b>nascita</b>","<b>cellulare</b>","<b>ip</b>","<b>timestamp</b>"];
    if($res = mysqli_query($db,$sql)){
        
        $row = mysqli_fetch_row($res);
       if($row[0]!="") echo "<hr><h4>Registrazione avvenuta tramite portale WebMangiare</h4>";
        
            for($i=0 ; $i<=3 ; $i++){
              
                
            if($row[$i] != "" && $row[$i] !== NULL )    echo "<div class='row p-1'>".$vettHead[$i].":    ".$row[$i]."</div><br><br>";
            }mysqli_free_result($res);
        if(checkValidation($mailOspite,$codCampagna)){
        include ("inc/pan-resend.php");  
        }
    }
    }else if(isset($_GET["s"]) && $_GET["s"]==2){
    

    $sql="select nascita,cellulare,ip,DATE_FORMAT(FROM_UNIXTIME(`timestamp`), '%d-%m-%Y %H:%i:%s') as timestamp from campaign51_leads where email= '".$_SESSION['ospiteM']."'";
    
    if($res = mysqli_query($db,$sql)){
        
        $row = mysqli_fetch_row($res);
       if($row[0]!="") echo "<hr><h4>Registrazione avvenuta tramite portale Web1</h4>";
 
            for($i=0 ; $i<=3 ; $i++){
              
                
              if($row[$i] != "" && $row[$i] !== NULL )      echo "<div class='row p-1'>".$vettHead[$i].":    ".$row[$i]."</div><br><br>";
            }mysqli_free_result($res);
     
    }
    
    }else if(isset($_GET["s"]) && $_GET["s"]==3){

    $sql="select nascita,cellulare,ip,DATE_FORMAT(FROM_UNIXTIME(`timestamp`), '%d-%m-%Y  %H:%i:%s') as timestamp from campaign54_leads where email= '".$_SESSION['ospiteM']."'";

    if($res = mysqli_query($db,$sql)){
        
        $row = mysqli_fetch_row($res);
        
        if($row[0]!="") echo "<hr><h4 class='text-center'>Registrazione avvenuta tramite portale Web2</h4>";
        
            for($i=0 ; $i<=3 ; $i++){
              
                
          if($row[$i] != "" && $row[$i] !== NULL )      echo "<div class='row p-1'>".$vettHead[$i].":    ".$row[$i]."</div><br><br>";
            }mysqli_free_result($res);
     
    }
    }else{
        echo "<p style='color:red;font-weight:500;'>Si prega di selezionare una voce qui a lato.";
    }
    
}
require 'inc/inc_disconnect.php';
?>
</div>