<?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){
        
        $gender=$doc_data['gender'];
        
        $acedemic_session_table='academic_session_details';
        $year_long='';
        $y1='';
        $y2='';
        // $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'];
        //         $y1=$ac_sess_data['y1'];
        //         $y2=$ac_sess_data['y2'];
        //     }
        // }
?>
<!DOCTYPE html>
<html>
    <head>
        <title>Student Character Certificate</title>
        <style>
            /*<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"> */
            
            <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=Inconsolata:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
            
            .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:60px;width:auto;}
            html{padding:0px;margin:0px;}
            body{padding:25px;margin:0px;font-size:13px;
            /*font-family: 'Exo 2', sans-serif !important;*/
                font-family: 'Inconsolata', monospace; 
            }
        </style>
    </head>
    <body>
        <div class="w-100" style="border:1px solid;">
            <div style="width:100%;text-align:center;margin:0px;padding:0px;height:110px;;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;">
                </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;">Hanspuram Naubasta , Kanpur</h2>
                    
                    <h2 style="padding:0px;margin:0px;font-size:18px !important;font-weight:700 !important;letter-spacing:2px;">Contact - 0512-3561186</h2>
                </div>   
            </div>
            <br>
            <div style="width:100%;margin:0px;padding:0px; text-align:center;">
                <span style="padding:15px;font-size:22px;font-weight:700;border:2px solid;">Character Certificate</span>
            </div>
        
            <div style="width:100%;">
            
                <div style="width:100%;float:left;padding-left:20px;">
                    <table style="padding:0px;width:100%;">
                        <tr style="width:100%;margin:0px;padding:0px;">
                            <th style="text-align:left;font-size:18px;">Sl. No. : <?php echo $doc_id;?></th>
                            <th style="text-align:right;font-size:18px;">Date : <?php echo date('d-m-Y',strtotime($doc_data['issuing_date'])); ?>&nbsp;&nbsp;</th>
                        </tr>
                    </table>
                </div>    
            </div>  
        
        
            <div style="width:100%;padding:20px;">
              <p style="line-height:25px;font-size:18px;">Certified that <b><u style="text-transform:uppercase;"><?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 style="text-transform:uppercase !important;">&nbsp;&nbsp;<?php echo $doc_data['salutation']." ".$doc_data['father_name']; ?></u></b> & <b><u style="text-transform:uppercase;"><?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 bonafide 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 style="line-height:25px;font-size:18px;"><?php if($gender == "male"){ echo "He"; }else if($gender == "female"){ echo "She"; }  ?> <b><u><?php echo $doc_data['status']; ?></u></b> in <b><u>&nbsp;&nbsp;<?php echo $doc_data['appeared_in']; ?>&nbsp;&nbsp;</u></b> Examination year <b><u>&nbsp;&nbsp; <?php echo $doc_data['examination_year']; ?> &nbsp;&nbsp;</u> .</b> During the above period <?php if($doc_data['gender'] == "male"){ echo "his"; }else if($doc_data['gender'] == "female"){ echo "her"; } ?> conduct was found to be <?php echo $doc_data['conduct']; ?>.</p>
              <p style="line-height:25px;font-size:18px;"><?php if($doc_data['gender'] == "male"){ echo "He"; }else if($doc_data['gender'] == "female"){ echo "She"; } ?> bears a good moral character.</p>
            </div>
        
        
            <div style="width:100%;padding:20px;text-align:right;font-size:22px;font-weight:600;">
                <b>Principal</b>
            </div>
        
        </div>
        <hr>
        <div class="w-100" style="border:1px solid;">
            <div style="width:100%;text-align:center;margin:0px;padding:0px;height:110px;;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;">
                </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;">Hanspuram Naubasta , Kanpur</h2>
                    
                    <h2 style="padding:0px;margin:0px;font-size:18px !important;font-weight:700 !important;letter-spacing:2px;">Contact - 0512-3561186</h2>
                </div>   
            </div>
            <br>
            <div style="width:100%;margin:0px;padding:0px; text-align:center;">
                <span style="padding:15px;font-size:22px;font-weight:700;border:2px solid;">Character Certificate</span>
            </div>
        
            <div style="width:100%;">
            
                <div style="width:100%;float:left;padding-left:20px;">
                    <table style="padding:0px;width:100%;">
                        <tr style="width:100%;margin:0px;padding:0px;">
                            <th style="text-align:left;font-size:18px;">Sl. No. : <?php echo $doc_id;?></th>
                            <th style="text-align:right;font-size:18px;">Date : <?php echo date('d-m-Y',strtotime($doc_data['issuing_date'])); ?>&nbsp;&nbsp;</th>
                        </tr>
                    </table>
                </div>    
            </div>  
        
        
            <div style="width:100%;padding:20px;">
              <p style="line-height:25px;font-size:18px;">Certified that <b><u style="text-transform:uppercase;"><?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 style="text-transform:uppercase !important;">&nbsp;&nbsp;<?php echo $doc_data['salutation']." ".$doc_data['father_name']; ?></u></b> & <b><u style="text-transform:uppercase;"><?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 bonafide 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 style="line-height:25px;font-size:18px;"><?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> Examination year <b><u>&nbsp;&nbsp; <?php echo $doc_data['examination_year']; ?> &nbsp;&nbsp;</u> .</b> During the above period <?php if($doc_data['gender'] == "male"){ echo "his"; }else if($doc_data['gender'] == "female"){ echo "her"; } ?> conduct was found to be <?php echo $doc_data['conduct']; ?>.</p>
              <p style="line-height:25px;font-size:18px;"><?php if($doc_data['gender'] == "male"){ echo "He"; }else if($doc_data['gender'] == "female"){ echo "She"; } ?> bears a good moral character.</p>
            </div>
        
        
            <div style="width:100%;padding:20px;text-align:right;font-size:22px;font-weight:600;">
                <b>Principal</b>
            </div>
        
        </div>
    </body>
</html>
    
<?php
    }
}
?>    