<?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 #787878">
<div style="width:800px; height:550px; padding:20px; text-align:center; border: 5px solid #787878">
<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: 60%;font-size:30px; font-weight:bold">

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

  <br>

  <span style="font-size:14px; "><?php echo $branch[0]['Branch_Location5']; ?><br><br>

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


    Provisional 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 $student[0]['ref_no']." / ".date("Y"); ?> </h3>
     <h3 style="text-align: right; float: right"> GR NO. <i><?php echo $student[0]['ref_no'];?> </i> </h3>
     </div>
     
 
     <p style="text-align:justify; font-size:18px; line-height: 2;">
 
      This is to certified that Mr/Ms <u><b> <?php echo $student[0]['first_name'];?></b></u> 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 <u><b> <?php echo $student[0]['last_name'];?></b></u> Has been a Bonified Student of this School. He/She Has Passed <u><b> <?php echo $Section[0]['section_name'];?></b></u>(Class <u><b> <?php echo $Class[0]['Class_Name'];?></b></u>) Annual Exam <b><?php echo date("Y"); ?></b>  Held by <input type="text" name="" value="" placeholder="Board Name" style="font-weight: bold; border: none; text-align: center; font-size: 18px;"> in Science Group Under Seat No <input type="text" name="" value="" placeholder="Seat" style="width: 3em;font-weight: bold; border: none; text-align: center; font-size: 18px;"> With Grade <input type="text" name="" value="" placeholder="Grade" style="width: 3em; font-weight: bold; border: none; text-align: center; font-size: 18px;"> By Securing <u><b><input type="text" name="" value="" placeholder="Enter" style="width: 3em; font-weight: bold; border: none; text-align: center; font-size: 18px;"></b></u>(<b><input type="text" name="" value="" placeholder="Enter In Words" style="border: none; text-align: center; font-size: 18px;font-weight: bold;"></b>)  His/her behaviour was good with teachers and students. <br><br><br>
        I wish all success and prosperity in his/her life.
     </p><br><br><br><br>

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


</div>
</div>
</div>