PHP Classes

File: app/modules/news/load_images_repository.php

Recommend this page to a friend!
  Classes of Laudir Bispo   PHP Real Estate Website   app/modules/news/load_images_repository.php   Download  
File: app/modules/news/load_images_repository.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Real Estate Website
Manage the properties of a real estate business
Author: By
Last change:
Date: 3 years ago
Size: 1,425 bytes
 

Contents

Class file image Download
?<?php

require_once $_SERVER['DOCUMENT_ROOT'].'/config/config.php';

$error_msg = '<div class="alert alert-danger alert-dismissible clearfix"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><p><i class="icon fa fa-ban"></i> Error! Não foi possível carregar as imagens!</p></div>';

$end_msg = '<div class="alert alert-info alert-dismissible clearfix" STYLE="clear:both"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><p><i class="icon fa fa-ban"></i> Fim! Não há mais imagens para carregar!</p></div>';

$page = $_GET['page'];
if(
$_GET['page'] == '0') {$inicio = 0;}
$qntd = 20;
$inicio = $qntd * $page;


require_once
$_SERVER['DOCUMENT_ROOT'].'/controles/class/connect.class.php';
$connection = new DB();
$con = $connection->connect();

$load_images = $con->query("SELECT * FROM `repository` ORDER BY `id` DESC LIMIT $inicio,$qntd") or die($error_msg);

$imgs = '';

while(
$reg = $load_images->fetch_array() )
{
 
$imgs .= '<div CLASS="col-lg-4 col-md-4 col-sm-6 col-xs-6" STYLE="height:90px;margin-bottom:20px;">';
 
$imgs .= ' <img data-src="'.DOMINIO.'/docs/noticias/'.$reg['image_name'].'" SRC="/plugins/EagerImageLoader/ajax_loader.gif" class="img-responsive" STYLE="max-height:100% !important; margin:auto;">';
 
$imgs .= '</div>';
}


$return = ($load_images->num_rows > 0 and $load_images) ? $imgs : $end_msg ;
echo
$return;