晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。   林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。   见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝)   既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。   南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。 sh-3ll

HOME


sh-3ll 1.0
DIR:/home/bolconlineco/www/aaaaaa/coordinator/
Upload File :
Current File : //home/bolconlineco/www/aaaaaa/coordinator/studentInfo.php
<?php
ob_start();
ob_flush();
session_start();
include('includes/headerOld.php');
include('functions.php');
include ('../PHPMailer/class.phpmailer.php');
include ('../PHPMailer/class.smtp.php');
if(!isset($_SESSION['coordinator']) || $_SESSION['coordinatorrole'] != 2) {
	header("location:../index.php");
	exit();
}
header("Cache-Control: no-cache, must-revalidate");
$id = $_GET['Id']; ?>

<style>
    .tble tr {
        display: block;
        margin-bottom: 10px;
    }
</style>
<script src="../combine/colorbox-master/jquery.colorbox.js"></script>
<link rel="stylesheet" href="../combine/colorbox-master/colorbox.css" />
<script>

    $("document").ready(function(){

        $("#nte tr:odd").addClass('high');

    });

    function checkValue (vv)
    {
        if(vv==='3')
        {
            document.getElementById('otther').style.display="inline-block";
        }
        else
        {
            document.getElementById('otther').style.display="none";
        }
    }
    function checking (vv)
    {
        if(vv==='paid')
        {
            document.getElementById('showpayment').style.display="inline-block";
        }
        else
        {
            document.getElementById('showpayment').style.display="none";
        }
    }

    function checke (vv)
    {
        if(vv==='3')
        {
            document.getElementById('otther').style.display="inline-block";
        }
        else
        {
            document.getElementById('otther').style.display="none";
        }
    }
    $("#date1").datepick({dateFormat:'dd/mm/yyyy'});
</script>
<script>
    $("document").ready(function(){
        $("#ddd").datepicker({dateFormat:'dd/mm/yy'});

    });
</script>
<script>
    $("#date").datepick({dateFormat:'dd/mm/yyyy'});
    $(".group1").colorbox({rel:'group1'});
</script>
<?php include('inc.php');

if(isset($_POST['add-fee'])) {

    $fee=sql_strip($_POST['fee']);
    $query = mysql_query("insert into tbl_fee values ('','$id','$fee')") or die(mysql_error());
    echo "<script>window.location.href='studentInfo.php?Id=$id&fe'</script>";

}

if(isset($_POST['add-fees']))
{
    $payment=sql_strip($_POST['payment']);

    $amount=sql_strip($_POST['amount']);

    $fee_desc=sql_strip($_POST['fee_desc']);

    $date=sql_strip($_POST['ss']);

    $payment_type=sql_strip($_POST['payment_type']);

    if($payment=='paid')
    {

        $queryInstall = mysql_query("insert into tbl_fees_install values ('','$id','','$amount','$payment_type','$fee_desc','$date',1)") or die(mysql_error());

    } else if($payment=='payable') {


        $queryInstall = mysql_query("insert into tbl_fees_install values ('','$id','$amount','','','$fee_desc','$date',0)") or die(mysql_error());
    }


    //header("location:studentInfo.php?Id=$id");
    //exit();
    echo "<script>window.location.href='studentInfo.php?Id=$id&af'</script>";
}

?>

<?php

if(isset($_POST['add_install']))
{
    $amount=sql_strip($_POST['amount']);
    $date=sql_strip($_POST['date']);
    $iddd=$_GET['eid'];
    $query="insert into tbl_install values ('','$id','$amount','$date')";
    mysql_query($query) or die(mysql_error());
    echo "<script>window.location.href='studentInfo.php?Id=$id&af'</script>";
}


?>

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

    $payble=sql_strip($_POST['payble']);
    $paiddate=sql_strip($_POST['paiddate']);
    $eid=sql_strip($_GET['eid']);

    $queryq="update tbl_install set paid='$payble',piad_date='$paiddate' where id='$eid'";

    $result=mysql_query($queryq) or die(mysql_error());
    echo "<script>window.location.href='studentInfo.php?Id=$id&af'</script>";
}

if(isset($_POST['update-fees'])) {

    $payment=sql_strip($_POST['pt']);
    $nfid=$_GET['feid'];
    $amount=sql_strip($_POST['amount']);
    $fee_desc=sql_strip($_POST['fee_desc']);
    $date=sql_strip($_POST['ss']);

    if($payment=='paid') {
        $type=sql_strip($_POST['payment_type']);
        $queryInstall = mysql_query("update tbl_fees_install set paid='$amount',des='$fee_desc',fee_date='$date',bankname='$type' where id='$nfid'") or die(mysql_error());
    } else if($payment=='payable') {
        $queryInstall = mysql_query("update tbl_fees_install set payble='$amount',des='$fee_desc',fee_date='$date' where id='$nfid'") or die(mysql_error());
    }
    // header("location:studentInfo.php?Id=$id");

    echo "<script>window.location.href='studentInfo.php?Id=$id&uf'</script>";
}

if(isset($_POST['vsubmit'])){
    $vid=$_POST['vid'];
    $rre=mysql_query("select * from tbl_studentvideos where videoId='$vid'") or die(mysql_error());
    $qq="insert into tbl_studentvideos values ('','$id','$vid')";
    mysql_query($qq) or die(mysql_error());
    header("location:studentInfo.php?Id=$id");
    exit();
}

if(isset($_POST['upda_amount'])) {
    $upd_am=$_POST['upd_am'];
    $uq=mysql_query("update tbl_fee set fee='$upd_am' where rollno='$id'") or die(mysql_error());
    echo "<script>window.location.href='studentInfo.php?Id=$id&uf'</script>";
}
if(isset($_POST['st_document']))
{
    $name=$_FILES['document']['name'];
    $tmpname=$_FILES['document']['tmp_name'];
    $title=$_POST['title'];
    $ext=pathinfo($name,PATHINFO_EXTENSION);

    $array=array('jpg','jpeg','png','pdf','doc','docx');
    if(in_array($ext,$array))
    {
        $rand=rand();
        $filename=$rand.$name;
        if(move_uploaded_file($tmpname, '../combine/stdocs/'.$filename))
        {
            $InsertDoc=mysql_query("insert into tbl_stdocs values ('','$title','$filename','$id')") or die(mysql_error());
            echo "<script>window.location.href='studentInfo.php?Id=$id&vn'</script>";
        }

    }

    else
    {
        echo "<script>window.location.href='studentInfo.php?Id=$id&nv'</script>";
    }
}
if(isset($_GET['imgid']))
{
    $imgid=$_GET['imgid'];

    $qq="select filename from tbl_stdocs where id='$imgid'";
    $rr=mysql_query($qq) or die(mysql_error());
    $fet=mysql_fetch_array($rr);
    if(file_exists('../combine/stdocs/'.$fet['filename']))
    {
        unlink('../combine/stdocs/'.$fet['filename'])	;
    }

    $q="delete from tbl_stdocs where id='$imgid'";
    mysql_query($q) or die(mysql_error());
    echo "<script>window.location.href='studentInfo.php?Id=$id&de'</script>";
}
?>
<script type="text/javascript">
    $(function() {
        $("#tabs").tabs({ fx: { height: 'toggle', opacity: 'toggle' } });
    });
</script>
<script type="text/javascript">
    $(document).ready(function(){
        $(".ui-corner-top").corner("top 10px");
        $(".ui-corner-all").corner("10px");

    })
</script>
<div style="padding:10px;">

<!--   <p><strong><span id="stassignhead">Tutor:</span></strong><span id="studenassignment"><?php echo $tutorFetch['full']; ?></span></p>-->
<?php
$qquery_t=mysql_query("select tutorId from assigncourse where rollno='$id'") or die(mysql_error());

$ffetch_t=mysql_fetch_array($qquery_t);

$gTutorFetch="select tutorId,concat_ws(' ',firstname,lastname) as full from tutor where tutorId=".$ffetch_t['tutorId'];
$gTutorResultt=mysql_query($gTutorFetch) or die(mysql_error());
$tutorFetcher=mysql_fetch_array($gTutorResultt); ?>

<div class="row clearfix">

<!-- BEGIN EXAMPLE TABLE PORTLET-->
<div class="portlet box blue">
<div class="portlet-title clearfix">
    <div class="caption"> <i class="fa fa-globe"></i>Student Id : <?php echo $id; ?>
        <span style="margin-left: 50px;">Student Name : </span><?php echo $fname.' '.$lname;?></div>
</div>

<div class="portlet-body clearfix">

<div><span style="font-size:18px;">Course Name:</span> <span style="color:#28166F;font-size:18px"><?php echo $resultSEt['courseName']; ?></span></div>
<div><span style="font-size:18px;">Tutor Name:</span> <span style="color:#28166F;font-size:18px"><?php echo $tutorFetcher['full']; ?></span></div><br />


<div style="-moz-border-radius: 10px 10px 10px 10px;" class="ui-tabs ui-widget ui-widget-content ui-corner-all" id="tabs">
<ul style="-moz-border-radius: 10px 10px 10px 10px;" class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
    <li style="-moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px;" class="ui-corner-top ui-tabs-selected ui-state-active"><a href="#tabs-1">Personal Details</a></li>
    <li style="-moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px;" class="ui-corner-top ui-state-default"><a href="#ui-tabs-9">Employment Details</a></li>
    <li style="-moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px;" class="ui-corner-top ui-state-default"><a href="#ui-tabs-8">Fee Details</a></li>
    <li style="-moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px;" class="ui-corner-top ui-state-default"><a href="#ui-tabs-3">Course Details</a></li>
    <li style="-moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px;" class="ui-corner-top ui-state-default"><a href="#ui-tabs-4">Notes</a></li>
    <li style="-moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px;" class="ui-corner-top ui-state-default"><a href="#ui-tabs-13">Emails</a></li>
    <li style="-moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px;" class="ui-corner-top ui-state-default"><a href="#ui-tabs-5">Tasks</a></li>
    <li style="-moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px;" class="ui-corner-top ui-state-default"><a href="#ui-tabs-a">Logs</a></li>
    <li style="-moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px;" class="ui-corner-top ui-state-default"><a href="#ui-tabs-7">Videos</a></li>
    <li style="-moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px;" class="ui-corner-top ui-state-default"><a href="#ui-tabs-12">Documents</a></li>
</ul>
<div style="" id="tabs-1" class="tabsContent ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"><ul class="thumbs">
<table width="650" border="0" id="personnaldetails" class="tablestyle table table-striped table-bordered table-hover">
<thead>
<tr>

    <td id="col">Registration Date:</td>
    <td id="col2"><?php
        if(isset($_POST['submit-1']))
        {
            $rr=$_POST['regist'];

            $full=explode('-',$rr);
            ?>
            <form action="" method="post" autocomplete="off">
                <select name="day">
                    <option value="<?php echo $full[2]; ?>"><?php echo $full[2];?></option>
                    <?php
                    for( $d=01; $d<=31; $d++)
                    {
                        ?>
                        <option value="<?php echo str_pad($d,2,'0',STR_PAD_LEFT);?>"><?php echo str_pad($d,2,'0',STR_PAD_LEFT);?></option>
                    <?php
                    }

                    ?>
                </select>
                <select name="month">
                    <option value="<?php echo $full[1];?>"><?php echo $full[1];?></option>
                    <?php
                    for( $d=01; $d<=12; $d++)
                    {
                        ?>
                        <option value="<?php echo str_pad($d,2,'0',STR_PAD_LEFT);?>"><?php echo str_pad($d,2,'0',STR_PAD_LEFT);?></option>
                    <?php
                    }

                    ?>



                </select>
                <select name="year">
                    <option value="<?php echo $full[0]; ?>"><?php echo $full[0];?></option>
                    <?php
                    for($d=date("Y"); $d>=1960; $d--)
                    {
                        if($full[0]==$d)
                        {
                        }else{
                            ?>
                            <option value="<?php echo str_pad($d,2,'0',STR_PAD_LEFT);?>"><?php echo str_pad($d,2,'0',STR_PAD_LEFT);?></option>
                        <?php
                        }
                    }
                    ?>
                </select>


                <input type="submit" name="registrationdate" value="" class="update" style="width:30px;" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />

            </form>
        <?php

        }else{
            echo date('d/m/Y',strtotime($registrationdate));
        }
        ?>
    </td>
    <td>
        <?php if(!isset($_POST['submit-1']))
        {
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
                <div id="btn">
                    <input type="hidden" name="regist" value="<?php echo $registrationdate; ?>" />
                    <input type="submit" name="submit-1" class="edit" value="" style="width:40px;" />

                </div>
            </form>
        <?php
        }else{
            ?>

        <?php
        }
        ?>
    </td>
    <td>

    </td>
</tr>
</thead>
<tbody>
<tr>
    <td id="col">StudentID:</td>
    <td id="col2"><?php echo $rollno;?></td>
</tr>
<tr>
    <td id="col">Course:</td>
    <td id="col2"><?php echo $resultSEt['courseName'];?></td>
</tr>
<tr>
    <td id="col">Title:</td>
    <td id="col2"><?php
        if(isset($_POST['title-3']))
        {
            $title=$_POST['tit'];
            ?>
            <form action="" method="post">

                <select name="titles" id="tt" onchange='checkValue(this.value)' class="cstat">
                    <option value="<?php echo $title; ?>"><?php echo $title; ?></option>
                    <option value="Mr">Mr</option>
                    <option value="Mrs">Mrs</option>
                    <option value="Miss">Miss</option>
                    <option value="Mis">Mis</option>
                    <option value="3">Other</option>
                </select>

                <input type="text" name="title" value="" id="otther" style="width:160px; display:none;" />

                <input type="submit" name="updatetitle" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />

            </form>
        <?php

        }else{
            echo $title;
        }
        ?></td>
    <td><?php if(!isset($_POST['title-3']))
        {
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
                <div id="btn">
                    <input type="hidden" name="tit" value="<?php echo $title; ?>" />
                    <input type="submit" name="title-3" class="edit" value="" style="width:40px;"  />
                </div>
            </form>
        <?php
        }else{
            ?>

        <?php
        }
        ?></td>
</tr>
<tr>
    <td id="col">First Name:</td>
    <td id="col2"><?php
        if(isset($_POST['submit-3']))
        {
            $firstname=$_POST['firstname'];
            ?>
            <form action="" method="post">
                <input type="text" name="firstname" value="<?php echo $firstname; ?>" />
                <input type="hidden" name="oldfname" value="<?php echo $firstname; ?>" />
                <input type="submit" name="updatefname" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>
        <?php

        }else{
            echo $fname;
        }
        ?></td>
    <td><?php if(!isset($_POST['submit-3']))
        {
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
                <div id="btn">
                    <input type="hidden" name="firstname" value="<?php echo $fname; ?>" />
                    <input type="submit" name="submit-3" class="edit" value="" style="width:40px;"  />
                </div>
            </form>
        <?php
        }else{
            ?>

        <?php
        }
        ?></td>
</tr>
<tr>
    <td id="col">Last Name:</td>
    <td id="col2"><?php
        if(isset($_POST['submit-4']))
        {
            $lname=$_POST['lname'];
            ?>
            <form action="" method="post">
                <input type="text" name="lastname" value="<?php echo $lname; ?>" />
                <input type="hidden" name="oldlname" value="<?php echo $lname; ?>" />
                <input type="submit" name="updatelname" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>
        <?php

        }else{
            echo $lname;
        }
        ?></td>
    <td><?php if(!isset($_POST['submit-4']))
        {
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
                <div id="btn">
                    <input type="hidden" name="lname" value="<?php echo $lname; ?>" />
                    <input type="submit" name="submit-4" class="edit" value="" style="width:40px;"  />
                </div>
            </form>
        <?php
        }else{
            ?>

        <?php
        }
        ?></td>
</tr>
<tr>
    <td id="col">Date OF Birth:</td>
    <td id="col2"><?php
        if(isset($_POST['submit-5']))
        {
            $dateob=$_POST['dateob'];
            $full=explode('-',$dateob);

            ?>
            <form action="" method="post">
                <select name="day">
                    <option value="<?php echo $full[2]; ?>"><?php echo $full[2];?></option>
                    <?php
                    for( $d=01; $d<=31; $d++)
                    {
                        ?>
                        <option value="<?php echo str_pad($d,2,'0',STR_PAD_LEFT);?>"><?php echo str_pad($d,2,'0',STR_PAD_LEFT);?></option>
                    <?php
                    }

                    ?>
                </select>
                <select name="month">
                    <option value="<?php echo $full[1];?>"><?php echo $full[1];?></option>
                    <?php
                    for( $d=01; $d<=12; $d++)
                    {
                        ?>
                        <option value="<?php echo str_pad($d,2,'0',STR_PAD_LEFT);?>"><?php echo str_pad($d,2,'0',STR_PAD_LEFT);?></option>
                    <?php
                    }

                    ?>


                </select>
                <select name="year">
                    <option value="<?php echo $full[0]; ?>"><?php echo $full[0];?></option>
                    <?php
                    for($d=date("Y"); $d>=1960; $d--)
                    {
                        if($full[0]==$d)
                        {
                        }else{
                            ?>
                            <option value="<?php echo str_pad($d,2,'0',STR_PAD_LEFT);?>"><?php echo str_pad($d,2,'0',STR_PAD_LEFT);?></option>
                        <?php
                        }
                    }
                    ?>
                </select>



                <input type="submit" name="updatedob" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>
        <?php

        }else{
            echo date('d/m/Y',strtotime($dob));
        }
        ?></td>
    <td><?php if(!isset($_POST['submit-5']))
        {
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
                <div id="btn">
                    <input type="hidden" name="dateob" value="<?php echo $dob; ?>" />
                    <input type="submit" name="submit-5" class="edit" value="" style="width:40px;"  />
                </div>
            </form>
        <?php
        }else{
            ?>

        <?php
        }
        ?></td>
</tr>
<tr>
    <td id="col">Email: </td>
    <td id="col2"><?php
        if(isset($_POST['submit-email']))
        {
            $email=$_POST['email'];
            ?>
            <form action="" method="post">
                <input type="text" name="newemail" value="<?php echo $email; ?>" />
                <input type="hidden" name="oldemail" value="<?php echo $email; ?>" />
                <input type="submit" name="updateemail" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>
        <?php

        }else{
            echo $email;
        }
        ?></td>
    <td><?php if(!isset($_POST['submit-email']))
        {
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
                <div id="btn">
                    <input type="hidden" name="email" value="<?php echo $email; ?>" />
                    <input type="submit" name="submit-email" class="edit" value="" style="width:40px;"  />
                </div>
            </form>
        <?php
        }else{
            ?>

        <?php
        }
        ?></td>
</tr>
<tr>
    <td id="col">Password: </td>
    <td id="col2"><?php
        if(isset($_POST['submit-pass']))
        {
            $email=$_POST['email'];
            ?>
            <form action="" method="post">
                <input type="password" name="newpass" id="passcheck" value="" />
                <input type="hidden" name="passemail" value="<?php echo $email; ?>" />
                <input type="checkbox" name="chec" id="check" style="margin:0;width: 16px;height: 14px;" />Show password
                <input type="submit" name="updatepass" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>
        <?php

        }else{
            echo "Change Password";
        }
        ?></td>
    <td><?php if(!isset($_POST['submit-pass']))
        {
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
                <div id="btn">
                    <input type="hidden" name="email" value="<?php echo $email; ?>" />
                    <input type="submit" name="submit-pass" class="edit" value="" style="width:40px;"  />
                </div>
            </form>
        <?php
        }else{
            ?>

        <?php
        }
        ?></td>
</tr>
<tr>
    <td id="col">Address line1:</td>
    <td id="col2"><?php
        if(isset($_POST['submit-6']))
        {
            $address1=$_POST['address1'];
            ?>
            <form action="" method="post">
                <input type="text" name="newaddress1" value="<?php echo $address1; ?>" />
                <input type="hidden" name="oldaddress1" value="<?php echo $address1; ?>" />
                <input type="submit" name="updateaddress1" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>
        <?php

        }else{
            echo $address;
        }
        ?></td>
    <td><?php if(!isset($_POST['submit-6']))
        {
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
                <div id="btn">
                    <input type="hidden" name="address1" value="<?php echo $address; ?>" />
                    <input type="submit" name="submit-6" class="edit" value="" style="width:40px;"  />
                </div>
            </form>
        <?php
        }else{
            ?>

        <?php
        }
        ?></td>
</tr>
<tr>
    <td id="col">Address line2:</td>
    <td id="col2"><?php
        if(isset($_POST['submit-62']))
        {
            $address2=$_POST['address2'];
            ?>
            <form action="" method="post">
                <input type="text" name="newaddress2" value="<?php echo $address2; ?>" />

                <input type="submit" name="updateaddress2" value="" class="update" />
                <input type="submit" name="submm2" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>
        <?php

        }else{
            echo $address2;
        }
        ?></td>
    <td><?php if(!isset($_POST['submit-62']))
        {
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
                <div id="btn">
                    <input type="hidden" name="address2" value="<?php echo $address2; ?>" />
                    <input type="submit" name="submit-62" class="edit" value="" style="width:40px;"  />
                </div>
            </form>
        <?php
        }else{
            ?>

        <?php
        }
        ?></td>
</tr>
<tr>
    <td id="col">Address line3:</td>
    <td id="col2"><?php
        if(isset($_POST['submit-63']))
        {
            $address3=$_POST['address3'];
            ?>
            <form action="" method="post">
                <input type="text" name="newaddress3" value="<?php echo $address3; ?>" />

                <input type="submit" name="updateaddress3" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>
        <?php

        }else{
            echo $address3;
        }
        ?></td>
    <td><?php if(!isset($_POST['submit-63']))
        {
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
                <div id="btn">
                    <input type="hidden" name="address3" value="<?php echo $address3; ?>" />
                    <input type="submit" name="submit-63" class="edit" value="" style="width:40px;"  />
                </div>
            </form>
        <?php
        }else{
            ?>

        <?php
        }
        ?></td>
</tr>
<tr>
    <td id="col">City:</td>
    <td id="col2"><?php
        if(isset($_POST['submit-7']))
        {
            $city=$_POST['city'];
            ?>
            <form action="" method="post">
                <input type="text" name="newcity" value="<?php echo $city; ?>" />
                <input type="hidden" name="oldcity" value="<?php echo $city; ?>" />
                <input type="submit" name="updatecity" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>
        <?php

        }else{
            echo $city;
        }
        ?></td>
    <td><?php if(!isset($_POST['submit-7']))
        {
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
                <div id="btn">
                    <input type="hidden" name="city" value="<?php echo $city; ?>" />
                    <input type="submit" name="submit-7" class="edit" value="" style="width:40px;"  />
                </div>
            </form>
        <?php
        }else{
            ?>

        <?php
        }
        ?></td>
</tr>
<tr>
    <td id="col">PostCode:</td>
    <td id="col2">
        <?php
        if(isset($_POST['PoCode']))
        {

            $postcode=$_POST['postcode'];
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
                <input type="text" name="postcodes" value="<?php echo $postcode; ?>" />
                <input type="hidden" name="oldrepostcode" value="<?php echo $postcode; ?>" />
                <input type="submit" name="postcodeupdate" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>
        <?php


        }
        else{
            echo $postcode;
        }
        ?>

    </td>
    <td>
        <?php if(!isset($_POST['PoCode']))
        {
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
                <div id="btn">
                    <input type="hidden" name="postcode" value="<?php echo $postcode; ?>" />
                    <input type="submit" name="PoCode" class="edit" value="" style="width:40px;"  />
                </div>
            </form>
        <?php
        }else{
            ?>

        <?php
        }
        ?>
    </td>
</tr>
<tr>
    <td id="col">Country:</td>
    <td id="col2"><?php
        if(isset($_POST['submit-8']))
        {
            $country=$_POST['country'];
            ?>
            <form action="" method="post">
                <select name="newcountry">
                    <option value="<?php echo $country; ?>"><?php echo $country; ?></option>
                    <?php
                    $q="SELECT * FROM country where name !='$country' order by name";
                    $r=mysql_query($q) or die(mysql_error());
                    while($cont=mysql_fetch_array($r))
                    {
                        ?>
                        <option value="<?php echo $cont['name']; ?>"><?php echo $cont['name']; ?></option>
                    <?php
                    }
                    ?>
                </select>

                <input type="submit" name="updatecountry" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>
        <?php

        }else{
            echo $country;
        }
        ?></td>
    <td><?php if(!isset($_POST['submit-8']))
        {
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
                <div id="btn">
                    <input type="hidden" name="country" value="<?php echo $country; ?>" />
                    <input type="submit" name="submit-8" class="edit" value="" style="width:40px;"  />

                </div>
            </form>
        <?php
        }else{
            ?>

        <?php
        }
        ?></td>
</tr>
<tr>
    <td id="col">Phone:</td>
    <td id="col2"><?php
        if(isset($_POST['submit-9']))
        {
            $phone=$_POST['phone'];
            ?>
            <form action="" method="post">
                <input type="text" name="phone" value="<?php echo $phone; ?>" />

                <input type="submit" name="updatephone" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>
        <?php

        }else{
            echo $phone;
        }
        ?></td>
    <td><?php if(!isset($_POST['submit-9']))
        {
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
                <div id="btn">
                    <input type="hidden" name="phone" value="<?php echo $phone; ?>" />
                    <input type="submit" name="submit-9" class="edit" value="" style="width:40px;"  />
                </div>
            </form>
        <?php
        }else{
            ?>

        <?php
        }
        ?></td>
</tr>
<tr>
    <td id="col">Mobile:</td>
    <td id="col2"><?php
        if(isset($_POST['submit-10']))
        {
            $mobile=$_POST['mobile'];
            ?>
            <form action="" method="post">
                <input type="text" name="mobile" value="<?php echo $mobile; ?>" />

                <input type="submit" name="updatemobile" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>
        <?php

        }else{
            echo $mobile;
        }
        ?></td>
    <td><?php if(!isset($_POST['submit-10']))
        {
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
                <div id="btn">
                    <input type="hidden" name="mobile" value="<?php echo $mobile; ?>" />
                    <input type="submit" name="submit-10" class="edit" value="" style="width:40px;"  />
                </div>
            </form>
        <?php
        }else{
            ?>

        <?php
        }
        ?></td>
</tr>
<tr>
    <td id="col">Status:</td>
    <td id="col2">
        <?php
        if(isset($_POST['submit-status'])) {
            $st=$_POST['st']; ?>

            <form action="" method="post">
                <select name="studstatus" class="cstat" style="width:230px;">
                    <option value="">Status</option>
                    <?php $select_status = "SELECT * FROM status WHERE Status = 1";
                    $select_status2 = mysql_query($select_status);
                    while($select_status3 = mysql_fetch_array($select_status2)){ ?>
                        <option value="<?php echo $select_status3['StatusId']; ?>" <?php if($st == $select_status3['StatusId']){ echo "selected"; }?>><?php echo $select_status3['StatusName'];  ?></option>
                    <?php } ?>
                </select>

                <input type="date" name="titles" value="" id="otther" style="width:160px; display:none;" />
                <input type="submit" name="updatest" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>

        <?php
        } else {
            $selectStt = "SELECT * FROM status WHERE StatusId = '".$studentstatus."' ";
            $selectStt2 = mysql_query($selectStt);
            $selectStt3 = mysql_fetch_array($selectStt2);
            echo $selectStt3['StatusName'];
        }?>
    </td>
    <td><?php if(!isset($_POST['submit-status']))
        {
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
                <div id="btn">
                    <input type="hidden" name="st" value="<?php echo $studentstatus; ?>" />
                    <input type="submit" name="submit-status" class="edit" value="" style="width:40px;"  />

                </div>
            </form>
        <?php
        }else{
            ?>

        <?php
        }
        ?>

    </td>
</tr>

<tr>
    <td id="col">Admission Source:</td>
    <td id="col2">
        <?php
        if(isset($_POST['submit_admission_source'])) {
            $st=$_POST['ad_s']; ?>

            <form action="" method="post">
                <select name="admission_source" class="cstat" style="width:230px;">
                    <option value="">Admission Srource</option>
                    <?php $select_status = "SELECT * FROM admission_sources ORDER BY id DESC";
                    $select_status2 = mysql_query($select_status);
                    while($select_status3 = mysql_fetch_array($select_status2)){ ?>
                        <option value="<?php echo $select_status3['title']; ?>" <?php if($st == $select_status3['title']){ echo "selected"; }?>><?php echo $select_status3['title'];  ?></option>
                    <?php } ?>
                </select>

                <input type="date" name="titles" value="" id="otther" style="width:160px; display:none;" />
                <input type="submit" name="update_admission_source" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>

        <?php
        } else {

            echo $admission_source;
        }?>
    </td>
    <td><?php if(!isset($_POST['submit_admission_source'])){
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
                <div id="btn">
                    <input type="hidden" name="ad_s" value="<?php echo $admission_source; ?>" />
                    <input type="submit" name="submit_admission_source" class="edit" value="" style="width:40px;"  />

                </div>
            </form>
        <?php
        }
        ?>

    </td>
</tr>



<tr>
    <td id="col">Stage:</td>
    <td id="col2">
        <?php
        if(isset($_POST['submit_stage'])) {
            $st=$_POST['sta']; ?>

            <form action="" method="post">
                <select name="stage" class="cstat" style="width:230px;">
                    <option value="">Select Stage</option>
                    <?php $select_status = "SELECT * FROM stages ORDER BY id DESC";
                    $select_status2 = mysql_query($select_status);
                    while($select_status3 = mysql_fetch_array($select_status2)){ ?>
                        <option value="<?php echo $select_status3['id']; ?>" <?php if($st == $select_status3['id']){ echo "selected"; }?>><?php echo $select_status3['title'];  ?></option>
                    <?php } ?>
                </select>

                <input type="date" name="titles" value="" id="otther" style="width:160px; display:none;" />
                <input type="submit" name="update_stage" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>

        <?php
        } else {
        	
        	$stage_sql = mysql_fetch_array(mysql_query("SELECT title FROM stages WHERE id='$stage'"));
        	echo $stage_sql['title'];
        	
        }?>
    </td>
    <td><?php if(!isset($_POST['submit_stage'])){
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#tabs-1" method="post">
                <div id="btn">
                    <input type="hidden" name="sta" value="<?php echo $stage; ?>" />
                    <input type="submit" name="submit_stage" class="edit" value="" style="width:40px;"  />

                </div>
            </form>
        <?php
        }
        ?>

    </td>
</tr>



</tbody>
</table>

</ul>

</div>

<div class="ui-tabs-panel ui-widget-content ui-corner-bottom" id="ui-tabs-9"><ul class="thumbs">
<table width="600" border="0" id="personnaldetails" class="tablestyle table table-striped table-bordered table-hover">
<tr>
    <td id="col1">Job Title:</td>
    <td id="col2"><?php
        if(isset($_POST['updatejobtitle']))
        {
            $jobtitle=$_POST['jobtitle'];
            ?>
            <form action="" method="post">
                <input type="text" name="title" value="<?php echo $jobtitle; ?>" />

                <input type="submit" name="updatetitle" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>
        <?php

        }else{
            echo $jobtitle;
        }
        ?></td>
    <td style="width:50px;"><?php if(!isset($_POST['updatejobtitle']))
        {
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#ui-tabs-9" method="post">
                <div id="btn">
                    <input type="hidden" name="jobtitle" value="<?php echo $jobtitle; ?>" />
                    <input type="submit" name="updatejobtitle" class="edit" value="" style="width:40px;"  />

                </div>
            </form>
        <?php
        }else{
            ?>

        <?php
        }
        ?></td>
</tr>
<tr>
    <td id="col1">Company Name:</td>
    <td id="col2"><?php
        if(isset($_POST['updatecompany']))
        {
            $companyname=$_POST['companyname'];
            ?>
            <form action="" method="post">
                <input type="text" name="companyname" value="<?php echo $companyname; ?>" />

                <input type="submit" name="updatecomp" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>
        <?php

        }else{
            echo $companyname;
        }
        ?></td>
    <td><?php if(!isset($_POST['updatecompany']))
        {
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#ui-tabs-9" method="post">
                <div id="btn">
                    <input type="hidden" name="companyname" value="<?php echo $companyname; ?>" />
                    <input type="submit" name="updatecompany" class="edit" value="" style="width:40px;"  />

                </div>
            </form>
        <?php
        }else{
            ?>

        <?php
        }
        ?></td>
</tr>
<tr>
    <td id="col1">Address line1:</td>
    <td id="col2"><?php
        if(isset($_POST['updateadd1']))
        {

            ?>
            <form action="" method="post">
                <input type="text" name="addline1" value="<?php echo $addressline1; ?>" />

                <input type="submit" name="upadd1" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>
        <?php

        }else{
            echo $addressline1;
        }
        ?></td>
    <td><?php if(!isset($_POST['updateadd1']))
        {
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#ui-tabs-9" method="post">
                <div id="btn">

                    <input type="submit" name="updateadd1" class="edit" value="" style="width:40px;"  />

                </div>
            </form>
        <?php
        }else{
            ?>

        <?php
        }
        ?></td>
</tr>
<tr>
    <td id="col1">Address line2:</td>
    <td id="col2"><?php
        if(isset($_POST['addressline-2']))
        {
            $lname=$_POST['lname'];
            ?>
            <form action="" method="post">
                <input type="text" name="addressline2" value="<?php echo $addressline2; ?>" />
                <input type="submit" name="updateaddressline2" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>
        <?php } else {
            echo $addressline2;
        } ?></td>
    <td><?php if(!isset($_POST['addressline-2']))
        { ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#ui-tabs-9" method="post">
                <div id="btn">
                    <input type="hidden" name="lname" value="<?php echo $lname; ?>" />
                    <input type="submit" name="addressline-2" class="edit" value="" style="width:40px;"  />

                </div>
            </form>
        <?php
        } else {
        } ?>
    </td>
</tr>
<tr>
    <td id="col1">Address line3:</td>
    <td id="col2"><?php
        if(isset($_POST['addressline-3']))
        {
            $lname=$_POST['lname'];
            ?>
            <form action="" method="post">
                <input type="text" name="addressline3" value="<?php echo $addressline3; ?>" />

                <input type="submit" name="updateaddressline3" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>
        <?php

        }else{
            echo $addressline3;
        }
        ?></td>
    <td><?php if(!isset($_POST['addressline-3']))
        {
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#ui-tabs-9" method="post">
                <div id="btn">
                    <input type="hidden" name="lname" value="<?php echo $lname; ?>" />
                    <input type="submit" name="addressline-3" class="edit" value="" style="width:40px;"  />

                </div>
            </form>
        <?php
        }else{
            ?>

        <?php
        }
        ?></td>
</tr>
<tr>
    <td id="col1">City:</td>
    <td id="col2"><?php
        if(isset($_POST['e-city']))
        {

            ?>
            <form action="" method="post">
                <input type="text" name="ecity" value="<?php echo $ecity; ?>" />

                <input type="submit" name="updatee-City" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>
        <?php

        }else{
            echo $ecity;
        }
        ?></td>
    <td><?php if(!isset($_POST['e-city']))
        {
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#ui-tabs-9" method="post">
                <div id="btn">

                    <input type="submit" name="e-city" class="edit" value="" style="width:40px;"  />

                </div>
            </form>
        <?php
        }else{
            ?>

        <?php
        }
        ?></td>
</tr>
<tr>
    <td id="col1">Post Code: </td>
    <td id="col2"><?php
        if(isset($_POST['e-postcode']))
        {

            ?>
            <form action="" method="post">
                <input type="text" name="ecode" value="<?php echo $epostcode; ?>" />

                <input type="submit" name="epostcode" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>
        <?php

        }else{
            echo $epostcode;
        }
        ?></td>
    <td><?php if(!isset($_POST['e-postcode']))
        {
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#ui-tabs-9" method="post">
                <div id="btn">

                    <input type="submit" name="e-postcode" class="edit" value=""  style="width:40px;" />

                </div>
            </form>
        <?php
        }else{
            ?>

        <?php
        }
        ?></td>
</tr>
<tr>
    <td id="col1">Country:</td>
    <td id="col2"><?php
        if(isset($_POST['updateECountry']))
        {
            //$lname=$_POST['lname'];
            ?>
            <form action="" method="post">

                <!--<input type="text" name="ecountry" value="<?php //echo $ecountry; ?>" />-->
                <select name="ecountry">
                    <option value="<?php echo $ecountry; ?>"><?php echo $ecountry; ?></option>
                    <?php
                    $q="SELECT * FROM country where name !='$ecountry' order by name";
                    $r=mysql_query($q) or die(mysql_error());
                    while($cont=mysql_fetch_array($r))
                    {
                        ?>
                        <option value="<?php echo $cont['name']; ?>"><?php echo $cont['name']; ?></option>
                    <?php
                    }
                    ?>
                </select>
                <input type="submit" name="updatemecountry" value="" class="update" />
                <input type="submit" name="submm" class="cancel" value="" onClick="document.href='studentInfo.php'" />
            </form>
        <?php

        }else{
            echo $ecountry;
        }
        ?></td>
    <td><?php if(!isset($_POST['updateECountry']))
        {
            ?>
            <form action="studentInfo.php?Id=<?php echo $id;?>#ui-tabs-9" method="post">
                <div id="btn">
                    <input type="hidden" name="ecountry" value="<?php echo $ecountry; ?>" />
                    <input type="submit" name="updateECountry" class="edit" value="" style="width:40px;"  />

                </div>
            </form>
        <?php
        }else{
            ?>

        <?php
        }
        ?></td>
</tr>

</table>
</ul>
</div>

<div class="ui-tabs-panel ui-widget-content ui-corner-bottom" id="ui-tabs-8" ><ul class="thumbs">

        <div class="main-div"><!-- Start of main Div -->

            <div class="main-div1" style="    margin-left: 87px;"><!-- start of div 1 -->
                <?php
                if(isset($_GET['ifd']))
                {
                    $if=$_GET['ifd'];
                    $rqy=mysql_query("select * from tbl_fee where id='$if'") or die(mysql_error());
                    $rfetch=mysql_fetch_array($rqy);

                    ?>
                    <form action="" method="post">
                        <input type="text" name="upd_am" value="<?php echo $rfetch['fee']; ?>" class="form-control"/>
                        <input type="submit" name="upda_amount" value="Update" class="add2 btn btn-success" />
                    </form>
                <?php

                }
                else
                {
                $feequery="select * from tbl_fee where rollno='$id'";
                $feeresult=mysql_query($feequery) or die(mysql_error());
                $fetchFee=mysql_fetch_array($feeresult);
                //$totalQuery="select sum(paid) as totalpaid from tbl_fees_install where rollno='$id'";
                $totalQuery="select sum(paid) as paid  from tbl_fees_install where rollno='$id'";
                $totalResult=mysql_query($totalQuery) or die(mysql_error());
                $fetchAmount=mysql_fetch_array($totalResult);
                if(mysql_num_rows($feeresult) > 0)
                {
                ?>
                <div class="fees"><!-- starto of fees div -->
                    <div class="left">Total Balance</div><div class="right"><?php echo '&pound;'.$fetchFee['fee']; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="studentInfo.php?Id=<?php echo $id; ?>&ifd=<?php echo '&pound;'.$fetchFee['id']; ?>#ui-tabs-8">E</a></div>
                    <div class="left">Total Paid</div><div class="right"><?php echo '&pound;'.$fetchAmount['paid']; ?></div>
                    <div class="left" style="border-top:1px solid red";>Balance</div><div class="right" style="border-top:1px solid red";><?php echo '&pound;'.$full=$fetchFee['fee']-$fetchAmount['paid']; ?></div>
        </div><!-- End fo fees div-->

        <?php

        }
        else
        {

            ?>

            <form action="" method="post">
                <div class="form-group clearfix">
                    <div class="col-sm-6"><input type="text" name="fee" class="form-control"/></div>
                    <div class="col-sm-6"><input type="submit" name="add-fee" value="Add" class="add2 btn btn-success" style="margin-top: 0px; height: auto;"/></div>
                </div>
            </form>
        <?php
        }
        }
        ?>
</div><!-- end of div1 -->

<div class="main-div2"><!-- start of div2 -->

    <?php if(isset($_GET['ed']))
    {
        $feid=$_GET['feid'];
        $fequery=mysql_query("select * from tbl_fees_install where id='$feid'") or die(mysql_error());
        $fefetch=mysql_fetch_array($fequery);
        list($yeard,$monthd,$dayd)=explode('-',$fefetch['fee_date']);
        ?>
        <form action="" method="post">

            <div>
                <table style="margin-bottom:20px;" class="table table-striped table-bordered table-hover">
                    <tr>
                        <td align="left"><label>Type : </label></td>
                        <td><select name="payment" class="cstat form-control" disabled="disabled" >
                                <?php
                                if($fefetch['pStatus']==0)
                                { ?>
                                    <option value="payable">Payable</option>
                                    <option value="paid">Paid</option>
                                <?php
                                }else if($fefetch['pStatus']==1)
                                {
                                    ?>
                                    <option value="paid">Paid</option>
                                    <option value="payable">Payable</option>

                                <?php
                                }
                                ?>
                            </select></td>
                    </tr>


                    <tr>
                        <td  align="left"><label>Amount : </label></td>
                        <td>
                            <?php if($fefetch['pStatus']==1)
                            {
                                ?>
                                <input type="text" name="amount" value="<?php echo $fefetch['paid']; ?>" class="form-control"/>
                            <?php
                            }else if($fefetch['pStatus']==0)
                            {
                                ?>
                                <input type="text" name="amount" value="<?php echo $fefetch['payble']; ?>" class="form-control"/>
                            <?php
                            }
                            ?>

                        </td>
                    </tr>


                    <tr>
                        <td  align="left"><labe>Date : </labe></td>
                        <td><input type="date" name="ss" value="<?php echo $fefetch['fee_date'];?>" /></td>
                    </tr>
                    <tr id="showpayment" class="fee-main" >
                        <td  align="right">Payment Type:</td>
                        <td><select name="payment_type">
                                <option value="<?php echo $fefetch['bankname'];?>"><?php echo $fefetch['bankname'];?></option>
                                <option value="Bank Transfer">Bank Transfer</option>
                                <option value="Paypal">Paypal</option>
                                <option value="Payatrader">Payatrader</option>
                                <option value="Westren Union">Westren Union</option>
                                <option value="Checque">Checque</option>
                                <option value="Hotcourses">Hotcourses</option>

                            </select></td>
                    </tr>
                    <tr>
                        <td  align="left"><label>Description : </label></td>
                        <td><textarea name="fee_desc" rows="5" cols="25"><?php echo $fefetch['des'];?></textarea></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <?php
                            if($fefetch['pStatus']==0) { ?>
                                <input type="hidden" name="pt" value="payable" />
                            <?php
                            } else if($fefetch['pStatus']==1) { ?>
                                <input type="hidden" name="pt" value="paid" />
                            <?php } ?>
                            <input type="submit" name="update-fees" value="Update" class="add2 btn btn-success" /><a href="studentInfo.php?Id=<?php echo $id;?>#ui-tabs-8" class="add2" style="margin-left:20px;padding:5px;">Cancel</a>
                        </td>
                    </tr>
                </table>

            </div>
        </form>


    <?php  } else { ?>

        <form action="" method="post">

            <div>

                <table style="margin-bottom:20px;" class="tble">
                    <tr>
                        <td align="left"><label> Type  </label></td>
                        <td>
                            <select name="payment" class="cstat form-control" disabled="disabled" >
                                <option value="payable">Payable</option>
                                <option value="paid">Paid</option>
                            </select>
                        </td>
                    </tr>


                    <tr>
                        <td  align="left"><label> Amount  </label></td>
                        <td>
                            <input type="text" name="amount"  class="form-control"/>

                        </td>
                    </tr>


                    <tr>
                        <td  align="left"><label>Date: </label></td>
                        <td><input type="date" name="ss" value="date/month/year" class="form-control"/></td>
                    </tr>
                    <tr id="showpayment" class="fee-main" style="display:none;">
                        <td  align="left">Payment Type:</td>
                        <td  align="left"><select name="payment_type">
                                <option value="Bank Transfer">Bank Transfer</option>
                                <option value="Paypal">Paypal</option>
                                <option value="Payatrader">Payatrader</option>
                                <option value="Westren Union">Westren Union</option>
                                <option value="Checque">Checque</option>
                                <option value="Hotcourses">Hotcourses</option>

                            </select></td>
                    </tr>
                    <tr>
                        <td  align="left"><label>Description:</label></td>
                        <td><textarea name="fee_desc" rows="5" cols="25" class="form-control"></textarea></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td  align="right">
                            <input type="submit" name="add-fees" value="Add" class="add2 btn btn-success" />
                        </td>
                    </tr>
                </table>





            </div>

        </form>

    <?php } ?>

</div><!-- end of div 2 -->
<div class="main-div3" style="    margin-left: 87px;"><!-- start of div 3 -->
    <?php
    $paysum="";
    $remains="";
    $totalPaid="";

    $queryFees=mysql_query("select * from tbl_fees_install where rollno='$id' order by fee_date asc") or die(mysql_error());
    while($setFees=mysql_fetch_array($queryFees))
    {
        $totalPaid=$totalPaid+$setFees['paid'];
        $paysum=$paysum+$setFees['payble'];
    } ?>
    <div>
        <div style="margin-bottom: 5px;" ><div style="width: 180px;float: left;font-size:16px;">Total Payable:</div><span style="color:#28166f;font-size:16px;"><?php echo '&pound;'.$paysum; ?></span></div>
        <div style="margin-bottom: 5px;" ><div style="width: 180px;float: left;font-size:16px;">Total Paid:</div><span style="color:#28166f;font-size:16px;"><?php echo '&pound;'.$totalPaid; ?></span></div>
        <div style="margin-bottom: 5px; margin-bottom:30px; border-top:1px solid red; width:200px;" ><div style="width: 180px;float: left;color:red;font-size:16px;">Due:</div><span style="color:#28166f;font-size:16px;"><?php echo '&pound;'.$cin=$paysum-$totalPaid;?></span></div>
    </div>
</div>

<table class="uniq table table-striped table-bordered table-hover" id="sample_2">

    <thead>
    <tr>
        <th>Date</th>
        <th>Description</th>
        <th>Payment Type</th>
        <th>Payable</th>
        <th>Paid</th>
        <th>Edit</th>
    </tr>
    </thead>

    <tbody>
    <?php
    $paysum="";
    $remains="";
    $totalPaid="";
    $queryFees=mysql_query("select * from tbl_fees_install where rollno='$id' order by fee_date asc") or die(mysql_error());

    while($setFees=mysql_fetch_array($queryFees)) {

        $totalPaid=$totalPaid+$setFees['paid'];
        $paysum=$paysum+$setFees['payble'];
        list($year,$month,$day)=explode('-',$setFees['fee_date']); ?>

        <tr>
            <td><?php echo $day.'/'.$month.'/'.$year; ?></td>
            <td><?php echo $setFees['des']; ?></td>
            <td><?php echo $setFees['bankname'];?></td>
            <td><?php echo $setFees['payble']; ?></td>
            <td><?php echo $setFees['paid']; ?></td>
            <td><a href="studentInfo.php?Id=<?php echo $id; ?>&feid=<?php echo $setFees['id'];?>&ed#ui-tabs-8"><img src="../images/edit-icon.png" /></a></td>
        </tr>

    <?php } ?>
    </tbody>
</table>

</div>

</ul>
</div>
<div class="ui-tabs-panel ui-widget-content ui-corner-bottom" id="ui-tabs-3"><ul class="thumbs">
<?php
$qquery=mysql_query("select tutorId from assigncourse where rollno='$id'") or die(mysql_error());

$ffetch=mysql_fetch_array($qquery);

$gTutorQuery="select tutorId,concat_ws(' ',firstname,lastname) as full from tutor where tutorId=".$ffetch['tutorId'];
$gTutorResult=mysql_query($gTutorQuery) or die(mysql_error());
$tutorFetch=mysql_fetch_array($gTutorResult);



?>
<div>
    <div style="float:left; display:inline-block;">
        <span>Tutor :<?php echo $tutorFetch['full']; ?></span>&nbsp;&nbsp;&nbsp;
    </div>
    <?php
    if(isset($_POST['chnegetutor']))
    {
        ?>
        <form action="" method="post" >
            <select name="chgetutor">
                <option value="0">Select Tutor</option>
                <?php
                $qqqqqq="select tutorId from coursetutor where courseId=".$resultSEt['courseId'] ." and tutorId != ".$tutorFetch['tutorId'];
                $rrrrr=mysql_query($qqqqqq) or die(mysql_error());
                while($rrsw=mysql_fetch_array($rrrrr))
                {
                    $qui="select tutorId,concat_ws(' ',firstname,lastname) as fullname from tutor where tutorId=".$rrsw['tutorId'];

                    $rq=mysql_query($qui) or die(mysql_error());
                    $fetchesss=mysql_fetch_array($rq)
                    ?>
                    <option value="<?php echo $fetchesss['tutorId']; ?>"><?php echo $fetchesss['fullname']; ?></option>
                <?php
                }
                ?>
            </select>
            <input type="submit" name="changeTutor" value="Update" class="add2" style="margin:0px;height:20px;" />
        </form>
    <?php
    }else
    {
        ?>
        <form action="" method="post">
            <input type="submit" name="chnegetutor" value="Change" class="add2 btn btn-success" style="margin:0px;" />
        </form>

    <?php
    }
    ?>
</div>

<p><strong><span id="stassignhead">Course Name:</span></strong><span id="studenassignment"><?php echo $resultSEt['courseName']; ?></span></p>
<p><strong><span id="stassignhead">Total Topics:</span></strong><span id="studenassignment"><?php echo $resultSEt['coursetopic'];?></span></p>
<hr style="color:#CCC;" />
<?php

$query="select * from topic where courseId=".$resultSEt['courseId'];
$result=mysql_query($query) or die(mysql_error());
if(mysql_num_rows($result) > 0)
{ ?>
    <div class="table-responsive">
    <table class="tablestyle table table-striped table-bordered table-hover" id="sample_2"">
    <thead>
    <tr><th>#</th>
        <th>Topic Title</th>
        <th>Authorize </th>
        <th>download Assignment</th>
        <th>Upload Result</th>
        <th>View Result</th>
        <th>Assignment Status</th>
        <th>Re-Permit</th>
    </tr>
    </thead>
    <tbody>
    <?php
    $sr=0;
    while($rSet=mysql_fetch_array($result))
    {
        $sr++;
        ?>
        <tr>
            <td><?php echo $sr; ?></td>
            <td><?php echo $rSet['topicName']; ?></td>

            <td>
                <?php
                $q="SELECT * FROM studentassignment where topicId=".$rSet['topicId']." and courseId=".$rSet['courseId']." and rollno='$id'   order by SAid desc limit 1";
                $results=mysql_query($q) or die(mysql_error());
                $afetch=mysql_fetch_array($results);

                if(mysql_num_rows($results) > 0) {

                    echo "Assign";

                } else { ?>

                    <form action="studentInfo.php?Id=<?php echo $id;?>#ui-tabs-3" method="post" autocomplete="off">
                        <input type="submit" name="submitthis" value="Assign"  style="width:50px; height:20px;" onClick="return confirm('Are you sure to Assign')" />
                        <input type="hidden" name="topicIdd" value="<?php echo $rSet['topicId']; ?>" />
                        <input type="hidden" name="courseIdd" value="<?php echo $rSet['courseId']; ?>" />
                    </form>

                <?php } ?>

            </td>
            <td>

                <?php
                $quer22="select * from uploadassignment where topicId=".$rSet['topicId']." and rollno='$id'";
                $result22=mysql_query($quer22) or die(mysql_error());
                $ffe=mysql_fetch_array($result22);
                $assId=$ffe['assignmentId'];
                $qeuer="select * from studenresult where assignmentId='$assId' and rollno='$id'";
                $res=mysql_query($qeuer) or die("error");
                $fe=mysql_fetch_array($res);

                if($afetch['AssignmentStatus']==1)
                {
                    $q="select * from uploadassignment where topicId=".$rSet['topicId']." and courseId=".$rSet['courseId']." and rollno='$id'";
                    $r=mysql_query($q) or die(mysql_error());
                    $ffes=mysql_fetch_array($r);
                    if(mysql_num_rows($r) > 0)
                    {

                        echo "<a href=\"download.php?file=".$ffe['fullname']."\"><img src='../images/download-btn.png' /></a>";
                    }
                    else
                    {
                        echo "---------";
                    }
                }else if(($afetch['AssignmentStatus']==2)||($afetch['AssignmentStatus']==3))
                {

                    echo "<a href=\"download.php?file=".$ffe['fullname']."\"><img src='../images/download-btn.png' /></a>(".date('d/m/Y',strtotime($ffe['uploaddate'])).")";
                    //echo "----------";

                }
                /*else if($afetch['AssignmentStatus']==3)
                 {


                    echo "<a href=\"download.php?file=".$ffe['fullname']."\"><img src='../images/download-btn.png' /></a>";


                 }*/

                else
                {
                    ?>
                    <span>----------</span>
                <?php
                }
                ?>


            </td>

            <td>
                <?php
                if($afetch['AssignmentStatus']==2 || $afetch['AssignmentStatus']==3) { ?>

                    <form action="" method="post" autocomplete="off" enctype="multipart/form-data">
                        <input type="file" name="upload" style="width:150px;" />
                        <input type="hidden" name="assigid" value="<?php echo $assId; ?>" />
                        <input type="submit" name="add-upload" value="" class="upload"/>
                    </form>

                <?php

                }

                if( $afetch['AssignmentStatus']==1) {

                    $q="select * from uploadassignment where topicId=".$rSet['topicId']." and courseId=".$rSet['courseId']." and rollno='$id'";
                    $r=mysql_query($q) or die(mysql_error());

                    if(mysql_num_rows($r) > 0) { ?>

                        <form action="" method="post" autocomplete="off" enctype="multipart/form-data">
                            <input type="file" name="upload" style="width:150px;" />
                            <input type="hidden" name="assigid" value="<?php echo $assId; ?>" />
                            <input type="submit" name="add-upload" value="" class="upload"/>
                        </form>

                    <?php
                    } else {
                        echo "--------";
                    }

                } ?>

            </td>
            <td>
                <?php
                if($afetch['AssignmentStatus']==3||$afetch['AssignmentStatus']==2 || $afetch['AssignmentStatus']==1)
                {

                    $studenResult=mysql_query("SELECT * from studenresult where rollno='$id' and assignmentId= ".$afetch['AssignmentName']) or die('errr');

                    $studentSet=mysql_fetch_array($studenResult);
                    if(mysql_num_rows($studenResult) >0)
                    {
                        ?>

                        <a href="download.php?rfile=<?php echo $studentSet['fullname'];?>">View <?php echo "(".date('d/m/y',strtotime($studentSet['uploaddate'])).")";?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>

                    <?php
                    }else
                    {
                        echo "---------";
                    }
                }else
                {
                    echo "------";
                }
                ?>

            </td>
            <td>
                <?php
                if($afetch['AssignmentStatus']==3)
                {
                    echo "<span class=\"assign\">Completed</span>";
                }
                else if($afetch['AssignmentStatus']==2)
                {
                    echo "<span class=\"tut\">With Tutor</span>";
                }else if($afetch['AssignmentStatus']==1)

                {
                    echo "<span class=\"as\">With Student</span>";

                }else
                {
                    echo "<span class=\"notassign\">Not Assigned<span>";
                }

                ?>

            </td>
            <td>
                <?php

                if($afetch['AssignmentStatus']==2 || $afetch['AssignmentStatus']==3 || $afetch['AssignmentStatus']==1)
                { ?>
                    <form action="" method="post">
                        <input type="hidden" name="topicId" value="<?php echo $rSet['topicId']; ?>" />
                        <input type="hidden" name="courseId" value="<?php echo $rSet['courseId']; ?>" />
                        <input type="submit" name="Re-Assign" value="Ok" style="width:22px; height:20px; float:left;" onClick="return confirm('Are you Sure to Re Assign')" />
                    </form>
                    <?php
                    extract($rSet);
                    $q="select * from uploadassignment where topicId='$topicId' and courseId='$courseId' and rollno='$id' and Reassign=1";
                    $r=mysql_query($q) or die(mysql_error());
                    if(mysql_num_rows($r)>0)
                    {
                        ?>
                        <img src="../images/success.gif" style="float:left;" />
                    <?php
                    }
                    ?>
                <?php
                }
                ?>
            </td>
        </tr>
    <?php
    }
    ?>

    </tbody>
    </table>
    </div>
<?php

}else{
    echo "No Topic exists";
}
?>


</ul>



</div>
<div class="ui-tabs-panel ui-widget-content ui-corner-bottom" id="ui-tabs-4"><ul class="thumbs">


        <?php
        if(isset($_GET['edit']))
        {
            ?>
            <form action="" method="post">

                <textarea name="note" rows="10" cols="92"></textarea><br />
                <input type="submit" name="addnote" value="Add Note" class="add2 btn btn-success" />
                <!--<input type="submit" name="" class="add" value="Cancel" onclick="document.href='studentInfo.php'" />-->


            </form>
        <?php
        }else
        {
            ?>
            <a href="studentInfo.php?Id=<?php echo $id;?>&edit#ui-tabs-4" class="add2 btn btn-success" style="">Add Note</a>
        <?php
        }
        ?>

        <?php
        if(isset($_POST['addnote']))
        {
            $note=mysql_real_escape_string(addslashes($_POST['note']));
            $query="insert into studentnote values ('','$note',now(),'$id',2,'$fullname')";
            $result=mysql_query($query) or die(mysql_error());
            $maintainLogs = "INSERT INTO `tbl_audit`(  `user_id`, `user_name`, `role`, `action`, `date`) VALUES ( '".$co_id."','".$fullname."','".$_SESSION['coordinatorrole']."',' Added a Note ','".date('Y-m-d H:i:s')."')";
            mysql_query($maintainLogs);
            header("location:studentInfo.php?Id=$id#ui-tabs-4");
            exit();
        }

        ?>


        <?php
        $query="SELECT * FROM studentnote where rollno='$id' order by id desc";

        $result=mysql_query($query) or die(mysql_error());

        if(mysql_num_rows($result) > 0)
        {

            ?>
            <table width="1100" border="0" style="margin-top:20px;border-collapse:separate;
border-spacing:2em;" id="nte" class="tablestyle">

                <?php

                while($rr=mysql_fetch_array($result)) {
                    $all=explode(' ',$rr['edittime']);
                    $date=$all[0];
                    $time=@$all[1];
                    $msg="";
                    if($rr['role']==1)
                    {
                        $msg="Admin";
                    }else if($rr['role']==2)
                    {
                        $msg=$rr['name']."(Coordinator)";

                    }else if($rr['role']==3)
                    {
                        $msg=$rr['name']."(Tutor)";
                    }
                    $string= wordwrap($rr['note'], 110, "<br />", true);
                    ?>
                    <tr style="margin-top:20px; vertical-align:text-top; margin-bottom:15px; ">
                        <td width="1000"  id="sty"><?php echo $string; ?></td>

                        <td width="500" style="background-color:#fff; color:black; font-size:10px; ">Added by <?php echo $msg; ?> at <?php echo date("g:i a",strtotime($time)); ?> on <?php echo date('d F Y',strtotime($date)); ?></td>
                    </tr>
                <?php
                }
                ?>
            </table>
        <?php
        } else {
            echo "No Note Exists";
        } ?>

    </ul>
</div>
<div class="ui-tabs-panel ui-widget-content ui-corner-bottom" id="ui-tabs-13"><ul class="thumbs">


        <?php

        if(isset($_POST['submit_email']))
        {

            if(isset($_FILES['attachment_email']) &&  $_FILES['attachment_email']['name']!=""){

                //to upload file
                $name = $_FILES['attachment_email']['name'];

                $temp_name = $_FILES['attachment_email']['tmp_name'];

                $allowed=array('doc','docx','pdf');

                $type=explode('.',$name);

                $dir="../email_attachments/";
                $rand=mt_rand();

                $fullername=$rand.$name;

                if(in_array($type[1],$allowed))
                {
                    if(move_uploaded_file($temp_name, $dir.$fullername)) {

                    } else {

                        $_SESSION['sessionMsg']="Error! Invalid File Format, Only 'doc, docx, pdf' file supported ";
                        header("location:studentInfo.php?Id=$id#ui-tabs-31");
                        exit();
                    }



                }
            }
            $email_message= str_replace('\n', '<br />', $_POST['message']);

            $idad = $_POST['emailsOfstudents'];
            $query_12 = "SELECT email  FROM student WHERE email = '$idad' ";
            $resutlt_12 = mysql_query($query_12);
            $fectch_12 = mysql_fetch_array($resutlt_12);

            /**********************************************************************/

            $str="";

            $subject = $_POST['subject'];

            $mail = new PHPMailer;
            $mail->FromName = 'BOLC';
            $mail->From = 'admissions@bolc.co.uk';
            $mail->addAddress($idad, $idad);
            $mail->isHTML(true);
            $mail->Subject = $subject;
            $mail->Body = $email_message;

            $mail->AddAttachment($_SERVER['DOCUMENT_ROOT'].'/email_attachments/'.$fullername);



            if(!$mail->send())
            {
                $msg = " Not Sent! ";
            }
            else
            {
                $msg = "Your Message has been Sent!";
            }


            /***************************************************************************************************/
            $email_message = mysql_real_escape_string($email_message);
            
            $query="INSERT INTO emails(  student_id, coordinator_id, student_email, coordinator_email, message, attachment, sender, subject, email_date) VALUES ( ".$id.",".$co_id.",'".$fectch_12[0]."','".$co_email."','".$email_message."','".$fullername."',1,'".$subject."', CURDATE())";
            $result=mysql_query($query) or die(mysql_error());
            header("location:studentInfo.php?Id=$id#ui-tabs-13");
            exit();

        } else  if(isset($_GET['edit'])) { ?>

            <!--<select name="emailsOfstudents" id="change_id" onchange="ChangeText()">
            <option value=""></option>-->

            <?php
            $selectEmail = "SELECT Sid,email FROM student";
            $selectEmail2 = mysql_query($selectEmail) or die(mysql_error());
            while($selectEmail3 = mysql_fetch_array($selectEmail2)){ ?>
                <!--<option value="<?php echo $selectEmail3[0]; ?>" <?php if($SId == $selectEmail3[0]){  ?>  selected="selected" <?php } ?>> <?php echo $selectEmail3[1]; ?></option>
				<?php } ?>
				</select>-->
            <div class="borderfound" style="border: 1px solid #ccc; padding: 20px; margin: 10px 0px 25px;">

                <ul class="nav nav-tabs" role="tablist">
                    <?php $allTemplates = findAllEmailTemplate();
                    $tab = 1;
                    while($emailTemplate = mysql_fetch_array($allTemplates)){
                        $emailTitle = str_replace(' ', '-', $emailTemplate['title']); ?>
                        <li role="presentation" class="<?php if($tab==1){ echo 'active'; } ?>"><a href="#<?php echo $emailTitle; ?>" aria-controls="<?php echo $emailTitle; ?>" role="tab" data-toggle="tab"><?php echo $emailTemplate['title'] ?></a></li>
                        <?php
                        $tab++; } ?>
                </ul>

                <div class="tab-content">

                    <?php  $allTemplates = findAllEmailTemplate();
                    $tab = 1;
                    while($emailTemplate = mysql_fetch_array($allTemplates)){

                        $emailTitle = str_replace(' ', '-', $emailTemplate['title']);
                        $selectEmail = "SELECT SId,email, fname FROM student WHERE SId = '".$SId."' ";
                        $selectEmail2 = mysql_query($selectEmail) or die(mysql_error());
                        $selectEmail3 = mysql_fetch_array($selectEmail2);
                        $fname = $selectEmail3['fname']; ?>

                        <div role="tabpanel" class="tab-pane fade <?php if($tab==1){ echo " in active"; } ?>" id="<?php echo $emailTitle; ?>">
                            <form method="post" action="" enctype="multipart/form-data">

                                <div class="form-group">
                                    <label for="email">Email</label>
                                    <input type="text" value="<?php echo $selectEmail3[1]; ?>" class="form-control" name="emailsOfstudents">
                                </div>

                                <div class="form-group">
                                    <label for="subject">Subject</label>
                                    <input type="text" value="<?php echo $emailTemplate['subject']; ?>" class="form-control" name="subject">
                                </div>

                                <div class="form-group">
                                    <textarea class="ckeditor" name="message" id="desc<?php echo $tab; ?>"><b>Dear <?php echo $fname."</b>,<br />".$emailTemplate['message']; ?></textarea>
                                </div>

                                <div class="form-group">
                                    <label for="subject">Attachment</label>
                                    <input type="file" name="attachment_email" class="form-control">
                                </div>

                                <input type="submit" name="submit_email" class="btn btn-success" Value="Send"/>

                            </form>
                        </div>

                        <?php $tab++; } ?>

                </div>

            </div>

        <?php } else { ?>

            <a href="studentInfo.php?Id=<?php echo $id;?>&edit#ui-tabs-13"  style="padding: 10px;
                                        background-color: #A2D4AE;
                                        border-radius: 10px;
                                        clear: both;
                                        margin-bottom: 20px;
                                        display: block;
                                        width: 127px">Create Message</a>

        <?php }
        $query="SELECT * FROM emails where student_id='$id' order by email_id desc";
        $result=mysql_query($query) or die(mysql_error());
        if(mysql_num_rows($result) > 0) { ?>

            <?php

            $email_counter=0;
            while($rr=mysql_fetch_array($result)) {
                $email_counter++;
                $msg="";
                if($rr['role']==1) {
                    $msg="Admin";
                } else if($rr['role']==2) {
                    $msg=$rr['name']."(Coordinator)";
                } else if($rr['role']==3) {
                    $msg=$rr['name']."(Tutor)";
                }
                $string =  preg_replace("/(<br\s*\/?>\s*)+/", '<br />', $rr['message']) ; ?>

                <?php
                if($rr['sender'] == 0){ ?>

                    <div class="left_message"><?php echo $string; ?></div>
                    <span class="d_time_l"><?php echo $rr['email_date']; ?></span>

                <?php } else { ?>

                    <div class=right_message><?php echo $string; ?></div>
                    <span class="d_time"><?php echo date('d-m-Y', strtotime($rr['email_date'])); ?></span>

                <?php } ?>


            <?php } ?>
            <div style="clear: both;"></div>
        <?php
        } else { echo "No Email Exists"; } ?>
    </ul>
</div>
<div class="ui-tabs-panel ui-widget-content ui-corner-bottom" id="ui-tabs-5">

    <ul class="thumbs">

        <?php if(isset($_GET['edittask'])) {

            $q="select * from tasks where id='$taskId'";
            $r=mysql_query($q) or die(mysql_error());
            $fetch=mysql_fetch_array($r);
            extract($fetch);
            $dd=explode('-',$taskdate);
            $d=$dd[2].'/'.$dd[1].'/'.$dd[0]; ?>

            <form action="" method="post">
                <textarea name="task" rows="10" cols="40"><?php echo $task; ?></textarea><br /><br />
                <input type="text" name="date" id="ddd" value="<?php echo $d; ?>" /><br />
                <input type="hidden" name="id" value="<?php echo $id; ?>" />
                <input type="submit" name="updatetask" value="update" class="add2" />

                <a href="studentInfo.php?Id=<?php echo $id; ?>">Cancel</a>
            </form>

        <?php

        } else { ?>


            <?php
            if(isset($_GET['tasks']))
            {

                ?>
                <form action="" method="post">
                    <select name="assgined_task_to" class="form-control" style="width: 52%;">
                        <option value="">Assigned to</option>
                        <?php $selectadmins = "SELECT * FROM admin WHERE role = 2 OR role = 3";
                        $selectadmins2 = mysql_query($selectadmins) or die(mysql_error());
                        while($selectadmins3 = mysql_fetch_array($selectadmins2)) {

                            if($selectadmins3['role'] == 3) {

                                $selectuser = "SELECT CONCAT(firstname,\" \",lastname) AS name,email FROM tutor WHERE email = '".$selectadmins3['username']."' ";
                                $selectuser2 = mysql_query($selectuser);
                                $selectuser3 = mysql_fetch_array($selectuser2);

                            } else {

                                $selectuser = "SELECT CONCAT(name,\" \",fathername) AS name,email FROM programe_co WHERE email = '".$selectadmins3['username']."' ";
                                $selectuser2 = mysql_query($selectuser);
                                $selectuser3 = mysql_fetch_array($selectuser2); } ?>

                            <option value="<?php echo $selectuser3['email']  ?>"><?php echo $selectuser3['name'] ?></option>
                        <?php } ?>

                    </select><br /><br />

                    <input type="text" placeholder="Task Date" name="taskdate" id="ddd"  class="form-control" style="width:54%;"/><br /><br />
                    <textarea name="task" rows="10" cols="70" class="form-control hwidth"></textarea><br /><br /><br />

                    <input type="submit" name="addtasks" value="Add Task" class="add2 btn btn-success" />

                    <a href="studentInfo.php?Id=<?php echo $id; ?>" class="add2 btn btn-success" style="color: #fff;">Cancel</a>


                </form>
            <?php
            } else {
                $taskId=$_GET['taskId'];  ?>
                <a href="studentInfo.php?Id=<?php echo $id;?>&tasks#ui-tabs-5" class="add2 btn btn-success" style="color: #fff;">Add Task</a>
            <?php }
        }

        $query="SELECT * FROM tasks where rollno='$id' order by id desc";
        $result=mysql_query($query) or die(mysql_error());
        if(mysql_num_rows($result) > 0) { ?>

            <table id="nte" class="tablestyle table table-striped table-bordered table-hover">
                <tbody>
                <?php

                while($rres=mysql_fetch_array($result)) {

                    $all=explode(' ',$rres['cdate']);
                    $date=$all[0];
                    $time=@$all[1];
                    $msg="";
                    if($rres['role']==1)
                    {
                        $msg="Admin";
                    }else if($rres['role']==2)
                    {
                        $msg="Coordinator";
                    }else if($rres['role']==3)
                    {
                        $msg="Tutor";
                    }  ?>
                    <tr>
                        <td><?php if($rres['taskstatus'] == 15){ ?><img src="../images/complete.jpeg" width="20" height="20"/> <?php } ?><?php echo "&nbsp;&nbsp;&nbsp;".substr($rres['task'],0,90); ?></td>
                        <td>Assigned To <?php
                            $select_name_co = "SELECT CONCAT(name,\" \",fathername) AS name FROM programe_co WHERE email = '".$rres['assigned_to']."' ";
                            $select_name_co2 = mysql_query($select_name_co);
                            $trow = mysql_num_rows($select_name_co2);
                            if($trow > 0 )
                            {
                                $select_name_co3 = mysql_fetch_array($select_name_co2);
                            }
                            else
                            {
                                $select_name_co = "SELECT CONCAT(firstname,\" \",lastname) AS name FROM tutor WHERE email = '".$rres['assigned_to']."' ";
                                $select_name_co2 = mysql_query($select_name_co);
                                $select_name_co3 = mysql_fetch_array($select_name_co2);
                            }

                            echo  "<strong>".$select_name_co3 ['name']."</strong>";
                            ?>  </td>
                        <td><?php

                            $d1=explode('-',$rres['taskdate']);
                            echo $date=$d1[2].'/'.$d1[1].'/'.$d1[0];

                            $tasktime=date("H:i:s",strtotime($rres['cdate']));
                            $taskdate=date('d F Y',strtotime($rres['cdate']));
                            ?></td>
                        <td>
                            <a href="studentInfo.php?Id=<?php echo $id;?>&edittask&taskId=<?php echo $rres['id'];?>#ui-tabs-5"><img src="../images/edit-icon.png" /></a>&nbsp;&nbsp;&nbsp;

                            <a href="studentInfo.php?Id=<?php echo $id;?>&d&taskId=<?php echo $rres['id']; ?>"><img src="../images/complete.jpeg" width="20" height="20"/></a>
                        </td>
                        <td>Added by <?php echo $msg; ?> at <?php echo $tasktime; ?> On <?php echo $taskdate; ?></td>


                    </tr>
                <?php } ?>
                </tbody>
            </table>
        <?php } ?>

    </ul>
</div>
<div style="" id="ui-tabs-a" class="tabsContent ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"><ul class="thumbs">


        <?php

        $queryLogs = "select * from tbl_logs where username='$email'";

        $resultLogs = mysql_query($queryLogs) or die(mysql_error());

        if(mysql_num_rows($resultLogs)>0)
        {
        ?>
        <table class="uniq table table-striped table-bordered table-hover" id="sample_2">

            <thead>
            <th>Sr#</th>
            <th>Login Date</th>
            <th>Logout Date</th>
            <th>Ip Address</th>
            </thead>
            <tbody>

            <?php
            $sr="";
            while($rowSet = mysql_fetch_array($resultLogs)){
                $sr++; ?>
                <tr>
                    <td><?php echo $sr; ?></td>
                    <td><?php echo $rowSet['detetime']; ?></td>
                    <td><?php echo $rowSet['log_datetime']; ?></td>
                    <td><?php echo $rowSet['ip']; ?></td>
                </tr>

            <?php }

            } else {

                echo "No Login Details Exists";
            } ?>

            </tbody>
        </table>



    </ul></div>
<div style="" id="ui-tabs-7" class="tabsContent ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"><ul class="thumbs">

        <table class="uniq table table-striped table-bordered table-hover" id="sample_2">

            <thead>
            <th>Sr#</th>
            <th>Video Name</th>
            <th>View Videos</th>
            <th>Assign</th>
            </thead>
            <tbody class="studenassignment">
            <?php
            $query09="select courseid from assigncourse where rollno='$rollno'";
            $result09=mysql_query($query09) or die(mysql_error());
            $fe=mysql_fetch_array($result09);
            $video = "select * from coursevideo where course_id=".$fe['courseid'];

            $result = mysql_query($video) or die(mysql_error());

            $sr="";

            $fetcharray=mysql_query("select videoId from tbl_studentvideos where rollno='$id'") or die(mysql_error());;
            $fetcharrays=mysql_fetch_array($fetcharray);
            while($rowSet = mysql_fetch_array($result))
            {
                $sr++;
                ?>

                <tr>
                    <td><?php echo $sr; ?></td>
                    <td><?php echo $rowSet['name']; ?></td>
                    <td><a href="../combine/coursevideos/<?php echo $rowSet['videopath'];?>" class="html5lightbox">View </a></td>

                    <td>
                        <?php
                        if(@in_array($rowSet['id'],$fetcharrays)) {
                            echo "Assign";
                        } else { ?>

                            <form action="" method="post">
                                <input type="hidden" name="vid" value="<?php echo $rowSet['id']; ?>" />
                                <input type="submit" name="vsubmit" value="Assign" style="width:60px; height:20px;" onClick="return confirm('Are you Sure to Assign')" />
                            </form>

                        <?php } ?>
                    </td>

                </tr>

            <?php } ?>

            </tbody>
        </table>



    </ul>
</div>

<div style="" id="ui-tabs-12" class="tabsContent ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"><ul class="thumbs">

        <form  action="" method="post" enctype="multipart/form-data"   id="MyUploadForm">

            <div class="full">
                <div class="label">Title:</div>
                <div class="inputs">
                    <input class="validate[required] form-control hwidth" type="text" name="title" id="doc" value="" required/>
                </div>
            </div>

            <div class="full">
                <div class="label">Documents:</div>
                <div class="inputs">
                    <input class="validate[required] form-control hwidth" type="file" name="document" id="doc" value="" required />
                </div>
            </div>

            <div class="full">
                <div class="label"></div>
                <div class="inputs">
                    <input class="add2 btn btn-success" type="submit" name="st_document" value="Add" id="submit-btn" />
                </div>
            </div>

        </form>

        <h2>Student Docs</h2>

        <table class="uniq table table-striped table-bordered table-hover" id="sample_2">
            <thead>
            <tr>
                <th> Sr# </th>
                <th> Title </th>
                <th> Docs </th>
                <th> Action </th>
            </tr>
            </thead>
            <tbody>
            <?php
            $q="select * from tbl_stdocs where rollno='$id'";
            $r=mysql_query($q) or die(mysql_error());
            $i=0;
            while($fesh=mysql_fetch_array($r))
            {
                $i++; ?>
                <tr>

                    <td> <?php echo $i; ?> </td>
                    <td> <?php echo $fesh['title']; ?> </td>
                    <td> <a href="../combine/stdocs/<?php echo $fesh['filename']; ?>" class="group1" target="_new"><img src="../combine/stdocs/<?php echo $fesh['filename']; ?>" width="100" height="100" /></a> </td>
                    <td> <a href="studentInfo.php?Id=<?php echo $id; ?>&imgid=<?php echo $fesh['id'];?>" onClick="return confirm('Are you Sure you Want to delete')"><img src="../images/delete-icon.png" /></a> </td>
                </tr>


            <?php  } ?>
            </tbody>
        </table>

    </ul></div>
</div>
</div>
</div>
</div>
</div>
</div>

</div> <!-- end content  -->

</div><!-- end wrapper -->

<script>
    CKEDITOR.replace( 'desc2',
        {
            filebrowserBrowseUrl : 'ckfinder/ckfinder.html',
            filebrowserImageBrowseUrl : 'ckfinder/ckfinder.html?Type=Images',
            filebrowserFlashBrowseUrl : 'ckfinder/ckfinder.html?Type=Flash',
            filebrowserUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
            filebrowserImageUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
            filebrowserFlashUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
        });

    CKEDITOR.replace( 'desc3',
        {
            filebrowserBrowseUrl : 'ckfinder/ckfinder.html',
            filebrowserImageBrowseUrl : 'ckfinder/ckfinder.html?Type=Images',
            filebrowserFlashBrowseUrl : 'ckfinder/ckfinder.html?Type=Flash',
            filebrowserUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
            filebrowserImageUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
            filebrowserFlashUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
        });

    CKEDITOR.replace( 'desc4',
        {
            filebrowserBrowseUrl : 'ckfinder/ckfinder.html',
            filebrowserImageBrowseUrl : 'ckfinder/ckfinder.html?Type=Images',
            filebrowserFlashBrowseUrl : 'ckfinder/ckfinder.html?Type=Flash',
            filebrowserUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
            filebrowserImageUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
            filebrowserFlashUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
        });

    CKEDITOR.replace( 'desc5',
        {
            filebrowserBrowseUrl : 'ckfinder/ckfinder.html',
            filebrowserImageBrowseUrl : 'ckfinder/ckfinder.html?Type=Images',
            filebrowserFlashBrowseUrl : 'ckfinder/ckfinder.html?Type=Flash',
            filebrowserUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
            filebrowserImageUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
            filebrowserFlashUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
        });
    CKEDITOR.replace( 'desc6',
        {
            filebrowserBrowseUrl : 'ckfinder/ckfinder.html',
            filebrowserImageBrowseUrl : 'ckfinder/ckfinder.html?Type=Images',
            filebrowserFlashBrowseUrl : 'ckfinder/ckfinder.html?Type=Flash',
            filebrowserUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
            filebrowserImageUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
            filebrowserFlashUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
        });
    CKEDITOR.replace( 'desc7',
        {
            filebrowserBrowseUrl : 'ckfinder/ckfinder.html',
            filebrowserImageBrowseUrl : 'ckfinder/ckfinder.html?Type=Images',
            filebrowserFlashBrowseUrl : 'ckfinder/ckfinder.html?Type=Flash',
            filebrowserUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
            filebrowserImageUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
            filebrowserFlashUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
        });
    CKEDITOR.replace( 'desc8',
        {
            filebrowserBrowseUrl : 'ckfinder/ckfinder.html',
            filebrowserImageBrowseUrl : 'ckfinder/ckfinder.html?Type=Images',
            filebrowserFlashBrowseUrl : 'ckfinder/ckfinder.html?Type=Flash',
            filebrowserUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
            filebrowserImageUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
            filebrowserFlashUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
        });
    CKEDITOR.replace( 'desc9',
        {
            filebrowserBrowseUrl : 'ckfinder/ckfinder.html',
            filebrowserImageBrowseUrl : 'ckfinder/ckfinder.html?Type=Images',
            filebrowserFlashBrowseUrl : 'ckfinder/ckfinder.html?Type=Flash',
            filebrowserUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
            filebrowserImageUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
            filebrowserFlashUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
        });
    CKEDITOR.replace( 'desc10',
        {
            filebrowserBrowseUrl : 'ckfinder/ckfinder.html',
            filebrowserImageBrowseUrl : 'ckfinder/ckfinder.html?Type=Images',
            filebrowserFlashBrowseUrl : 'ckfinder/ckfinder.html?Type=Flash',
            filebrowserUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
            filebrowserImageUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
            filebrowserFlashUploadUrl : 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'
        });
</script>
<script src="tabs/jquery-ui-1.js" type="text/javascript"></script>
<script src="tabs/ui_002.js" type="text/javascript"></script>
<?php include('../includes/footer-old.php'); ?>