<? include ("../settings.php"); ?>
<? include ("session.php"); ?>
<?
    if (isset($_REQUEST['registrant_id']) && $_REQUEST['registrant_id']>0){

        $bind = array (":search1"=>$_REQUEST['registrant_id']);
        $results = $db->select("tbl_registrant","registrant_id=:search1",$bind);
        $deresult =$results[0];
        
        $extra1 = $deresult['remarks'];
        $extra2 = "";
        
        //print_r($deresult);
        if ($deresult['registrant_salutation']=="Prof" || $deresult['registrant_salutation']=="AProf" || $deresult['registrant_salutation']=="Dr" || $deresult['registrant_salutation']=="A/Prof")
			$fullname = $deresult['registrant_salutation']." ".$deresult['registrant_fullname'];        
        else
        	$fullname = $deresult['registrant_fullname'];
        $var = "user_name=sp&user_password=spspsp&name=".urlencode($fullname)."&sn=".urlencode($deresult['registrant_sn'])."&company=".urlencode($deresult['registrant_organisation'])."&extra1=".urlencode($extra1)."&extra2=N.A.&printer=".urlencode($_SESSION['user_printer'])."&event=SASO2025";
        
        //echo $var;
        $contents = file_get_contents('https://www.events-sp.com/PRINT/insert.php?'.$var);    
        
        echo "1";
    }


?>