Ejemplo n.º 1
0
<?php

require_once "session.php";
require_once "header.php";
require_once 'functions/states_function.php';
require_once 'functions/district_function.php';
require_once 'functions/athletes_functions.php';
require_once 'functions/sports_function.php';
$statesFunction = new statesFunction();
$districtFunction = new districtFunction();
$sportsfunction = new sportsfunction();
$athleteFunction = new athletesFunction();
?>
<div class="container">
	<div class="container align_center align_height">
		<span class="sports">ADD ATHLETES</span>
	</div><!--end container-->
	<div class="container">
		<div class="col-xs-12 col-md-11">
			<div class="col-md-4 hidden-xs"></div>
			<div class="col-xs-12 col-md-7 align_margin">
				<form name="athletes_form" id="athlete_form">
					<div class="form-group">
						<label>Athlete Name</label><br>
						<input type="text" class="adjust_width" name="athlete_name" data-validation-error-msg="Please Enter the name of the Athelete" data-validation="required">
					</div>

					<div class="form-group" style="margin-left: -15px;">
					  <label for="date" class="fl" style="position: relative; left: 15px;">Date Of Birth</label><br>
					  <input class="athlete_date_pick" type="text">
					 <!-- <select class="form-control classic dob_align fl" id="date" name="athlete_dobday" data-validation-error-msg="Please Select the Date" data-validation="required">
Ejemplo n.º 2
0
        }
    }
    public function isStatesExist()
    {
        $qr = mysql_query("SELECT * FROM wc_states WHERE states_name = '" . $this->statesname . "'");
        $row = mysql_num_rows($qr);
        if ($row > 0) {
            return true;
        } else {
            return false;
        }
    }
}
if (isset($_POST)) {
    if (isset($_GET['adddata'])) {
        $statesFunction = new statesFunction();
        $statesFunction->statesname = $_POST['states_name'];
        // if ($_POST['states_name']){
        // if (in_array($_POST['states_name'], $STATES)) {
        $states = $statesFunction->isStatesExist();
        if (!$states) {
            $statesinsert = $statesFunction->statesInsert();
            if ($statesinsert) {
                echo "success#State Inserted#" . $statesinsert . '#' . $_POST['states_name'];
            } else {
                echo "failure#State Not Inserted";
            }
        } else {
            echo "failure#State Already Exist";
        }
        // }