function showMessage($P_message,$P_jumpUrl = '',$P_type = 1,$P_messageType = 'success',$P_time = 2000){ if(empty($P_jumpUrl)) { $P_jumpUrl = getRefUrl(); } switch ($P_messageType) { case 'success': $L_messageType = '操作成功'; break; case 'error': $L_messageType = '操作失败'; break; case 'warning': $L_messageType = '操作警告'; break; } switch($P_type) { case 1: echo '<!DOCTYPE html>'; echo '<html>'; echo '<head>'; echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'; echo '<title></title>'; echo '<style type="text/css">'; echo 'body { font-family: "Verdana";padding: 0; margin: 0;}'; echo 'h2 { font-size: 12px; line-height: 30px; border-bottom: 1px dashed #CCC; padding-bottom: 8px;width:800px; margin: 20px 0 0 150px;}'; echo 'dl { float: left; display: inline; clear: both; padding: 0; margin: 10px 20px 20px 150px;}'; echo 'dt { font-size: 14px; font-weight: bold; line-height: 40px; color: #333; padding: 0; margin: 0; border-width: 0px;}'; echo 'dd { font-size: 12px; line-height: 40px; color: #333; padding: 0px; margin:0;}'; echo '</style>'; echo '</head>'; echo '<script>'; echo 'var time = '.$P_time.';'; echo 'function loading(){if(cnt < 0){ window.location.href = "'.$P_jumpUrl.'";}else{document.getElementById("showTime").innerHTML = "页面<font color=red>" + time + "</font>秒后跳转";cnt--;}setTimeout("loading()",1000);}'; echo '</script>'; echo '<body onload="loading()">'; echo '<h2>'.$L_messageType.'</h2>'; echo '<dl>'; echo '<dd>'.$P_message.'</dd>'; echo '<dt><p id="showTime"></p></dt>'; echo '<dd><a href="'.$P_jumpUrl.'">'.$P_jumpUrl.'<a></dd>'; echo '<dd><p /><p /><p /><p /></dd>'; echo '<dd><p /><p /><p /><p /></dd>'; echo '</dl>'; echo '</body>'; echo '</html>'; exit; break; case 2: $L_order_message_array = array(); $L_order_message_array['type'] = $P_messageType; $L_order_message_array['message'] = $P_message; $L_order_message_array['refurl'] = $P_jumpUrl; exit(json_encode($L_order_message_array)); break; case 3: $L_order_message_array = array(); $L_order_message_array['type'] = $P_messageType; $L_order_message_array['message'] = $P_message; $L_order_message_array['refurl'] = $P_jumpUrl; print_r(getXml($L_order_message_array)); exit(); break; case 4: echo '<script>'; echo 'alert("'. $L_messageType.'\n原因来自于:\n'.$P_message .'");'; echo 'location.href="'. $P_jumpUrl .'"'; echo '</script>'; exit; break; }}
添加回答
举报
0/150
提交
取消