<?php include ("kfunctions.php");
//role("dos,hmp");
?>
<html>
<head>
<?php kheader(); ?>

<?php
if (isset($_POST['submit_change'])) {

$adj_mode2=$_POST['adj_mode'];
$adj_type2=$_POST['adj_type'];
$fsitemid2=$_POST['fsitemid'];
   
$adjustment2=$_POST['adjustment'];
$reason2=$_POST['reason'];
$cid=$_POST['cid'];
$schoolclass=$_POST['schoolclass'];
$schoolyear=$_POST['schoolyear'];
$schoolterm=$_POST['schoolterm'];
$adj='1';

$yy=date("Y");
$mm=date("m");
$dd=date("d");
$ourdate=$yy."-".$mm."-".$dd;

$hi=date("H"); $mi=date("i");
$sa=date("sa"); $sa=date("s");
$ourtime=$hi."-".$mi."-".$sa;

$stage='56';
$ip_ad2=$_SERVER['REMOTE_ADDR'];
$kbrowser2=$_SERVER['HTTP_USER_AGENT'];
$currentpage2=$_SERVER['SCRIPT_NAME'];
$userid2 = $_SESSION["rolenumber"];
$activity2="@".$userid2." edited adjustment details of ".$cid." to ".$adj_type2.", ".$fsitemid2.", ".$adjustment2." ( adjustment type, fees structure item, amount repectively) and reason ".$reason2;



$result_scrapss=$dbh->query("select * from scrap where  item2='$fsitemid2'");
$row_scrapss=$result_scrapss->fetchObject();
$count_scrapss=$result_scrapss->rowCount();

$result_bravoss2=$dbh->query("SELECT * from bravos where cid='$cid' and fsitemid='$fsitemid2'");
$row_bravoss2=$result_bravoss2->fetchObject();
$count_bravoss2=$result_bravoss2->rowCount();

//
if ($adj_mode2==1) {

$inserts_homesland=$dbh->query("INSERT into homeland (cid,schoolyear,schoolclass,schoolterm,fsitemid,paytype,amount,adjustment,originalfee,ouruser,paydate,time_recieved,reason) values('$cid','$schoolyear','$schoolclass','$schoolterm','$fsitemid2','$adj_type2','$adjustment2','$adj','$adjustment2','$rolenumber','$ourdate','$ourtime','$reason2')");

//if the item exists already in bravos, just update it. below
if ($count_bravoss2>0){

if($adj_type2=='d'){
$update_bravoss=$dbh->query("UPDATE bravos SET balance = balance + $adjustment2, payable= payable + $adjustment2  where fsitemid='$fsitemid2' and cid='$cid'");
$update_bravoss=$dbh->query("UPDATE bravos SET balance = balance + $adjustment2, payable= payable + $adjustment2  where fsitemid='fullpay' and cid='$cid'");
} 

elseif ($adj_type2=='c'){
$update_bravoss=$dbh->query("UPDATE bravos SET balance = balance - $adjustment2, payable= payable - $adjustment2 where fsitemid='$fsitemid2' and cid='$cid'");
$update_bravoss=$dbh->query("UPDATE bravos SET balance = balance - $adjustment2, payable= payable - $adjustment2 where fsitemid='fullpay' and cid='$cid'");
}

else{}
}

//if the item doesnt exist in bravos, just insert it. below
else{
    $insert_bravoss=$dbh->query("INSERT into bravos (cid,schoolyear,schoolclass,schoolterm,fsitemid,payable,balance,originalfee,lastuser,lastupdate) values ('$cid','$schoolyear','$schoolclass','$schoolterm','$fsitemid2','$adjustment2','$adjustment2','$adjustment2','$rolenumber','$ourdate')");
  $update_bravoss=$dbh->query("UPDATE bravos SET balance = balance + $adjustment2, payable= payable + $adjustment2  where fsitemid='fullpay' and cid='$cid'");
  
}

$insertactivity = $dbh->exec("insert into useractivity (activity,userid,deviceid,browser,currentpage,stage) 
    values('$activity2','$userid2','$ip_ad2','$kbrowser2','$currentpage2','$stage')");

}


//if mod2 which is the dropdown saying both current fees and future affected. has homeland, bravos and paychanger

elseif ($adj_mode2==2) {

    $inserts_homesland=$dbh->query("INSERT into homeland (cid,schoolyear,schoolclass,schoolterm,fsitemid,paytype,amount,adjustment,originalfee,ouruser,paydate,time_recieved,reason) values('$cid','$schoolyear','$schoolclass','$schoolterm','$fsitemid2','$adj_type2','$adjustment2','$adj','$adjustment2','$rolenumber','$ourdate','$ourtime','$reason2')");

//if the item exists already in bravos, just update it. below
if ($count_bravoss2>0){

if($adj_type2=='d'){
$update_bravoss=$dbh->query("UPDATE bravos SET balance = balance + $adjustment2, payable= payable + $adjustment2  where fsitemid='$fsitemid2' and cid='$cid'");
$update_bravoss=$dbh->query("UPDATE bravos SET balance = balance + $adjustment2, payable= payable + $adjustment2  where fsitemid='fullpay' and cid='$cid'");
} 

elseif ($adj_type2=='c'){
$update_bravoss=$dbh->query("UPDATE bravos SET balance = balance - $adjustment2, payable= payable - $adjustment2 where fsitemid='$fsitemid2' and cid='$cid'");
$update_bravoss=$dbh->query("UPDATE bravos SET balance = balance - $adjustment2, payable= payable - $adjustment2 where fsitemid='fullpay' and cid='$cid'");
}

else{}
}

//if the item doesnt exist in bravos, just insert it. below
else{
    $insert_bravoss=$dbh->query("INSERT into bravos (cid,schoolyear,schoolclass,schoolterm,fsitemid,payable,balance,originalfee,lastuser,lastupdate) values ('$cid','$schoolyear','$schoolclass','$schoolterm','$fsitemid2','$adjustment2','$adjustment2','$adjustment2','$rolenumber','$ourdate')");
  $update_bravoss=$dbh->query("UPDATE bravos SET balance = balance + $adjustment2, payable= payable + $adjustment2  where fsitemid='fullpay' and cid='$cid'");
  
}

//counting if a discount/increment already exists for this child and item
$result_paychange=$dbh->query("SELECT * from paychanger where cid='$cid' and fsitemid='$fsitemid2'");
$row_paychange=$result_paychange->fetchObject();
$count_paychange=$result_paychange->rowCount();


if($count_paychange>0){
$update_paychanger=$dbh->query("UPDATE paychanger SET ouruser='$rolenumber', payable='$row_bravoss2->payable', ourdate='$ourdate', adjustment='$adjustment2', adjust_type='$adj_type2', comment='$reason2' where cid='$cid' and fsitemid='$fsitemid2'");
}
else{
$inserts_paychanger=$dbh->query("INSERT into paychanger (cid,fsitemid,ouruser,originalfee,payable,ourdate,adjustment,adjust_type,comment) values('$cid','$fsitemid2','$rolenumber','$adjustment2','$adjustment2','$ourdate','$adjustment2','$adj_type2','$reason2')"); }    

/*
if($count_paychange>0){
$update_paychanger=$dbh->query("UPDATE paychanger SET ouruser='$rolenumber', payable='$row_bravoss2->payable', ourdate='$ourdate', adjustment='$adjustment2', adjust_type='$adj_type2', comment='$reason2' where cid='$cid' and fsitemid='$fsitemid2'");
}
else{
$inserts_paychanger=$dbh->query("INSERT into paychanger (cid,fsitemid,ouruser,originalfee,payable,ourdate,adjustment,adjust_type,comment) values('$cid','$fsitemid2','$rolenumber','$row_bravoss2->originalfee','$row_bravoss2->payable','$ourdate','$adjustment2','$adj_type2','$reason2')");
}  */ 

$insertactivity = $dbh->exec("insert into useractivity (activity,userid,deviceid,browser,currentpage,stage) 
    values('$activity2','$userid2','$ip_ad2','$kbrowser2','$currentpage2','$stage')");

}

elseif ($adj_mode2==3) {

    //counting if a discount/increment already exists for this child and item
$result_paychange=$dbh->query("SELECT * from paychanger where cid='$cid' and fsitemid='$fsitemid2'");
$row_paychange=$result_paychange->fetchObject();
$count_paychange=$result_paychange->rowCount();

if($adj_type2=='c'){

if($count_paychange>0){
$update_paychanger=$dbh->query("UPDATE paychanger SET ouruser='$rolenumber', payable='$now_balance', ourdate='$ourdate', adjustment='$adjustment2', adjust_type='$adj_type2', comment='$reason2' where cid='$cid' and fsitemid='$fsitemid2'");
}
else{
$inserts_paychanger=$dbh->query("INSERT into paychanger (cid,fsitemid,ouruser,originalfee,payable,ourdate,adjustment,adjust_type,comment) values('$cid','$fsitemid2','$rolenumber','$row_bravoss2->originalfee','$now_balance','$ourdate','$adjustment2','$adj_type2','$reason2')");
}

} 

elseif ($adj_type2=='d'){

if($count_paychange>0){
$update_paychanger=$dbh->query("UPDATE paychanger SET ouruser='$rolenumber', payable='$adjustment2', ourdate='$ourdate', adjustment='$adjustment2', adjust_type='$adj_type2', comment='$reason2' where cid='$cid' and fsitemid='$fsitemid2'");
}
else{
$inserts_paychanger=$dbh->query("INSERT into paychanger (cid,fsitemid,ouruser,originalfee,payable,ourdate,adjustment,adjust_type,comment) values('$cid','$fsitemid2','$rolenumber','$adjustment2','$adjustment2','$ourdate','$adjustment2','$adj_type2','$reason2')");
}

$insertactivity = $dbh->exec("insert into useractivity (activity,userid,deviceid,browser,currentpage,stage) 
    values('$activity2','$userid2','$ip_ad2','$kbrowser2','$currentpage2','$stage')");
 
}

}

}

?>


<?php
 
if(isset($_POST["submit_feesitem"])){

$schoolclass=$_POST["schoolclass"];
$schoolyear=$_POST["schoolyear"];
$category=$_POST["category"];

if(!empty($schoolclass)&&!empty($schoolyear)&&!empty($category)){
$fsfilter="where schoolyear LIKE '%".$schoolyear."%' and schoolclass='$schoolclass' and category LIKE '%".$category."%'";}

elseif(!empty($schoolclass)&&!empty($schoolyear)&&empty($category)){
$fsfilter="where schoolyear LIKE '%".$schoolyear."%' and schoolclass='$schoolclass'";}

elseif(!empty($schoolclass)&&empty($schoolyear)&&empty($category)){
$fsfilter="where schoolclass='$schoolclass'";}

elseif(empty($schoolclass)&&!empty($schoolyear)&&!empty($category)){
$fsfilter="where schoolyear LIKE '%".$schoolyear."%' and category LIKE '%".$category."%'";}

elseif(empty($schoolclass)&&empty($schoolyear)&&!empty($category)){
$fsfilter="where category LIKE '%".$category."%'";}

elseif(empty($schoolclass)&&!empty($schoolyear)&&empty($category)){
$fsfilter="where schoolyear LIKE '%".$schoolyear."%'";}

elseif(!empty($schoolclass)&&empty($schoolyear)&&!empty($category)){
$fsfilter="where schoolclass='$schoolclass' and category LIKE '%".$category."%'";}

else {
    $fsfilter='';}

}

else {
    $fsfilter='';
}
?>


<?php
if (isset($_POST['update_cdetail'])) {

$c_name1=$_POST['first_name'];
$c_name2=$_POST['second_name'];  
$c_class=$_POST['child_class'];
$c_category=$_POST['child_category'];

$cid=$_POST['cid'];

if (!empty($c_name1)&&!empty($c_name2)&&!empty($c_class)&&!empty($c_category)) {

$update_cdetails=$dbh->query("UPDATE children SET fname='$c_name1', sname='$c_name2', schoolclass='$c_class', category='$c_category' WHERE cid='$cid'");
$child_details=" - Success: Details for ".$c_name1." have been Updated";
}

elseif (empty($c_class)&&empty($c_category)) {
$update_cdetails=$dbh->query("UPDATE children SET fname='$c_name1', sname='$c_name2' WHERE cid='$cid'");
$child_details=" - Success: Details for ".$c_name1." have been Updated";
}

elseif (!empty($c_class)&&empty($c_category)) {
$update_cdetails=$dbh->query("UPDATE children SET fname='$c_name1', sname='$c_name2', schoolclass='$c_class' WHERE cid='$cid'");
$child_details=" - Success: Details for ".$c_name1." have been Updated";
}

elseif (empty($c_class)&&!empty($c_category)) {
$update_cdetails=$dbh->query("UPDATE children SET fname='$c_name1', sname='$c_name2', category='$c_category' WHERE cid='$cid'");
$child_details=" - Success: Details for ".$c_name1." have been Updated";
}

else{
    $child_details='';
}

}
else{
    $child_details='';

}
?>

<script src="js/print.js"></script>

<?php
if (isset($_POST['update_dayhalf'])) {

$comp_id=$_POST['child_id'];
$day_skola='cat3';

$update_day1=$dbh->query("UPDATE children SET category='$day_skola' WHERE cid='$comp_id'");

}
?>

<?php
if (isset($_POST['update_day'])) {

$comp_id=$_POST['child_id'];
$day_skola='cat1';

$update_day1=$dbh->query("UPDATE children SET category='$day_skola' WHERE cid='$comp_id'");

}
?>

<?php
if (isset($_POST['update_board'])) {

$comp_id=$_POST['child_id'];
$boda='cat2';

$update_day2=$dbh->query("UPDATE children SET category='$boda' WHERE cid='$comp_id'");

}
?>

<?php 
require_once("connect.php");

?>
<link href="css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
<script src="js/sorttable.js"></script>

<script>
function show_dis(ai){$("#dis_edit"+ai).toggle(500);}
function display_row(ai){$("#rows"+ai).toggle();}
function show_2(ai){$("#attachment"+ai).toggle(500);}  
function show_dis2(ai){$("#dis_edit2"+ai).toggle(500);}
function display_row2(ai){$("#row2"+ai).toggle();}
function get_no(ai){document.getElementById("no").value=ai;}
</script>

</head>
<body>


    <div id="wrapper">

        <!-- Navigation -->
        <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
            <!-- Brand and toggle get grouped for better mobile display -->
            <?php ktopbar(); ?>
            <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
            <?php kleftbar(); ?>
            <!-- /.navbar-collapse -->
        </nav>

        <div id="page-wrapper">

            <div class="container-fluid">

 <!-- Page Heading -->
                <div>&nbsp;</div>
                <div class="row">
                    <div class="col-sm-7">
                    <form method='post'>
<div class='col-lg-4'>
<select class="form-control" name="schoolyear">
<option value="<?php echo date("y"); ?>"><?php echo date("Y"); ?></option>
<?php
$result_scrap=$dbh->query("select * from scrap where  type='ya'");
$row_scrap=$result_scrap->fetchObject();
$count_scrap=$result_scrap->rowCount();

if($count_scrap){
    do{
echo "<option value='".$row_scrap->item."'>".$row_scrap->item2."</option>";
}while($row_scrap=$result_scrap->fetchObject());
}else{
    echo "<option value=''>Please contact your IT department. </option>";
}
?>
</select>
</div>

<div class='col-lg-4'>
<select class="form-control" name="schoolclass">
<option value="">Select Class</option>
<?php
$role=$_SESSION["role"];
if($role=="doss"){$type_out="type='secclas'";}
elseif($role=="dosp"){$type_out="type='priclas'";}

$result_scrap=$dbh->query("select * from scrap where type='priclas'");
$row_scrap=$result_scrap->fetchObject();
$count_scrap=$result_scrap->rowCount();

if($count_scrap){
    do{
echo "<option value='".$row_scrap->item."'>".$row_scrap->item2."</option>";
}while($row_scrap=$result_scrap->fetchObject());
}else{
    echo "<option value=''>Please contact your IT department. </option>";
}
?>
</select>
</div>

<div class='col-lg-4'>
<select class='form-control' name='category'>
<option value=''>All Category</option>
  <?php
include("connect.php");

$result_scrap = $dbh->query("select * from scrap where type='category'");
$row_scrap = $result_scrap->fetchObject();
$count_scrap = $result_scrap->rowCount();
if($count_scrap>0){
do{
echo "<option value='".$row_scrap->item."'>".$row_scrap->item2."</option>";
}while($row_scrap = $result_scrap->fetchObject());
}else{
echo "<option value=''>Please contact your IT department. </option>";
}
?>
</select>
    </div>

</div>
<div class='col-sm-1'>
    <input type='submit' name='submit_feesitem' class='btn btn-sm btn-success col-sm-12' value='Filter'>
</div></form>

<div class="col-sm-3"></div>

<div class="col-sm-1">
<button onClick="PrintDiv('myDiv')" style='float:right' class='btn btn-sm btn-primary'>Print</button>
</div>

</div>

<div class='col-lg-12'><p>&nbsp;

</div>

<div id='myDiv'>
<form method='post'>
<div class='col-lg-12'><br></div>
<div class="col-lg-12">
<div class='panel panel-yellow'><!--Initiative-->
<div class='panel-heading'><h3 class='panel-title'>List of Learners <?php echo $child_details; ?> </h3></div>
<div class='panel-body'>
<table class='table table-bordered table-hover table-striped sortable' border='1'>
    <tr>
    <th width='2%'>No</th>
    <th width='12%'>Computer No.</th>
    <th width='2%'>Class</th>
    <th >Student name</th>
    <th >Fees</th>
    <th width="22.7%">Category</th>
    <th width="10%">Action</th>
    </tr>

<?php 

include("connect.php");
$result_children=$dbh->query("SELECT * from children $fsfilter order by autoid desc limit 200");
$row_children=$result_children->fetchObject();
$count_children=$result_children->rowCount();

if($count_children>0){ $r=1;

do {

$result_scrapp=$dbh->query("select * from scrap where  item='$row_children->schoolclass' and type='priclas'");
$row_scrapp=$result_scrapp->fetchObject();
$count_scrapp=$result_scrapp->rowCount();

// echo "<div class='col-lg-12'><br><div class='alert alert-success'> ".$row_children->fname."<br> ".$count_children." </div></div>";

echo "
    <tr>
    <td>".$r++."</td>
    <td>".$row_children->cid.".</td>
    <td>".$row_scrapp->item2."</td>
    <td >".$row_children->fname." ".$row_children->sname."</td>
    <td >";

        $result_bravoss=$dbh->query("select * from bravos where cid='$row_children->cid' and fsitemid='fullpay'");
        $row_bravoss=$result_bravoss->fetchObject();
        $count_bravoss=$result_bravoss->rowCount();
        if($row_bravoss){
       
        echo "<span style='color:green;'>".number_format($row_bravoss->balance)."</span>"." / "."<span style='color:red;'>".number_format($row_bravoss->payable)."</span>";}
        else {
            echo '0';
        }

    echo "</td>
    <td>";

    if(!empty($row_children->category)) {
        $result_scrapps=$dbh->query("select * from scrap where  item='$row_children->category'");
        $row_scrapps=$result_scrapps->fetchObject();
        $count_scrapps=$result_scrapps->rowCount();
        echo $row_scrapps->item2;
    }
    else{
        echo "
        <form method='post'>
<input type='hidden' name='child_id' value='$row_children->cid'>
<input type='submit' name='update_day' class='btn btn-sm btn-info' value='Day'>
<input type='submit' name='update_dayhalf' class='btn btn-sm btn-warning' value='Half Day'>
<input type='submit' name='update_board' class='btn btn-sm btn-success' value='Boarding'>
</form>";
    }

    echo "</td><td>
<button type='button' onClick='show_dis2(".$row_children->autoid.")' class='btn btn-sm btn-primary'><i class='fa fa-edit'></i></button>
<a href='child_statement.php?cid=".$row_children->cid."' class='btn btn-sm btn-success' role='button'><i class='fa fa-dollar'></i></a>

        </td></tr>

<tr id='dis_edit2".$row_children->autoid."' style='border-bottom: 2px solid red;border-top: 2px solid red;display:none;'>

<td colspan='8'>

<form method='post'>
<input type='hidden' name='cid' value='$row_children->cid'>

<div class='row'>

<div class='col-sm-3'>First Name:
<input type='text' class='form-control' name='first_name' value='".$row_children->fname."'>
</div>

<div class='col-sm-3'>Last Name:
<input type='text' class='form-control' name='second_name' value='".$row_children->sname."'>
</div>

<div class='col-sm-2'>Class:
<select class='form-control' name='child_class'>
<option value=''>Class</option>";

$role=$_SESSION["role"];
if($role=="doss"){$type_out="type='secclas'";}
elseif($role=="dosp"){$type_out="type='priclas'";}

$result_scrap=$dbh->query("select * from scrap where type='priclas'");
$row_scrap=$result_scrap->fetchObject();
$count_scrap=$result_scrap->rowCount();

if($count_scrap){
    do{
echo "<option value='".$row_scrap->item."'>".$row_scrap->item2."</option>";
}while($row_scrap=$result_scrap->fetchObject());
}else{
    echo "<option value=''>Please contact your IT department. </option>";
}

echo "
</select>
</div>

<div class='col-sm-2'>Category:
<select class='form-control' name='child_category'>
<option value=''>Category</option>";

$result_scrap = $dbh->query("select * from scrap where type='category'");
$row_scrap = $result_scrap->fetchObject();
$count_scrap = $result_scrap->rowCount();
if($count_scrap>0){
do{
echo "<option value='".$row_scrap->item."'>".$row_scrap->item2."</option>";
}while($row_scrap = $result_scrap->fetchObject());
}else{
echo "<option value=''>Please contact your IT department. </option>";
}
echo"
</select>
</div>

<div class='col-sm-1'>&nbsp
<input type='submit' name='update_cdetail' class='btn btn-sm btn-primary' value='Submit Update'>
</div>

</div></form>&nbsp

<form method='post'>
<div class='row'>&nbsp

<input type='hidden' name='cid' value='$row_children->cid'>
<input type='hidden' name='schoolterm' value='$row_children->term'>
<input type='hidden' name='schoolclass' value='$row_children->schoolclass'>
<input type='hidden' name='schoolyear' value='$row_children->schoolyear'>

<div class='col-sm-2'>Mode:
<select class='form-control' name='adj_mode' required>
<option value=''>Adjustment Mode</option>
<option value='1'>Current</option>
<option value='2'>Current and Future</option>
<option value='3'>Future</option>
</select>
</div>

<div class='col-sm-2'>Adjustment:
<select class='form-control' name='adj_type' required>
<option value=''>Adj Type</option>
<option value='c'>Deduction</option>
<option value='d'>Increment</option>
</select>
</div>

<div class='col-sm-2'>Fees Item:
<select class='form-control' name='fsitemid' required>
<option value=''>Fees Item</option>";

$result_scrap=$dbh->query("select * from scrap where  type='fsitem'");
$row_scrap=$result_scrap->fetchObject();
$count_scrap=$result_scrap->rowCount();
if($count_scrap>0){
do{

echo "<option value='".$row_scrap->item."'>".$row_scrap->item2."</option>";
}while($row_scrap = $result_scrap->fetchObject());
}else{
echo "<option value=''>Please contact your IT department. </option>";
}
echo"
</select>
</div>

<div class='col-sm-2'>Amount:
<input type='text' class='form-control' name='adjustment' value='' required>
</div>

<div class='col-sm-2'>Reason:
<input type='text' class='form-control' name='reason' value='' required>
</div>

<div class='col-sm-1'>&nbsp
<input type='submit' name='submit_change' class='btn btn-sm btn-success' value='Apply Adjustment'>
</div>
</div>
</form>";

} while ($row_children=$result_children->fetchObject()); } 



?>
</td></tr>
</table>
</div></div>
</div>
</form>

</div>

</div>

</form>

                            </div> 

                <!-- /.row -->

               

            </div>
            <!-- /.container-fluid -->
<?php useractivity("on page", "56"); ?>
        </div>
        <!-- /#page-wrapper -->

    </div>
    <!-- /#wrapper -->
    <script>
function checkall(){
<?php
include("connect.php");
$result_citadel=$dbh->query("select * from citadel_o where schoolyear='$schoolyear' and term='$schoolterm' and schoolclass='$schoolclass'");
$row_citadel=$result_citadel->fetchObject();
$count_citadel=$result_citadel->rowCount();

if($count_citadel>0){
    do{
?>
if(document.getElementById('checkallz').checked){
document.getElementById('cidcheck<?php echo $row_citadel->autoid; ?>').checked=true;
}else{
document.getElementById('cidcheck<?php echo $row_citadel->autoid; ?>').checked=false; 
}
<?php
}while($row_citadel=$result_citadel->fetchObject());
}
?>
}
</script>

    <!-- jQuery -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.1/jquery.js"></script>
    <!-- Bootstrap Core JavaScript -->
    <script src="js/bootstrap.min.js"></script>
    <script type="text/javascript" src="js/jquery-1.8.3.min.js" charset="UTF-8"></script>
</body>

</html>
