| Current Path : /home2/wtmwscom/public_html/member/ |
| Current File : /home2/wtmwscom/public_html/member/messages.php |
<?php
$title = "Messages";
include 'header.php';
//include_once('lib/ps_pagination.php');
$uid = $_SESSION['userid'];
if (!isset($_GET['help_id'])) {
redirect("./index.php");
}
$help_id = $_GET['help_id'];
?>
<div class="container-fluid">
<?php echo getMessage(); ?>
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<h4 class="page-title">Messages</h4>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.php">Home</a></li>
<li class="breadcrumb-item"><a href="#">Index</a></li>
<li class="breadcrumb-item active">Messages</li>
</ol>
</div>
</div>
</div>
<!-- end row -->
<div class="row">
<div class="col-12">
<div class="card m-b-20">
<div class="card-body">
<form action="messages_model.php" name="form" id="form" method="post" enctype="multipart/form-data">
<div class="form-group row">
<!-- <label for="example-text-input" class="col-sm-2 col-form-label">Text</label>-->
<label class="col-sm-2 col-form-label" for="subject">Subject <span>*</span></label>
<!-- <label class="col-sm-2 col-form-label" for="dob"> Name<span>*</span></label>-->
<div class="col-sm-10">
<input class="form-control"type="text" name="subject" id="subject" required="required" maxlength="100">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label" for="message">Message</label>
<div class="col-sm-10">
<input class="form-control" name="message" id="message" required="required">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label" for="receipt">Select File</label>
<div class="col-sm-10">
<input class="form-control" type="file" name="receipt" id="receipt">
</div>
</div>
<div class="form-group">
<div>
<input type="hidden" name="help_id" value="<?php echo $help_id; ?>" />
<button name="submit" type="submit" id="submit" value="Submit" class="btn btn-primary waves-effect waves-light">
Submit
</button>
</div>
</div>
</form>
</div>
</div>
</div> <!-- end col -->
</div> <!-- end row -->
</div> <!-- container-fluid -->
<div class="container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="page-title-box">
<h4 class="page-title">Bank Account Details</h4>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="javascript:void(0);">Lexa</a></li>
<li class="breadcrumb-item"><a href="javascript:void(0);">Tables</a></li>
<li class="breadcrumb-item active">Basic Tables</li>
</ol>
<!-- <div class="state-information d-none d-sm-block">
<div class="state-graph">
<div id="header-chart-1"></div>
<div class="info">Balance $ 2,317</div>
</div>
<div class="state-graph">
<div id="header-chart-2"></div>
<div class="info">Item Sold 1230</div>
</div>
</div>-->
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="card m-b-20">
<div class="card-body">
<!-- <h4 class="mt-0 header-title">Basic example</h4>
<p class="text-muted m-b-30">For basic styling—light padding and
only horizontal dividers—add the base class <code>.table</code> to any
<code><table></code>.
</p>-->
<table class="table mb-0 datatable">
<thead>
<tr>
<th>S. No.</th>
<th>Sender</th>
<th>Receiver</th>
<th>Date</th>
<th>Subject</th>
<th>Message</th>
<th>Attach File</th>
</tr>
</thead>
<tbody>
<?php
$query = mysqli_query($connection, "SELECT * FROM `bank_receipt` WHERE (`sender`='" . $uid . "' OR `receiver`='" . $uid . "') AND help_id='$help_id' ORDER BY `datetime` DESC");
if (!isset($_GET['page'])) {
$i = 1;
} else {
$i = (($_GET['page'] - 1) * 20) + 1;
}
// if ($rs) {
while ($message = mysqli_fetch_object($query)) {
$sender = mysqli_fetch_object(mysqli_query($connection, "SELECT login_id, name, mobile FROM user WHERE uid='$message->sender'"));
$receiver = mysqli_fetch_object(mysqli_query($connection, "SELECT login_id, name, mobile FROM user WHERE uid='$message->receiver'"));
?>
<tr>
<td><?php echo $i; ?></td>
<td><?php echo "$sender->name ($sender->mobile)"; ?></td>
<td><?php echo "$receiver->name ($receiver->mobile)"; ?></td>
<td><?php echo date("d M,Y H:i A", strtotime($message->datetime)); ?></td>
<td><?php echo $message->subject; ?></td>
<td onclick="viewMyModal(<?php echo $i ?>)"><span title="View Message" id="opener<?php echo $i ?>" ></span>View Message
<!-- end row -->
<div id="myModal-<?php echo $i; ?>" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<form class="form-horizontal" id="activate_pin_form" method="post">
<div class="modal-header">
<h5 class="modal-title mt-0" id="myModalLabel">Activate account by Pin</h5>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<!-- <h5>Activate account by Pin</h5>-->
<table class="table table-bordered table-striped table-hover">
<tbody>
<?php /*
<tr class="light">
<td>Sender</td>
<td><?php echo $sender;?></td>
</tr>
<tr class="dark">
<td>Receiver</td>
<td><?php echo $receiver;?></td>
</tr>
<tr class="light">
<td>Send Date</td>
<td><?php echo date("d M,Y H:i A", strtotime($message->datetime));?></td>
</tr>
<tr class="dark">
<td>Subject</td>
<td><?php echo $message->subject;?></td>
</tr>
*/?>
<tr class="light">
<td>Message</td>
<td><?php echo $message->message;?></td>
</tr>
<tr class="dark">
<td>File</td>
<td>
<?php if(file_exists("uploads/".$message->filename) && $message->filename!=''){?>
<img src="uploads/<?php echo $message->filename;?>" />
<?php }?>
</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<!--<button type="submit" class="btn btn-primary waves-effect waves-light">Activate NOw</button>-->
<button name="submit" id="submit" type="button" class="btn btn-secondary waves-effect" data-dismiss="modal">Close</button>
</div>
</form>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</td>
<td>
<?php if(file_exists("uploads/".$message->filename) && $message->filename!=''){?>
<a href="uploads/<?php echo $message->filename;?>" target="_blank">View File</a>
<?php }?>
</td>
</tr>
<?php
$i++;
}
// }
?>
</tbody>
</table>
<?php //echo $pager->renderFullNav(); ?>
</div>
</div>
</div> <!-- end col -->
</div>
<!--table content ends here-->
</div>
<script>
function viewMyModal(index) {
// console.log("opppppppppppppppp"+index);
// alert('hhhh');1
$("#myModal-" + index).modal();
}
</script>
<?php include 'footer.php'; ?>