b0y-101 Mini Shell


Current Path : E:/www/b-group.old/spfin - Copy/campusrumaster/
File Upload :
Current File : E:/www/b-group.old/spfin - Copy/campusrumaster/insert.php

<?php 

    include_once('functions.php');

    $insertdata = new DB_con();

    if (isset($_POST['btn_register'])) {
        $codest = $_POST['txt_codest'];
        $cardnumber = $_POST['txt_cardnumber'];
		$phonenumber =$_POST['txt_phonenumber'];
        $email = $_POST['txt_email'];
        $password = $_POST['txt_password'];
		$time=date('now');
        
        
        $sql = $insertdata->insert($codest, $cardnumber, $phonenumber, $email, $password,$time);

        if ($sql) {
            echo "<script>alert('Record Inserted Successfully!');</script>";
            echo "<script>window.location.href='index.php'</script>";
        } else {
            echo "<script>alert('Something went wrong! Please try again!');</script>";
            echo "<script>window.location.href='insert.php'</script>";
        }
    }

?>


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Insert Page</title>

    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/css/bootstrap.min.css" integrity="sha384-r4NyP46KrjDleawBgD5tp8Y7UzmLA05oM1iAEQ17CSuDqnUK2+k9luXQOfXJCJ4I" crossorigin="anonymous">
</head>
<body>
    
    <div class="container">
        <a href="index.php" class="btn btn-primary mt-3">Go Back</a>
        <hr>
		<div class="text-center">
			  <img src="../images/logo/logopk.png" class="rounded" width="200" height="239" alt="...">
				<h1 class="mt-3">
					 ขึ้นทะเบียนขอรหัสผ่าน</h1>
			</div>
                <hr>
        <form action="" method="post" class="form-horizontal my-5">

        <div class="form-group">
            <label for="codestudent" class="col-sm-3 control-label">รหัสนักศึกษา</label>
            <div class="col-sm-12">
                <input type="text" name="txt_codest" class="form-control" required placeholder="Enter Code Student">
            </div>
        </div>
			<div class="form-group">
            <label for="cardnumber" class="col-sm-3 control-label">หมายเลขบัตรประชาชน</label>
            <div class="col-sm-12">
                <input type="text" name="txt_cardnumber" class="form-control" required placeholder="Enter Cardnumber">
            </div>
        </div>
			
			<div class="form-group">
            <label for="phonenumber" class="col-sm-3 control-label">หมายเลขโทรศัพท์ที่ติดต่อได้</label>
            <div class="col-sm-12">
                <input type="text" name="txt_phonenumber" class="form-control" required placeholder="Enter Phonenumber">
            </div>
        </div>
        
        <div class="form-group">
            <label for="exampleInputEmail1" class="col-sm-3 control-label">E-mail</label>
            <div class="col-sm-12">
                <input type="email" name="txt_email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">
            </div>
        </div>
        
        <label for="password" class="col-sm-3 control-label">Password</label>
        <div class="col-sm-12">
            <input type="password" name="txt_password" class="form-control" required placeholder="Enter password">
        </div>

        
        <div class="form-group">
            <div class="col-sm-12 mt-3">
                <input type="submit" name="btn_register" class="btn btn-primary" style="width: 100%;" value="ตกลง">
            </div>
        </div>

        <div class="form-group text-center">
            <div class="col-sm-12 mt-3">
                Already have an account ? 
                <p><a href="index.php">Login</a></p>
            </div>
        </div>

        </form>
    </div>


    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/js/bootstrap.min.js" integrity="sha384-oesi62hOLfzrys4LxRF63OJCXdXDipiYWBnvTl9Y9/TRlw5xlKIEHpNyvvDShgf/" crossorigin="anonymous"></script>
</body>
</html>

Copyright © 2019 by b0y-101