File: aksara/Modules/Galleries/Views/read.php

Recommend this page to a friend!
  Classes of Aby Dahana  >  Aksara  >  aksara/Modules/Galleries/Views/read.php  >  Download  
File: aksara/Modules/Galleries/Views/read.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Aksara
A CodeIgniter based API and CRUD generator
Author: By
Last change: Initial commit for update 4.2.7

1. Core: Fix the CRUD function both back end and front end;
2. Core: Fix the query string parameter for each returned data;
3. Core: Block the Internet Explorer under version 11 that no longer supports common used javascript;
4. Model: Fix the multiple database connection when switching the main connection to the second connection;
5. Javascript: Fix the query string extraction that return null value;
6. Galleries: Add the slide view for next and previous image if available;
Date: 1 month ago
Size: 4,304 bytes
 

Contents

Class file image Download
<?php
    $count
= 0;
   
$images = json_decode($results[0]->gallery_images);
   
$attributes = json_decode($results[0]->gallery_attributes);
   
$current = service('request')->uri->getSegment(3);
   
$carousel = null;
   
    if(
$images)
    {
        foreach(
$images as $key => $val)
        {
           
$carousel .= '
                <div class="carousel-item text-center rounded'
. ($current == $key ? ' active' : null) . '">
                    <img src="'
. get_image('galleries', $key) . '" class="img-fluid" alt="' . $val . '">
                    <div class="carousel-caption d-none d-md-block text-shadow">
                        '
. $val . '
                    </div>
                </div>
            '
;
           
           
$count++;
        }
    }
?>

<style type="text/css">
    .rounded-top-0
    {
        border-top-left-radius: 0;
        border-top-right-radius: 0
    }
    @media (max-width: 640px)
    {
        .photo-view
        {
            margin-left: -15px;
            margin-right: -15px
        }
    }
</style>
<div class="photo-view text-center bg-dark">
    <div class="relative" style="overflow: hidden">
        <div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
            <div class="carousel-inner">
                <?php echo $carousel; ?>
</div>
            <?php if($count > 1) { ?>
<a class="carousel-control-prev gradient-right" href="#carouselExampleControls" role="button" data-slide="prev">
                    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                    <span class="sr-only">
                        <?php echo phrase('previous'); ?>
</span>
                </a>
                <a class="carousel-control-next gradient-left" href="#carouselExampleControls" role="button" data-slide="next">
                    <span class="carousel-control-next-icon" aria-hidden="true"></span>
                    <span class="sr-only">
                        <?php echo phrase('next'); ?>
</span>
                </a>
            <?php } ?>
</div>
    </div>
</div>
<div class="container">
    <div class="row">
        <div class="col-md-8 offset-md-2">
            <div class="card shadow rounded-top-0 border-top-0">
                <div class="card-body">
                    <div class="row mb-3">
                        <div class="col-2 col-md-1 pr-0">
                            <a href="<?php echo base_url('user/' . $results[0]->username); ?>" class="--xhr">
                                <img src="<?php echo get_image('users', $results[0]->photo, 'thumb'); ?>" class="img-fluid rounded" />
                            </a>
                        </div>
                        <div class="col-10 col-md-7">
                            <a href="<?php echo base_url('user/' . $results[0]->username); ?>" class="--xhr">
                                <b class="mb-0">
                                    <?php echo $results[0]->first_name . ' ' . $results[0]->last_name; ?>
</b>
                            </a>
                            <p>
                                <span class="text-sm text-muted" data-toggle="tooltip" title="<?php echo $results[0]->updated_timestamp; ?>">
                                    <?php echo time_ago($results[0]->updated_timestamp); ?>
</span>
                            </p>
                        </div>
                        <div class="col-md-4">
                            <div class="btn-group btn-group-sm d-flex">
                                <a href="//www.facebook.com/sharer/sharer.php?u=<?php echo current_page(); ?>" class="btn btn-primary" data-toggle="tooltip" title="<?php echo phrase('share_to_facebook'); ?>" target="_blank">
                                    <i class="mdi mdi-facebook"></i>
                                </a>
                                <a href="//www.twitter.com/share?url=<?php echo current_page(); ?>" class="btn btn-info" data-toggle="tooltip" title="<?php echo phrase('share_to_twitter'); ?>" target="_blank">
                                    <i class="mdi mdi-twitter"></i>
                                </a>
                                <a href="//wa.me/?text=<?php echo current_page(); ?>" class="btn btn-success" data-toggle="tooltip" title="<?php echo phrase('send_to_whatsapp'); ?>" target="_blank">
                                    <i class="mdi mdi-whatsapp"></i>
                                </a>
                            </div>
                        </div>
                    </div>
                    <?php
                       
if($attributes)
                        {
                            foreach(
$attributes as $key => $val)
                            {
                                if(!isset(
$val->label) && !isset($val->value)) continue;
                               
                                echo
'
                                    <div class="row">
                                        <div class="col-sm-4 col-lg-3">
                                            <label class="d-block text-muted">
                                                '
. $val->label . '
                                            </label>
                                        </div>
                                        <div class="col-sm-8 col-lg-9">
                                            <label>
                                                '
. $val->value . '
                                            </label>
                                        </div>
                                    </div>
                                '
;
                            }
                        }
                   
?>
<div>
                        <?php echo $results[0]->gallery_description; ?>
</div>
                </div>
                <div class="card-footer">
                    <?php echo load_comment_plugin(current_page()); ?>
</div>
            </div>
        </div>
    </div>
</div>


For more information send a message to info at phpclasses dot org.