Your IP : 10.1.73.149


Current Path : /home/bolconlineco/public_html/aaaaaa/demo/coordinator/
Upload File :
Current File : /home/bolconlineco/public_html/aaaaaa/demo/coordinator/newemails-outbox.php

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

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

$email_counter = 1;

$query="SELECT * FROM emails WHERE  sender = 1 ORDER BY email_date DESC";

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

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

<h3 class="page-title">Outbox</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">Outbox</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>Outbox</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="outbox_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="outbox_data_found">
          <?php
          $email_counter = 0;
            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);

                $id = $studnet_info['rollno'];

                $msg = "";
                $string = $rr['message'] ; ?>

    <tr>

        <td>
            <a href="#" data-toggle="modal" data-target="#myModal<?php echo $email_counter; ?>w">
            <strong><?php echo sprintf("%02d", $email_counter); ?></strong></a>
        </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" 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="padding: 10px;
                                                                            background-color: #A2D4AE;
                                                                            border-radius: 10px;
                                                                            clear: both;
                                                                            margin-bottom: 20px;
                                                                            display: block;
                                                                            color: #fff;
                                                                            width: 127px">Create Message</a>
                </div>

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

    <?php $email_counter++; } ?>
    </tbody>
</table>
<?php
				   } else {
					   echo "No Email Exists";
				   } ?>

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