include("include_breadcrumb.php"); ?>
// check the db for similar matches
$name_tag = strtolower(str_replace(" ","", $_POST['name']));
$name_superstart = substr($name_tag, 0, 4);
$name_superend = substr($name_tag, -4, 4);
$name_supermid = substr($name_tag, ((strlen($name_tag))/2 - 2), 4);
//echo $name_supermid;
$match_sql = "SELECT coach_id, coach_name, coach_name_tag, coach_city, coach_state FROM ".$prefix."Coaches WHERE coach_valid = 1 AND (coach_name_tag LIKE '%".$name_superstart."%' OR coach_name_tag LIKE '%".$name_superend."%' OR coach_name_tag LIKE '%".$name_supermid."%')";
//echo $match_sql;
$match_fetch = mysql_query($match_sql) OR die(mysql_error());
$i = false;
while ($match_row = mysql_fetch_array($match_fetch)) {
similar_text($match_row['coach_name'], $_POST['name'], $percent);
if ($percent >= 50) {
if ($i == false) {
echo ("Duplicate Alert: ");
}
if ($i == true) {echo ("
");} echo ("".$match_row['coach_name']." (".$match_row['coach_city'].", ".$match_row['coach_state'].") (Similarity: ".(round($percent, 0))."%)"); $i = true; } } if ($i == true) { echo(" "); }
?>
}
//end confirmation form
?>
include("include_sidebar.php"); ?>
if( $insert_success == true || $_GET[confirmed] == "yes" ) { ?>
Thank you
Thank you. Your coach information should be added within 24 hours. You will now be redirected back to the add page.
unset($insert_success); unset($confirm_coach); ?> } else if( $confirm_coach == true ) { ?>Add a Coach: Step 2 of 2
}else if( ($confirm_coach != true) || ($_POST[add_coach] != true) ){ ?>Add a Coach: Step 1 of 2
if (!$errmsg) { ?>If you would like to add a coach to our website, simply fill out the form below. Be sure to fill out every field. After filling out each field, click submit. You will then be prompted to confirm your information before the information is sent to us.
} else { ?>echo $errmsg; ?>
} ?> } // begin insert form if( (($_POST[add_coach] != true) || ($errmsg) || (($confirm_coach != true) && ($_POST[insert_coach] != true))) && $_GET[confirmed] != "yes") { ?> } // end insert form // begin confirmation form if($confirm_coach == true){ ?> Please confirm your information. If everything is correct, click the submit button. Otherwise, you may click the edit button to change your information before submitting.Name
echo stripslashes($_POST[name]); ?>
");} echo ("".$match_row['coach_name']." (".$match_row['coach_city'].", ".$match_row['coach_state'].") (Similarity: ".(round($percent, 0))."%)"); $i = true; } } if ($i == true) { echo("
Street Address
echo stripslashes(htmlspecialchars($_POST[address])); ?>
Street Address Two
echo stripslashes(htmlspecialchars($_POST[address_two])); ?>
City
echo stripslashes(htmlspecialchars($_POST[city])); ?>
State
echo stripslashes(htmlspecialchars($_POST[state])); ?>
Zip/Postal Code
echo stripslashes(htmlspecialchars($_POST[zip])); ?>
Phone
echo stripslashes(htmlspecialchars($_POST[phone])); ?>
Fax
echo stripslashes(htmlspecialchars($_POST[fax])); ?>
E-mail
echo stripslashes(htmlspecialchars($_POST[email])); ?>
Website
Info
Certifications
$explosion = implode(",", $_POST[certifications]);
$sql = ("SELECT * FROM ".$prefix."CoachesCertifications WHERE coach_certification_id IN ($explosion) ORDER BY coach_certification_name ASC");
//echo $sql;
$results = mysql_query($sql) or die(mysql_error());
$certification_list = "";
while ($row = mysql_fetch_array($results)) {
$certification_list = $certification_list."$row[coach_certification_name], ";
}
$certification_list = rtrim($certification_list, ', ');
echo $certification_list;
?>
Services
$explosion = implode(",", $_POST[services]);
$sql = ("SELECT * FROM ".$prefix."CoachesServices WHERE coach_service_id IN ($explosion) ORDER BY coach_service_name ASC");
//echo $sql;
$results = mysql_query($sql) or die(mysql_error());
$service_list = "";
while ($row = mysql_fetch_array($results)) {
$service_list = $service_list."$row[coach_service_name], ";
}
$service_list = rtrim($service_list, ', ');
echo $service_list;
?>
Education
$explosion = implode(",", $_POST[degrees]);
$sql = ("SELECT * FROM ".$prefix."CoachesDegrees WHERE coach_degree_id IN ($explosion) ORDER BY coach_degree_name ASC");
//echo $sql;
$results = mysql_query($sql) or die(mysql_error());
$degree_list = "";
while ($row = mysql_fetch_array($results)) {
$degree_list = $degree_list."$row[coach_degree_name], ";
}
$degree_list = rtrim($degree_list, ', ');
echo $degree_list;
?>
General Info
echo strip_tags(stripslashes($_POST[info])) ?>
Rates & Fees
echo strip_tags(stripslashes($_POST[cost])) ?>
Camps
echo strip_tags(stripslashes($_POST[camps])) ?>