HTML
<a style="float:left" data-toggle="modal" data-target="#memberInfo" href="<?php echo $row['id']; ?>" class="table-link clsMemberInfo view"></a>
<!-- Member info Modal -->
<div class="modal fade" role="dialog" id="memberInfo">
</div>
AJAX
$('.view').click(function(e){
e.preventDefault();
var view_id = $(this).attr("href");
datastring = 'memberId='+view_id;
$.ajax({
url: "memberinfo.php",
data: datastring,
type:"POST",
text:"json"
}).done(function(info) {
// console.log(info);
$('#memberInfo').html(info);
});
console.log(view_id);
});
PHP
$sql = "SELECT d.expiry, (SELECT u.expiry from upgrade as u where u.customerId='$memberId' AND d.customerId=u.customerId AND u.cmpId = '$companyId' order by expiry DESC limit 1) as uexp
from details as d where d.customerId ='$memberId' AND d.cmpId = '$companyId' order by expiry DESC limit 1";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_array($result, MYSQLI_ASSOC);
if($row['uexp']>$row['expiry']){
$s = "SELECT d.*, c.*, (SELECT time from freeze where customerFreezeid='$memberId' AND c.cmpId = '$companyId' order by expiry DESC limit 1) as ftime
from upgrade as d, customer as c
where d.customerId = c.id AND c.id='$memberId' AND c.cmpId = '$companyId' order by expiry DESC";
$result = mysqli_query($conn, $s);
$row = mysqli_fetch_array($result, MYSQLI_ASSOC);
} else {
$s = "SELECT d.*, c.*,
(SELECT time from freeze where customerFreezeid='$memberId' AND c.cmpId = '$companyId' order by expiry DESC limit 1) as ftime
from details as d, customer as c
where d.customerId = c.id AND c.id='$memberId' AND c.cmpId = '$companyId' order by expiry DESC";
$result = mysqli_query($conn, $s);
$row = mysqli_fetch_array($result, MYSQLI_ASSOC);
}
$expfz = $row['expiry'];
$explode = explode(" ", $expfz);
$expfz1 = $explode[0];
$expfz2 = $explode[1];
echo '
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div id="example">
<div id="invoice" style="display:none" class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-center"><b>Tax Invoice</b>
</div>
<div id="company" style="display:none" class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-center">'.$companyName.'<br>'.$companyAddress.'
<hr>
</div>
<div class="modal-body text-center">
<b>Name : </b>'.$row['customerName'].'<span id="btnPrint" style="cursor:pointer; float:right" class="glyphicon glyphicon-print"> </span><span id="cmd" style="cursor:pointer; float:right" class="glyphicon glyphicon-download-alt">| </span><br>
<b>Email : </b>'.$row['email'].'<br>
<b>Mobile : </b>'.$row['mobile'].'.<br>
<b>Address : </b>'.$row['address'].'<br>
<b>Emergency Name :</b>'.$row['nameEmg'].'<br>
<b>Emergency Mobile : </b>'.$row['mobileEmg'].'<br>
<hr></hr>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
<span><b>Date of joining : </b>'.$row['joining'].'</span>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
<span><b>Period : </b>'.$row['period'].'</span>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
<span><b>Date of expiry : </b>'.$expfz1.'</span>
</div>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-center">
<hr></hr>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 text-center">
<span><b>Amount Paid : </b>'.$row['paid'].'</span>
</div>
';
if($row['due']==0 || empty($row['due'])) {
echo '
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 text-center">
<span><b>Amount Due : </b>'.$row['due'].'</span>
</div>
'; } else {
echo '<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 text-center">
<span><b>Amount Due : </b>'.$row['due'].' on '.$row['duedate'].'</span>
</div>
';
}
if($row['payment']=="Cheque"){
echo '
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-center">
<br>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 text-center">
<span><b>Paid By: </b>'.$row['payment'].'</span>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 text-center">
<span><b>Bank Name : </b>'.$row['bank'].'</span>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 text-center">
<span><b>Cheque Number: </b>'.$row['cqn'].'</span>
</div>
';
} if($row['payment']=="Credit Card"){
echo '
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-center">
<br>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 text-center">
<span><b>Paid By: </b>'.$row['payment'].'</span>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 text-center">
<span><b>Bank Name : </b>'.$row['bank'].'</span>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 text-center">
<span><b>Credit Card Name: </b>'.$row['ccn'].'</span>
</div>
';
} if($row['payment']=="Debit Card"){
echo '
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-center">
<br>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 text-center">
<span><b>Paid By: </b>'.$row['payment'].'</span>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 text-center">
<span><b>Bank Name : </b>'.$row['bank'].'</span>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 text-center">
<span><b>Debit Card Name: </b>'.$row['dcn'].'</span>
</div>
';
}
echo '
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-center">
<hr></hr>
</div>
<span class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
<img src="images/gym.png" width="50px" height="50px">
<b>Gym : </b>'.$row['gym'].'</span>
<span class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
<img src="images/ca.png" width="50px" height="50px">
<b>Cardio : </b>'.$row['cardio'].'</span>
<span class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
<img src="images/s.png" width="50px" height="50px">
<b>Steam : </b>'.$row['steam'].'</span>
<span class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
<img src="images/sauna.png" width="50px" height="50px">
<b>Sauna : </b>'.$row['sauna'].'</span>
<span class="col-lg-3 col-xs-3">
<img src="images/steam.png" width="50px" height="50px">
<b>Spa : </b>'.$row['spa'].'</span>
<span class="col-lg-3 col-xs-3">
<img src="images/diet.png" width="50px" height="50px">
<b>Diet : </b>'.$row['diet'].'</span>
<img src="images/train.png" width="50px" height="50px">
<span><b>Trainer : </b>'.$row['trainer'].'</span><br>
</div>
<div id="rules" class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style="display:none">
<hr>
<h6 class="text-center">Rules and Regulations</h6>
<ul style="font-size:10px">
<li>We reserve the right to admission.</li>
<li>Membership fees are non-refundable.</li>
<li>The rates for the facility may be changed at the sole discretion of Management without prior notice.</li>
<li>The management is not responsible for any loss or theft of members belongings.</li>
<li>We advice members not responsible not to carry valuables to the gym.</li>
<li>Smoking, chewing of Beetle Leafis strictly prohibited in the gym premises.</li>
<li>Courteous member conduct is very important in order to provide everyone with a pleasant workout experience. Poor conduct includes, but is not limited to : use of profanity, bad mouthing others and fighting. If a member is found treating anyone disrespectfully, their membership will be terminated without refund and that member waives their right to recourse.</li>
<li>Sports wear is compulsory in the gym.</li>
<li>Members must carry a separate pair of training shoes to be changed into the gym premises to help maintain hygiene.</li>
<li>The Management will maintain a notice board for intimidating the members of any future changes.</li>
<li>The Management expects the members to read it on regular basis. We assume the members read the notice.</li>
<li>We request members to use a deodorant spray.</li>
<li>Taxes are applicable.</li>
</ul>
<hr>
</div>
<div id="signature" class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style="display:none;">Authorised Signature <input type="text"> <span style="float:right">Customer Signature <input type="text"></span></div>
</div>
<div class="modal-footer">
<span class="col-lg-3 col-xs-12 col-sm-12 text-center">
<a href="'.$row['id'].'" class="freeze" data-toggle="modal" data-target="#freezeModal">FREEZE ACCOUNT</a>
</span>
<span class="col-lg-3 col-xs-12 col-sm-12 text-center">
<a href="'.$row['id'].'" id="preview" data-toggle="modal" data-target="#previewModal">PREVIEW HISTORY</a>
</span>
<span class="col-lg-3 col-xs-12 col-sm-12 text-center">
<a href="#" data-toggle="modal" data-target="#renew">RENEW/UPGRADE</a>
</span>
<span class="col-lg-3 col-xs-12 col-sm-12 text-center">
<a href="#" data-toggle="modal" data-target="#transfer">ACCOUNT TRANSFER</a>
</span>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-center">
<p></p>
</div>
</div>
</div>
</div>
</div>';
}
我知道有相关的问题,但我尝试了几乎所有的工作而且还没有工作
当我点击一个标签时,它以一个模态为目标,模态的信息由AJAX显示,数据由JSON互换
但是当我想再次打开模态时,模态背景变得更暗更暗。