<? 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];
        
        $tbind = array(":search1"=>$deresult['table_id']);
        $tresults = $db->select("tbl_table","tbl_id=:search1",$tbind);
        $tresult = $tresults[0];
        
        if ($tresult['tbl_name']!="")
            $extra1 = "Table ".$tresult['tbl_name'];
        else
            $extra1 = "";
        $extra2 = "";
        
        //print_r($deresult);
        $fullname = $deresult['registrant_fullname'];
        $var = "user_name=sp&user_password=spspsp&name=".urlencode($fullname)."&sn=".urlencode($deresult['registrant_seatingplan'])."&company=".urlencode($deresult['registrant_company'])."&extra1=".urlencode($extra1)."&extra2=N.A.&printer=".urlencode($_SESSION['user_printer'])."&event=PSTA2016";
        
        //echo $var;
        $contents = file_get_contents('https://www.events-sp.com/PRINT/insert.php?'.$var);    
        
        echo "1";
    }


?>