Href pas d effet

vbmarh Messages postés 60 Date d'inscription dimanche 9 octobre 2005 Statut Membre Dernière intervention 30 novembre 2010 - 16 nov. 2007 à 00:56
vbmarh Messages postés 60 Date d'inscription dimanche 9 octobre 2005 Statut Membre Dernière intervention 30 novembre 2010 - 16 nov. 2007 à 17:57
salut voila ca un jour que je suis sur ca
displayQCalendar('month','".(year)."')"class='headerNav' title='Prev Year'><<
cela ne donne rien sur ie et firefox
voici la fonction

function displayQCalendar(m,y) {
    var ran_no=(Math.round((Math.random()*9999)));
    http.open('get', '<?= $ajaxPath; ?>?m='+m+'&y='+y+'&ran='+ran_no);
       http.onreadystatechange = function() {        if(http.readyState 4 && http.status 200) {
              var response = http.responseText;
              if(response) {
                document.getElementById("quickCalender").innerHTML = http.responseText;
              }
           }
    }
       http.send(null);
}

pas d effet sur le href

7 réponses

cs_bultez Messages postés 13615 Date d'inscription jeudi 13 février 2003 Statut Membre Dernière intervention 15 octobre 2013 30
16 nov. 2007 à 09:27
Bonjour,

    comme on ne voit pas ce qu'il y a dans les variables...
          il faut la page générée, enfin, un extrait !
          le minimum, mais tout ce qu'il faut quand même pour voir.
   
    quelques pistes

[javascript:displayQCalendar(12,2007) lien]
    ( la syntaxe que tu nous montres n'est pas correcte )

    puis après, comme http est indéfini....
   
   difficile d'aller plus loin.

<hr />                Cordialement            Bul         [mon Site]     [M'écrire]
0
vbmarh Messages postés 60 Date d'inscription dimanche 9 octobre 2005 Statut Membre Dernière intervention 30 novembre 2010
16 nov. 2007 à 15:44
merci BULTEZ


<?php 

 * CREATE TABLE `calendar` (
 * `id` INT NOT NULL AUTO_INCREMENT ,
`* day` VARCHAR( 2 ) NOT NULL ,
 * `month` VARCHAR( 2 ) NOT NULL ,
 * `year` VARCHAR( 4 ) NOT NULL ,
 * `link` VARCHAR( 255 ) NOT NULL ,
 * `desc` TEXT NOT NULL ,
 * PRIMARY KEY ( `id` )
 * );
 *
 * 3. Configure the db and path access below. Use any db of your choice. You can also configure
 * the CSS to change the look and feel of the calendar.
 */


// This year
$y = date('Y');
// This month
$m = date('n');
// This Day
$d = date('j');
$today = array('day'=>$d, 'month'=>$m, 'year'=>$y);
// If user specify Day, Month and Year, reset the var
if (isset($_GET['m'])) {
 $y = $_GET['y'];
 $m = $_GET['m'];
}


// CONFIGURE THE DB ACCESS
$dbhost = 'localhost';
$dbuser = 'name';
$dbpass = 'mypass';
$database = "dbasen";
$dbConnect = mysql_connect($dbhost, $dbuser, $dbpass);
if (!$dbConnect) {
   die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db($database, $dbConnect);
if (!$db_selected) {
   die ('db selection error : ' . mysql_error());
}


// name of table
$tableName = 'calendar';


// name of css
$css = 'calendar';
$day=1;
$month=1;
$year=1;
$link=1;
$desc=1;
// Location of the calendar script file from the root
$ajaxPath = '/quick_calendar.php';
if(isset($_SESSION['idste'])){
$idste = $_SESSION['idste'];
//


$sql = "SELECT * FROM $tableName WHERE (idste='$idste') && ((month='$m' AND year='$y') || (month='*' AND year='$y') || (month='$m' AND year='*') || (month='*' AND year='*'))";
} else { $idste = 0 ;
$sql = "SELECT * FROM $tableName WHERE (idste='$idste') && ((month='$m' AND year='$y') || (month='*' AND year='$y') || (month='$m' AND year='*') || (month='*' AND year='*'))";
echo "Utiliser votre calendrier" ;}
$rs = mysql_query($sql);
$links = array();


while ($rw = mysql_fetch_array($rs)) {
 extract($rw);
 $links[] = array('day'=>$day, 'month'=>$month, 'year'=>$year, 'link'=>$link, 'desc'=>$desc);
}


?>


<?php
// if called via ajax, dont display style sheet and javascript again
if (!isset($_GET['ran'])) {


?>
<style type="text/css">
.calendar {
 /** configure the width **/
 width:220px;
 background-color: #D6E8FF;
 border: 1px solid #000000;
 font-family: Arial, Helvetica, sans-serif;
 font-size: 12px;
 margin:0px;
 padding:0px;
 text-align:center;
}
.calendar th {
 background-color: #FFFFCC;
 font-weight: bold;
 height: 20px;
}
.calendar .header {
 background-color: #5670B3;
 font-weight: bold;
 height: 24px;
 color: #FFFFFF;
}
.calendar .footer {
 background-color: #5670B3;
 font-weight: bold;
 font-size:0.8em;
 color: #FFFFFF;
 width:100%;
}
.calendar td {
 width: 22px;
 height: 20px;
 text-align: center;
 font-size:0.9em;
 padding: 2px;
}
.calendar .today {
 width: 18px;
 height: 16px;
 background-color: #FAD2DA;
 padding: 2px;
 border: 1px solid #000000;
}


.calendar .link {
 width: 18px;
 height: 16px;
 background-color: #D4C9EF;
 padding: 2px;
 border: 1px solid #000000;
}


.calendar a, .calendar a:link, .calendar a:hover {
 font-weight: bold;
 text-decoration: underline;
 color: #000000;


}
.calendar a.headerNav, .calendar a:link.headerNav, .calendar a:hover.headerNav {
 background-color: #5670B3;
 color: #ffffff;
}


.calendar a.footerNav, .calendar a:link.footerNav, .calendar a:hover.footerNav {
 width: 100%;
 background-color: #5670B3;
 color: #ffffff;
}
</style>


<script language="javascript">


function createQCObject() {
   var req;
   if(window.XMLHttpRequest){
      // Firefox, Safari, Opera...
      req = new XMLHttpRequest();
   } else if(window.ActiveXObject) {
      // Internet Explorer 5+
      req = new ActiveXObject("Microsoft.XMLHTTP");
   } else {
      alert('Problem creating the XMLHttpRequest object');
   }
   return req;
}


// Make the XMLHttpRequest object
var http = createQCObject();


function displayQCalendar(m,y) {
 var ran_no=(Math.round((Math.random()*9999)));
 http.open('get', '<?php echo $ajaxPath; ?>?m='+m+'&y='+y+'&ran='+ran_no);
    http.onreadystatechange = function() {  if(http.readyState 4 && http.status 200) {
        var response = http.responseText;
        if(response) {
    document.getElementById("quickCalender").innerHTML = http.responseText;
        }
     }
 }
    http.send(null);
}
</script>
<?php
}
?>
<?php
class CreateQCalendarArray {
   
 var $daysInMonth;
 var $weeksInMonth;
 var $firstDay;
 var $week;
 var $month;
 var $year;


 function CreateQCalendarArray($month, $year) {
  $this->month = $month;
  $this->year = $year;
  $this->week = array();
  $this->daysInMonth = date("t",mktime(0,0,0,$month,1,$year));
  // get first day of the month
  $this->firstDay = date("w", mktime(0,0,0,$month,1,$year));
  $tempDays = $this->firstDay + $this->daysInMonth;
  $this->weeksInMonth = ceil($tempDays/7);
  $this->fillArray();
 }
 
 function fillArray() {
  // create a 2-d array
  $counter=1;
  for($j=0;$j<$this->weeksInMonth;$j++) {
   for($i=0;$i<7;$i++) {
    $counter++ ;
    $this->week[$j][$i] = $counter;
    // offset the days
    $this->week[$j][$i] -= $this->firstDay;
    if (($this->week[$j][$i] < 1) || ($this->week[$j][$i] > $this->daysInMonth)) { 
     $this->week[$j][$i] = "";
    }
   }
  }
 }
}


class QCalendar {
 
 var $html;
 var $weeksInMonth;
 var $week;
 var $month;
 var $year;
 var $today;
 var $links;
 var $css;


 function QCalendar($cArray, $today, &$links, $css='') {
  $this->month = $cArray->month;
  $this->year = $cArray->year;
  $this->weeksInMonth = $cArray->weeksInMonth;
  $this->week = $cArray->week;
  $this->today = $today;
  $this->links = $links;
  $this->css = $css;
  $this->createHeader();
  $this->createBody();
  $this->createFooter();
 }
 
 function createHeader() {
    $header = date('M', mktime(0,0,0,$this->month,1,$this->year)).' '.$this->year;
    $nextMonth = $this->month+1;
    $prevMonth = $this->month-1;
    // thanks adam taylor for modifying this part
  switch($this->month) {
   case 1:
       $lYear = $this->year;
       $pYear = $this->year-1;
       $nextMonth=2;
       $prevMonth=12;
       break;
     case 12:
       $lYear = $this->year+1;
       $pYear = $this->year;
       $nextMonth=1;
       $prevMonth=11;
         break;
     default:
         $lYear = $this->year;
       $pYear = $this->year;
         break;
    }//
  // --
  $this->html = "css'>
  ----

  <gras>&nbsp;http://www.evolt.org/quick_calendar_using_ajax_and_php

merci .
0
cs_bultez Messages postés 13615 Date d'inscription jeudi 13 février 2003 Statut Membre Dernière intervention 15 octobre 2013 30
16 nov. 2007 à 16:33
>>je répète, je me cite ?




      il faut la page générée ( pas le php ! ),enfin, un extrait !
          le minimum, mais tout ce qu'il faut quand même pour voir.


      parce que je ne sais pas, mais moi je n'ai pas ta base de données !
      ou alors, c'est une question PHP, et là tu n'es pas dans le bon forum.

       tu as peut-être des erreurs de syntaxe :








¡————————¡——————————————————————————————————————————————————————————¡
|FireFox |regarder la "console d'erreurs" |
| | Outils / Console d'erreurs |
| | |
| | et mieux, télécharger FireBug |
¦————————¦——————————————————————————————————————————————————————————¦
|Internet|activer le deboggage : Outils/options Internet/Avancés |
|Explorer| dans la liste, sous "Navigation" : décocher |
| | ° Afficher une notification de chaque erreur de script |
| | ° Désactiver le débogage de Scripts (Internet Explorer) |
| | |
| | et mieux, télécharger le Debogger IE |
¦————————¦——————————————————————————————————————————————————————————¦
|K—Meleon|regarder la "console d'erreurs" |
| | Outils / Console d'erreurs |
¦————————¦——————————————————————————————————————————————————————————¦
|Opera |regarder la "console d'erreurs" |
| | utils / Asole d'erreurs |
¦————————¦——————————————————————————————————————————————————————————¦
|Safari |regarder Debug / Show JavaScript Console |
| | |
| |modif Fichier "Support:\Documents and Settings\utilisateur|
| |\Application Data\Apple Computer\Safari\Preferences.plist"|
| | y ajouter <key>IncludeDebugMenu</key> |
| | <true/> |
!————————!——————————————————————————————————————————————————————————!






<hr />                Cordialement            Bul         [mon Site]     [M'écrire]
0
vbmarh Messages postés 60 Date d'inscription dimanche 9 octobre 2005 Statut Membre Dernière intervention 30 novembre 2010
16 nov. 2007 à 16:34
Re
apres quelque tentative j ai reussi a faire marché les << < > >> pour naviguer sur le calandrier cela venait du path de la fonction java
 function displayQCalendar(m,y){
 var ran_no= (Math.round((Math.random()*9999)));
 http.open('get', ' <?php echo $ajaxPath; ?m ='+m+'&y='+y+'&ran='+ran_no);
    http.onreadystatechange = function() { ....
et a la place il faut avoir puisque mon fichier php se trouve sur un dossier calendar/
<?php echo '../calender/'. $ajaxPath; ?m = '+m+'&y='+y+'&ran='+ran_no);
ca m as pris du temps pour connaitre un truc tout bete
Mais helas je suis pas au bou de mes peines
aufait lors du lancement de la page pour la premiere fois ou apres un refresh du navivagateur la clause SQL where est prise en compte  => idste ma variable de session s injecte dans mon sql

idste ici represante un index sur ma table qui stock l ide d une personne
if (isset($_SESSION['idste'])){
$idste = $_SESSION['idste'];
$sql = "SELECT * FROM $tableName WHERE (idste='$idste') && ((month='$m' AND year='$y') || (month='*' AND year='$y') || (month='$m' AND year='*') || (month='*' AND year='*'))";
} else{ $idste = 0 ;
$sql = "SELECT * FROM $tableName WHERE (idste='$idste') && ((month='$m' AND year='$y') || (month='*' AND year='$y') || (month='$m' AND year='*') || (month='*' AND year='*'))";
echo "Utiliser votre calendrier" ;}
$rs = mysql_query($sql);$links array();while ($rw mysql
Mais  lorsque je naviguer sur  le navigateur du calendrier << < Nov2007 > >> j ai remarquer que la Clause  WHERE (idste ='$idste') n est plus efficace et que la sortie prend le else plutot que la partie true du
if
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
vbmarh Messages postés 60 Date d'inscription dimanche 9 octobre 2005 Statut Membre Dernière intervention 30 novembre 2010
16 nov. 2007 à 16:48
merci BULTEZ
C t tres rapide merci pour repondre si rapidement et pour les conseil 
tous ce qu il faut pour ce script est la .c est un melange de php et javascript c la raison pour laquel je poste chez vous
 

la base 

 * CREATE TABLE `calendar` (
 * `id` INT NOT NULL AUTO_INCREMENT ,
*  'idste'  VARCHAR( 34 ) NOT NULL ,
`* day` VARCHAR( 2 ) NOT NULL ,
 * `month` VARCHAR( 2 ) NOT NULL ,
 * `year` VARCHAR( 4 ) NOT NULL ,
 * `link` VARCHAR( 255 ) NOT NULL ,
 * `desc` TEXT NOT NULL ,
 * PRIMARY KEY ( `id` )
 * );
le code sur le post en haut est tout ce qu il ya il suffit cette ligne sur les autres page en php
<?php include('../calender/quick_calendar.php'); ?> calender represente ici le dossier du fichier quick_calendar.php
merci une autre fois pour les delais
0
cs_bultez Messages postés 13615 Date d'inscription jeudi 13 février 2003 Statut Membre Dernière intervention 15 octobre 2013 30
16 nov. 2007 à 16:56
quand je parlais de la base je ne parlais pas de sa
description, ( que tu avsis mis ) mais de son contenu.
et surtout : n'envoie pas le contenu, mais la page html générée
( un extrait, juste le nécessaire ), pas le PHP.
<hr />                Cordialement            Bul         [mon Site]     [M'écrire]
0
vbmarh Messages postés 60 Date d'inscription dimanche 9 octobre 2005 Statut Membre Dernière intervention 30 novembre 2010
16 nov. 2007 à 17:57
Re j ai installer fire bug sur l anglet console fire bug Sur l anglais script  j ai cette source html 107112006108 109 &nbsp; 114 DiLuMaMeJeVeSa123456789101112131415161718192021222324 252627 282930Aujourdhui est le 25 Nov 2007115/--------------------------Noter que infobull tirent leur text par Ajax du TABLE field desc suivant WHERE idste = $_SESSION['idste'] du sqlPHpMa table sur PHPMYADMIN--------- id    idste   day  month    year   link         desc 1     61      24     *         2007   link1       Info bull  du 24 si idste=$_SESSION[idste]  2     61      5      11        2006   link2       Olympics, remember to buy ticket   3     0        2      11        2007   link3       ../membre.php      Ici vous notez tous evennement .. 4     61      9      *           *        link4       ../membre.php      Ici vous notez tous evennement----------cela semble bon par rapport au java et je crois que je dois peut trouver un moyen d imposer au java de prendrze en consideration la variable de session php dans les fonction java qui sont reecrite avec php function createQCObject() {  var req;  if(window.XMLHttpRequest){  // Firefox, Safari, Opera...  req = new XMLHttpRequest();  } else if(window.ActiveXObject) {  // Internet Explorer 5+  req = new ActiveXObject("Microsoft.XMLHTTP");  } else {  alert('Problem creating the XMLHttpRequest object');  }  return req; }  // Make the XMLHttpRequest object var http = createQCObject();  function displayQCalendar(m,y) { var ran_no=(Math.round((Math.random()*9999)));  http.open('get', '../calender/quick_calendar.php?m='+m+'&y='+y+'&ran='+ran_no); http.onreadystatechange = function() { if(http.readyState == 4 && http.status == 200) {  var response = http.responseText; if(response) {  document.getElementById("quickCalender").innerHTML = http.responseText;  }  }  }  http.send(null);je ne comprend vraiment cette ligne aussi  if(http.readyState == 4 && http.status == 200) enfin je suis pas tres fort en dev je l avoufaut il passer idste la variable de session ici http.open('get', '../calender/quick_calendar.php?m='+m+'&y='+y+'&ran='+ran_no);j ai tete qui chauffe merci sos  
0
Rejoignez-nous