<?php include('inc/header.php');
$clientObj->select($org_id); 
if(isset($_POST['std_category_submit']))
{
	$std_categoryObj->std_category=sanitize($_POST['std_category']);
	$std_categoryObj->org_id=$org_id;
	$std_categoryObj->insert();
	$msg=1;
}
/* Delete Course */ 
if(isset($_POST['delsubmit']))
{
	$id=sanitize($_POST['del_id']);
	$std_categoryObj->select($id);
	$std_categoryObj->delete($id);
}
/* Delete Course */

?>
<!--Delete Form--> 
             
<form action="#" name="delete_std_catform" id="delete_std_catform" method="POST">
<input type="hidden" name="del_id" id="del_id" value="" />
<input type="hidden" name="delsubmit" value="<?php echo time(); ?>" />
</form>
<!--Delete Form-->
<!-- mobile navigation -->
			<nav id="mobile_navigation"></nav>
			
			<section id="breadcrumbs">
				<div class="container">
					<ul>
						<li><a href="#">Web school </a></li>
                        <li><a href="#">General Settings </a></li>
						<li><span>Student Category</span></li>						
					</ul>
				</div>
			</section>
			<section class="container clearfix main_section">
				<div id="main_content_outer" class="clearfix">
					<div id="main_content">
						<div class="alert alert-info"><strong>Student Category</strong></div>
                         <?php 
						if($setting_error==1)
						{
						?>
                        <div class="warning">Hello ! Please <a href="general_setting.php" />Click Here</a> Complete your settings page. It is very important to fill up your general settings before you start.</div>
                        <?php
						}?>
                        <?php 
						if($msg==1)
						{
						?>
                        <div class="success">Student Category  has been added successfully</div>
                        <?php
						}?> 
                         
						<!-- main content -->
        
                        <form action="#" method="POST" id="stdcategory" name="stdcategory" enctype="multipart/form-data">
                          
						<div class="row">
							<div class="col-sm-12">
								<div class="panel panel-default">
									<!--<div class="panel-heading">
										<h4 class="panel-title">Simple Validation</h4>
									</div>-->
									<div class="panel-body">
											<div class="form_sep">
												<label for="reg_input_name" class="req">Student Category Name</label>
												<input type="text" id="std_category" name="std_category" class="form-control" data-required="true" >
											</div>  
									</div>
								</div>
							</div>
						</div>
						<div class="row">
							<div class="col-sm-5">
							<div class="form_sep">
							<button class="btn btn-success" type="submit" name="std_category_submit" id="std_category_submit" >Save</button>
							</div>
                            </div>
                                
                            
						</div>
						</form>
                        <div style="margin-top:20px;">
						<div class="row">
							<div class="col-sm-12"> 
							<div class="panel panel-default">
                           
							<?php $std_categorylist=$std_categoryObj->selectorgall(); 
							if(count($std_categorylist)>0)
							{?>
                            <div class="panel-heading">
										<h4 class="panel-title"> Student Category List </h4>
									</div>
							<div class="panel_controls">
										<div class="row">
											<div class="col-sm-4">
												<label for="table_search">Search:</label>
												<input type="text" id="table_search" class="form-control">
											</div>
											<div class="col-sm-3 col-xs-6">
												
											</div>
											<div class="col-sm-3 col-xs-6">
												
											</div>
										</div>
									</div>
                            <table id="resp_table" class="table toggle-square" data-filter="#table_search" data-page-size="40">
										<thead>
											<tr>
												<th data-toggle="true">Student Category</th>
                                                <th data-hide="phone,tablet" > Edit</th>
                                                <th > Delete</th>
											</tr>
										</thead>
										<tbody>
                                        <?php foreach($std_categorylist as $list)
										{?>
											<tr>
                                            <td><?php echo $list->std_category; ?></td>
                                            <td><a href="<?php echo VIEW_SITE_URL; ?>std_category.php?id=<?php echo $list->id; ?>"><img class="" name="editstdcat" id="editstdcat" src="img/edit.png" edit="<?php echo $list->id; ?>" /></a></td>
                                            <td><img src="img/error.png" class="deletestdcategory" name="del" id="del" del_id="<?php echo $list->id; ?>" title="Remove " /></td>
                                            </tr>
                                        <?php } ?>
											
										</tbody>
										<tfoot class="hide-if-no-paging">
											<tr>
												<td colspan="6" class="text-center">
													<ul class="pagination pagination-sm"></ul>
												</td>
											</tr>
										</tfoot>
									</table>
                            <?php } ?>
							</div>
                            </div>
						</div>
						</div>
							
						</div>
					</div>
				
			</section>
			<div id="footer_space"></div>
		</div>
	<?php include('inc/footer.php'); ?>