<?php 
include("../db.php");

$res=$db->getRow("select * from student where school_id='".$_SESSION["admin"]["school_id"]."' and idno=".$_GET["id"]);
//	$res=$db->getRow("select * from newtc where tc_number='".$_GET["id"]."'");

if($_POST){
	$data=json_encode($_POST);
	
	 $tcnumber=$db->getVal("SELECT max(tc_number) FROM extra");
  $ptcnumber=$tcnumber+1;
//	$db->insertAry("extra",array("data"=>$data,"school_id"=>$_SESSION["admin"]["school_id"],"tc_number"=>$ptcnumber, "added_by"=>$_SESSION["admin"]["uid"],
//"idno"=>$_GET["id"],"type"=>"tc"));
$value=array(
   "data"=>$data 
     );


 $flgIn=$db->updateAry("cc_extra",$value,"where idno='".$_GET["id"]."'");

	echo $db->getErMsg();
}

	
	
	$detail=$db->getVal("select data from cc_extra where school_id='".$_SESSION["admin"]["school_id"]."' and idno='".$_GET["id"]."' and type='tc'");
//echo 	$ss="select data from extra where school_id='".$_SESSION["admin"]["school_id"]."' and idno='".$_GET["id"]."' and type='tc'";
if($detail!=""){
	$idata=json_decode($detail,true);
}
//print_r($idata);
//print_r($detail);
?>
<form  method="post">
<table border="0" width="100%" class="tc">
  <tr>
    <td colspan="3" align="center" style="color:blue;"><h1>TRANSFER CERTIFICATE </h1></td>
    </tr>
  <tr>
    <td colspan="3">
    <div style="margin:3px; padding:5px 5px; width:235px; float:right">
   
</div>
   <!-- <div style="margin:3px; padding:	5px 5px; width:200px"> TC-No. <span class="span" style="width:100px"> !-->
      
    
    </td>
    </tr>
  
  <tr>
  <?php
    
  $detail=$db->getVal("SELECT max(tc_number) FROM newtc");
 // echo $ss="SELECT max(tc_number) FROM newtc";
    ?>
	<td colspan="3"> 
  <span class="name" style="font-size:18px;">This is to certify that Master/Miss:</span> <span class="txt" style="font-size:18px; width:280px; border-bottom-style: dotted; #333;"><?php echo $res["name"] ?></span></br></br>
        
  <span class="name" style="font-size:18px;">Son/Daughter Of Shri: </span><span class="txt"  style="font-size:18px; width:250px; border-bottom-style: dotted; #333;"><?php echo $res["fname"] ?></span> 
  <span class="name" style="font-size:19px;"> Roll No. :</span> </br></br><span class="txt" style="font-size:18px; width:100px;border-bottom-style: dotted; #333;"><?php echo $res["feducation"] ?></span>
    <span class="name" style="font-size:19px;"> has been a bonafide Student of this school.&nbsp;He/She has</br></br> passed All India Secondary /Senior Secondary School Examination</br></br> held in the month of <span  class="txt" style="font-size:16px; border-bottom-style: dotted; #333;"><b>March 2020.</b></span>&nbsp;<span class="name" style="font-size:18px;">to the best of my knowledge, </br></br>he/she bear a good moral character, during the session .<br /><br />  
   
  
        <span style="font-size:16px; font-family: serif;"><span style="width:95px style="font-size:16px; font-family: serif; 	font-weight:bold;">&nbsp;</span> <br /><b>Date.<input type="text" style="font-size:16px;" class="txt" name="cdate" value="<?php echo $idata["cdate"] ?>" /></b></span>
  
   <br> <br> <br>
 <?PHP    


session_start();




if($flgIn>0)
{
?>	
<!--<a class="button" href="print/?page_id=tc&action=print&id=<?PHP  echo $_GET["id"];?> " >PRINT TC</a>'; !-->
echo "<script>alert('your data edited');document.location='print/?page_id=cc&action=print&id=<?PHP  echo $_GET["id"];?>'</script>";


<?php }

else

{
?>
<input type="submit" name="SUBMIT">
<?php
}	
 ?>
</td>
    </tr>
 

</table>
</form>
<style>
.button {
    display: block;
    width: 115px;
    height: 25px;
    background: #4E9CAF;
    padding: 10px;
    text-align: center;
    border-radius: 5px;
    color: white;
    font-weight: bold;
}
</style>
<style>
input[type="text"]
{
    border: 0;
  outline: 0;
  background: transparent;
  border-bottom: 1px solid black;
}

input[type="date"]
{
    border: 0;
  outline: 0;
  background: transparent;
  border-bottom: 1px solid black;
}
textarea name[type="address"]
{
    border: 0;
  outline: 0;
  background: transparent;
  border-bottom: 1px solid black;
}
</style>
<?php

 
//print_r($value);

?>
<SCRIPT>
$(document).ready(function(){
    $("a.submit").click(function(){
        document.getElementById("myForm").submit();
    }); 
});
</SCRIPT>
