PHP Classes

File: aksara/Modules/Administrative/Views/account/logs.php

Recommend this page to a friend!
  Packages of Aby Dahana   Aksara   aksara/Modules/Administrative/Views/account/logs.php   Download  
File: aksara/Modules/Administrative/Views/account/logs.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Aksara
A CodeIgniter based API and CRUD generator
Author: By
Last change: Refactor code for improved readability and consistency across multiple views

- Rearranged comments and code blocks for better organization in database.php, error_404.php, error_exception.php, error_exception.php (HTML), index.php, requirement.php, security.php, system.php, and Home module views.
- Ensured consistent formatting and indentation throughout the files.
- Added missing PHP opening tags and improved variable initialization.
- Enhanced error handling and user feedback in error views.
- Updated HTML structure for better semantic clarity and accessibility.
Date: 4 months ago
Size: 3,121 bytes
 

 

Contents

Class file image Download
<?php

/**
 * @var mixed $logs
 */
?>

<div class="container-fluid py-3">
    <div class="alert alert-info callout rounded-4">
        <h3><?= phrase('Information'); ?></h3>
        <i class="mdi mdi-information-outline"></i> <?= phrase('You are signed in on these devices or have been recently in.'); ?> <?= phrase('There might be multiple activity sessions from the same device.'); ?>
    </div>
    <div class="row">
        <div class="col-md-7 col-xxl-6">
            <?php foreach($logs as $platform => $log): ?>
                <div class="card rounded-4 mb-3">
                    <div class="card-body">
                        <div class="row">
                            <div class="col-sm-5">
                                <b><?= $platform; ?></b>
                            </div>
                            <div class="col-sm-7">
                                <?php foreach($log as $key => $session): ?>
                                    <?php if ($key): ?>
                                        <hr />
                                    <?php endif; ?>

                                    <div>
                                        <?php if ($session->ip_address != service('request')->getIPAddress()): ?>
                                            <a href="<?= current_page('kick', ['session' => $session->session_id]); ?>" class="btn btn-sm btn-danger float-end rounded-pill --xhr">
                                                <i class="mdi mdi-logout"></i>
                                                <?= phrase('Kick'); ?>
                                            </a>
                                        <?php endif; ?>
                                        <b>
                                            <?= date('d F Y, H:i', strtotime($session->timestamp)); ?>
                                        </b>
                                        <br />
                                        <?= $session->browser; ?>
                                        <br />
                                        <a href="//ipinfo.io/<?= $session->ip_address; ?>" target="_blank">
                                            <b class="--fetch-ip-info" data-ip="<?= $session->ip_address; ?>">
                                                <?= $session->ip_address; ?> <i class="mdi mdi-launch"></i>
                                            </b>
                                        </a>
                                        <?php if ($session->ip_address == service('request')->getIPAddress()): ?>
                                            <br />
                                            <i class="mdi mdi-check-circle text-primary"></i>
                                            <?= phrase('Your current session'); ?>
                                        <?php endif; ?>
                                    </div>
                                <?php endforeach; ?>
                            </div>
                        </div>
                    </div>
                </div>
            <?php endforeach; ?>
        </div>
    </div>
</div>