Your IP : 10.1.73.149


Current Path : /home/bolconlineco/www/aaaaaa/coordinator/
Upload File :
Current File : /home/bolconlineco/www/aaaaaa/coordinator/newemails-inbox.php

<?php
ob_start();
ob_flush();
session_start();
include('includes/header.php');
include('functions.php');
require '../emails/PHPMailerAutoload.php';

if(!isset($_SESSION['coordinator']) || $_SESSION['coordinatorrole'] != 2)
{
    header("location:../index.php");
    exit();
}

$email_counter = 0;

$query="SELECT * FROM emails WHERE  sender = 0 ORDER BY email_date DESC, email_id DESC";
$result=mysql_query($query) or die(mysql_error());
if(mysql_num_rows($result) > 0) { ?>

    <style>

    </style>
    <h3 class="page-title">Inbox</h3>
    <ul class="page-breadcrumb breadcrumb">
        <li><i class="fa fa-home"></i> <a href="dashbord.php"> Home </a> <i class="fa fa-angle-right"></i> </li>
        <li class="active">Inbox</li>
    </ul>
    <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>Inbox</div>
    </div>

    <div class="portlet-body clearfix">

    <div class="col-xs-6 col-md-offset-3">
        <input type="text" placeholder="Search By Name" class="form-control" id="inbox_search" />
    </div>

    <table class="tablestyle table_style1 table table-striped table-bordered table-hover" id="sample_2">
        <thead>
        <tr>
            <th>Sr</th>
            <th>Date</th>
            <th>Student</th>
            <th>Subject</th>
            <th>Attachment</th>
            <th>Status</th>
        </tr>
        </thead>
        <tbody class="inbox_data_found">
        <?php
        while($rr=mysql_fetch_array($result)) {
            $stQuery = mysql_query("select SId, title,fname,lname, rollno from student where rollno = '".$rr['student_id']."'") or die(mysql_error());
            $studnet_info = mysql_fetch_array($stQuery);
            $email_counter++;
            $msg="";
            $string=  $rr['message'] ;
            $id =  $studnet_info['rollno'];?>
            <tr>
                <td><?php echo $email_counter; ?></td>
                <td>
                    <a href="#" data-toggle="modal" data-target="#myModal<?php echo $email_counter; ?>w">
                        <?php echo date('d/m/Y', strtotime($rr['email_date'])); ?></a>
                </td>

                <td>
                    <a href="#" data-toggle="modal" data-target="#myModal<?php echo $email_counter; ?>w">
                        <?php echo $studnet_info['title'] . '  '. $studnet_info['fname'] . '  '. $studnet_info['lname']; ?></a>
                </td>

                <td>
                    <a href="#" data-toggle="modal" data-target="#myModal<?php echo $email_counter; ?>w">
                        <?php echo $rr['subject']; ?></a>
                </td>

                <td>
                    <?php if(!empty($rr['attachment'])){ ?> <a href="../email_attachments/<?php echo $rr['attachment'] ?>">Download</a> <?php } ?>
                </td>

                <td>
                    <?php echo ($rr['status'])?'Read':'<a href="updateemailstatus.php?Id='.$rr['student_id'].'&eid='.$rr['email_id'].'">UnRead</a>'; ?>
                </td>

            </tr>

            <div class="modal fade mesgContainer" id="myModal<?php echo $email_counter; ?>w" tabindex="1" role="dialog" aria-labelledby="myModalLabel">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">

                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title" id="myModalLabel"><?php echo $rr['subject']; ?></h4>
                        </div>

                        <div class="modal-body">
                            <?php echo preg_replace("/(<br\s*\/?>\s*)+/", '<br />', $rr['message']) ; ?>
                        </div>

                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                            <a href="studentInfo.php?Id=<?php echo $id;?>&edit#ui-tabs-13"  style="color: #fff;" class="btn btn-success">Create Message</a>
                        </div>

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

        <?php } ?>

        </tbody>
    </table>
<?php

} else {
    echo "No Email Exists";
} ?>

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


<?php include('../includes/footer.php');?>