McGansWebsite/application/views/index.php

86 lines
2.3 KiB
PHP
Raw Normal View History

<?php include 'include/header.php';?>
<!-- sidebar-menu end-->
<!--=============== wrapper ===============-->
<div id="wrapper">
<!-- content-holder -->
<div class="content-holder">
<!-- content -->
<div class="content full-height">
<div class="error-wrap">
<div class="container">
<br>
<div class="row">
<div class="col-md-3">
<div class="content-wrap about-wrap">
<h5 id="semesterEvent" class="bold-title">Department</h5>
<span class="bold-separator"></span>
<div class="clearfix"></div>
</div>
</div>
<div class="col-md-3 getDepartment">
</div>
</div>
</div>
</div>
<div class="partcile-dec" data-parcount="200"></div>
</div>
<!--=============== content-footer ===============-->
<!-- content-footer end -->
</div>
<!-- content-holder end -->
</div>
<!-- wrapper end -->
<?php include 'include/footer.php';?>
<script>
var base_path=$('body').attr('data-path');
$(document).ready(function()
{
var defaultId=$('.setValue').attr('data-defaltId');
var hidd=$('.hidden').attr('data-hid');
console.log("hiddenId",hidd);
var defaultName=$('.setValue').attr('data-defaltName');
var defaultYear=$('.setValue').attr('data-defaltYear');
var data=defaultName+' - '+defaultYear;
var url=base_path+"Welcome/getDepartment";
$.post(url,{hidd:hidd,data:data,defaultId:defaultId,csrf_test_name:$.cookie('csrf_cookie_name')},function(departmentResult)
{
console.log(departmentResult)
var result=departmentResult;
$('.getDepartment').html(result);
});
});
</script>
<script>
$(".semesterEvent").on('click', function() {
var semesterId=$(this).attr('data-id');
var semesterName=$(this).attr('data-name');
var semesterYear=$(this).attr('data-year');
//var dataSession=$('.setValue').attr('data-session');
var data=semesterName+" - "+semesterYear;
var dataId=semesterId;
var url=base_path+"Welcome/getDepartmentClick";
$.post(url,{data:data,dataId:dataId,csrf_test_name:$.cookie('csrf_cookie_name')},function(departmentResult)
{
var result=departmentResult;
alert(result)
$('.getDepartment').html(result);
$('.setValue').html(data);
$('.setValue').attr('data-defaltId' ,dataId );
$('.setValue').attr('data-defaltName' ,semesterName );
$('.setValue').attr('data-defaltYear' ,semesterYear );
});
});
</script>