HEX
Server: Apache
System: Linux sg2plmcpnl492417.prod.sin2.secureserver.net 4.18.0-553.58.1.lve.el8.x86_64 #1 SMP Fri Jul 4 12:07:06 UTC 2025 x86_64
User: nyiet8349bzl (9207396)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/nyiet8349bzl/Backup/sbc_back/homedir/public_html/admin-e-resources/edit-teacher.php
<?php   
	//error_reporting(-1);
	include("../classes/resources_class.php");
	$obj = new Work();
	if($_SESSION['admin']['id']=='')
	{
		echo "<script>window.location.href='index.php'</script>";
	}
	if(isset($_REQUEST['action']) and !empty($_REQUEST['action']) and ($_REQUEST['action']=='updateTeacher'))
	{
		$resp = $obj->updateTeacher();
		if($resp==0)
		{
		  echo "<script>alert('Required parameter missing')</script>";
		}
		if($resp==5)
		{
			echo "<script>alert('Teacher update Successfully')</script>";
			echo "<script>window.location.href='teacher-list.php'</script>";
		}
		if($resp==1 )
		{
			echo "<script>alert('Teacher is not save, Please try later')</script>";
			echo "<script>window.location.href='edit-teacher.php'</script>";
		}
	}
	
	if(isset($_REQUEST['id'],$_REQUEST['action']) and ($_REQUEST['action']=='editTeacher') and !empty($_REQUEST['id']))
	{        
		$data  = mysqli_fetch_array(mysqli_query($obj->myconn, "SELECT * FROM teacher where id='".$_REQUEST['id']."'"));
	}
?>
<!doctype html>
<html class="fixed">
	<head>
		<title>Admin</title>
		<?php include("inc-head.php");?>
	</head>
	<body>
		<section class="body">
			<!-- start: header -->
			<?php include("inc-header.php"); ?>
			<!-- end: header -->
			<div class="inner-wrapper">
				<!-- start: sidebar -->
				<?php include("inc-navigation.php"); ?>
				<!-- end: sidebar -->
				<section role="main" class="content-body">
					<header class="page-header">
						<h2>Teacher Management</h2>
						<div class="right-wrapper pull-right">
							<ol class="breadcrumbs">
								<li>
									<a href="dashboard.php">
										<i class="fa fa-home"></i>
									</a>
								</li>
								<li><span>Teacher Management</span></li>
								<li><span>Edit Teacher</span></li>
							</ol>
							<a class="sidebar-right-toggle"></a>
						</div>
					</header>
					<!-- start: page -->
						<div class="row">
							<div class="col-lg-12">
								<section class="panel">
									<header class="panel-heading">
										<div class="panel-actions">
											<a href="#" class="panel-action panel-action-toggle" data-panel-toggle></a>
											<a href="#" class="panel-action panel-action-dismiss" data-panel-dismiss></a>
										</div>
										<h2 class="panel-title">Edit Teacher</h2>
									</header>
									<div class="panel-body">
										<form class="form-horizontal form-bordered" name="teacher_form" method="Post" action="" enctype="multipart/form-data">
											<input type="hidden" name="action" value="updateTeacher" />
											<input type="hidden" name="id" value="<?php echo $data['id']; ?>" />
											<div class="form-group">
												<label class="control-label col-sm-2" for="category">Subject*</label>
												<div class="col-sm-10">
													<input type="text" class="form-control" name="subject" value="<?php $name = mysqli_fetch_array(mysqli_query($obj->myconn, "SELECT id, name FROM subject where id = '".$data['subject_id']."' ")); echo $name['name']; ?>" readonly>
												</div>
											</div>
											<div class="form-group">
												<label class="col-md-2 control-label" for="inputDefault">Teacher Name*</label>
												<div class="col-md-10">
													<input type="text" class="form-control" name="teacher" value="<?php echo $data['name']; ?>">
												</div>
											</div>
											<div class="row">
												<div class="col-sm-2"></div>
												<div class="col-sm-1 text-center">
													<input type="submit" class="btn btn-primary" name="Update" value="Update" onclick="return Validate_Teacher();" />
												</div>
											</div>
										</form>
									</div>
								</section>	
							</div>
						</div>
				</section>
			</div>
		</section>
<?php include("inc-footer.php"); ?>
</body>
</html>