<?php 

include("dbconfig.php");

session_start();

if(!isset($_SESSION['login_user']))

	{

	header("Location: login.php");

	}

	$login_type=$_SESSION['login_type'];

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Print ID CARD</title>

</head>

<body>

 <script type="text/javascript" src="js/connectcode-javascript-code128c.js"></script>

    <style type="text/css">

  	#barcode {font-weight: normal; font-style: normal; line-height:normal; sans-serif; font-size: 12pt}

    </style><style>



td{



font-family:Verdana, Arial, Helvetica, sans-serif;



font-size:10px;

text-transform:capitalize;

}









table



{



   



    border-spacing: 0;



    border-collapse: collapse;



}







td



{



    margin: 0;



    padding: 0px;



   



   



}



.style3 {color: #0000CC; font-weight: bold; }



    </style>



<?php 



$rollno=$_GET['rollno'];







//$rollno='13401,13402';



$check_exist_qry1="select * from class2 where college_roll='$rollno' and pay_fee!='' and checked_by!='' and session='$session' and code='$code'";



$run_qry1=mysql_query($check_exist_qry1);



$total_found1=mysql_num_rows($run_qry1);



//$roww = mysql_fetch_array($run_qry1, MYSQL_BOTH);







while ($roww = mysql_fetch_array($run_qry1)){



   $code=$roww['college'];

   $college_type=$roww['CourseType'];

   $course_type=$roww['Course'];

   $sem_yer=$roww['Course_Details'];

   $roll_no=$roww['college_roll'];

   $pay_fee=$roww['pay_fee'];



$check_exist_qry2="select * from id_card where rollno='$roll_no' and session='$session' and code='$code'";

$run_qry2=mysql_query($check_exist_qry2);

$total_found2=mysql_num_rows($run_qry2);

$rowwpp = mysql_fetch_array($run_qry2, MYSQL_BOTH);

$rtt=$rowwpp['issue_no_id'];

//echo $rtt.'*******************';



if($rtt!=""){



	



	if (function_exists('date_default_timezone_set'))



{



  date_default_timezone_set('Asia/Kolkata');



}







$datee=date('Y-m-d');



	$issue_no_id=2;

//

//	$ins_qry_cpr="INSERT INTO `id_card` (`rollno`, `issuedate`, `checked_by`, `code`, `college_type`, `course_type`, `sem_yer`, `issue_no_id`) VALUES ('$rollno', '$datee', '$login_session', '$code', '$college_type', '$course_type', '$sem_yer', '$issue_no_id')";

//$retval_challan = mysql_query($ins_qry_cpr);



	$rs_activ = mysql_query("update id_card set issuedate='$datee',issue_no_id='$issue_no_id' WHERE rollno='$roll_no' and session='$session' and code='$code'") or die(mysql_error());



	



	}else{

	echo "---------------------";



	if (function_exists('date_default_timezone_set'))



{



  date_default_timezone_set('Asia/Kolkata');



}







$datee=date('Y-m-d');



	$issue_no_id=1;



	$ins_qry_cpr="INSERT INTO `id_card` (`rollno`, `issuedate`, `checked_by`, `code`, `college_type`, `course_type`, `sem_yer`, `issue_no_id`, `session`) VALUES ('$roll_no', '$datee', '$login_session', '$code', '$college_type', '$course_type', '$sem_yer', '$issue_no_id', '$session')";

	$retval_challan = mysql_query($ins_qry_cpr);



	}



	



	



//echo $frn;



if(($pay_fee!="")&&($roll_no!="")){



//echo "*************";







$college_roll=$roww['college_roll'];



$check_exist_qry2="select * from class2 where college_roll='$college_roll' and session='$session' and code='$code'";



$run_qry2=mysql_query($check_exist_qry2);



$total_found2=mysql_num_rows($run_qry2);



$rowww = mysql_fetch_array($run_qry2, MYSQL_BOTH);



							

$queryyo = "SELECT * FROM college_info where code='$code'";

$numresultsyo=mysql_query($queryyo);

$resultyo= mysql_query($queryyo) or die("Couldn't execute query");

$a_rowwo = mysql_fetch_row( $resultyo );



?>







<table width="100%" border="0" cellspacing="2" cellpadding="2" style="border:2px #990000 solid; height:8cm; width:23cm; background-image:url(water_mark.png); background-repeat:repeat;">

          <tr>

            <td style="width:11.4cm; height:7cm;"><table width="100%" border="0" cellspacing="0" cellpadding="2">

              <tr>

                <td><div align="center"><img src="../<?php echo $a_rowwo['4']; ?>" width="74" height="82" /></div></td>

                <td><div align="center" style="text-transform:capitalize; font-size:13px; color:#FF0000;text-shadow: .9px .9px #999999;"><strong><?php echo $a_rowwo['2']; ?><br />

                  ( <?php echo $a_rowwo['1']; ?>)</strong></div>

                  <div align="center" style="font-size:13px"><?php echo $a_rowwo['3']; ?></div>

                  

                  <div align="center" style="font-size:10px; color:#990000"> ( Affiliated to Dr. Ram Manohar Lohia Avadh University, Faizabad )</div></td>

              </tr>

              <tr>

                <td>&nbsp;</td>

                <td>&nbsp;</td>

              </tr>

              <tr>

                <td><div align="center" style="height:100px; width:88px; background-image:url(../uploads/<?php  $p=$rowww['class_std_ing']; 



		$p = str_replace(' ', '%20', $p);echo $p;?>); background-position:top; background-repeat:no-repeat; background-size: 100%;"><br /><br /><br /><br /><br /><br /><?php if($p!=""){ ?><img src="../<?php echo $a_rowwo['5']; ?>" width="126" height="57" style="text-align:center;" align="bottom" /><?php } ?></div>

        <div style="font-size:11px;" align="center"><strong>.</strong><br />

         

        </div></td>

                <td align="center"><table width="95%" border="0" cellspacing="2" cellpadding="2">

                  <tr>

                    <td colspan="2"><div align="center" style="color:#FF0000; font-weight:bold">Identity Card (<?PHP echo $rowww['session']; ?>)

                      <?php

          	  

          $queryy = "SELECT * FROM course_name where college_id='$code' && id='$course_type' and session=$session";

$numresultsy=mysql_query($queryy);

$resulty= mysql_query($queryy) or die("Couldn't execute query");

$a_rowwx = mysql_fetch_array( $resulty );



echo $a_rowwx['course_name'];



 ?>

                        <?PHP echo $rowww['Course_Details']; ?> -  Year<br />

                        <?php if($rtt!=""){?>

                      Duplicate

  <?php }?>

                    </div></td>

                    </tr>

                  <tr>

                    <td colspan="2" style="font-size:14px;"><div align="center"><strong>

                    <?php  

	 $queryyu = "SELECT * FROM fverify where croll_on='$rpp' and session='$session' and code='$code'";

$numresultsyu=mysql_query($queryyu);

$resultyu= mysql_query($queryyu) or die("Couldn't execute query");

$a_rowwu = mysql_fetch_row($resultyu); 

$sff=$a_rowwu[2];



 ?>

                    <?php $check_exist_qryxre="select * from uroll where form='$sff' and session=$session and codee=$code";



$run_qryxre=mysql_query($check_exist_qryxre);



$total_foundxre=mysql_num_rows($run_qryxre);



$rowwxre = mysql_fetch_array($run_qryxre, MYSQL_BOTH);



	echo $roll=$rowwxre['roll'];

 ?>

                    </strong></div></td>

                  </tr>

                  <tr>

                    <td><strong>College Roll No.</strong></td>

                    <td><?php echo $roww['college_roll']; ?></td>

                  </tr>

                  <tr>

                    <td><strong>Student Name</strong></td>

                    <td><span class="style3"><?php echo $rowww['StudentName']; ?> (<?php echo $rowww['Student_Type']; ?>)</span></td>

                  </tr>

                  <tr>

                    <td><strong>Father's Name</strong></td>

                    <td><span class="style3"><?php echo $rowww['FatherName']; ?></span></td>

                  </tr>

                  <tr>

                    <td><strong>Date of Birth</strong></td>

                    <td><span class="style3"><?php echo $rowww['txt_dob']; ?></span></td>

                  </tr>

                  <tr>

                    <td><strong>Category</strong></td>

                    <td><span class="style3"><?php echo $rowww['Category']; ?></span></td>

                  </tr>

                </table></td>

              </tr>

            </table></td>

            <td style="width:.1cm; height:7cm; border-left:1px #000000 solid">&nbsp;</td>

            <td style="width:11.5cm; height:7cm;"><table width="100%" height="100%" border="0" cellspacing="2" cellpadding="0">

              <tr>

                <td colspan="2" align="center">

				<div id="barcodecontainer" style="width:3.5in; height:1in; text-align:center">

<div id="barcode" ><?php echo $roww['college_roll']; ?></div>

</div>



<br />



<script type="text/javascript">

/* <![CDATA[ */

  function get_object(id) {

   var object = null;

   if (document.layers) {

    object = document.layers[id];

   } else if (document.all) {

    object = document.all[id];

   } else if (document.getElementById) {

    object = document.getElementById(id);

   }

   return object;

  }

get_object("barcode").innerHTML=DrawHTMLBarcode_Code128C(get_object("barcode").innerHTML,"yes","in",0,3,1,"bottom","center","","black","white");

/* ]]> */

</script>

				

				

				

				<?php /*?><img src="https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl=[College No.-<?php echo $roww['college_roll']; ?>/Name-<?php echo $rowww['StudentName']; ?>/Father Name - <?php echo $rowww['FatherName']; ?>/Date of Birth - <?php echo $rowww['txt_dob']; ?>]&choe=UTF-8"  width="50" height="50" style="border:1px #000000 solid"/><?php */?>                </td>

                </tr>

              <tr>

                <td width="26%"><strong>Subject Applied</strong></td>

                <td width="74%"><span class="style3"><?php echo $rowww['class_app']; ?></span></td>

              </tr>

              <tr>

                <td><strong>Contact No </strong></td>

                <td><?php echo $rowww['MobileNO'];?>/<?php echo $rowww['mno2'];?></td>

              </tr>

              <tr>

                <td><strong>Address</strong></td>

                <td><span style="font-size:10px"><span class="style3"><strong>House No.:</strong> <?php echo $rowww['txtHouseNo'];?>, <strong>Street/Village: </strong><?php echo $rowww['txtStreet'];?><strong> Post Office :</strong><?php echo $rowww['txtPostOffice'];?>, <strong>District/City :<?php echo $rowww['txtDistrict0'];?></strong> <strong>State : </strong><?php echo $rowww['txtState'];?>&nbsp;&nbsp;<strong>PIN :</strong> <?php echo $rowww['txtPinCode'];?></span></span></td>

              </tr>

              <tr>

                <td colspan="2" style="font-size:8px; color:#FF0000"><strong>1.छात्र छात्राओं की उपस्थिति 75% होनी चाहिए | छात्र छात्राओं को परीक्षा फार्म स्वयं भरना होगा अन्यथा महाविद्यालय की कोई जिम्मेदारी नहीं होगी |  छात्रवृत्ति ,परीक्षा फार्म प्रयोगात्मक ,परीक्षा  संबंधी व महाविद्यालय संबंधित समस्त जानकारी के लिए वेबसाइट पर संपर्क करें</strong></td>

              </tr>

            </table></td>

          </tr>

        </table>











<br>





<?php } else{ ?>



<div align="center" style="color:#FF0000; font-size:24px">I Card Already Print - <?php echo $roll_no; ?></div>



<?php 

}}?>



</body>

</html>

