Foros del Web » Programando para Internet » PHP »

manejo de chronoline, php y mysql

Estas en el tema de manejo de chronoline, php y mysql en el foro de PHP en Foros del Web. disculpen alguien puede ayudarme esto trbajando con la libreria chronolinepero no hay muchas informacion quiero saber si se puede introducir un bd en ellaeste es ...
  #1 (permalink)  
Antiguo 23/04/2014, 08:15
 
Fecha de Ingreso: abril-2014
Mensajes: 6
Antigüedad: 10 años
Puntos: 0
Información manejo de chronoline, php y mysql

disculpen alguien puede ayudarme esto trbajando con la libreria chronolinepero no hay muchas informacion quiero saber si se puede introducir un bd en ellaeste es el codigo
Código PHP:
<!DOCTYPE html>
<
html>
 <
head>
    <
meta charset='utf-8' />
    <
meta http-equiv="X-UA-Compatible" content="chrome=1" />
    <
meta name="description" content="Chronoline.js : chronoline.js is a library for making a chronology timeline out of events on a horizontal timescale." />
<
link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css">
 <
title>Chronoline.js</title>
  </
head>
 <
body>
 <
div id="target1" class="timeline-tgt">
 </
div>
<
div id="footer_wrap" class="outer">
      <
footer class="inner">
 </
footer>
    </
div>
<
script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <link rel="stylesheet" type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/qtip2/2.0.1/jquery.qtip.min.css" />
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/qtip2/2.0.1/jquery.qtip.min.js"></script>
<script type="text/javascript" src="chronoline/raphael-min.js"></script>
<link rel="stylesheet" type="text/css" href="chronoline/chronoline.css" />
<script type="text/javascript" src="chronoline/chronoline.js"></script>
    
    <script type="text/javascript">
      $(document).ready(function(){

      var events = [
      {dates: [new Date(2014, 3, 8)], title: "2011 Season Opener", section: 0},
      {dates: [new Date(2014, 3, 8)], title: "Spring Training Begins", section: 2},
      {dates: [new Date(2014, 3, 5)], title: "Atlanta Braves @ New York Mets Game 1", section: 1},
      {dates: [new Date(2014, 3, 7)], title: "Atlanta Braves @ New York Mets Game 2", section: 1},
      {dates: [new Date(2014, 3, 8)], title: "Atlanta Braves @ New York Mets Game 3", section: 1},
      {dates: [new Date(2014, 3, 10)], title: "All-Star Game", section: 1},
      {dates: [new Date(2014, 3, 11)], title: "World Series Begins", section: 3}
      ];

      var sections = [
      {dates: [new Date(2014, 0, 1), new Date(2014, 12, 30)], title: "Procesos", section: 0, attrs: {fill: "#d4e3fd"}}
      
      ];

      var timeline1 = new Chronoline(document.getElementById("target1"), events,
        {animated: true,
         tooltips: true,
         defaultStartDate: new Date(2014, 3, 1),
         sections: sections,
         sectionLabelAttrs: {'fill': '#997e3d', 'font-weight': 'bold'},
      });

      $('#to-today').click(function(){timeline1.goToToday();});

      var sections2 = [
      {dates: [new Date(2014, 0, 1), new Date(2014, 11, 31)], title: "Procesos", section: 0, attrs: {fill: "##e3f0fe"}} ];

      var timeline2 = new Chronoline(document.getElementById("target2"), events,
        {visibleSpan: DAY_IN_MILLISECONDS * 91,
      animated: true,
         tooltips: true,
         defaultStartDate: new Date(2014, 4, 1),
         sections: sections2,
         sectionLabelAttrs: {'fill': '#997e3d', 'font-weight': 'bold'},
      labelInterval: isFifthDay,
      hashInterval: isFifthDay,
      scrollLeft: prevMonth,
      scrollRight: nextMonth,
      markToday: 'labelBox',
         draggable: true
      });

      var timeline3 = new Chronoline(document.getElementById("target3"), events,
        {visibleSpan: DAY_IN_MILLISECONDS * 366,
      animated: true,
         tooltips: true,
         defaultStartDate: new Date(2014, 4, 1),
         sections: sections,
         sectionLabelAttrs: {'fill': '#997e3d', 'font-weight': 'bold'},
      labelInterval: isHalfMonth,
      hashInterval: isHalfMonth,
      scrollLeft: prevQuarter,
      scrollRight: nextQuarter,
      floatingSubLabels: false,
      });

      });
    </script>

  </body>
</html> 
me crea lalinea de tiempo pero nose como poner el codigo mysql en el
  #2 (permalink)  
Antiguo 23/04/2014, 09:07
Avatar de hhs
hhs
Colaborador
 
Fecha de Ingreso: junio-2013
Ubicación: México
Mensajes: 2.995
Antigüedad: 10 años, 9 meses
Puntos: 379
Respuesta: manejo de chronoline, php y mysql

tienes que hacer tu consulta, y recorrer el resultado mediante un while y vaciar lo que necesitas en esta parte:

Código Javascript:
Ver original
  1. var events = [
  2.       {dates: [new Date(2014, 3, 8)], title: "2011 Season Opener", section: 0},
  3.       {dates: [new Date(2014, 3, 8)], title: "Spring Training Begins", section: 2},
  4.       {dates: [new Date(2014, 3, 5)], title: "Atlanta Braves @ New York Mets Game 1", section: 1},
  5.       {dates: [new Date(2014, 3, 7)], title: "Atlanta Braves @ New York Mets Game 2", section: 1},
  6.       {dates: [new Date(2014, 3, 8)], title: "Atlanta Braves @ New York Mets Game 3", section: 1},
  7.       {dates: [new Date(2014, 3, 10)], title: "All-Star Game", section: 1},
  8.       {dates: [new Date(2014, 3, 11)], title: "World Series Begins", section: 3}
  9.       ];

Ya tienes la idea general ahora solo tienes que ponerte a trabajar.
__________________
Saludos
About me
Laraveles
A class should have only one reason to change.
  #3 (permalink)  
Antiguo 23/04/2014, 11:28
 
Fecha de Ingreso: febrero-2012
Ubicación: México, DF.
Mensajes: 1
Antigüedad: 12 años, 2 meses
Puntos: 0
Respuesta: manejo de chronoline, php y mysql

Si se puede, recuerda que la extension de tu archivo deberá de ser .php, y de manera común y corriente, puedes agreagar la conexion a la base de datos. te recomiendo que busques un pequeño tutorial de php y mysql
  #4 (permalink)  
Antiguo 30/04/2014, 12:55
 
Fecha de Ingreso: abril-2014
Mensajes: 6
Antigüedad: 10 años
Puntos: 0
Respuesta: manejo de chronoline, php y mysql

ya tengo la consulta pero solo me da el primer dato de la consulta alguien puede ayudar para ver como puedo hacer para que me sirvan tados los datos de fecha que tengo en mi tabla
Código PHP:
Ver original
  1. <?php
  2.   $result = mysql_query("SELECT * FROM bitacora ");
  3. $nConfig = mysql_num_rows ($result);
  4. while($r = mysql_fetch_array($result)) {
  5.        
  6.         $fecha= $r['fecha'];
  7.         $sqldate=date('Y,m,d',strtotime($fecha));
  8.         $id=$r['idUsuario'];   
  9.        
  10.        
  11.   ?>         
  12.     <script type="text/javascript">
  13.       $(document).ready(function(){
  14.  
  15. var ini=new Date(<?php echo $sqldate?>);
  16.  
  17. anio1= ini.getFullYear() + ',' + ini.getMonth() + ',' + ini.getDate();
  18. var events = [
  19.       {dates: [new Date(anio1)], title: "<?php echo $id?>'<br>'<?php echo $sqldate?>", section: 0},
  20.       {dates: [new Date(anio2)], title: "<?php echo $id?>'<br>'<?php echo $sqldate?>", section: 2},
  21.       {dates: [new Date(anio1)], title: "<?php echo $id?><br>fecha inicio'<?php echo $sqldate?>'<br>fecha final'<?php echo $sqldate?>'", section: 0}
  22.      
  23.       ];
  24. </Script><? }?>

Etiquetas: html, manejo, mysql
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 02:29.