<?php 
$doc_id=$this->uri->segment('3');
$doc_table='student_character_certificate';
$get_doc_data=$this->CertificateModel->get_item_data($doc_id,$doc_table);
if($get_doc_data){
    foreach($get_doc_data as $doc_data){
        // $sch_no=$doc_data['sch_no'];
        $gender=$doc_data['gender'];
?>
<!DOCTYPE html>
<html>
    <head>
        <title>Student Character Certificate</title>
        <link rel="preconnect" href="https://fonts.googleapis.com">
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
        <link href="https://fonts.googleapis.com/css2?family=Exo+2:ital,wght@0,500;1,400&display=swap" rel="stylesheet"> 
        <style>
            .w-100{width:100%;}
            .w-50-1{width:50%;float:left;height:100%;border-right:1px dotted red;}
            .w-50-2{width:50%;float:left;height:100%;}
            .w-2{width:0%;float:left;}
            img{height:80px;width:auto;}
            html{padding:0px;margin:0px;}
            body{padding:20px;margin:0px;font-size:13px;font-family: 'Exo 2', sans-serif !important;}
        </style>
    </head>
    <body>
        
    
        
        <div style="height:80%;width:100%;float:left;padding:0px;border:2px solid;">
            
            
            <div style="width:100%;text-align:center;margin:0px;padding:0px;height:130px;;display:block; border-bottom:1px solid;">
                <div style="width:20%;text-align:right;float:left;">
                    <img src="<?php echo school_logo_full; ?>" style="width:60px;margin-top:0px;padding-top:10px;height:auto;">
                </div>
                <div style="width:80%;text-align:center;float:right;">
                    <h1 style="padding:0px;margin:0px;font-size:38px !important;font-weight:900 !important;text-transform:uppercase;display:flex;text-align:center;letter-spacing:2px;">
                            <?php echo school_full_name; ?><br>
                    </h1>
                    <h2 style="padding:0px;margin:0px;font-size:14px !important;font-weight:500 !important;letter-spacing:2px;"><?php echo school_affiliation;?></h2>
                    
                    <h2 style="font-size:14px;margin:0px; padding :0px;font-weight:500;letter-spacing:2px;"><?php echo school_address;?></h2>
                    
                    <h2 style="padding:0px;margin:0px;font-size:13px;font-weight:500;"><b>Contact : <?php echo landline; ?></b> </h2>
                    
                </div>
                
            </div>    
            <hr>
            
            <div style="width:100%;text-align:center;">
                <!--<span style="padding:5px;font-size:22px;font-weight:600;border:5px solid;height:50px;">Character Certificate</span>-->
            
                <table style="width:100%;margin:0px;padding:0px;">
                    <tr>
                        <th colspan="2" style="text-align:center;">
                            <span style="padding:10px !important;font-size:22px;font-weight:600;border:2px solid;height:50px;padding-top:10px;padding-bottom:10px;width:150px;">Character Certificate</span>
                        </th>
                    </tr>
                    <tr style="width:100%;margin:0px;padding:0px;font-size:22px;font-weight:600;">
                    
                        <th style="text-align:left;padding-left:15px;">Sl. No. : <?php echo $doc_id;?></th>
                        <th style="text-align:right;">
                        Date : <?php echo date('d-m-Y',strtotime($doc_data['issuing_date'])); ?>&nbsp;&nbsp;
                        </th>
                    </tr>
                </table>
            </div>
    
            <?php
            $acedemic_session_table='academic_session_details';
            $year_long='';
            $get_ac_sess_data=$this->CertificateModel->get_item_data($doc_data['acedemic_session'],$acedemic_session_table);
            if($get_ac_sess_data){
                foreach($get_ac_sess_data as $ac_sess_data){
                    $year_long=$ac_sess_data['year_long'];
                }
            }
            ?>
        
            <div style="width:100%;padding-top:20px;padding-left:15px;">
              <p>Certified that <b><u><?php echo $doc_data['student_name']; ?></u></b> <?php if($doc_data['gender'] == "male"){ echo "Son"; }else if($doc_data['gender'] == "female"){ echo "Daughter"; } ?> of <b><u>&nbsp;&nbsp;<?php echo $doc_data['salutation']." ".$doc_data['father_name']; ?></u></b> & <b><u><?php echo $doc_data['mother_name_salutation']." ".$doc_data['mother_name']; ?>&nbsp;&nbsp;</u></b> <?php if($doc_data['in_school'] == "yes" ){ echo "is"; }else if($doc_data['in_school'] == "no"){ echo "was"; }else { echo "is / was"; } ?> a bonafied Student of class <b><u>&nbsp;&nbsp;<?php echo $doc_data['course']; ?>&nbsp;&nbsp;</u></b> of the School from <b><u> &nbsp;<?php echo date('d-m-Y',strtotime($doc_data['admission_date'])); ?>&nbsp; </u></b> to <b><u>&nbsp;&nbsp;<?php echo date('d-m-Y',strtotime($doc_data['to_date'])); ?>&nbsp;&nbsp;</u></b></p>  
              <p><?php if($gender == "male"){ echo "He"; }else if($gender == "female"){ echo "She"; }  ?> <b><u><?php echo $doc_data['status']; ?></u></b> appeared in <b><u>&nbsp;&nbsp;<?php echo $doc_data['appeared_in']; ?>&nbsp;&nbsp;</u></b></p>
            </div>
        
        <div style="">
            <table class="table table-bordered" style="width:100%;">
                <tr style="width:100%;margin:0px;padding:0px;">
                    <th style="margin:0px;padding:0px;text-align:left">Date</th>
                    <th></th>
                </tr>
                <tr style="width:100%;margin:0px;padding:0px;">>
                    <th style="margin:0px;padding:0px;text-align:left;"><br>COUNTERSIGNED</th>
                    <th>Principal</th>
                </tr>
                
            </table>
            <!--Date : <br>-->
            <!--COUNTERSIGNED-->
        </div>
        
    </div>    
    </body>
</html>
    
<?php
    }
}
?>    