<?php 
ob_start();
session_start();
include_once("include/functions.php");

if(!empty($_POST['mid']))
$mid=$_POST['mid'];
else if(!empty($_GET['mid']))
$mid=$_GET['mid'];
else
$mid='';

if(!empty($_POST['email_id']))
$suc=instructor_signup();
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="Instructor registration page for LMS platform.">
  <title>Instructor Registration | LMS</title>

  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
  <link href="css/bootstrap.min.css" rel="stylesheet">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css" rel="stylesheet">
  <link href="css/main.css" rel="stylesheet">
  <link href="css/register.css" rel="stylesheet">
</head>
<body class="instructor-register-page">
  <div class="register-shell container-fluid">
    <div class="row g-0 register-card">
      <div class="col-lg-6 register-form-pane">
        <a href="register.php" class="logo-brand">
          <span class="auth-brand__icon"><img src="images/logo.jpg" style="width: 240px;border-radius: 20px;" ></span>
        </a>

        <div class="register-form-wrap">
          <p class="register-eyebrow">Instructor Portal</p>
          <h1>Create Instructor Account</h1>
          <p class="register-lead">Join our LMS and start delivering engaging lessons with modern AI-powered teaching support.</p>

          <form method="post" action="<?php $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data"  id="instructorRegisterForm" class="needs-validation" novalidate>
            <div id="formFeedback" class="alert d-none mb-3" role="alert"></div>
			
             <?php
				if(!empty($_GET['exist']))
				{
			  ?>
				<div class="alert alert-danger" align="center"><strong style="color:black"> <centrer> Email Id Already Exists . </centrer> </strong></div>
			<?php
				}
				if(!empty($_GET['succ']))
				{
			?>
				<div class="alert alert-success" align="center"><strong style="color:black"> <centrer> Password Changed Successfully </centrer> </strong></div>
			<?php
				}
			?>

			
            <div class="row g-3">
              <div class="col-12 col-md-6">
                <label for="fullName" class="form-label">Instructor's Name</label>
                <input type="text" class="form-control" name="instructor_name" id="instructor_name" required>
                <div class="invalid-feedback">Instructor's Name Required.</div>
              </div>

              <div class="col-12 col-md-6">
                <label for="email" class="form-label">Instructor's Email</label>
                <input type="email" class="form-control" name="email_id" id="email_id" required>
                <div class="invalid-feedback">Instructor's Email Required.</div>
              </div>

              <div class="col-12 col-md-6">
                <label for="phone" class="form-label">Instructor's Mobile No</label>
                <input type="number" class="form-control" name="instructor_mobile" id="instructor_mobile" required>
                <div class="invalid-feedback">Instructor's Mobile No Required.</div>
              </div>

              <div class="col-12 col-md-6">
                <label for="subject" class="form-label">Instructor's Education</label>
                <input type="text" class="form-control" name="instructor_education" id="instructor_education" required>
                <div class="invalid-feedback">Instructor's Education Required.</div>
              </div>

              <div class="col-12 col-md-6">
                <label for="password" class="form-label">Instructor's LinkedIn Url</label>
                  <input type="url" class="form-control" name="instructor_linkedIn" id="instructor_linkedIn" required>
                  <div class="invalid-feedback">Instructor's LinkedIn Url Required.</div>
              </div>

              <div class="col-12 col-md-6">
                <label for="fullName" class="form-label">University Name</label>
                <input type="text" class="form-control" name="university_name" id="university_name" required>
                <div class="invalid-feedback">University Name Required.</div>
              </div>
              
              <div class="col-12 col-md-6">
                <label for="fullName" class="form-label">University Major </label>
                <input type="text" class="form-control" name="university_major" id="university_major" required>
                <div class="invalid-feedback">University Major Required.</div>
              </div>
              
              <div class="col-12 col-md-6">
                <label for="fullName" class="form-label">Instructor's Teaching Experience</label>
                <input type="text" class="form-control" name="teaching_exp" id="teaching_exp" required>
                <div class="invalid-feedback">Instructor's Teaching Experience Required.</div>
              </div>

              <div class="col-12">
                <label for="bio" class="form-label">Instructor's Address</label>
                <textarea class="form-control" id="instructor_address" name="instructor_address" rows="4" required></textarea>
                <div class="invalid-feedback">Instructor's Address Required.</div>
              </div>

              <div class="col-12">
                <label for="profilePhoto" class="form-label">Instructor's Resume</label>
                <input class="form-control" type="file" name="instructor_resume" id="instructor_resume" accept=".jpg,.jpeg,.png,.pdf,.webp" required>
                <div class="invalid-feedback">Instructor's Resume Required.</div>
              </div>

              <div class="col-12 d-grid mt-2">
              <input type="hidden" name="mid" value="<?php echo $mid; ?>">
                <button type="submit" class="btn btn-primary btn-register">Register</button>
              </div>
            </div>
          </form>

          <p class="register-footnote">
            Already have an account?
            <a href="index.php">Instructor Login</a>
          </p>
        </div>
      </div>

      <div class="col-lg-6 register-media-pane">
        <div class="register-media-content">
          <h2>Teach smarter with robotics support</h2>
          <p>Publish courses, track learner progress, and collaborate with intelligent robot-assisted education workflows.</p>
          <div class="feature-pill"><i class="bi bi-robot me-2"></i>Instructor + Robotics Learning Suite</div>
        </div>
        <div class="register-media-image-wrap">
          <img
            src="images/instructorwithrobot.jpg?auto=format&fit=crop&w=1200&q=80"
            alt="Instructor teaching with robot"
            class="register-media-image"
          >
        </div>
      </div>
    </div>
  </div>

  <script src="js/jquery.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
  <script src="js/main.js"></script>
</body>
</html>
