<?php include("parent/callMe.php"); ?>
<?php  include("sessioncheck.php");

        $m->where("branch_id", $_SESSION['branch']);
        $branch=$m->get("edu_branch_config");

        $m->where("student_id", $_REQUEST['student_id']);
        $student=$m->get("edu_student_details");

        $m->where("class_id", $student[0]['class_id']);
        $Class=$m->get("edu_class_config");


        $m->where("section_id", $student[0]['section_id']);
        $Section=$m->get("edu_adm_section_detail");

 ?>


 <?php 


function convertNumber($num = false)

{
    $num = str_replace(array(',', ''), '' , trim($num));
    if(! $num) {
        return false;
    }
    $num = (int) $num;
    $words = array();
    $list1 = array('', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven',
        'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'
    );
    $list2 = array('', 'ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety', 'hundred');
    $list3 = array('', 'thousand', 'million', 'billion', 'trillion', 'quadrillion', 'quintillion', 'sextillion', 'septillion',
        'octillion', 'nonillion', 'decillion', 'undecillion', 'duodecillion', 'tredecillion', 'quattuordecillion',
        'quindecillion', 'sexdecillion', 'septendecillion', 'octodecillion', 'novemdecillion', 'vigintillion'
    );
    $num_length = strlen($num);
    $levels = (int) (($num_length + 2) / 3);
    $max_length = $levels * 3;
    $num = substr('00' . $num, -$max_length);
    $num_levels = str_split($num, 3);
    for ($i = 0; $i < count($num_levels); $i++) {
        $levels--;
        $hundreds = (int) ($num_levels[$i] / 100);
        $hundreds = ($hundreds ? ' ' . $list1[$hundreds] . ' hundred' . ( $hundreds == 1 ? '' : '' ) . ' ' : '');
        $tens = (int) ($num_levels[$i] % 100);
        $singles = '';
        if ( $tens < 20 ) {
            $tens = ($tens ? ' and ' . $list1[$tens] . ' ' : '' );
        } elseif ($tens >= 20) {
            $tens = (int)($tens / 10);
            $tens = ' and ' . $list2[$tens] . ' ';
            $singles = (int) ($num_levels[$i] % 10);
            $singles = ' ' . $list1[$singles] . ' ';
        }
        $words[] = $hundreds . $tens . $singles . ( ( $levels && ( int ) ( $num_levels[$i] ) ) ? ' ' . $list3[$levels] . ' ' : '' );
    } //end for loop
    $commas = count($words);
    if ($commas > 1) {
        $commas = $commas - 1;
    }
    $words = implode(' ',  $words);
    $words = preg_replace('/^\s\b(and)/', '', $words );
    $words = trim($words);
    $words = ucfirst($words);
    $words = $words . ".";
    return $words;
}

?>

  <style type="text/css">



.center {
  margin-left: auto;
  margin-right: auto;
}

</style>
<div style="margin-left: 45px;" class="watermarked">
<div class="center"style="width:850px; height:600px; padding:20px; text-align:center; border: 10px solid #000">
<div style="width:800px; height:550px; padding:20px; text-align:center;     border: 6px solid #000;border-style: dotted;">
<br>


<div style="">
<div style="float: left;width: 20%;">

   <?php if($brid[0]['logo']!=NULL){ ?>
          
          <img src="<?php echo DOMAIN.AgentDirectory;?>img/<?php echo $brid[0]['logo'];?>" id="preview" class="img-thumbnail" style="width:100px;height:100px;"   />

       <?php }else { ?>   

           <img src="http://cdn.onlinewebfonts.com/svg/img_234957.png" id="preview" style="width:100px;height:100px;" class="img-thumbnail" />


       <?php } ?> 

</div>
<div style="float: left; width: 57%;font-size: 22px;text-transform: uppercase;
    font-size: 18px; font-weight: 600;">

    <?php echo $branch[0]['Branch_Name']; ?><br><br> <br>

    <span style="background: #ededed;
                padding: 10px 44px; 
                font-size: 23px;
                text-transform: uppercase;
                border-radius: 19px;
                border: 2px solid lightgray;">


    Sports Certificate</span>

    </div>

<div style="float: left;width: 20%;">
  <?php if($student[0]['image']!=NULL){ ?>

      <img src="<?php echo DOMAIN;?>Production/students_pics/<?php echo $student[0]['image'];?>" id="preview" class="img-thumbnail" style="width:100px;height:100px;"   />

   <?php }else { ?>   

       <img src="<?php echo DOMAIN;?>Production/images/upload.png" id="preview" height="100px" class="img-thumbnail" width="100px"  />


   <?php } ?>
</div>
</div>

     <br><br><br><br><br><br><br><br>

<div class="hr">

    <hr style="width: auto; border-style: dotted; " />
    <hr style="width: auto;border: 1px solid black;margin-top: -7px; " />

</div>
    <div style="margin-bottom: 5em;">
     <h3 style="text-align: left; float: left"> Sr No &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo date("Y"); ?> </h3>
     <h3 style="text-align: right; float: right"> GR NO. <u><?php echo $student[0]['ref_no'];?></u> </h3>
     </div>
     <p style="text-align:justify; font-size:18px; line-height: 2;">
      This is to certified that Mr/Ms <b><u><?php echo $student[0]['first_name'];?></u></b> Son/Daughter<u><b> <?php echo $student[0]['last_name'];?></b></u> by Religion <u><b> <?php echo $student[0]['religion'];?></b></u> R/O _____________________ took keen intrest in co-circular activities and was player of <b>Indoor/Outdoor</b> games of this School.<br><br> <b>He/She Has Been Bonafied Student of this School. </b>
       
     </p><br><br><br><br><br><br>

     <div style="font-weight: bold; text-align: right; margin-top: -4em; ">Principal Signature: _____________________________</div> 
<br><br>
     
</div>
</div>
</div>