D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
u166148318
/
domains
/
avrd.org
/
public_html
/
admin
/
Filename :
team.php
back
Copy
<?php include '../components/connect.php'; ?> <!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"> <title>Team</title> <!-- font awesome cdn link --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css"> <!-- custom css file link --> <link rel="stylesheet" href="./css/admin_style.css"> </head> <body> <!-- header section starts --> <?php include '../components/admin_header.php'; ?> <!-- header section ends --> <!-- register section starts --> <section class="form-container"> <form action="" method="POST" enctype="multipart/form-data"> <h3>Add a Team Member</h3> <?php if(isset($_POST['submit'])){ $name = $_POST['name']; $function = $_POST['function']; $facebook = $_POST['facebook']; $whatsapp = $_POST['whatsapp']; $image_01 = $_FILES['team_pic']['name']; $image_01 = filter_var($image_01, FILTER_SANITIZE_STRING); $image_01_ext = pathinfo($image_01, PATHINFO_EXTENSION); $rename_image_01 = uniqid("pic", true).'.'.$image_01_ext; $image_01_tmp_name = $_FILES['team_pic']['tmp_name']; $image_01_size = $_FILES['team_pic']['size']; $image_01_folder = 'team/'.$rename_image_01; if($image_01_size > 2000000){ $warning_msg[] = 'image 01 size too large!'; }else{ $insert_team = $conn->prepare("INSERT INTO `team`(id, name, fuction, fb_url, whats_url, team_pic) VALUES(?,?,?,?,?,?)"); $insert_team->execute([null, $name, $function, $facebook, $whatsapp, $image_01_folder]); move_uploaded_file($image_01_tmp_name, $image_01_folder); if ($insert_team){ echo "<font size='3px' padding='5px' color='green' text-align='center'>One member added successfully.</font>"; }else{ echo "<font size='3px' padding='5px' color='red' text-align='center'>OOoops something went wrong, try again later.</font>"; } } } ?> <input type="file" name="team_pic" id="" required > <input type="text" name="name" placeholder="Type member Name" maxlength="80" class="box" required > <input type="text" name="function" placeholder="Type thier Function" maxlength="80" class="box" required > <input type="text" name="facebook" placeholder="paste facebook url" maxlength="800" class="box" required > <input type="text" name="whatsapp" placeholder="type whatsapp number ex(+243850111738)" maxlength="800" class="box" required> <input type="submit" value="Add now" name="submit" class="btn"> <center> <a href="./view_team.php" ><h2>View My Team</h2> </a> </center> </form> </section> <!-- register section ends --> <script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.2/sweetalert.min.js"></script> <!-- custom js file link --> <script src="./js/admin_script.js"></script> <?php include '../components/message.php'; ?> </body> </html>