D:\host\scoreman.in\assisiinterschool2025closed\SearchApplications.php

<?php
include('dbconnect.php');
include('jfunctions.php');

function auto_version($file)
{
 // if(strpos($file, '/') !== 0 || !file_exists($_SERVER['DOCUMENT_ROOT'] . $file))
 
//    return $file;

  //$mtime = filemtime($file);
 // return preg_replace('{\\.([^./]+)$}', ".$mtime.\$1", $file);

$appvers=6;
return $file."?version=".$appvers;
}


?>
<!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" />

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css" />
		<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.css" />
		<link rel="stylesheet" href="vendor/waves/waves.min.css" />
		<link rel="stylesheet" href="css/nativedroid2.css" />
        <link rel="stylesheet" href="css/cbstyle.css" />
      	<link rel="stylesheet" href="vendor/wow/animate.css" />
		
		<!-- <link rel="stylesheet" type="text/css" href="../css/sparkle.css">  

		
		<style>
	/*	//*[@id="entryform"]/div[1]/div[3]/div/div/div[1]
		#entryform > div:nth-child(1) > div:nth-child(3) > div > div > div 
		{
			content:"";
			display:none !important;
			width:50% !important;
			height:0px !important;
		}*/
		</style>-->


<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
		<script src="//code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
		<script src="//ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.js"></script>
		<script src="vendor/waves/waves.min.js"></script>
        
      <script src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
        
        
        <script src="vendor/wow/wow.min.js"></script> 
		<script src="js/nativedroid2.js"></script>
		<script src="nd2settings.js"></script>
        
         <script src="js/jquery.cropit.js"></script>
         <script type="text/javascript" src="<?php echo auto_version('j.js'); ?>"></script>
         
         
           

	
  
  <script type="text/javascript">
  
   window.onload = function () {
	   var lastScrollTop = $.cookie('last-scroll-top');
	//    alert(lastScrollTop);
if (lastScrollTop) {
    $(window).scrollTop(lastScrollTop);
//	$(window).scroll(0,lastScrollTop);
	
	// alert("final"+ $(window).scrollTop());
    $.removeCookie('last-scroll-top');
}
   }
    $(function() {
        $('.image-editor').cropit();
		
		 $('.rotate-cw').click(function() {
          $('.image-editor').cropit('rotateCW');
        });
        $('.rotate-ccw').click(function() {
          $('.image-editor').cropit('rotateCCW');
        });


        $('#entryform').submit(function() {
          // Move cropped image data to hidden input
	//	    var w = window.open();
			
          var imageData = $('.image-editor').cropit('export');
          $('.hidden-image-data').val(imageData);
		  
		 if(checkform()==false)
		 {
			 return false;
			 
			 }

          // Print HTTP request params
        //  var formValue = $(this).serialize();
        //  $('#result-data').text(formValue);
		$.mobile.loading( "show", {
  text: "Submitting...",
  textVisible: true,
  theme: "z",
  html: ""
});
		$.ajax({
        url: 'register.php',
        type: 'post',
        dataType: 'text',
        data: $('#entryform').serialize(),
        success: function(data) {
                  alert(data);
			//	 $(w.document.body).html(data);
				 
				 clearform();
			 location.reload();
                 }
    });
	

          // Prevent the form from actually submitting
          return false;
        });
      });
	  


</script>



<title>KRSA 2017</title>

<style>
      
	    .cropit-preview {
        background-color: #f8f8f8;
        background-size: cover;
        border: 1px solid #ccc;
        border-radius: 3px;
        margin-top: 7px;
        width: 276px;
        height: 354px;
      }

      .cropit-preview-image-container {
        cursor: move;
      }

      .image-size-label {
        margin-top: 10px;
      }

      input {
       /* display: block;*/
      }

      button[type="submit"] {
        margin-top: 10px;
      }

      #result {
        margin-top: 10px;
        width: 900px;
      }

      #result-data {
        display: block;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        word-wrap: break-word;
      }
<style>
@media print
{    
    .no-print, .no-print *
    {
        display: none !important;
    }
	
	table
{
font-size:10px;
max-width:60%;
}

}



/*table, th, td {
    border: 1px solid black;
}


table
{
	font-family:Verdana, Geneva, sans-serif;
    border-collapse: collapse;
}
			th
			{
				background-color:#EBEBEB;
				color:#00F;
				text-align: center;
				vertical-align: bottom;
				height: 100px;
				padding-bottom: 3px;
				padding-left: 0px;
			padding-right: 0px;
			
			}
			td{
				text-align:center;
padding-bottom: 3px;
padding-top: 3px;
			} */
			tr:nth-child(even) {
    background-color:#F1F1F8;
}

table
{
font-size:11px;
max-width:100%;
margin:0px;
}
table, th, td {
    border: 1px solid #ccc;
}



	th{
text-align: center;
				vertical-align: middle;
				height: 110px;
				padding-bottom: 3px;
				padding-left: 0px;
			padding-right: 0px;
				
			
background-color:#E6E6E6;

	}
   


			.verticalText
			{
				/*font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;*/
				font-size:11px;
				text-align: left;
				vertical-align: bottom;
				width: 12px;
				margin:0px;
				margin-top:60px;
				padding: 0px;
				padding-left: 0px;
				padding-right: 0px;
				padding-top: 0px;
				
			
				white-space: nowrap;
				-webkit-transform: rotate(-90deg); 
				-moz-transform: rotate(-90deg);  				
			};
		</style>
       <h2></h2>
</head>

<body>


 <div data-role="page" id="login" data-url="login">  

<div data-role="header" style="overflow:hidden;">
<h1>33rd STATE ROLLER SKATING CHAMPIONSHIP & SELECTION TRIALS - 2017</h1>
      </div><!-- /header -->
 
 

<div data-role="main" class="ui-content">
<?php
	$club=$_SESSION["username"];
	
	if($club !="")
	{
	//	echo $club;
		?>
		<script type="text/javascript">
window.location = "SearchApplications.php#page1";
</script>
<?php
	}
	else
	{
		?>
		
		
		<div class="row">
    <!-- Lead story block -->
    
    <!-- secondary story block #1 -->
     <div class="col-xs">
        <div class="box">
            <center>
		<img src="jimages/logo.png" style="margin: 10px auto 0;    max-width: 30vh;    width: 80%;    display: block;">
		<p><h3>KARNATAKA ROLLER SKATING ASSOCIATION</h3>
Affiliated to Roller Skating Federation of India<br/>
Recognized by Sports Authority of Karnataka</p>
<h3>33rd State Roller Skating Championship and Selection Trials </h3>
<h2><span style="{    font-family: Montez !important;    font-size: 1.9em;    font-weight: 300;    margin: 0 0.3em;    color: #ff0080;}">Mangaluru - 2017</span></h2>
<h4>24th to 27th Nov. 2017</h2> 
<!--<a onclick="$('#venue').show();"><button>Venue</button></a>-->
<a href="#"><button>Tentative Schedule</button></a>


<div id="venue" style="display:none">

<p align="center">
<div style="max-width:920px; left:0; right:0; margin:auto;">
Dear all, <br/><strong>Venue Details will be updated shortly.</strong>
</div></p></div>



</center>
        </div>
    </div>
	
	<div class="col-xs">
        <div class="box">
           <div class="nd2-card" >

					<div class="card-media">
						
					</div>

					<div class="card-supporting-text">
						

				
  <form name="login-form" class="login-form" action="dashboard.php" method="post"  >
  <div style="padding:10px 20px; padding-left:100p">
            <h3>Please sign in</h3>
			<div class="ui-field-contain">
    

            <label for="district" >Username:</label>
            
			 <select  name="username" id="district" required="required" data-theme="a">

<option>Bagalkot</option>
<option>Bangalore Urban</option>
<option>Bangalore Rural</option>
<option>Belgaum</option>
<option>Bellary</option>
<option>Bidar</option>
<option>Bijapur</option>
<option>Chamarajanagar</option>
<option>Chikballapur</option>
<option>Chikmagalur</option>
<option>Chitradurga</option>
<option>Dakshina Kannada</option>
<option>Davanagere</option>
<option>Dharwad</option>
<option>Gadag</option>
<option>Gulbarga</option>
<option>Hassan</option>
<option>Haveri</option>
<option>Kodagu</option>
<option>Kolar</option>
<option>Koppal</option>
<option>Mandya</option>
<option>Mysore</option>
<option>Raichur</option>
<option>Ramanagara</option>
<option>Shimoga</option>
<option>Tumakuru</option>
<option>Udupi</option>
<option>Uttara Kannada</option>
<option>Yadgir</option>

  
    </select> 
	
	</div>
	
	<div class="ui-field-contain">
            <label for="password" class="ui-hidden-accessible">Password:</label>
            <input type="password" name="password" id="password" value="" placeholder="password" data-theme="a">
			
			</div>
			<div class="ui-field-contain">
            <button type="submit" class="ui-btn ui-corner-all ui-shadow clr-btn-green ui-btn-icon-left ui-icon-check">SUBMIT</button>
				</div>
        </div>
    </form>
	
	
	



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

		

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


 <div data-role="page" id="circulars" data-url="circulars">  

<div data-role="header" style="overflow:hidden;">
<h1>Circulars</h1>
      </div><!-- /header -->
 
 

<div data-role="main" class="ui-content">
<h3>Coming Soon..</h3>
</div>
</div>


<div data-role="page" id="page1" data-url="page1"> 

<div data-role="header" style="overflow:hidden;">
<h1>33rd STATE ROLLER SKATING CHAMPIONSHIP & SELECTION TRIALS - 2017</h1>
       <div data-role="navbar">
        <ul>
            <li><a href="SearchApplications.php">Entries</a></li>
            <li><a href="#">Circulars</a></li>
            <li><a href="logout.php">Logout <?php echo $_SESSION["username"] ?></a></li>
        </ul>
    </div><!-- /navbar -->
</div><!-- /header -->
 
 

<div data-role="main" class="ui-content">

<?php

//if ($_SERVER['REQUEST_METHOD'] == 'POST')
//{
	
	//$skey=$_POST["skey"];
	//$club=$_POST["club"];
	$club=$_SESSION["username"];
	
	if($club =="secretary")
	{
		echo "Team Wise Entries <br/><table border=1>";
		$databaseQuery = 'SELECT club,count(*) as c FROM applications group by club';
	$result = mysqli_query($con,$databaseQuery) or die('Query failed: ' . mysqli_error());
	while($row = mysqli_fetch_array($result))
  {
	   echo "<tr><td>".$row["club"]."</td><td>".$row["c"]."</td><td class='no-print'><a  href='SearchApplications.php?team=".$row["club"]."&stype=all'>View List</a></td></tr>";
  }
  echo "</table>";
  
  echo "Summary <br/><table border=1>";
		$databaseQuery = 'SELECT  status,count(appno) as c FROM applications group by status order by c desc';
	$result = mysqli_query($con,$databaseQuery) or die('Query failed: ' . mysqli_error());
	while($row = mysqli_fetch_array($result))
  {
	  if($row["status"]!="")
	  {
	   echo "<tr><td>".$row["status"]."</td><td>".$row["c"]."</td></tr>";
	  }
	  else
	  {
		  	   echo "<tr><td>Unverified</td><td>".$row["c"]."</td></tr>";
		  }
  }
  echo "</table>";
echo "Participation Summary <br/><table border=1>";
		$databaseQuery = 'SELECT  skatertype,count(appno) as c FROM applications group by skatertype order by c desc';
	$result = mysqli_query($con,$databaseQuery) or die('Query failed: ' . mysqli_error());
	while($row = mysqli_fetch_array($result))
  {
	  if($row["skatertype"]!="")
	  {
	   echo "<tr><td>".$row["skatertype"]."</td><td>".$row["c"]."</td></tr>";
	  }
	  else
	  {
		  	   echo "<tr><td>Unverified</td><td>".$row["c"]."</td></tr>";
		  }
  }
  echo "</table>";
	
	
	
	if ($_SERVER['REQUEST_METHOD'] == 'GET')
{
	$club=$_GET['team'];
	$skey=$_GET['team'];
	$stype=$_GET['stype'];
	if($stype=="" || $stype=="all")
	{
		$stype="%";
		}
	
	$databaseQuery = 'SELECT * FROM applications WHERE (skatertype like "%'.$stype.'%") and (club like "%'.$con->real_escape_string($club).'%")  order by LTRIM(RTRIM(agorder)),LTRIM(RTRIM(gender)) desc,LTRIM(RTRIM(skatertype)),CONVERT(LTRIM(RTRIM(appno)),UNSIGNED INTEGER)';
	
	$result2 = mysqli_query($con,$databaseQuery) or die('Query failed: ' . mysqli_error());
	$skey=$club;
	
	 echo "Summary for ".$club."<br/><table border=1>";
		$databaseQuery = 'SELECT  status,count(appno) as c FROM applications  WHERE (club like "%'.$con->real_escape_string($club).'%")  group by status order by c desc';
	$result = mysqli_query($con,$databaseQuery) or die('Query failed: ' . mysqli_error());
	while($row = mysqli_fetch_array($result))
  {
	  if($row["status"]!="")
	  {
	   echo "<tr><td>".$row["status"]."</td><td>".$row["c"]."</td></tr>";
	  }
	  else
	  {
		  	   echo "<tr><td>Unverified</td><td>".$row["c"]."</td></tr>";
		  }
  }
  echo "</table>";
  
  
}
else
{
	
	$databaseQuery = 'SELECT * FROM applications WHERE (skatertype like "%'.$stype.'%")  order by agorder,gender desc,skatertype,CONVERT(appno,UNSIGNED INTEGER) ';
	$result = mysqli_query($con,$databaseQuery) or die('Query failed: ' . mysqli_error());
	
	$skey="All Applications";
	$stype="%";
}
	}
	else if($club !="")
	{
		$stype="%";
		if ($_SERVER['REQUEST_METHOD'] == 'GET')
{
	//$club=$_GET['team'];
//	$skey=$_GET['team'];
	$stype=$_GET['stype'];
	if($stype=="" || $stype=="all")
	{
		$stype="%";
		}
}
	
	$databaseQuery = 'SELECT * FROM applications WHERE (skatertype like "%'.$stype.'%") and (club like "%'.$con->real_escape_string($club).'%")  order by agorder,gender desc,skatertype,CONVERT(appno,UNSIGNED INTEGER)';

	$result2 = mysqli_query($con,$databaseQuery) or die('Query failed: ' . mysqli_error());
	$skey=$club;
	}
	else
	{
		echo 'Please Enter Correct Login Credentials..';
		// window.location = "SearchApplications.php#login";
						loginbox();
						?>
						
						<a href="#login" data-rel="popup" data-position-to="window" data-role="button" data-inline="true" data-transition="pop"><i class='lIcon fa fa-external-link'></i> Official Login</a>
<script type="text/javascript">

//$(document).on("pagecreate","#page1", function(){ 
   
    //    $("#popupDialog").popup("open"); 
       
//});

</script>



<?php
					 exit();
		}
		if (function_exists('date_default_timezone_set'))
{
 date_default_timezone_set('Asia/Calcutta');
}
if($stype=="%")
	{
		$stype="all";
		}
		echo '<p class="font2"> ' .mysqli_num_rows($result2) . ' Results found for "'.$club.'", "'.$stype.'" as on '.date('d-m-Y  h:i:s A').'.</p>';
		echo '<h5 class="no-print">Filters: ';
	echo '<a class="ui-btn ui-btn-inline ui-btn-raised ui-mini" href="SearchApplications.php?team='.$club.'&stype=Tenacity">Tenacity</a>&nbsp;&nbsp;|&nbsp;&nbsp;';
		echo '<a class="ui-btn ui-btn-inline ui-btn-raised ui-mini" href="SearchApplications.php?team='.$club.'&stype=Under8-Quad">Under8-Quad</a>&nbsp;&nbsp;|&nbsp;&nbsp;';
		echo '<a class="ui-btn ui-btn-inline ui-btn-raised ui-mini" href="SearchApplications.php?team='.$club.'&stype=Speed-Quad">Speed-Quad</a>&nbsp;&nbsp;|&nbsp;&nbsp;';
				echo '<a  class="ui-btn ui-btn-inline ui-btn-raised ui-mini" href="SearchApplications.php?team='.$club.'&stype=Speed-Inline">Speed-Inline</a>&nbsp;&nbsp;|&nbsp;&nbsp;';
				
	//		echo '<a href="SearchApplications.php?team='.$club.'&stype=Artistic">Artistic</a>&nbsp;&nbsp;|&nbsp;&nbsp;';
	//			echo '<a href="SearchApplications.php?team='.$club.'&stype=Hockey">Hockey</a>&nbsp;&nbsp;|&nbsp;&nbsp;';
	//				echo '<a href="SearchApplications.php?team='.$club.'&stype=Freestyle">Freestyle</a>&nbsp;&nbsp;|&nbsp;&nbsp;';
				echo '<a  class="ui-btn ui-btn-inline ui-btn-raised ui-mini" href="SearchApplications.php?team='.$club.'&stype=all">All</a>&nbsp;&nbsp; <br/><br/>
					<a href="javascript:window.print()">PRINT</a></h5>';
if($result2)
{
	//id="example"
?>
   <button  onclick=" $.cookie('last-scroll-top', $(window).scrollTop()); $('#myPopup').popup('open'); clearform(); " data-rel="popup" data-position-to="window" class="ui-btn-fab ui-btn-raised clr-warning ui-btn ui-btn-inline waves-effect waves-button waves-effect waves-button" style="position:fixed;right:10px;bottom:10px;"><i class="zmdi zmdi-account-add zmd-2x"></i></button>

   
   



  


 <div data-role="popup" id="myPopup" class="ui-content"  >
<!--<div data-role="panel" id="myPopup" data-display="overlay" data-position-fixed="true" class="ui-panel ui-panel-position-left" style="min-width:550px; float:right;">  -->

<!-- <div  id="myPopup" class="ui-content" style="display:none;" >-->
 <div data-role="header">
		<h1 class='nd-title'>Add / Edit Entry</h1>
	</div>
	
	
	<div data-role="content">
   

    
    <div class="nd2-no-menu-swipe">

			
			<div  class="ui-content wow fadeIn" data-inset="false" data-wow-delay="0.2s">


				<form id="entryform">


				 <div class="row">

		<div class="col-xs-12 col-sm-6 col-md-4">

       				<div class="box">

						<label for="sname">Name:</label>
                        <input required="required" type="text" name="sname" id="sname" value="" data-clear-btn="true" placeholder="Type Skater Name here...">
                        <label for="dob">Date of Birth: (Don't use Slash "/")</label>
                        <input required="required" type="date" name="dob" id="dob" value="" data-clear-btn="true" placeholder="" onchange="calcagegroup();">
                         
                         <label for="age">Age :</label>
                          <input required="required" type="text" name="aget" id="aget" value="" data-clear-btn="true" placeholder=""  readonly>
                           <input required="required" type="hidden" name="age" id="age" value="" data-clear-btn="true" placeholder="">
                         <label for="ag">Age Group:</label>
                          <input required="required" type="text" name="ag" id="ag" value="" data-clear-btn="true" placeholder=""  readonly>
                            <input required="required" type="hidden" name="agorder" id="agorder" value="" data-clear-btn="true" placeholder="">

                          <fieldset data-role="controlgroup" data-type="horizontal" data-mini="true">
                            <legend>Gender</legend>
                                 <label for="gender1">Male</label>
                            <input type="radio" name="gender" id="gender1" value="Male" checked="checked">
                            <label for="gender2">Female</label>
                            <input type="radio" name="gender" id="gender2" value="Female">
                            </fieldset>
                          <label for="phone">Phone:</label>
                        <input required="required" type="text" name="phone" id="phone" value="" data-clear-btn="true" placeholder="">
                                           <label for="clubname">Club Name:</label>
                          <input required="required" type="text" name="clubname" id="clubname" value="" data-clear-btn="true" placeholder="">
                            <label for="address">Fathername & Address:</label>
                          <input type="text" name="address" id="address" value="" data-clear-btn="true" placeholder="">
                           <label for="blood">Blood Group</label>
                          <input type="text" name="blood" id="blood" value="" data-clear-btn="true" placeholder="">

					</div>
		</div>
        
        <div class="col-xs-12 col-sm-6 col-md-4">
<div class="box">
<fieldset data-role="controlgroup" data-type="horizontal" data-mini="true">
                            <legend>Category</legend>
                            <input type="radio" name="skatertype" id="skatertype1" value="Speed-Quad"  onchange="setraces();">
                            <label for="skatertype1">Speed-Quad</label>
                            <input type="radio" name="skatertype" id="skatertype2" value="Speed-Inline"  onchange="setraces();">
                            <label for="skatertype2">Speed-Inline</label>
                            <input type="radio" name="skatertype" id="skatertype3" value="Under8-Quad"  onchange="setraces();" >
                            <label for="skatertype3">Under8-Quad</label>
                            <input type="radio" name="skatertype" id="skatertype4" value="Tenacity"  onchange="setraces();" >
                            <label for="skatertype4">Tenacity</label> 
                        </fieldset>

						
<div id="sqraces" style="display:none;">
	<fieldset data-role="controlgroup">
  <legend>Speed-Quad Events</legend>
  <input type="checkbox" name="rink1" id="rink1">
  <label for="rink1">Rink - I</label>
   <input type="checkbox" name="rink2" id="rink2">
  <label for="rink2">Rink - II</label>
   <input type="checkbox" name="rink3" id="rink3">
  <label for="rink3">Rink - III</label>
   <input type="checkbox" name="road1" id="road1">
  <label for="road1">Road - I</label>

</fieldset>
</div>
<div id="siraces" style="display:none;">
	<fieldset data-role="controlgroup">
  <legend>Speed-Inline Events</legend>
  <input type="checkbox" name="rink4" id="rink4">
  <label for="rink4">Rink - IV</label>
   <input type="checkbox" name="rink5" id="rink5">
  <label for="rink5">Rink - V</label>
   <input type="checkbox" name="rink6" id="rink6">
  <label for="rink6">Rink - VI</label>
   <input type="checkbox" name="road2" id="road2">
  <label for="road2">Road - II</label>
      <input type="checkbox" name="race100" id="race100">
  <label for="race100">Road - III</label>

   <input type="checkbox" name="p2p" id="p2p">
  <label for="p2p">Point to Point</label>
    
       <input type="checkbox" name="elim" id="elim">
  <label for="elim">Elimination - Rink</label>
    <input type="checkbox" name="elimrd" id="elimrd">
  <label for="elimrd">Elimination - Road</label>
  
    <input type="checkbox" name="relay" id="relay">
  <label for="relay">Relay</label>
    <input type="checkbox" name="marathon" id="marathon">
  <label for="marathon">Marathon</label>
  

</fieldset>
</div>
<div id="u8qraces" style="display:none;">
	<fieldset data-role="controlgroup">
  <legend>Under8-Quad Events</legend>
  <input type="checkbox" name="u8race1" id="u8race1" >
  <label for="u8race1">Race - I</label>
   <input type="checkbox" name="u8race2" id="u8race2">
  <label for="u8race2">Race - II</label>
  

</fieldset>
</div>
<div id="tenraces" style="display:none;">
	<fieldset data-role="controlgroup">
  <legend>Tenacity Events</legend>
  <input type="checkbox" name="tenrace1" id="tenrace1">
  <label for="tenrace1">Race - I</label>
   <input type="checkbox" name="tenrace2" id="tenrace2">
  <label for="tenrace2">Race - II</label>
   
</fieldset>
</div>


                          
<img  id="uploadedphoto" name="uploadedphoto" height="120px" />
					</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-4">
<div class="box">

						
<!--<label for="file">Select Photo:</label>
<a href="#" name="file" id="file"  onclick="$('#photofile').click();" class="ui-btn ui-btn-raised ui-btn-icon-left"><i class="zmdi-image zmdi"></i> Select Photo</a> -->
                          
      <div class="image-editor" style="max-width:320px;">
       <div class="ui-field-contain">
    <label for="photofile">Select Photo:</label>
     <input type="file" name="photofile" id="photofile" class="cropit-image-input" />
</div>
                    <!--      <input type="file" name="photofile" id="photofile" class="cropit-image-input ui-hidden-accessible" style=" visibility: hidden; display:none;" /> -->
						  
						 
        <div class="cropit-preview"> 

		</div>
        <div class="image-size-label">
          Resize image
        </div>
        <input type="range" class="cropit-image-zoom-input">
        <button class="rotate-ccw ui-btn ui-btn-inline ui-mini"><i class="zmdi-rotate-left zmdi zmd-2x" ></i></button>
      <button class="rotate-cw ui-btn ui-btn-inline ui-mini"><i class="zmdi-rotate-right zmdi zmd-2x"></i></button>
        <input type="hidden" name="photodata" class="hidden-image-data" />
      
      </div>

    
    
   
    
    </div>

					</div>
                    
                    
</div>

<div class="row">
<div class="box">
<input type="hidden" value="" name="photourl" id="photourl"/>
<input type="hidden" value="" name="applno" id="applno"/>
<input type="hidden" value="" name="mode" id="mode"/>
<input type="submit" id="submitbutton" value="Submit" class="ui-btn" />
</div>

</div>
			</form>


			</div>

		</div>
        
        
        
        
    
    
    
    
    </div>

	    </div>
	
<table data-role="table" data-mode="columntoggle" style="overflow-x: auto;	display: block;"    class="ui-responsive table-stroke">
<thead>
 <?php
                if($stype=="all" )
			{
                ?>
 <tr class="th-groups" >
            
            <th colspan="4" data-priority="1" style="height:auto !important; text-align:center;">Skater Details</th>
            <th colspan="2" data-priority="5" style="height:auto !important; text-align:center;" >DOB & Age</th>
            <th colspan="2" data-priority="2" style="height:auto !important; text-align:center;">Age Group</th>
            <th colspan="1" data-priority="6" style="height:auto !important; text-align:center;">Team</th>
			 <th colspan="4" data-priority="1" style="height:auto !important; text-align:center;">Quad Events</th>
            <th colspan="10" data-priority="1" style="height:auto !important; text-align:center;">Inline Events</th>
			<th colspan="1" data-priority="4" style="height:auto !important; text-align:center;">Comments</th>
        </tr>
		   <?php
			}
                ?>
		
<tr><th><div class="verticalText">AppNo</div></th>
<th class="no-print"><div class="no-print">Edit Application</div></th>
<th><div>Status</div></th>
				 <!--<th><div>TNRSA_ID</div></th>-->
				<th ><div style=" width:220px;">Skater Name</div></th>
                <th><div>Date_of_Birth</div></th>
                <th><div>Age</div></th>
                <th><div>AgeGroup</div></th>
                <th><div>Gender</div></th>
                <th><div>Team</div></th>
                <?php
                if($stype=="Tenacity")
			{
                ?>
                <th><div class="verticalText">Tenacity-Race 1</div></th>
                <th><div class="verticalText">Tenacity-Race 2</div></th> 
             <!--   <th><div class="verticalText">Adj-Rink IIA</div></th> -->
              <?php
			}
                ?>
                 <?php
                if($stype=="Under8-Quad")
			{
                ?>
                <th><div class="verticalText">Under 8-Race 1</div></th>
                <th><div class="verticalText">Under 8-Race 2</div></th> 
             <!--   <th><div class="verticalText">Adj-Rink IIA</div></th> -->
              <?php
			}
                ?>
                
                 <?php
                if($stype=="Speed-Quad"|| $stype=="all" )
			{
                ?>
               <th><div class="verticalText">Rink I</div></th>
                <th><div class="verticalText">Rink II</div></th>
                <th><div class="verticalText">Rink III</div></th>
                <th><div class="verticalText">Road I</div></th>
                                 
                   <?php
			}
                ?>
                 <?php
                if($stype=="Speed-Inline"|| $stype=="all" )
			{
                ?>
              
                <th><div class="verticalText">Rink IV</div></th>
                <th><div class="verticalText">Rink V</div></th>
                <th><div class="verticalText">Rink VI</div></th>
                <th><div class="verticalText">Road II</div></th>
                  <th><div class="verticalText">Road III</div></th> 
                    <th><div class="verticalText">Point to Point</div></th>
                <th><div class="verticalText">Elim (Rink)</div></th>
                                <th><div class="verticalText">Elim (Road)</div></th>
         	        <th><div class="verticalText">Relay</div></th>
                 <th><div class="verticalText">Marathon</div></th> 
                
                   <?php
			}
                ?>
                <?php
                if($stype=="Artistic" )
			{
                ?>
                    <th><div class="verticalText">Figure</div></th>
                <th><div class="verticalText">Free</div></th>
                <th><div class="verticalText">Combined</div></th>
                <th><div class="verticalText">Pair</div></th>
                <th><div class="verticalText">Inlinefree</div></th>
                <th><div class="verticalText">Solodance</div></th>
                <th><div class="verticalText">Pairdance</div></th>
                                <th><div class="verticalText">ShowSkating</div></th> 
                                 <?php
			}
                ?>
                                 <?php
                if($stype=="Hockey" )
			{
                ?>
                <th><div class="verticalText">Quadhockey</div></th>
                <th><div class="verticalText">Inlinehockey</div></th>
                
                   <?php
			}
                ?>
                 <?php
                if($stype=="Freestyle")
			{
                ?>
                <th><div class="verticalText">Classic Slalom</div></th>
                <th><div class="verticalText">Speed Slalom</div></th> 
                <?php
			}
                ?>
                        <th><div class="verticalText">Comments</div></th>
                
           <!--    <th class="no-print"><div class="no-print">Reprint</div></th> -->
                </tr></thead>
<?php

//  id="example"  class="display"
$twocol=0;	
$itcount=0;
$curag="";
$curgender="";
	echo '<tbody>';
	while($row = mysqli_fetch_array($result2))
  {
	   $status=trim($row["status"]);
 $appno=trim($row["appno"]);
$sname=trim($row["sname"]);
$tnrsaid=trim($row["tnrsaid"]);
$dob=trim($row["dob"]);
$age=trim($row["age"]);
$ag=trim($row["agegroup"]);
$gender=trim($row["gender"]);
$club=trim($row["club"]);
$clubname=trim($row["clubname"]);
$fathername=trim($row["fathername"]);
$address=trim($row["address"]);
$city=trim($row["city"]);
$pin=trim($row["pin"]);
$phone=trim($row["phone"]);
$email=trim($row["email"]);
$blood=trim($row["bloodgroup"]);
$comments=trim($row["comments"]);
$photourl=trim($row["photourl"]);
$nodob="";
$doburl=trim($row["doburl"]);
if($doburl=='NA')
{
$nodob="true";
}
$adjrink1=trim($row["adjrink1"]);

if($adjrink1=='on')
{
	$adjrink1="P";
	}
	else
	{
		$adjrink1="-";
		}
		
$adjrink2=trim($row["adjrink2"]);

if($adjrink2=='on')
{
	$adjrink2="P";
	}
	else
	{
		$adjrink2="-";
	}
	
	$adjrink3=trim($row["adjrink3"]);

if($adjrink3=='on')
{
	$adjrink3="P";
	}
	else
	{
		$adjrink3="-";
		}
		
		$u8race1=trim($row["u8race1"]);

if($u8race1=='on')
{
	$u8race1="P";
	}
	else
	{
		$u8race1="-";
		}
		
			$u8race2=trim($row["u8race2"]);

if($u8race2=='on')
{
	$u8race2="P";
	}
	else
	{
		$u8race2="-";
		}
		
		
		
$rink1=trim($row["rink1"]);
	if($rink1=='on')
	{
		$rink1="P";
	}
		else
	{
		$rink1="-";
	}
$rink2=trim($row["rink2"]);
if($rink2=='on')
	{
		$rink2="P";
	}
		else
	{
		$rink2="-";
	}
$rink3=trim($row["rink3"]);
if($rink3=='on')
	{
		$rink3="P";
	}
		else
	{
		$rink3="-";
	}
$road1=trim($row["road1"]);
if($road1=='on')
	{
		$road1="P";
	}
		else
	{
		$road1="-";
	}

$rink4=trim($row["rink4"]);
if($rink4=='on')
	{
		$rink4="P";
	}
		else
	{
		$rink4="-";
	}
$rink5=trim($row["rink5"]);
if($rink5=='on')
	{
		$rink5="P";
	}
		else
	{
		$rink5="-";
	}
$rink6=trim($row["rink6"]);
if($rink6=='on')
	{
		$rink6="P";
	}
		else
	{
		$rink6="-";
	}
$road2=trim($row["road2"]);
if($road2=='on')
	{
		$road2="P";
	}
		else
	{
		$road2="-";
	}
$p2p=trim($row["p2p"]);
if($p2p=='on')
	{
		$p2p="P";
	}
		else
	{
		$p2p="-";
	}

$elim=trim($row["elim"]);
if($elim=='on')
	{
		$elim="P";
	}
		else
	{
		$elim="-";
	}
	$elimrd=trim($row["elimrd"]);
if($elimrd=='on')
	{
		$elimrd="P";
	}
		else
	{
		$elimrd="-";
	}
$relay=trim($row["relay"]);
if($relay=='on')
	{
		$relay="P";
	}
		else
	{
		$relay="-";
	}
	$marathon=trim($row["marathon"]);
if($marathon=='on')
	{
		$marathon="P";
	}
		else
	{
		$marathon="-";
	}
	
	$race100=trim($row["race100"]);
	if($race100=='on')
	{
		$race100="P";
	}
		else
	{
		$race100="-";
	}

$figure=trim($row["figure"]);
if($figure=='on')
	{
		$figure="P";
	}
		else
	{
		$figure="-";
	}
$free=trim($row["free"]);
if($free=='on')
	{
		$free="P";
	}
		else
	{
		$free="-";
	}
$combined=trim($row["combined"]);
if($combined=='on')
	{
		$combined="P";
	}
		else
	{
		$combined="-";
	}
$pair=trim($row["pair"]);
if($pair=='on')
	{
		$pair="P";
	}
		else
	{
		$pair="-";
	}
$inlinefree=trim($row["inlinefree"]);
if($inlinefree=='on')
	{
		$inlinefree="P";
	}
		else
	{
		$inlinefree="-";
	}
$solodance=trim($row["solodance"]);
if($solodance=='on')
	{
		$solodance="P";
	}
		else
	{
		$solodance="-";
	}
$pairdance=trim($row["pairdance"]);
if($pairdance=='on')
	{
		$pairdance="P";
	}
		else
	{
		$pairdance="-";
	}
$showskating=trim($row["showskating"]);
if($showskating=='on')
	{
		$showskating="P";
	}
		else
	{
		$showskating="-";
	}

$quadhockey=trim($row["quadhockey"]);
if($quadhockey=='on')
	{
		$quadhockey="P";
	}
		else
	{
		$quadhockey="-";
	}
$inlinehockey=trim($row["inlinehockey"]);
if($inlinehockey=='on')
	{
		$inlinehockey="P";
	}
		else
	{
		$inlinehockey="-";
	}

$classicslalom=trim($row["classicslalom"]);
if($classicslalom=='on')
	{
		$classicslalom="P";
	}
		else
	{
		$classicslalom="-";
	}
$speedslalom=trim($row["speedslalom"]);
if($speedslalom=='on')
	{
		$speedslalom="P";
	}
		else
	{
		$speedslalom="-";
	}


$bgc="";
if($status=="Approved")
{
	$bgc="Lime";
	}
	if($status=="Verified By Dt")
{
	$bgc="LightGreen";
	}
	if($status=="Pending")
{
	$bgc="Red";
	}
	if($status=="Held")
{
	$bgc="Yellow";
	}
	if($status=="Delete")
{
	$bgc="LightGrey";
	}
	
	if($curag!=$ag ||$curgender!=$gender)
	{
	echo '<tr style="background-color:#e6ffe6;"><td colspan=8><h5><b>'.$ag.' '.$gender.'</b></h5></td></tr>';	
	$curag=$ag;
	$curgender=$gender;
	}
echo '<tr style="background-color:'.$bgc.'"><td>'.$appno.'</td><td class="no-print"><a href="#" onclick="editapp('.$appno.');"  data-rel="popup" data-position-to="window" data-role="button">Edit -'.$appno.'</a></td><td>'.$status.'</td> <!--<td>'.$tnrsaid.'</td>--><td style=" text-align:left;">'.$sname.'<br/>'.$phone.'<br/>Club: '.$clubname.'</td><td>'.$dob.'</td><td>'.$age.'</td><td>'.$ag.'</td><td>'.$gender.'</td><td>'.$club.'</td>';

                if($stype=="Tenacity"  )
			{
                echo '<td>'.$adjrink1.'</td><td>'.$adjrink2.'</td><!--<td>'.$adjrink3.'</td> -->';
			}
			    if($stype=="Under8-Quad"  )
			{
                echo '<td>'.$u8race1.'</td><td>'.$u8race2.'</td><!--<td>'.$adjrink3.'</td> -->';
			}
			if($stype=="Speed-Quad" || $stype=="all" )
			{
                echo '<td>'.$rink1.'</td><td>'.$rink2.'</td><td>'.$rink3.'</td><td>'.$road1.'</td>';
			}
			if($stype=="Speed-Inline" || $stype=="all" )
			{
                echo '<td style="border-left:1px solid black !important;">'.$rink4.'</td><td>'.$rink5.'</td><td>'.$rink6.'</td><td>'.$road2.'</td><td>'.$race100.'</td><td>'.$p2p.'</td><td>'.$elim.'</td><td>'.$elimrd.'</td><td>'.$relay.'</td><td>'.$marathon.'</td>';
			}
			if($stype=="Artistic")
			{
			echo '<td>'.$figure.'</td><td>'.$free.'</td><td>'.$combined.'</td><td>'.$pair.'</td><td>'.$inlinefree.'</td><td>'.$solodance.'</td><td>'.$pairdance.'</td><td>'.$showskating.'</td>';
			}
			if($stype=="Hockey"  )
			{
				echo '<td>'.$quadhockey.'</td><td>'.$inlinehockey.'</td>';
			}
			if($stype=="Freestyle" )
			{
				echo '<td>'.$classicslalom.'</td><td>'.$speedslalom.'</td>';
			}
			//href="#myPopup"
			echo '<td> '.$comments.' </td><!--<td class="no-print"><a target="_blank" href="'."application.php?appno=".$appno.'">Print -'.$appno.'</a></td>--></tr>';
			


  }
echo '</tbody>';  
  ?>
</table>

<?php
	}
	else
	{
		echo "No Result Found!";
		}
	validate:
	$rowcount=0;
	




	
//}

?>
 </div>
  </div>

 
  </body>
</html>