header("Location:index.php");
}
$func = new COMMONFUNC();
$db = new DB();
$flag = 0;
$query_Athlete = " Select * from " . TBL_ATHELETE_REGISTER . " where fldUsername ='******'FRONTEND_USER'] . "'";
$db->query($query_Athlete);
$db->next_record();
$athemail = $db->f('fldEmail');
$coach_id = $db->f('fldApproveCoachId');
$userid = $db->f('fldId');
$fldSport = $db->f('fldSport');
$fldFirstname = $db->f('fldFirstname');
$fldLastname = $db->f('fldLastname');
if ($_GET['fldEventId']) {
    $programe_event = $func->selectTableOrder(TBL_EVENT, "fldEventId,fldEventName", "fldEventId", "where fldEventId=" . $_GET['fldEventId']);
}
$AthleteName = $fldFirstname . " " . $fldLastname;
$EventName = $programe_event[0]['fldEventName'];
if ($_POST['isSubmit'] == 'save') {
    if ($flag == 0) {
        for ($cataStatcount = 0; $cataStatcount < count($_POST['category']); $cataStatcount++) {
            $strDataArr = array('fldPrograme' => $programe_event[0]['fldEventId'], 'fldCategoryId' => $func->input_fun($_POST['categoryId'][$cataStatcount]), 'fldValue' => $func->input_fun($_POST['category'][$cataStatcount]), 'fldLabelname' => $func->input_fun($_POST['labelname'][$cataStatcount]), 'fldStatus' => 0, 'fldCoachId' => $coach_id, 'fldSportid' => $fldSport, 'fldAtheleteId' => $userid, 'fldAddDate' => date("y-m-d"));
            $db->insertRec(TBL_ATHELETE_STAT, $strDataArr);
        }
        $msg = "Hello Coach, <br /><br />\r\r\n            You are receiving this email because an Athlete on your team has posted Game Stats for a particular game/event. Please login to your Account at www.collegeprospectnetwork.com, and review these Stats @ 'My Account > Athlete Stats Approval' section.\r            <br /><br />  \r            <b>Athlete:</b> " . $AthleteName . "<br />  \r            <b>Game / Event:</b> " . $EventName . "<br />  \r            <br />     \r\r\n            Thank you in advance Coach,<br />\r\r\n            College Prospect Network<br />\r\r\n            www.CollegeProspectNetwork.com";
        $query_Coach_id = " Select fldEmail  from " . TBL_HS_AAU_COACH . " where fldId ='" . $coach_id . "'";
        $db->query($query_Coach_id);
        $db->next_record();
        $coachEmail = $db->f('fldEmail');
        $toStre1 = $coachEmail;
		<title>Messaging</title>

		<META NAME="Keywords" CONTENT="My Account">

		<META NAME="Description" CONTENT="My Account">

		<link href="css/style.css" rel="stylesheet" type="text/css" />	

	</head>

	<body style="background:none;">

		<!--middle panel starts from here -->

		<!--content panel starts from here -->

		<div class="container">

			<div class="innerWraper">

				<div class="middle-bg">

					<div>

						<div>

							<h1>Add Note / Comment</h1>

							<div class="registerPage" >

							<?php 
			&nbsp;
			</td>
			</tr>
			
			
			<tr height="20">
			<td valign="top" align="right" class="normalblack_12" width="30%">Sport<font color="red"> *</font></td>
			<td valign="top"  align="center" class="normalblack_12" > : </td>
			<td valign="top" align="left" class="normalblack_12">

			
			
			<?php 
echo $strcombo = '<select name="fldNeedType" style="width:200px">';
echo $strcombo = '<option value = "">Select Type</option>';
$categorylist = $func->selectTableOrder(tbl_sports, "fldId,fldSportsname", "fldId");
for ($i = 0; $i < count($categorylist); $i++) {
    echo '<option value ="' . $categorylist[$i]['fldId'] . '" >' . $categorylist[$i]['fldSportsname'] . '</option>';
}
echo $strcombo = '</select>';
?>

			
			
			</tr>
			<tr height="20">
			<td valign="top" class="normalwhite_14" colspan=3 align="center">
			&nbsp;
			</td>
			</tr>
			
$fldUserName = $func->output_fun($db->f('fldUserName'));
$fldAddDate = $func->output_fun($db->f('fldAddDate'));
$fldSubscribe = $func->output_fun($db->f('fldSubscribe'));
$fldPosition = $func->output_fun($db->f('fldPosition'));
$fldEmail = $func->output_fun($db->f('fldEmail'));
$fldExpiredate = $func->output_fun($db->f('fldExpiredate'));
$fldFirstName = $func->output_fun($db->f('fldFirstName'));
$fldLastName = $func->output_fun($db->f('fldLastName'));
$fldAlternativeEmail = $func->output_fun($db->f('fldAlternativeEmail'));
$fldPhone = $func->output_fun($db->f('fldPhone'));
$fldAlternativePhone = $func->output_fun($db->f('fldAlternativePhone'));
$fldDescriPation = $func->output_fun($db->f('fldDescriPation'));
$fldStatus = $func->output_fun($db->f('fldStatus'));
$fldSubscribe = $db->f('fldSubscribe');
if ($fldCollegeName != 'other') {
    $college_address_before = $func->selectTableOrder(TBL_COLLEGE, "fldId,fldName,fldAddress,fldCity,fldState,fldZipCode,fldDivison", "fldId", "where fldStatus =1 and fldId=" . $fldCollegeName);
    $fldCity = $college_address_before[0]['fldCity'];
    $fldState = $college_address_before[0]['fldState'];
    $fldAddress = $college_address_before[0]['fldAddress'];
    $fldZipCode = $college_address_before[0]['fldZipCode'];
    $fldDivison = $college_address_before[0]['fldDivison'];
}
$selquery = "select fldSportsname from " . TBL_SPORTS . " where fldId='" . $fldSport . "'";
$objQuery = mysql_query($selquery);
$numquery = mysql_num_rows($objQuery);
$resquery = mysql_fetch_array($objQuery);
$SportsName = $resquery['fldSportsname'];
?>

		<table width="100%" cellpadding="3" cellspacing="5">
		<tr>
<?php

include_once "inc/common_functions.php";
//for common function
include_once "inc/page.inc.php";
require_once 'zipcode.class.php';
session_start();
$z = new zipcode_class();
$func = new COMMONFUNC();
$db = new DB();
$flag = 0;
$college_info = $func->selectTableOrder(TBL_COLLEGE, 'fldId,fldAddress,fldCity,fldState,fldZipCode', "fldId", "where fldId=" . $_GET['fldid']);
?>

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Google Maps For view Location</title>
    <script src="//maps.google.com/maps?file=api&amp;v=2.x&amp;key=<?php 
echo MAPS_APIKEY;
?>
" type="text/javascript"></script>
    <script type="text/javascript">

    var map = null;
    var geocoder = null;

    function initialize() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));
			<td valign="top" class="normalwhite_14" colspan=3 align="center">
			&nbsp;
			</td>
			</tr>		
			
			
			
			
			<tr height="20">
			<td valign="top" align="right" class="normalblack_12" width="30%">Sport<font color="red">*</font> </td>
			<td valign="top"  align="center" class="normalblack_12" > : </td>
			<td valign="top" align="left" class="normalblack_12">
			
			<?php 
echo '<select name="fldParentId" style="width:220px"><option value="">Please Select</option>';
$sport_list = $func->selectTableOrder(TBL_SPORTS, "fldId,fldSportsname", "fldSportsname", "where fldStatus='ACTIVE'");
/*$sport_list=$func->selectTableOrder(TBL_SPORTS,"fldId,fldSportsname","fldId");*/
for ($i = 0; $i < count($sport_list); $i++) {
    if ($fldParentId == $sport_list[$i]['fldId']) {
        echo '<option value ="' . $sport_list[$i]['fldId'] . '" selected = "selected" >' . $sport_list[$i]['fldSportsname'] . '</option>';
    } else {
        echo '<option value ="' . $sport_list[$i]['fldId'] . '"  >' . $sport_list[$i]['fldSportsname'] . '</option>';
    }
}
echo $strcombo = '</select>';
?>

            </td>
			</tr>
			<tr height="20">
			<td align="center" valign="top" colspan="3" class="normalwhite_14">
} else {
    $query = "Select * from " . TBL_ATHLETE_STATS_CATAGORY . " where fldStatus=1  " . $srchCond;
}
if ($_REQUEST['sportid'] != '') {
    $srchCond1 = "AND fldParentId = " . $_REQUEST['sportid'];
    $query = "Select * from " . TBL_ATHLETE_STATS_CATAGORY . " where 1=1 " . $srchCond1 . " ORDER BY fldName";
}
$db1->query($query);
$db1->next_record();
$totalPages = $db1->num_rows();
if ($totalPages > 0) {
    ?>

								<tr> <td align="left" style="padding-left:7px;"colspan="10"><input type="checkbox" id="check_all" name="check_all" value="" onclick="javascript:checkAll();"> <b>Check All</b>&nbsp; &nbsp;<input type="button" name="delete" value="Delete Selected" onclick="return submitDeleteAll();"><?php 
    echo '<select name="fldParentId" style="width:220px" onChange="javascript:return formsubmit(this.value);" ><option value="">Select Sport</option>';
    $sport_list = $func->selectTableOrder(TBL_SPORTS, "fldId,fldSportsname", "fldId");
    for ($i = 0; $i < count($sport_list); $i++) {
        if ($_REQUEST['sportid'] == $sport_list[$i]['fldId']) {
            echo '<option value ="' . $sport_list[$i]['fldId'] . '" selected = "selected" >' . $sport_list[$i]['fldSportsname'] . '</option>';
        } else {
            echo '<option value ="' . $sport_list[$i]['fldId'] . '"  >' . $sport_list[$i]['fldSportsname'] . '</option>';
        }
    }
    echo $strcombo = '</select>';
    ?>
 
								
								&nbsp;&nbsp;<a href="ADAthleteCatagoryAdd.php">Add New</a>
								
								</td>
								
			
			</select></td>
			</tr>
			<tr height="20">
			<td valign="top" class="normalwhite_14" colspan=3 align="center">
			&nbsp;
			</td>
			</tr>-->
<tr height="20">
			<td valign="top" align="right" class="normalblack_12" width="30%">Sport <font color="red">*</font></td>
			<td valign="top"  align="center" class="normalblack_12" > : </td>
			<td valign="top" align="left" class="normalblack_12"> 
			<select name="fldSport" id="fldSport" style="width: 220px;font-size:12px;" 
			>
			<?php 
$sportlist = $func->selectTableOrder(TBL_SPORTS, "fldId,fldSportsname", "fldSportsname", "where fldStatus='ACTIVE'");
?>
<option value = "select">Select Sport</option><?php 
for ($i = 0; $i < count($sportlist); $i++) {
    ?>

   				<option value ="<?php 
    echo $sportlist[$i]['fldId'];
    ?>
" <?php 
    if (isset($_REQUEST['sportid']) and $_REQUEST['sportid'] == $sportlist[$i]['fldId']) {
        ?>
selected <?php 
    }
    ?>
><?php 
//for common function
include_once "inc/page.inc.php";
include_once "inc/config.inc.php";
if ($_SESSION['FRONTEND_USER'] == "") {
    header("Location:login.php");
}
//for paging
$func = new COMMONFUNC();
$db = new DB();
//$flag=1;
if ($_POST['isSubmit'] == 'save') {
    if ($_REQUEST['collegeid'] == '') {
        $error_msg[] = " Please Select College";
    }
    $collegeid = $func->input_fun($_POST['collegeid']);
    $ath_name = $func->selectTableOrder(TBL_ATHELETE_REGISTER, "fldFirstname,fldLastname", "fldId", "where fldId='" . $_SESSION['Athlete_id'] . "' and fldStatus ='ACTIVE'");
    $name = ucfirst($ath_name[0]['fldFirstname']) . ' ' . ucfirst($ath_name[0]['fldLastname']);
    $strDataArr = array('collegeid' => $collegeid, 'athleteid' => $_SESSION['Athlete_id'], 'athname' => $name, 'status' => $func->input_fun($_POST['status']));
    $whereClause = "athleteid='" . $_SESSION['Athlete_id'] . "' and collegeid = '" . $collegeid . "'";
    if ($db->MatchingRec(TBL_ADDTONETWORK_REQUEST, $whereClause) > 0) {
        $error_msg[] = 'You Have Already Send the Request!';
    }
    if (count($error_msg) == 0) {
        $db->insertRec(TBL_ADDTONETWORK_REQUEST, $strDataArr);
        $msg = "Your Request has been sent! Wait for Approval";
        header("Location: myaccount.php?msg={$msg}");
    }
}
?>

			</tr>
			<tr>
			<td height="35" colspan="3" align="right" class="normalblack_12"><FONT color="Red">Fields marked with * are mandatory&nbsp;</FONT></td>
			</tr>
			<tr height="20">
			<td valign="top" class="normalwhite_14" colspan=3 align="center">
			&nbsp;
			</td>
			</tr>		
			
			<tr height="20">
			<td valign="top" align="right" class="normalblack_12" width="30%">Game / Event<font color="red"> *</font> </td>
			<td valign="top"  align="center" class="normalblack_12" > : </td>
			<td valign="top" align="left" class="normalblack_12"> 
			 <?php 
$eventName = $func->selectTableOrder(TBL_EVENT, "fldEventId,fldEventName", "fldEventId");
?>

                                    <select name="fldPrograme" style="width: 220px;">
                                    <option value="select">Select Programe</option>
                                <?php 
for ($i = 0; $i < count($eventName); $i++) {
    ?>

									<option value="<?php 
    echo $eventName[$i]['fldEventId'];
    ?>
" <?php 
    if ($eventName[$i]['fldEventId'] == $fldPrograme) {
        ?>
selected<?php 
			</td>
			</tr>
			<tr height="20">
			<td valign="top" class="normalwhite_14" colspan=4 align="center">
			&nbsp;
			</td>
			</tr>
			
			
			<tr height="20">
			<td valign="top" align="right" class="normalblack_12" width="30%">College Name<font color="red"> *</font> </td>
			<td valign="top"  align="center" class="normalblack_12" > : </td>
			<td valign="top" align="left" class="normalblack_12"> <?php 
echo $strcombo = '<select name="fldCollegename" style="width:200px;">';
echo $strcombo = '<option value = "select">Select College</option>';
$collegelist = $func->selectTableOrder(TBL_COLLEGE, "fldId,fldName", "fldId", "where fldStatus =1");
for ($i = 0; $i < count($collegelist); $i++) {
    echo '<option value ="' . $collegelist[$i]['fldId'] . '" >' . $collegelist[$i]['fldName'] . '</option>';
}
echo $strcombo = '</select>';
?>
	</td>
			</tr>
			
			<tr height="20">
			<td valign="top" class="normalwhite_14" colspan=3 align="center">
			&nbsp;
			</td>
			</tr>
			<tr height="20">
			<td valign="top" align="right" class="normalblack_12" width="30%">First Name<font color="red"> *</font> </td>
    if (!$db->query($query)) {
        die(mysql_error());
        $success = FALSE;
    }
}
// TODO: Should the sport list be restricted to the sports that the coach has an active subscription to?
$query = 'SELECT tbl_sports.fldId, tbl_sports.fldSportsname ' . 'FROM tbl_sports INNER JOIN tbl_college_subscription ' . 'ON tbl_sports.fldId=tbl_college_subscription.fldSport ' . 'WHERE tbl_college_subscription.fldActive=1 ' . 'AND tbl_college_subscription.fldCoach=' . $coachId;
if (!$db->query($query)) {
    die(mysql_error());
}
$fldSportList = array();
while ($db->next_record()) {
    $fldSportList[$db->f('fldId')] = $db->f('fldSportsname');
}
$arrDistances = array('0', '10', '25', '50', '100', 'Any');
$fldClassList = $classlist = $func->selectTableOrder(TBL_CLASS, "fldId,fldClass", "fldId");
if ($_REQUEST['action'] == 'edit') {
    $needId = $_REQUEST['id'];
    $query = 'SELECT * FROM ' . TBL_COLLEGE_NEEDS . ' WHERE fldId=' . $needId;
    if (!$db->query($query)) {
        die(mysql_error());
    }
    $db->next_record();
    $fldSport = $db->f('fldSportId');
    $fldGradClass = $db->f('fldGradClass');
    $fldMinHeight = intval($db->f('fldMinHeight') / 12) . '-' . intval($db->f('fldMinHeight') % 12);
    $fldMaxHeight = intval($db->f('fldMaxHeight') / 12) . '-' . intval($db->f('fldMaxHeight') % 12);
    switch ($db->f('fldMinWeight')) {
        case 0:
            $fldMinWeight = 'under140';
            break;
 public static function getSchoolList()
 {
     $func = new COMMONFUNC();
     $schoolList = array();
     $groups = $func->selectTableOrdergroupby(TBL_HS_AAU_TEAM, "fldState", "fldState", "WHERE fldStatus='ACTIVE'");
     for ($i = 0; $i < count($groups); $i++) {
         $groupLabel = '========' . $groups[$i]['fldState'] . '========';
         $schoolList[$groupLabel] = array();
         //School Loop (in state)
         $where = "WHERE fldState='" . $groups[$i]['fldState'] . "'";
         $schools = $func->selectTableOrder(TBL_HS_AAU_TEAM, "fldId,fldSchoolname", "fldSchoolname", $where);
         for ($j = 0; $j < count($schools); $j++) {
             $key = $schools[$j]['fldId'];
             $value = $schools[$j]['fldSchoolname'];
             $schoolList[$groupLabel][$key] = $value;
         }
     }
     return $schoolList;
 }
                if(error_msg != '') {

                    alert(error_msg);

                    return false;

                } else {

                    return true;

                }

            }
		</script>
	</head>
	<body>
		<!--header link starts from here -->
		<?php 
include 'header.php';
?>

		<!--Header ends from here -->
		<!--middle panel starts from here -->
		<!--content panel starts from here -->
		<div class="container">
			<div class="innerWraper">
				<div class="middle-bg">
					<div class="cantener">
						<div class="register-main">
							<h1>Send Messages</h1>
							<?php 
    case 'coach':
        //HS Coach ID
        $UserID = $_SESSION['Coach_id'];
        break;
    case 'college':
        //College Coach ID
        $UserID = $_SESSION['College_Coach_id'];
        //Check Subscription Status
        $query = " Select fldSubscribe from " . TBL_COLLEGE_COACH_REGISTER . " where fldId ='" . $UserID . "' ";
        $db->query($query);
        $db->next_record();
        $_SESSION['fldSubscribe'] = $db->f('fldSubscribe');
        break;
}
#### PENDING NETWORK REQUESTS ####
$Pending_request = $func->selectTableOrder(TBL_NETWORK, "fldId", "fldId", "where fldReceiverid='" . $UserID . "' and fldReceiverType='" . $UserType . "' and fldStatus='Pending'");
if (count($Pending_request) > 0) {
    $NetworkReq_Pending = "(<font style='color:red;'>" . count($Pending_request) . " Pending</font>)";
}
#### PENDING NETWORK REQUESTS ####
#### INBOX ####
$inboxinfo = $func->selectTableOrder(TBL_MAIL, "mail_id", "mail_id", "where UserTo='" . $_SESSION['FRONTEND_USER'] . "' and status ='unread'");
$Countinboxinfo = count($inboxinfo);
if ($Countinboxinfo > 0) {
    $Countinboxinfo = "(<font style='color:red;'>" . $Countinboxinfo . " Unread</font>)";
} else {
    $Countinboxinfo = "";
}
?>

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

<TABLE cellSpacing=0 cellPadding=1 width="95%" align=center border=0>

<TR>

<TD>

	<TABLE cellSpacing=0 cellPadding=1 width=780 border=0>

	<TR>

	<TD bgColor=#ffffff>

		<TABLE cellSpacing=0 cellPadding=0 width=900 border=0>

		<TR>

		<TD vAlign=top width=20%>

			<?php 
include "include/ADmenu.php";
?>

		</TD>

		<TD valign=top width=1%>

		&nbsp;

		</TD>
<?php

include_once "../inc/common_functions.php";
//for common function
include_once "../inc/page.inc.php";
include_once "../inc/config.inc.php";
//for paging
$func = new COMMONFUNC();
$db = new DB();
$q = $_GET['q'];
if ($q == "other") {
    $other_info = $func->selectTableOrder(TBL_OTHER, "fldId,fldName", "fldId", " where fldUserId ='" . $_GET['fldUserName'] . "'");
    $college_address_other_info = $func->selectTableOrder(TBL_COLLEGE, "fldId,fldName,fldAddress,fldCity,fldState,fldZipCode", "fldId", "where fldStatus =0 and fldId='" . $other_info[0]['fldId'] . "'");
    ?>

         	<table align="center"  border="0" align="center" width="60%">

         	<tr height="20">

                 

			<td valign="top" align="right" class="normalblack_12" width="30%">College Name<font color="red"> *</font> </td>

         	

         	<td valign="top"  align="center" class="normalblack_12" > : &nbsp; </td>

         	<td valign="top" align="left" class="normalblack_12"  colspan=2> 

                                    <input type="text" name="txtfldName" id="txtfldName" style="width:200px;" value="<?php 
    echo $other_info[0]['fldName'];
>Prince Edward Island</option>
               <option value='Quebec' <?php 
    if ($college_address_info[0]['fldState'] == 'Quebec') {
        echo 'selected';
    }
    ?>
>Quebec</option>
               <option value='Saskatchewan' <?php 
    if ($college_address_info[0]['fldState'] == 'Saskatchewan') {
        echo 'selected';
    }
    ?>
>Saskatchewan</option>
               <option value='Yukon Territory' <?php 
    if ($college_address_info[0]['fldState'] == 'Yukon Territory') {
        echo 'selected';
    }
    ?>
>Yukon Territory</option>
               </optgroup>
            </select><font color="#0000ff">&nbsp;*</font>                                            
        </span>
<label>Zip Code:</label>
<span>
	<input type="text" name="fldZipcode" id="fldZipcode" value="<?php 
    echo $college_address_other_info[0]['fldZipcode'];
    ?>
" >
	<font color="#0000ff">&nbsp;*</font></span>
	
	</div>
//for common function
include_once "inc/page.inc.php";
session_start();
if ($_SESSION['FRONTEND_USER'] == "") {
    header("Location:index.php");
}
//for paging
$func = new COMMONFUNC();
//Create an instance of class COMMONFUNC
$page = new Page();
//Create an instance of class Pate
$lnb = "2";
$error_msg = '';
$srchCond = '';
if ($_SESSION['mode'] == "athlete") {
    $athlete_info = $func->selectTableOrder(TBL_ATHELETE_REGISTER, "fldId,fldUsername,fldSchool,fldSport", "fldId", " where fldUsername='******'FRONTEND_USER'] . "'");
}
if (!$searchname) {
    $searchname = $_REQUEST['searchname'];
}
$searchname = addslashes($searchname);
if (strlen($searchname) > 0) {
    $queryString = "searchname={$searchname}";
    $srchCond = "AND fldEventName like '%" . $searchname . "%'";
}
if ($_REQUEST['mode'] == "del") {
    $fldEventId = $_REQUEST['fldEventId'];
    $delete_query_details = "delete from " . TBL_EVENT . " where fldEventId=" . $fldEventId;
    $delmsg = $db->query($delete_query_details);
    if (isset($delmsg)) {
        $_REQUEST['msg'] = "Event successfully deleted.";
 <?php 
include_once "inc/common_functions.php";
//for common function
include_once "inc/page.inc.php";
include_once "inc/config.inc.php";
$func = new COMMONFUNC();
$db = new DB();
$q = $_GET["q"];
if ($q == "other") {
    $college_address_other_info = $func->selectTableOrder(TBL_COLLEGE, "fldId,fldName,fldAddress,fldCity,fldState,fldZipCode", "fldId", "where fldStatus =0 and fldName='" . $txtfldName . "'");
    ?>

<div class="yellow">  
<label>College Name:</label>
<span>
	<input type="text" name="txtfldName" id="txtfldName" class="yellow"><?php 
    echo $txtfldName;
    ?>
<font color="#0000ff">&nbsp;*</font></span>
<label>Address:</label>
<span> 	<textarea rows=14 cols=69 name=fldAddress><?php 
    echo $college_address_other_info[0]['fldAddress'];
    ?>
</textarea><font color="#0000ff">&nbsp;*</font></span>
<br/>
<br/>
<label>City:</label>
<span>
	<input type="text" name="fldCity" id="fldCity" value="<?php 
    echo $college_address_other_info[0]['fldCity'];
    ?>
 var error_msg = "";
 var blnResult = true;
 if(trimString(document.frmUsers.fldUsername.value) == "") {
     error_msg += "Please Enter  UserName! \n";
 } else {
     if(hasSpecialCharaters(document.frmUsers.fldUsername.value)) {
         error_msg += " Please Enter valid UserName! \n";
     }
 }
 if(trimString(document.frmUsers.fldEmail.value) == "") {
     error_msg += "Please Enter  Email! \n";
 } else {
     if(!isValid(document.frmUsers.fldEmail.value)) {
         error_msg += " Please Enter valid Email! \n";
     }
 }
 if(trimString(document.frmUsers.fldFirstname.value) == "") {
     error_msg += "Please Enter  First Name! \n";
 } else {
     if(hasSpecialCharaters(document.frmUsers.fldFirstname.value)) {
         error_msg += " Please Enter First Name! \n";
     }
 }
 if(trimString(document.frmUsers.fldSchool.value) == "0") {
     error_msg += "Please Select HS/AAU Team! \n";
 }
 if(trimString(document.frmUsers.fldSport.value) == "select") {
     error_msg += "Please Select Sport! \n";
 }
 if(error_msg != '') {
     alert(error_msg);
     echo "<input type='hidden' name='isSubmit' value='save'>";
     echo "<p><label>&nbsp;</label><span><button type=submit onsubmit='' class='btn'>Send Message</button></span></p>";
     echo "</form>";
 } else {
     if ($_REQUEST['value'] == 'coach') {
         ##TO HS COACH##
         $query1 = "SELECT fldSport from " . TBL_ATHELETE_REGISTER . "  WHERE fldUsername='******'";
         $db1->query($query1);
         $db1->next_record();
         $fldSport = $func->output_fun($db1->f('fldSport'));
         if ($_SESSION['mode'] == 'coach' || $_SESSION['mode'] == 'college') {
             echo "<h2 style='padding-left:160px;'>Send Message to HS/AAU Coach</h2><br><form name='messageform' action='' method=post onsubmit='return validate()'>";
             echo "<p><label>To:</label><span>";
             echo $strcombo = '<select name="to" style="width:276px">';
             echo $strcombo = '<option value="">----- Please Select -----</option>';
             $coachlist = $func->selectTableOrder(TBL_HS_AAU_COACH, "fldId,fldName,fldLastName,fldUsername", "fldLastName");
         } else {
             echo "<h2 style='padding-left:160px;'>Send Message to HS/AAU Coach</h2><br><form name='messageform' action='' method=post onsubmit='return validate()'>";
             echo "<p><label>To:</label><span>";
             echo $strcombo = '<select name="to" style="width:276px">';
             echo $strcombo = '<option value = "">----- Please Select -----</option>';
             $coachlist = $func->selectTableOrdergroupby("tbl_hs_aau_coach_sportposition cs, tbl_hs_aau_coach ac", "fldId,fldName,fldLastName,fldUsername", "ac.fldLastName", "where ac.fldId = cs.fldCoachNameId and cs.fldSportId = " . $fldSport);
         }
         for ($i = 0; $i < count($coachlist); $i++) {
             if (!in_array($coachlist[$i]['fldId'], $coachid)) {
                 if ($_REQUEST['to'] == $coachlist[$i]['fldUsername']) {
                     echo '<option value ="' . $coachlist[$i]['fldUsername'] . '" selected="selected" >' . ucfirst($coachlist[$i]['fldLastName']) . ', ' . ucfirst($coachlist[$i]['fldName']) . '</option>';
                 } else {
                     echo '<option value ="' . $coachlist[$i]['fldUsername'] . '">' . ucfirst($coachlist[$i]['fldLastName']) . ', ' . ucfirst($coachlist[$i]['fldName']) . '</option>';
                 }
             }
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>College Prospect Network - Manage Game Tape</title>
		<META NAME="Keywords" CONTENT="">
		<META NAME="Description" CONTENT="">
		<link href="css/style.css" rel="stylesheet" type="text/css" />
		<script language="Javascript" src="javascript/functions.js"></script>
		<script type="text/javascript" src="/jwplayer/jwplayer.js"></script>
		<script language="JavaScript" type="text/JavaScript">
            function deleteRecord(fldId, page, fldUserName) {
                if(confirm("Sure you want to delete this Game Tape? This cannot be undone")) {
                    document.frmCatagory.action = "?mode=del&fldId=" + fldId;
                    document.frmCatagory.submit();
                }
            }
            function submitDeleteAll() {
                var countChecked = 0;
                var checkBox = document.getElementsByName('check_delete[]');
                var totalCheckboxes = document.getElementsByName('check_delete[]').length;
                if(totalCheckboxes != 0) {
                    for(var i = 0; i < totalCheckboxes; i++) {
                        if(checkBox[i].checked == true) {
                            countChecked = countChecked + 1;
                        }
                    }
                }
                if(countChecked != 0) {
                    if(confirm("Sure you want to delete selected Game Tape? This cannot be undone")) {
                        document.frmCatagory.action = "?mode=delAll";
                        document.frmCatagory.submit();
                        return true;
                    }
" >
			</span><font color="#0000ff">&nbsp;*</font>		</p>
		<p>
			<label>Email Address (for Receipt):</label>
			<span><input type="text" name="fldEmail" id="fldEmail" value="<?php 
    echo $fldEmail;
    ?>
" ></span>
			<font color="#0000ff">&nbsp;*</font>		</p>
		 <p>
			<label>Graduating Class:</label>
			<span> 
			<select name="fldClass" id="fldClass">
				<option value="select" class="selectgrey" >Select Class</option>
				<?php 
    $classlist = $func->selectTableOrder(TBL_CLASS, "fldId,fldClass", "fldClass");
    for ($i = 0; $i < count($classlist); $i++) {
        ?>

				<option value ="<?php 
        echo $classlist[$i]['fldClass'];
        ?>
"<?php 
        if ($classlist[$i]['fldClass'] == $fldClass) {
            ?>
 selected="selected" <?php 
        }
        ?>
><?php 
        echo $classlist[$i]['fldClass'];
        ?>
	}

	else{

		if(hasSpecialCharaters(document.frmUsers.fldSport.value)){

			error_msg += "Please Select the Sport! \n";

		}

	}

	

	

	if(trimString(document.frmUsers.fldCoachname.value) == ""){

		error_msg += "Please Select the coachname! \n";

	}

	else{

		if(hasSpecialCharaters(document.frmUsers.fldCoachname.value)){

			error_msg += "Please Select the coachname! \n";

		}
        $db->next_record();
        $fldUserName = $db->f('fldUserName');
        $fldCollegename = $db->f('fldCollegename');
        $fldCoachname = $db->f('fldCoachname');
        $fldPosition = $db->f('fldPosition');
        $fldNeedType = $db->f('fldNeedType');
        $fldEmail = $db->f('fldEmail');
        $fldFirstName = $db->f('fldFirstName');
        $fldLastName = $db->f('fldLastName');
        $fldAlternativeEmail = $db->f('fldAlternativeEmail');
        $fldPhone = $db->f('fldPhone');
        $fldAlternativePhone = $db->f('fldAlternativePhone');
        $fldEnrollmentNumber = $db->f('fldEnrollmentNumber');
        $fldDivison = $db->f('fldDivison');
        if ($fldCollegename != 'other') {
            $college_address_before = $func->selectTableOrder(TBL_COLLEGE, "fldId,fldName,fldAddress,fldCity,fldState,fldZipCode", "fldId", "where fldStatus =1 and fldId=" . $fldCollegename);
            $fldCity = $college_address_before[0]['fldCity'];
            $fldState = $college_address_before[0]['fldState'];
            $fldAddress = $college_address_before[0]['fldAddress'];
            $fldZipCode = $college_address_before[0]['fldZipCode'];
        }
    }
} else {
    $fldUserName = "";
    $fldCollegename = "";
    $fldCity = "";
    $fldState = "";
    $fldPosition = "";
    $fldNeedType = "";
    $fldEmail = "";
    $fldFirstName = "";
$flag = 0;
/*
 * gets coach information. This is used to pre-fill form fields 
 * and provide necessary data for the Authorize.net transaction
 */
$query = 'SELECT * FROM ' . TBL_COLLEGE_COACH_REGISTER . " WHERE fldUserName='******'";
$db->query($query);
$db->next_record();
$fldCoach = $db->f('fldId');
$fldCollegename = $db->f('fldCollegename');
$fldtransectionId = $db->f('fldtransectionId');
$fldCancelCount = $db->f('fldCancelCount');
$fldSubscribe = $db->f('fldSubscribe');
// gets all active subscriptions for the current user
// gets available subscription types for the form
$table = TBL_COLLEGE_SUBSCRIPTION;
$fields = 'fldId,fldType,fldSport';
$where = 'WHERE fldCoach=' . $fldCoach . ' AND fldActive=1';
$subsList = $func->selectTableOrder($table, $fields, 'fldId', $where);
$subsCount = count($subsList);
// creates a human-readable version of the active subscriptions
$activeSubs = array();
for ($i = 0; $i < $subsCount; $i++) {
    $key = $subsList[$i]['fldId'];
    // gets the name of the subscription type
    $query = 'SELECT fldName FROM ' . TBL_SUBSCRIPTION . ' WHERE fldId=' . $subsList[$i]['fldType'];
    $db->query($query);
    $db->next_record();
    $typeName = $db->f('fldName');
    // gets the name of the subscribed sport
    $query = 'SELECT fldSportsname FROM ' . TBL_SPORTS . ' WHERE fldId=' . $subsList[$i]['fldSport'];
$ModeType = isset($_REQUEST["mode"]) ? $_REQUEST["mode"] : "";
switch ($ModeType) {
    case 'athlete':
        //AthleteID
        $UserID = isset($_SESSION['Athlete_id']) ? $_SESSION['Athlete_id'] : "";
        $fldSport = $func->GetValue("tbl_athelete_register", "fldSport", "fldId", $UserID);
        break;
    case 'coach':
        //HS Coach ID
        $UserID = isset($_SESSION['Coach_id']) ? $_SESSION['Coach_id'] : "";
        $fldSport = $func->GetValue("tbl_hs_aau_coach", "fldSport", "fldId", $UserID);
        break;
    case 'college':
        //College Coach ID
        $UserID = isset($_SESSION['College_Coach_id']) ? $_SESSION['College_Coach_id'] : "";
        $sport_info = $func->selectTableOrder(TBL_COLLEGE_COACH_REGISTER, "fldId,fldNeedType", "fldId", "where fldUserName='******'");
        $fldSport = $sport_info[0]['fldNeedType'];
        break;
}
//echo $fldSport;
//mdify 4-2-13
//if (empty($fldSport)) {
//die(mysql_error());
//	header('location:myaccount.php');
//}
//echo "abc ".__LINE__;
// query
$select = 'SELECT ' . TBL_COLLEGE . '.fldId, ' . TBL_COLLEGE . '.fldName, ' . TBL_COLLEGE_COACH_REGISTER . '.fldFirstName, ' . TBL_COLLEGE_COACH_REGISTER . '.fldLastName ' . 'FROM ' . TBL_COLLEGE . ' ' . 'INNER JOIN ' . TBL_COLLEGE_COACH_REGISTER . ' ' . 'ON ' . TBL_COLLEGE_COACH_REGISTER . '.fldCollegename=' . TBL_COLLEGE . '.fldId ';
$where = 'WHERE ' . TBL_COLLEGE_COACH_REGISTER . '.fldSport=' . $fldSport . ' ';
// gets the requested college ID if set
if (isset($_GET['Id']) && is_numeric($_GET['Id'])) {
			<td height="35" colspan="3" align="right" class="normalblack_12"><FONT color="Red">Fields marked with * are mandatory&nbsp;</FONT></td>
			</tr>
			<tr height="20">
			<td valign="top" class="normalwhite_14" colspan=4 align="center">
			
			<tr height="20">
			<td valign="top" class="normalwhite_14" colspan=4 align="center">&nbsp;
			</td>
			<tr height="20" id="txtEvent">
			<td valign="top" align="right" class="normalblack_12" width="30%">Special Event<font color="red">*</font> </td>
			<td valign="top"  align="center" class="normalblack_12" > : &nbsp; </td>
			<td valign="top" align="left" class="normalblack_12"  colspan=2> 
			<select name="Event_id" id="Event_id" style="width:220px;">
				<option value="">Select Event</option>
			<?php 
$EventList = $func->selectTableOrder(TBL_SPECIAL_EVENT, "fldEventId,fldEventName", "fldEventId");
for ($i = 0; $i < count($EventList); $i++) {
    ?>
			<option value ="<?php 
    echo $EventList[$i]['fldEventId'];
    ?>
"<?php 
    if ($EventList[$i]['fldEventId'] == $Event_id) {
        ?>
 selected="selected" <?php 
    }
    ?>
><?php 
    echo $EventList[$i]['fldEventName'];
    ?>
</option>
include_once "inc/common_functions.php";
//for common function
include_once "inc/page.inc.php";
require_once 'zipcode.class.php';
session_start();
if ($_SESSION['mode'] == "" or $_SESSION['FRONTEND_USER'] == "") {
    header("Location:index.php");
}
$func = new COMMONFUNC();
$z = new zipcode_class();
$page = new Page();
$db = new DB();
$flag = 0;
$sessionid = $_SESSION['College_Coach_id'];
$needType_info = $func->selectTableOrder(TBL_NEEDTYPE, "fldId,fldDivision,fldClass,fldHeight,fldWeight,fldSchool,fldCity,fldState,fldZipCode,fldDistance", "fldId", "where fldCollegeCoachId=" . $sessionid);
if ($_POST['isSubmit'] == 'save') {
    $condition = "";
    //For division
    if ($_POST['fldDivision'] != '') {
        if ($_POST['fldDivision'] == 'JUCO') {
            $condition .= "fldDivision='NAIA' or fldDivision='DivisionIII' or fldDivision='DivisionII' or fldDivision = 'DivisionI' or fldDivision='" . $_POST['fldDivision'] . "' and   ";
        } else {
            if ($_POST['fldDivision'] == 'NAIA') {
                $condition .= "fldDivision='DivisionIII' or fldDivision='DivisionII' or fldDivision = 'DivisionI' or fldDivision='" . $_POST['fldDivision'] . "' and   ";
            } else {
                if ($_POST['fldDivision'] == 'DivisionIII') {
                    $condition .= "fldDivision='DivisionII' or fldDivision = 'DivisionI' or fldDivision='" . $_POST['fldDivision'] . "' and   ";
                } else {
                    if ($_POST['fldDivision'] == 'DivisionII') {
                        $condition .= "fldDivision = 'DivisionI' or fldDivision='" . $_POST['fldDivision'] . "' and   ";