You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
information-system/application/third_party/trainsystem/views/refund.php

92 lines
3.6 KiB
PHTML

<div style="width:90%;margin:30px auto;">
<div class="panel panel-primary" style="width:60%;margin:0 auto;">
<div class="panel-heading">
<h3 class="panel-title"><?php echo $train_date;?>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $checi;?>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo isset($elecnumber)?$elecnumber:"";?></h3>
</div>
<div class="panel-body">
<?php
foreach ($passengers as $items){
echo '<p>'.$from_station_name.'<span class="glyphicon glyphicon-arrow-right"></span>'.$to_station_name.'</p>';
echo '<p style="border-top:1px dashed #000; height:1px;margin-top:10px;" ></p>';
echo '<p>ID:'.$items->tst_id.''.$items->tst_realname.'('.$items->tst_ticketype.')&nbsp;&nbsp;&nbsp;&nbsp;'.$items->tst_seatstype.'&nbsp;&nbsp;'.$items->tst_seatdetail.'&nbsp;&nbsp;&nbsp;&nbsp;票价:¥'.$items->tst_ticketprice.'</p>';
if ((int)$items->tst_status==7){//退票成功
echo '&nbsp;&nbsp;&nbsp;&nbsp;<p>退票成功</p>';
}else if ((int)$items->tst_status==8){
$errMsg = "";
if (!empty($items->tst_returncallback)){
$returnCallBack = json_decode($items->tst_returncallback);
if (isset($returnCallBack->failReason)){
$errMsg = $returnCallBack->failReason;
}
}
echo '&nbsp;&nbsp;&nbsp;&nbsp;<p>退票失败:'.$errMsg.'</p>';
}
if((int)$items->tst_status == 4 || (int)$items->tst_status==8){
echo '<p>';
echo '<a href="###" style="padding:5px 15px;" class="btn btn-warning btn-sm returnticket" name="'.$items->tst_realname.'" passid="'.$items->tst_numberid.'"><span class="glyphicon glyphicon-remove"></span>退票</a>';
echo '</p>';
}elseif((int)$items->tst_status == 9){
echo '<p>';
echo '<a href="###" style="padding:5px 15px;" class="btn btn-warning btn-sm reschedulereturn" name="'.$items->tst_realname.'" passid="'.$items->tst_numberid.'"><span class="glyphicon glyphicon-remove"></span>改签退票</a>';
echo '</p>';
}else{
$info = json_decode($items->tst_returncallback);
echo '<p><table class="table table-bordered table-hover" style="text-align:center;"><tr><th colspan="2" style="text-align:center;">退票处理</th></tr>';
echo '<tr><td>'.$items->tst_lasteditdate.'</td>';
echo '<tr><td>'.$msg.'</td></tr></table></p>';
}
}?>
</div>
</div>
</div>
<script>
$(function(){
//正常退票
$('.returnticket').click(function(){
var url = <?php echo "'/info.php/apps/trainsystem/returnorders/returntickets?ordernumber=$ordernumber'"?>;
var return_ticket = $(this);
name = $(this).attr('name');
passid = $(this).attr('passid');
url += '&passportname='+name+'&passportno='+passid+'&usercenter=no';
//console.log(url);return false;
$.ajax({
url:url,
success:function(json){
alert('请求成功,正在处理退票...');
return_ticket.html('退票提交成功');
},
error:function(json){
alert('请求失败,请重新请求,如果还有错误请联系管理员');
return_ticket.html('退票提交失败');
}
});
});
//改签退票
$('.reschedulereturn').click(function(){
var orderNumber = '<?php echo $ordernumber?>';
name = $(this).attr('name');
passid = $(this).attr('passid');
$.ajax({
url:'/info.php/apps/trainsystem/returnorders/returnreschedule',
type:'POST',
data:{
orderNumber:orderNumber,
username:name,
userid:passid
},
beforeSend:function(){
$('.reschedulereturn').html('退票请求已发送...');
$('.reschedulereturn').addClass('disabled');
},
success:function(json,status){
var data = $.parseJSON(json);
alert(data.Msg);
$('.reschedulereturn').html('改签退票');
$('.reschedulereturn').removeClass('disabled');
}
});
});
});
</script>