Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • humbertocamacho Friend
    #199335

    goog day

    its posible make the effect of the scroll when update the page using ajax to get script php and the info of DB and put in the page..?

    when i try to make this, the objets overlap whit the first one i make and break the style.

    tkans

    Nazario A Friend
    #540932

    @humbertocamacho,

    It would be best if you post the screenshot highlighting your problem here and PM me the URL, admin, FTP credentials of your site so that I can check it for you.

    humbertocamacho Friend
    #540975

    the site is in localhost

    humbertocamacho Friend
    #540982

    @nazario A

    this is when the page start

    and this when the ajax update make the magic

    and the code to make the update…
    [PHP]<?php

    $centro_id = $_GET[“centro_id”];

    $con=mysqli_connect(“10.101.3.2″,”ios”,”soi”,”iosweb”);

    // Check connection
    if (mysqli_connect_errno()) {
    echo “Failed to connect to MySQL: ” . mysqli_connect_error();
    }

    $sql= ”
    SELECT
    `Evento`.`empresa`,
    `Evento`.`nombre` AS `Evento_nombre`,
    `Evento`.`fecha_inicial`,
    `Evento`.`fecha_final`,
    `Evento`.`descripcion`,
    `Evento`.`personas`,
    `Sala`.`centro_id`
    FROM `eventos` AS `Evento`
    LEFT JOIN `calendarios` AS `Calendario` ON `Evento`.`calendario_id` = `Calendario`.`id`
    LEFT JOIN `salas` AS `Sala` ON `Evento`.`sala_id` = `Sala`.`id`
    LEFT JOIN `empresas` AS `Empresa` ON `Evento`.`empresa_id` = `Empresa`.`id`
    WHERE `Sala`.`centro_id` = “.(int)$centro_id.”
    and `Evento`.`Empresa_id`>0
    and to_days( `Evento`.`Fecha_inicial`)=to_days(now())
    and `Evento`.`fecha_final`>now()
    ORDER BY `Evento`.`fecha_inicial` ASC”;

    $result = mysqli_query($con,$sql);

    $count_events;
    while($row = mysqli_fetch_array($result)) {
    $datetime = new DateTime($row[‘fecha_inicial’]);
    $date = $datetime->format(‘d-F-y’);
    $time = $datetime->format(‘H:i:s’);

    $datetime2 = new DateTime($row[‘fecha_final’]);
    $time2 = $datetime2->format(‘H:i:s’);
    echo ‘
    <div class=”item masonry-brick”>
    <div class=”inner item-inner clearfix”>
    <div class=”item-image”>
    <div class=”img-intro-left”>
    <a class=”item-link” href=”#”>
    <img alt=”#” src=”http://ja-wall.demo.joomlart.com/images/stories/demo/travel/traveltips-5.jpg” class=”caption” style=”display: inline;”>
    <span> </span>
    <span class=”item-pin”> </span>
    </a>
    </div>
    </div>
    <div class=”item-main clearfix”>
    <div class=”header item-header clearfix”>
    <h2>
    <a class=”item-link” >
    ‘.utf8_decode($row[’empresa’]).'</a>
    </h2>
    </div>
    <!– <div class=”content item-content”>
    ‘.utf8_decode($row[‘nombre’]).’
    </div> –>
    <div class=”footer item-footer clearfix”>
    <dl class=”article-hit”>
    <dd class=”hits”>
    <strong>Fecha: ‘.$date.'</strong> <br />
    <strong>Hora: ‘.$time.’ A ‘.$time2.'</strong>
    </dd>
    </dl>
    </div>
    </div>
    <div class=”item-separator”> </div>
    </div>
    </div>
    ‘;
    $count_events++;
    }
    mysqli_close($con);
    ?>
    [/PHP]

    <?php

    $centro_id = $_GET[“centro_id”];

    $con=mysqli_connect(“10.101.3.2″,”ios”,”soi”,”iosweb”);

    // Check connection
    if (mysqli_connect_errno()) {
    echo “Failed to connect to MySQL: ” . mysqli_connect_error();
    }

    $sql= ”
    SELECT
    `Evento`.`empresa`,
    `Evento`.`nombre` AS `Evento_nombre`,
    `Evento`.`fecha_inicial`,
    `Evento`.`fecha_final`,
    `Evento`.`descripcion`,
    `Evento`.`personas`,
    `Sala`.`centro_id`
    FROM `eventos` AS `Evento`
    LEFT JOIN `calendarios` AS `Calendario` ON `Evento`.`calendario_id` = `Calendario`.`id`
    LEFT JOIN `salas` AS `Sala` ON `Evento`.`sala_id` = `Sala`.`id`
    LEFT JOIN `empresas` AS `Empresa` ON `Evento`.`empresa_id` = `Empresa`.`id`
    WHERE `Sala`.`centro_id` = “.(int)$centro_id.”
    and `Evento`.`Empresa_id`>0
    and to_days( `Evento`.`Fecha_inicial`)=to_days(now())
    and `Evento`.`fecha_final`>now()
    ORDER BY `Evento`.`fecha_inicial` ASC”;

    $result = mysqli_query($con,$sql);

    $count_events;
    while($row = mysqli_fetch_array($result)) {
    $datetime = new DateTime($row[‘fecha_inicial’]);
    $date = $datetime->format(‘d-F-y’);
    $time = $datetime->format(‘H:i:s’);

    $datetime2 = new DateTime($row[‘fecha_final’]);
    $time2 = $datetime2->format(‘H:i:s’);
    echo ‘
    <div class=”item masonry-brick”>
    <div class=”inner item-inner clearfix”>
    <div class=”item-image”>
    <div class=”img-intro-left”>
    <a class=”item-link” href=”#”>
    <img alt=”#” src=”http://ja-wall.demo.joomlart.com/images/stories/demo/travel/traveltips-5.jpg” class=”caption” style=”display: inline;”>
    <span> </span>
    <span class=”item-pin”> </span>
    </a>
    </div>
    </div>
    <div class=”item-main clearfix”>
    <div class=”header item-header clearfix”>
    <h2>
    <a class=”item-link” >
    ‘.utf8_decode($row[’empresa’]).'</a>
    </h2>
    </div>
    <!– <div class=”content item-content”>
    ‘.utf8_decode($row[‘nombre’]).’
    </div> –>
    <div class=”footer item-footer clearfix”>
    <dl class=”article-hit”>
    <dd class=”hits”>
    <strong>Fecha: ‘.$date.'</strong> <br />
    <strong>Hora: ‘.$time.’ A ‘.$time2.'</strong>
    </dd>
    </dl>
    </div>
    </div>
    <div class=”item-separator”> </div>
    </div>
    </div>
    ‘;
    $count_events++;
    }
    mysqli_close($con);
    ?>


    1. Screen-shot-2014-07-02-at-10.17.13
    2. Screen-shot-2014-07-02-at-10.17.22
    humbertocamacho Friend
    #540984

    <script type=”text/javascript” src=”js/mootools.js”></script>

    <script type=”text/javascript”>
    function getURLvar(var_name){

    var re = new RegExp(var_name + “(?:=([^&]*))?”, “i”);
    var pm = re.exec(decodeURIComponent(location.search));
    if(pm === null) return undefined;
    return pm[1] || “”;
    }
    centro_id = getURLvar(‘centro_id’);
    /*setTimeout(“alert(‘Hello word!’);”,5000);*/
    url=”http://localhost:8888/trabajo/Model/EventosModel.php?centro_id=”+centro_id;
    setInterval(“clickLinkAjax(‘.item3’,url,”)”, 10000);/*1000 = 1 segudno*/

    function clickLinkAjax(claselink,url,datos){
    jQuery(document).ready(function($) {
    $.ajax({
    url:url,
    dataType: ‘html’,
    //contentType: “application/json; charset=utf-8”,
    success:function(result){
    $(“#evento”).html(result);
    },
    complete: function() {
    }
    });
    });
    }
    </script>

    Ninja Lead Moderator
    #541141

    It’s pretty hard to debug and suggest the solution for you without clue now. It would be best if you can put your site online and PM me your site credentials. I will help you investigate further.

    humbertocamacho Friend
    #541187

    <em>@Ninja Lead 435161 wrote:</em><blockquote>It’s pretty hard to debug and suggest the solution for you without clue now. It would be best if you can put your site online and PM me your site credentials. I will help you investigate further.</blockquote>

    in this moment its not posible put the site in line and when a try to use in joomla i dont like joomla so o take all the template
    putting all the files in new project so now I haw a project without joomla and its works…

    the problem is when the ajax update make the magic putting new items in the main page is overlap this happen
    because the new items are outside of the original space of the main page and i try to use the scroll event but i cont found this in the wall.js

    all my project its the template whit the code i put here without the footer and the scripts of facebook

    thanks for all the help

    Ninja Lead Moderator
    #541338

    Thanks for your feedback.

    By the way, may I know if you have a paid membership on JoomlArt. I see you are with Expired subscription now. Please signup and be our club member to avail support.

Viewing 8 posts - 1 through 8 (of 8 total)

This topic contains 8 replies, has 3 voices, and was last updated by  Ninja Lead 10 years, 4 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum