| Current Path : /home/bolconlineco/public_html/aaaaaa/admin/ |
| Current File : /home/bolconlineco/public_html/aaaaaa/admin/topic.php |
<?php
ob_start();
session_start();
include('../includes/header.php');
if(!isset($_SESSION['adminname']) || $_SESSION['adminrole'] != 1)
{
header("location:../index.php");
exit();
}
if(isset($_GET['courseId']) && isset($_GET['cat_id']))
{
$ccat_id=$_GET['cat_id'];
$catId=$_GET['courseId'];
} ?>
<h3 class="page-title"> Add Topics </h3>
<ul class="page-breadcrumb breadcrumb">
<li> <i class="fa fa-home"></i> <a href="dashbord.php"> Home </a> <i class="fa fa-angle-right"></i> </li>
<li> <a href="category.php"> Categories </a> <i class="fa fa-angle-right"></i></li>
<li> <a href="course.php?cat_id=<?php echo $ccat_id; ?> "> Courses </a> <i class="fa fa-angle-right"></i></li>
<li class="active">topic</li>
</ul>
<!-- END PAGE TITLE & BREADCRUMB-->
</div>
</div>
<?php
if(isset($_GET['msg'])) { ?>
<div class="alert alert-success"><?php echo $_GET['msg']; ?></div>
<?php } ?>
<form id="ID" action="add_topic.php" method="post" class="form-horizontal">
<div class="form-group clearfix">
<label for="topicname" class="col-sm-2 control-label">Topic Name : </label>
<div class="col-sm-6">
<input class="validate[required] form-control" type="text" name="topicname" value="" />
</div>
</div>
<div class="form-group clearfix">
<label for="topicname" class="col-sm-2 control-label">Topic Order : </label>
<div class="col-sm-6">
<input class="validate[required,custom[onlyNumberSp]] small-input form-control" type="text" name="topicorder" value="" />
</div>
</div>
<div class="form-group clearfix">
<label for="topicstatus" class="col-sm-2 control-label">Category Status : </label>
<div class="col-sm-6">
<select name="topicstatus" class="cstat form-control">
<option value="1">Enabled</option>
<option value="0">Disabled</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-6 col-sm-offset-2">
<input type="hidden" name="courseId" value="<?php echo $catId; ?>" />
<input type="hidden" name="ccat_id" value="<?php echo $ccat_id; ?>" />
<input class="add2 btn btn-success" type="submit" name="add-topic" value="Add" />
</div>
</div>
</form>
</div>
<div class="row">
<div class="col-md-12">
<!-- BEGIN EXAMPLE TABLE PORTLET-->
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption"> <i class="fa fa-globe"></i>Topic Management</div>
</div>
<div class="portlet-body">
<?php
$result=topic_by_courseId($catId);
if(mysql_num_rows($result) > 0 ) { ?>
<table class="tablestyle table table-striped table-bordered table-hover" id="sample_2">
<thead>
<tr>
<th>Sr#</th>
<th>Topic Name</th>
<th>Order</th>
<th>Status</th>
<th>Assignments</th>
<th>Study Materils</th>
<th>Action</th>
</tr><!-- end title -->
</thead>
<tbody>
<?php
$sr=0;
while($rowSet=mysql_fetch_array($result)) {
$sr+=1;
extract($rowSet); ?>
<tr>
<td><?php echo $sr; ?></td>
<td><?php echo $topicName;?></td>
<td><?php echo $topicOrder?></td>
<td>
<?php
if($topicStatus==1)
{
echo "Enabled";
}
else
{
echo "Disabled";
}
?>
</td>
<?php
$querya="select * from topicassignment where topicId='$topicId'";
$resulta=mysql_query($querya) or die(mysql_error());
$numrows=mysql_num_rows($resulta);
$StudyMaterials = mysql_query("select * from topicstudy where topicId='$topicId'") or die(mysql_error());
$countStudyMaterials = mysql_num_rows($StudyMaterials);
?>
<td>
<a href="topicass.php?catId=<?php echo $ccat_id; ?>&courseId=<?php echo $catId;?>&topicId=<?php echo $topicId; ?>">View
</a>
<?php
if($numrows==1)
{
?>
<img src="../images/ok.png" />
<?php
}else if($numrows==0)
{
?>
<img src="../images/close.png" />
<?php
}
?>
</td>
<td>
<a href="topicstudymat.php?catId=<?php echo $ccat_id; ?>&courseId=<?php echo $catId;?>&topicId=<?php echo $topicId; ?>">Study Materials</a> <?php
if($countStudyMaterials==1)
{
?>
<img src="../images/ok.png" />
<?php
}else if($countStudyMaterials==0)
{
?>
<img src="../images/close.png" />
<?php
}
?>
</td>
<td>
<a href="edit_topic.php?catId=<?php echo $ccat_id;?>&course_id=<?php echo $catId; ?> &id=<?php echo $rowSet['topicId']; ?>"><img src="../images/edit-icon.png" alt="Edit"/></a>
<a href="delete_topic.php?catId=<?php echo $ccat_id;?>&course_id=<?php echo $catId;?> &id=<?php echo $rowSet['topicId'];?>" onclick='return confirm("Are you Sure to delete ?") ' ;> <img src="../images/delete-icon.png" alt="Delete" /> </a>
</td>
</tr><!-- end values -->
<?php
}
}else
{
echo "No topic inserted for this course";
}
?>
</tbody>
</table>
</div><!-- end data -->
</div> <!-- end content -->
</div><!-- end wrapper -->
<?php include('../includes/footer.php');?>