ÿØÿà JFIFÿØÿà JFIF ÿØÿà JFIFÿØÿà JFIF ÿþ$
<?php
session_start();
if (!isset($_SESSION['admin_logged_in'])) {
header("Location: login.php");
exit;
}
?>
<?php
include('config.php');
$cname = '';
$age='';
$email = '';
$pname='';
$phone = '';
$states = '';
$me =0;
if (isset($_POST['submit'])) {
$cname = mysqli_real_escape_string($conn,$_POST['cname']);
$age = mysqli_real_escape_string($conn,$_POST['age']);
$email = mysqli_real_escape_string($conn,$_POST['email']);
$parents= mysqli_real_escape_string($conn,$_POST['pname']);
$phone = mysqli_real_escape_string($conn,$_POST['phone']);
$states = mysqli_real_escape_string($conn,$_POST['states']);
$sql = "SELECT * FROM registration WHERE email='$email'";
$men=mysqli_query($conn,$sql);
if (mysqli_num_rows($men)> 0) {
$error = 'E-mail or Phone Number Already Exists';
}else{
$sqle = "SELECT Id FROM registration ORDER BY Id DESC LIMIT 1";
$use=mysqli_query($conn,$sqle);
$user=mysqli_fetch_all($use,MYSQLI_ASSOC);
$print_r=($user[0]['Id']);
$id = number_format($print_r);
$id= $id +1;
$sqli="INSERT INTO registration(Id,Childsname,Age,Email,Parentsname,Phone,states)
VALUES('$id','$cname','$age','$email','$parents','$phone','$states')";
$done=mysqli_query($conn,$sqli);
if ($done) {
session_start();
$_SESSION['bug'] = 'Registered';
$_SESSION['Id'] = $id;
$img_name = $_FILES['pic']['name'];
$img_size = $_FILES['pic']['size'];
"<br />";
$temp_name = $_FILES['pic']['tmp_name'];
$error = $_FILES['pic']['error'];
if($error ===0){
if ($img_size>3000000) {
$me = "picture is larger than 3mb";
}
else{
$img_ex_lc = 'jpg';
$id = $id;
$new_img_name = $id.'.'.$img_ex_lc;
echo "<br />";
$new_img_name;
$img_upload_path= 'c_image/'.$new_img_name;
move_uploaded_file($temp_name, $img_upload_path);
$new_img_nam='c_image/'.$new_img_name;
$sql = "UPDATE registration SET Image = '$new_img_nam' WHERE Id = '$id'";
if (mysqli_query($conn,$sql)) {
$_SESSION['email'] = $email;
echo "<script>alert('The Registration was successful!')</script>";
echo "<script>location.href='contestants.php'</script>";
?>
<?php }else{
$me = "An error occured while uploading";
}
}
}else{
$me = "There is an error on the image";
}
?>
<?php
}
else{
$error = 'Something Went Wrong Please Try Again';
}
}
}
?>
<?php include('topbar.php')?>
<style>
form#reg{
padding: 2rem;
}
</style>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="css/custom.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<!-- Compiled Font-Awesome CDN -->
<script src="https://kit.fontawesome.com/1e78e0a43f.js" crossorigin="anonymous"></script>
<title>Registration</title>
</head>
<style>
.dark{
background-color: #222227;
}
</style>
<body class="dark">
<!-- slider -->
<section style="margin-top: 6rem;">
<h4 class="center white-text" style="font-weight: bold; margin-top:-60px"><br><br>
Contestant Registration
</h4>
<p class="center" style="color:#F8D868">Please fill in the appropriate information</p>
</section>
<div class="row">
<div class="col l6 s12 m10 push-l3 push-m1">
<div style="padding: 30px; border-radius:5px" class="card animate__fadeInUp animate__animated animate__delay-1s">
<form action="" method="POST" id="reg" enctype="multipart/form-data">
<?php if (isset($error)) {?>
<div style="color: white; text-align: center; padding:1rem;" class="red ">
<?php echo $error ?>
</div>
<?php }?>
<?php if ($me!=0) {?>
<div style="color: white; text-align:center; padding:1rem;" class="red ">
<?php echo $me ?>
</div>
<?php }?>
<div class="row">
<div class="col l6 m6 s12 input-field ">
<label for="cname">Child's Full Name</label>
<input type="text" name="cname" id="cname" required="value" value="<?php echo $cname ?>">
</div>
<div class="col l6 m6 s12 input-fi ">
<label>Contestant's Age</label>
<select type="select" id="age" name="age" required value="<?php echo $age ?>">
<option ></option>
<option value="1 Month Old">1 Month</option>
<option value="2 Months Old">2 Months</option>
<option value="3 Months Old">3 Months</option>
<option value="4 Months Old">4 Months</option>
<option value="5 Months Old">5 Months</option>
<option value="6 Months Old">6 Months</option>
<option value="7 Months Old">7 Months</option>
<option value="8 Months Old">8 Months</option>
<option value="9 Months Old">9 Months</option>
<option value="10 Months Old">10 Months</option>
<option value="11 Months Old">11 Months</option>
<option value="1 Year">1 Year</option>
<option value="2 Years">2 Years</option>
<option value="3 Years">3 Years</option>
<option value="4 Years">4 Years</option>
<option value="5 Years">5 Years</option>
<option value="6 Years">6 Years</option>
<option value="7 Years">7 Years</option>
<option value="8 Years">8 Years</option>
<option value="9 Years">9 Years</option>
<option value="10 Years">10 Years</option>
<option value="10 Years">11 Years</option>
</select>
</div>
</div>
<div class="row">
<div class="col l6 m12 s12 input-field ">
<label for="email">E-mail</label>
<input type="email" name="email" id="email" required="validate" value="<?php echo $email ?>">
</div>
<div class="col l6 m12 s12 input-field ">
<label for="phone">Whatsapp Number</label>
<input type="tel" name="phone" id="phone" maxlength ="11" required="validate" value="<?php echo $phone ?>">
</div>
</div>
<div class="row">
<div class="col l6 m12 s12 input-field ">
<label for="fname">Parent's Name</label>
<input type="text" name="pname" id="pname" required="value" value="<?php echo $pname ?>">
</div>
<div class="col l6 m12 s12 input-field ">
<label for="state">State of Residence</label>
<input type="text" name="states" id="states" required="value" value="<?php echo $states ?>">
</div>
</div>
<div class="center">
<div class="row">
<div>
<div style="border-radius:8px">
<label style="font-size: 1.2rem">Select Picture</label>
<input type="file" name="pic" required style="color:white;">
</div>
<input type="hidden" name="Id" value="<?php //echo $user_id ?>">
<br>
</div>
</div>
</div>
<br>
<style>
.w:hover{
color:white !important;
background-color:#0f0c29 !important;
}
.w{
border-color:white !important;
}
</style>
<div class="center">
<button class="btn w" name="submit" type="submit" style="background-color: #886018">
Register
</button>
</div>
</form>
<!--<div class="center"> <br>-->
<!-- <h4 class="light black-text text-lighten-3 center" style="font-weight: bold; margin-top:-60px !important">Registration is over! <br> Vote for your favorite contestant
</h4>-->
<!-- <a href="vote.php"><button class="btn-small" style= "background-color: #D41692">Vote Now</button></a>-->
<!-- <br>-->
<!-- </div>-->
</div>
</div>
</div>
</div>
<!-- Materialze/jquery Script -->
<script src="js/jquery.js"></script>
<script src="js/materialize.js"></script>
<script>
$(document).ready(function(){
$('.collapsible').collapsible();
$('.materialboxed').materialbox();
$('.parallax').parallax();
$('.carousel').carousel();
$('.datepicker').datepicker();
$('.timepicker').timepicker();
$('select').formSelect();
$('.modal').modal();
$('.scrollspy').scrollSpy();
$('.sidenav').sidenav();
});
</script>
<?php
include "bottombar.php"
?>
</body>
</html>
ÿØÿà JFIF ÿþ$
ÿØÿà JFIF ÿþ$
ÿÂ