Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]Fullcalendar
krzesik
post
Post #1





Grupa: Zarejestrowani
Postów: 516
Pomógł: 1
Dołączył: 25.08.2012

Ostrzeżenie: (0%)
-----


Witam,

korzystam z rozwiązania fullcalendar, chciałbym wprowadzić modyfikacje w zapytaniu o dodatkowe filtry, ale nie wiem jak to przesłać jedeno do drugiego.
Mam teraz poniższy kod:


fragment pliku wyświetlającego kalendarz

...........
  1.  
  2. <script>
  3. $(document).ready(function() {
  4.  
  5. $('#bootstrapModalFullCalendar').fullCalendar({
  6. header: {
  7. left: 'today myCustomButton',
  8. center: 'prev title next',
  9. right:"month, agendaWeek, agendaDay"
  10.  
  11. },
  12. eventClick: function(event, jsEvent, view) {
  13. $('#modalTitle').html(event.description);
  14. $('#modalBody').html(event.title);
  15. $("#startTime").html((event.start).format('DD-MM-YYYY'));
  16. $("#endTime").html(moment(event.end).format('DD-MM-YYYY'));
  17. $('#eventUrl').attr('href',event.url);
  18. $('#fullCalModal').modal();
  19. return false;
  20. },
  21.  
  22. events: 'events.php'
  23. });
  24. });
  25. </script>
  26.  
  27.  




...........




plik events.php
  1. <?php
  2.  
  3. $json = array();
  4.  
  5.  
  6.  
  7. $requete = "SELECT * FROM evenement where end >= NOW() ORDER BY id";
  8. //chciałbym dodatkowo przesłać $requete = "SELECT * FROM evenement where id = '$id' and end >= NOW() ORDER BY id";
  9.  
  10.  
  11. try {
  12. $bdd = new PDO('mysql:host=*****l;dbname=*****charset=utf8', '****', '*****');
  13. $bdd->exec("set names utf8");
  14. } catch(Exception $e) {
  15. exit('Błąd połączenie z Bazą Danych.');
  16. }
  17. $resultat = $bdd->query($requete) or die(print_r($bdd->errorInfo()));
  18.  
  19. echo json_encode($resultat->fetchAll(PDO::FETCH_ASSOC));
  20.  
  21. ?>
  22.  
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 23:04