File: /home/nyiet8349bzl/Backup/sbc_back/homedir/public_html/admin-e-resources/add-subject.php
<?php
//error_reporting('0');
include("../classes/resources_class.php");
$obj = new Work();
if($_SESSION['admin']['id']=='')
{
echo "<script>window.location.href='index.php'</script>";
}
if(isset($_REQUEST['Submit']) and !empty($_REQUEST['Submit']) and ($_REQUEST['Submit']=='Submit'))
{
$resp = $obj->addSubject();
if($resp==0)
{
echo "<script>alert('Required parameter missing')</script>";
}
if($resp==5)
{
echo "<script>alert('Department add Successfully')</script>";
echo "<script>window.location.href='subject-list.php'</script>";
}
if($resp==1 )
{
echo "<script>alert('Department is not save, Please try later')</script>";
echo "<script>window.location.href='add-subject.php'</script>";
}
}
?>
<!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>Subject 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>Department Management</span></li>
<li><span>Add Department</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">Add Department</h2>
</header>
<div class="panel-body">
<form class="form-horizontal form-bordered" name="subject_form" method="Post" action="" enctype="multipart/form-data">
<div class="form-group">
<label class="control-label col-sm-3" for="category">Department Name*</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="subject" maxlength="35" />
</div>
</div>
<div class="row">
<div class="col-sm-3"></div>
<div class="col-sm-1 text-center">
<input type="submit" class="btn btn-primary" name="Submit" value="Submit" onclick="return Validate_Subject();"/>
</div>
</div>
</form>
</div>
</section>
</div>
</div>
</section>
</div>
</section>
<?php include("inc-footer.php"); ?>
</body>
</html>