
<?php 
require_once ("../var/res.php");
$infoid = $_REQUEST['infoid'];
?>
<style>
img {
    max-width: 750px;
    width: 750px;
}

@media print {
    .hidden-print,
    .hidden-print * {
        display: none !important;
    }
}

@media print {
    .footer,
    #non-printable {
        display: none !important;
    }
    #printable {
        display: block;
    }
}

@media print {
  @page { margin: 0; }
  body { margin: 1.6cm; }
}

@media print {
   html, body {
    font-family: Tahoma;
    width: 210mm;
    height:100%;
    position:absolute;
    margin:0 auto;
   }
   
img {
    max-width: 750px;
    width: 750px;
} 

}
</style>

<body style="width: 210mm; height: 100%; overflow: hidden;" onload="window.print()">
    <?php      
        $stts = $db->prepare("SELECT DISTINCT(regst_id) AS regst,con_info_id AS coninfo, sub_matt AS subj, 
        info_notes AS msgenote, dueCon AS regdate,info_sts AS stats, title_name AS appoint,title_id AS title,iSd AS docsender,conTrm,recvappnt,
        informto,reg_due FROM tbl_info_register i
        INNER JOIN tbl_con_infos c ON c.reg_info_id = i.regst_id 
        INNER JOIN tbl_title t ON t.title_id = c.appntsent 
        WHERE i.regst_id ='".$infoid."' ");

        $stts->execute(array());
        while($getinfo = $stts->fetch()){ 

        $subj = $getinfo['subj'];
        $msgenote = $getinfo['msgenote'];
        $recvappnt = $getinfo['recvappnt'];
        $appoint = $getinfo['appoint'];
        $informto = $getinfo['informto'];
        $reg_due =  $getinfo['reg_due'];

        ### RECEIVER DETAILS ####### 
            $receiv = $db->prepare("SELECT * FROM tbl_role r
            INNER JOIN tbl_title t ON t.department_id = r.role_id 
            WHERE t.title_id ='".$recvappnt."'");  
            $receiv->execute();
            while($viewReceiv = $receiv->fetch()){

            $rlename = $viewReceiv['role_name'];
            $tname = $viewReceiv['title_name'];
            }
        ### END RECEIVER DETAILS #######

    ?>
    <table>       
        <tr>
        <td>
        <img src="../img/tempmemo2.jpg" width="100%" style="margin-left:-3px;margin-top:-2px;margin-right:2px;">
        
        <table align="center" style="margin-top: -753px; margin-left:80px;font-size: 18px;font-weight:bold;font-family:Tahoma;">
            <tr>
                <td><b><?php echo $tname;?></b></td>
            </tr>
        </table>

        <table align="center" style="margin-top: -28px; margin-left:480px;font-size: 18px;font-weight:bold;font-family:Tahoma;">
            <tr>
                <td><b><?php echo $appoint;?></b></td>
            </tr>
        </table>

        <table align="center" style="margin-top: 12px; margin-left:95px;font-size: 18px;font-weight:bold;font-family:Tahoma;">
            <tr>
                <td><b><?php if($informto!=""){echo $informto; }else{ echo '---';};?></b></td>
            </tr>
        </table>

        <table align="center" style="margin-top: 10px; margin-left:465px;font-size: 18px;font-weight:bold;font-family:Tahoma;">
            <tr>
                <td><b><?php echo $_SESSION['phone'];?></b></td>
            </tr>
        </table>

        <table align="center" style="margin-top: 13px; margin-left:480px;font-size: 18px;font-weight:bold;font-family:Tahoma;">
            <tr>
                <td><b><?php echo date('d/M/Y',strtotime($reg_due));?></b></td>
            </tr>
        </table>

        <table align="center" style="margin-top: -30px; margin-left:125px;font-size: 18px;font-weight:bold;font-family:Tahoma;">
            <tr>
                <td><b></b></td>
            </tr>
        </table>

        <table align="center" style="margin-top: 115px; margin-left:125;font-size: 18px;font-weight:bold;font-family:Tahoma;">
            <tr>
                <td><b><u><?php echo $subj;?></u></b></td>
            </tr>
        </table>

        <table align="center" style="margin-top: 352px; margin-left:116px;margin-right:45px;font-size: 18px;font-family:Tahoma;">
            <tr>
                <td><?php echo $RkName;?></td>
            </tr>
        </table>

        <table align="center" style="margin-top: -28px; margin-left:230px;margin-right:45px;font-size: 18px;font-family:Tahoma;">
            <tr>
                <td><?php echo substr($first_name, 0, 1)." ".$family_name;?></td>
            </tr>
        </table>

        <table align="center" style="margin-top: -28px; margin-left:390px;margin-right:45px;font-size: 18px;font-family:Tahoma;">
            <tr>
                <td><?php echo $title_name;?></td>
            </tr>
        </table>


        <table align="center" style="margin-top: -380px; margin-left:45px;margin-right:45px;font-size: 18px;font-family:Tahoma;">
            <tr>
                <td><?php echo $msgenote;?></td>
            </tr>
        </table>
       

        

        
        </td>
        </tr>
     </table>
</body>

<?php }?>    

