McGansWebsite/admin/application/views/degree/degree_list.php

220 lines
6.9 KiB
PHP
Raw Permalink Normal View History

2023-01-06 07:23:42 +00:00
<!-- data tables -->
<link href="<?=base_url();?>/assets/datatables/plugins/bootstrap/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css" />
<?php $this->load->view('includes/header');?>
<!-- start page container -->
<div class="page-container">
<!-- start sidebar menu -->
<?php $this->load->view('includes/sidebar');?>
<!-- start page content -->
<div class="page-content-wrapper">
<div class="page-content">
<div class="page-bar">
<div class="page-title-breadcrumb">
<div class=" pull-left">
<div class="page-title">Degree List</div>
</div>
<ol class="breadcrumb page-breadcrumb pull-right">
<li><i class="fa fa-home"></i>&nbsp;<a class="parent-item" href="<?=base_url();?>/dashboard">Home</a>&nbsp;<i class="fa fa-angle-right"></i>
</li>
<li class="active">Degree</li>
</ol>
</div>
</div>
<?php $this->load->view('includes/msg');?>
<div class="row">
<div class="col-md-6">
<div class="card card-topline-red">
<div class="card-body ">
<div class="row">
<div class="col-md-6 col-sm-6 col-xs-6">
<div class="btn-group">
<a style="color:#fff;"href="<?=base_url();?>add_degree">
<button type="button" class="btn btn-info"
data-toggle="modal" data-target="#mediumModel" >add <i class="fa fa-plus"></i></button>
</a>
</div>
2023-01-06 07:23:42 +00:00
</div>
</div>
<div class="table-scrollable">
<table class="table table-hover table-checkable order-column full-width" id="example4">
<thead>
<tr>
<th> S.No</th>
<th> Department</th>
<th> Name </th>
<th> Action </th>
</tr>
</thead>
<tbody>
<?php
if(isset($deg) && $deg->num_rows()>0)
{
$i=1;
foreach($deg->result() as $d)
{
$id=$d->id;
$name=$d->name;
$departmentId=$d->departmentId;
$departmentName=$d->departmentName;
?>
<tr class="odd gradeX">
<td><?=$i;?></td>
<td><?=$departmentName;?></td>
<td><?=$name;?></td>
<td>
<a href="javascript:;" data-id="<?=$id;?>" class="editDegreeClass btn btn-primary btn-xs">
<i class="fa fa-pencil"></i>
</a>
<a data-id="<?=$id;?>" class="degreeClass btn btn-danger btn-xs">
<i class="fa fa-trash-o"></i>
</a>
</td>
</tr>
<?php
$i++;
}
}
?>
</tbody>
</table>
2023-01-06 07:23:42 +00:00
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="exampleModalLabel">Edit Degree</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form action="<?=base_url();?>Degree/editDegree/<?=$id;?>" method="post">
<div class="form-body">
<div class="form-group row">
<div class="col-md-12">
<label class="control-label">Degree Name
<span class="required"> * </span>
</label>
<input type="text" id="degName" value="" data-validation="required" name="degreeName" placeholder="Enter Degree Name" class="form-control">
</div>
</div>
<div class="form-group row">
<div class="col-md-12">
<label class="control-label">Department
<span class="required"> * </span>
</label>
<select class="form-control select2" id="departmenttId" name="depId" data-validation="required">
<option value="" selected="selected">Select</option>
<?php
if(isset($dep) && $dep->num_rows()>0)
{
foreach($dep->result() as $department)
{
?> <option value="<?=$department->id;?>"><?=$department->name;?></option><?php
}
}
?>
</select>
</div>
</div>
<div class="form-actions">
<div class="row">
<div class="offset-md-3 col-md-9">
<input type="submit" name="submit" class="btn btn-info m-r-20" value="Submit">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
2023-01-06 07:23:42 +00:00
</div>
</div>
</div>
</div>
</form>
2023-01-06 07:23:42 +00:00
</div>
</div>
2023-01-06 07:23:42 +00:00
</div>
</div>
<!-- end page content -->
<div class="modal fade" id="deleteRole" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="exampleModalLabel">delete Role</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form action="<?=base_url();?>Degree/deleteDegree" method="post">
<div class="form-body">
<div class="form-group row">
<p style="margin-left: 19px;">Do You Wante Delete?</p>
2023-01-06 07:23:42 +00:00
<input type="hidden" name="degreeId" value="<?=$id;?>">
</div>
2023-01-06 07:23:42 +00:00
<div class="form-actions">
<div class="row">
<div class="offset-md-3 col-md-9">
<input type="submit" name="submit" class="btn btn-info m-r-20" value="Yes">
<button type="button" class="btn btn-default">No</button>
</div>
</div>
2023-01-06 07:23:42 +00:00
</div>
</div>
</form>
2023-01-06 07:23:42 +00:00
</div>
</div>
</div>
</div>
<?php $this->load->view('includes/footer');?>
<!-- data tables -->
<script src="<?=base_url();?>/assets/datatables/jquery.dataTables.min.js"></script>
<script src="<?=base_url();?>/assets/datatables/plugins/bootstrap/dataTables.bootstrap4.min.js"></script>
<script src="<?=base_url();?>/assets/table_data.js"></script>
<script type="text/javascript" src="<?=base_url();?>assets/jquery.cookie.min.js"></script>
<script>
var base_path=$('body').attr('data-path');
$(".degreeClass").click(function(){
$('#deleteRole').modal('show');
2023-01-06 07:23:42 +00:00
var id=$(this).attr('data-id');
//alert(id);
$('#hiddenid').val(id);
});
</script>
<script>
var base_path=$('body').attr('data-path');
$(".editDegreeClass").click(function(){
$('#editModal').modal('show');
var id=$(this).attr('data-id');
var url22=base_path+"Degree/getDegree";
$.post(url22,{id:id,csrf_test_name:$.cookie('csrf_cookie_name')},function(result){
var fields=result.split("-");
var id = fields[0];
var name = fields[1];
var departmentValue = fields[2];
//alert (name)
$('#degName').val(name);
$("select#departmenttId").val(departmentValue)
//$("#departmenttId option : selected").val(departmentValue)
});
});
</script>