HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-31-18-78 6.17.0-1017-aws #17~24.04.1-Ubuntu SMP Tue May 26 21:09:53 UTC 2026 aarch64
User: ubuntu (1000)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /var/www/selfanalyse/counselor/booked-slot-list.php
<?php
	include_once('header.php');
	include_once('../wp-config.php');
	$counselor_id = $_SESSION['COUN-ID'];
	//echo "Counselor Name : " . $uname;

	$PSY_COUNSELLING_SUBSCRIPTION = $wpdb->prefix . PSY_COUNSELLING_SUBSCRIPTION;
	$PSY_ONLINE_TXN_MAIN = $wpdb->prefix . PSY_ONLINE_TXN_MAIN;
	$PSY_SLOT_AVAILABLE = $wpdb->prefix . PSY_SLOT_AVAILABLE;
	$PSY_USERS_DETAILS = $wpdb->prefix . PSY_USERS_DETAILS;
	$PSY_ABILITY_CLASS = $wpdb->prefix . PSY_ABILITY_CLASS;
	$PSY_STATES = $wpdb->prefix . PSY_STATES;
	$PSY_CITY = $wpdb->prefix . PSY_CITY;
	$PSY_USERS = $wpdb->prefix . PSY_USERS;

	$query = "SELECT pcs.subs_id, pcs.slot_table_id, pcs.counselor_id, pcs.user_id, pcs.online_txn_table_id, pcs.status, pcs.c_msg, pcs.subs_date, pud.first_name,pud.last_name,pud.state_id, pud.city_id, pud.email_address, potm.payment_type, potm.net_amount, psa.pricing_for_slot, psa.scheduled_date, psa.time_dur,psa.created_by, pud.current_education_level, pud.mobile_number,u.user_login FROM $PSY_COUNSELLING_SUBSCRIPTION AS pcs INNER JOIN $PSY_ONLINE_TXN_MAIN AS potm ON potm.txn_id=pcs.online_txn_table_id INNER JOIN $PSY_SLOT_AVAILABLE AS psa ON psa.id=slot_table_id INNER JOIN $PSY_USERS_DETAILS as pud on pud.user_id=pcs.user_id LEFT JOIN $PSY_USERS as u on u.ID=pud.user_id WHERE pcs.counselor_id='$counselor_id' and psa.slot_status='S'";
	$queryData = $wpdb->get_results($query);
?>

<style>
	.modal-backdrop {
	    z-index: 999!important;
	}
	table.dataTable.nowrap th, table.dataTable.nowrap td {
	    white-space: nowrap !important;
	}
	.page-title{
		float: left;
	    width: 100%;
	}
	.excel{
		float: right;
    	color: #fff;
	}
</style>

<div class="page-inner">
    <div class="page-title">
		<div class="col-md-4">
			<h3> Booked Slot </h3>
			<div class="page-breadcrumb">
				<ol class="breadcrumb">
					<li><a href="dashboard">Home</a></li>
					<li class="active">Booked Slot List</li>

				</ol>
			</div>
		</div>
		<div class="col-md-8">
			<div class="navbar-right">
				<ul class="navul">
					<!--<li><a href="apt-class">Class List</a></li>-->
				</ul>
			</div>
		</div>
    </div>

    <div id="main-wrapper">
        <div class="col-md-12" style="padding:0;">
            <div class="panel panel-info">
                <div class="panel-heading clearfix">
                    <h4 class="panel-title">Booked Slot List</h4>
                    <!-- <a href="student-test-excel.php?type=APT" target="_blank" class="excel">
						<i class="fa fa-file-excel-o" title="Download" style="cursor:pointer;"></i>
					</a> -->
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
						<table class="display " id="userList" style="font-size: 13px;">
							<thead>
								<tr>
									<th>Id</th>
									<th>User login</th>
									<th>Name</th>
									<th>Email</th>
									<th>Mobile</th>
									<th>State</th>
									<th>City</th>
									<th>Class</th>
									<th>Date of Book</th>
									<th>Slot of Book</th>
									<th>Created By</th>
									<!-- Additional Features -->
									<!-- <th>Payment Type</th>
									<th>Net Amount</th>
									<th>Slot Pricing</th>
									<th>Time Duration</th> -->
									<!-- Additional Features -->
								</tr>
							</thead>
							<tbody>
								<?php

									$i=1;
									foreach($queryData as $data){

										$name = $data->first_name . " " . $data->last_name;

										if($data->status == 'A'){
											$status = 'Active';
										} else if($data->status == 'D') {
											$status = 'Deactive';
										} else if($data->status == 'E') {
											$status = 'Expired';
										}
										$createdBy = $data->created_by == 'user' ? 'User' : 'Counselor';

										$state_name = $wpdb->get_var("SELECT state_name FROM $PSY_STATES WHERE state_id='$data->state_id'");
										$city_name = $wpdb->get_var("SELECT city_name FROM $PSY_CITY WHERE city_id='$data->city_id'");
										$class_name = $wpdb->get_var("SELECT class_name FROM $PSY_ABILITY_CLASS WHERE class_id='$data->current_education_level'");

										$link = "<a href='' target='_blank' style='cursor:pointer;' > Check Reports </a> "; 
                            	?>
								<tr>
									<td><?php echo $i; ?></td>
									<td><?php echo $data->user_login; ?></td>
									<td><?php echo $name; ?></td>
									<td><?php echo $data->email_address; ?></td>
									<td><?php echo $data->mobile_number; ?></td>
									<td><?php echo $state_name; ?></td>
									<td><?php echo $city_name; ?></td>
									<td><?php echo $class_name; ?></td>
									<td><?php echo $data->subs_date; ?></td>
									<td><?php echo $data->scheduled_date; ?></td>
									<td><?php echo $createdBy; ?></td>
									<!-- <td><?php // echo $data->payment_type; ?></td>
									<td><?php // echo $data->net_amount; ?></td>
									<td><?php // echo $data->pricing_for_slot; ?></td>
									<td><?php // echo $data->time_dur; ?></td> -->
									<!-- <td><?php // echo $link; ?></td> -->
									<!-- <td>
										<tr>
											<td> A
												<?php // echo $link; ?>
											</td>
											<td> P
												<?php // echo $link; ?>
											</td>
											<td> T
												<?php // echo $link; ?>
											</td>
										</tr>
									</td> -->
								</tr>
								<?php $i++; } ?>
							</tbody>
						</table>
					</div>
				</div>
			</div>
        </div>
    </div>
    <!-- Main Wrapper -->

	<!-------------------edit ability modal---------------->
	<div class="modal fade" id="editAbilityModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content" style="border: 3px solid #ccc;">
                <div class="modal-header" style="padding: 5px 10px 0px 0px; height: 20px;">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    	<span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body" id="edit_ability_modal"></div>
            </div>
        </div>
    </div>

    <div class="page-footer">
        <p class="no-s">shinemetrics.com</p>
    </div>
</div>
<!-- Page Inner -->

<script type="text/javascript" charset="utf-8">
	jQuery.noConflict();
    jQuery(function($) {
        $('#userList').dataTable({
            "bPaginate": true,
            "iDisplayLength": 50,
            "lengthMenu": [[10,20, 50, 100, 500, 1000 ], [10,20, 50, 100, 500, 1000]],
			"order": [[ 7, "desc" ]]
        });

		jQuery('#editAbilityModal').on('show.bs.modal', function (event) {
			var button = $(event.relatedTarget);
			var abid = button.data('id');
			//alert(abid);
			var url = "/counselor/apt-ability-edit.php";
			jQuery.ajax({
				url: url,
				type:'POST',
				data: { abid : abid },
				success:function(data){
					document.getElementById("edit_ability_modal").innerHTML = data;
				}
			})
		})
	});
</script>

<link href="assets/css/jquery.dataTables.min.css" rel="stylesheet">
<link href="assets/css/responsive.dataTables.min.css" rel="stylesheet">
<script src="assets/js/jquery.dataTables.min.js"></script>
<script src="assets/js/dataTables.responsive.min.js"></script>

<?php include_once('footer.php'); ?>