Discussion sur le bug du plug-in de conversion du calendrier Lunisolar
邓
2018-05-10 10:33:03
0
1
1195

J'ai testé ce plug-in et j'ai trouvé les problèmes suivants :

①Lorsque l'année et le mois sautent, le code a <a href='sy1.php?y={$nexty}'>>>< /a>, mais aucun fichier sy1.php n'existe, il peut être remplacé par le fichier actuel calendrier.php.

②Après le saut, par exemple, nous sommes en mai 2018. Si je passe à juin 2018 et sélectionne l'un des jours, le tableau de l'année et du mois reviendra à la valeur initiale de mai 2018. Merci de me donner la réponse.

邓

répondre à tous(1)
邓

//Résoudre le problème ②

Le code modifié est le suivant :

<!DOCTYPE html>

<html>

<style>

table{background:#99ffcc;}

th{ font-family :script officiel;color:#0099ff;}

#tr1{background:#00ccff;}

.td1{color:#009999;}

a{color:#ff9900;}

</ style>

<head>

<meta charset="UTF-8">

<script src="jquery-2.2.3.js" type="text/javascript"></ script>

</head>

<body>

<?php

require "./Convert.class.php";

$convert=isset($_GET["convert"]) ? $_GET["convert"]:date("Y-m-d");

//php calendrier

//1.date() la fonction obtient l'année, le mois et le jour en cours

$year=isset($_GET[" y"])?$ _GET["y"]:date("Y");

$mon=isset($_GET["m"])?$_GET["m"]:date("m") ;

$day= isset($_GET["d"])?$_GET["d"]:date("d");

$convert=$year.'-'.$mon.'-' .$day;// Assembler le format de date

if($convert!=''){

$c=new Convert($convert);

$time=$c->getLyTime();//Get l'heure lunaire

// echo $convert.'Heure lunaire correspondante :'.$time;

}

//2. Utilisation de la fonction mktime() pour obtenir le nombre de jours du mois en cours et du jour. de la semaine le 1er du mois

$daynum=date(" t",mktime(0,0,0,$mon,1,$year));//Le nombre de jours du mois en cours 31

$w=date("w",mktime(0,0,0,$mon, 1,$year));//Le jour de la semaine le 1er du mois 4

//3. informations d'en-tête du calendrier

echo"<div>";

echo"<table border='0' >";

echo"<h3><div>{$année}année{$ mon}mois{$jour}</div></h3>";

echo "<tr id='tr1'onmouseOver='overTr(this)'onmouseOut='outTr(this)'>";

echo "<th style=' color:#ff0000;'onmouseOver='overTr(this)'onmouseOut='outTr(this)'>日</th>";

echo "<th>一</th>";

echo "<th>deux</th>";

echo "<th>trois</th>";

echo "<th>quatre</th>";

echo " <th&gt ;五</th>";

echo "<th style='color:#ff0000;'>Six</th>";

echo "</tr>";

//4 . Parcourez le calendrier de sortie

$dayindex=1;

while($dayindex<=$daynum){

echo"<tr onmouseOver='overTr(this)'onmouseOut='outTr(this)' >" ;

for($i=1;$i<=7;$i++){//Boucle pour afficher des informations sur 7 jours

if($dayindex<=$daynum&&($w<$i||$dayindex ! =1)){

//'2014-10-1'(passer dans une telle chaîne)$année-$mois-$d

if($dayindex==$day){

echo "&lt ;th style='background:#ff0000;'><a href='?y={$year}&m={$mon}&d={$dayindex}'>{$dayindex}</a> /th>";

}else{

                  echo "<th onmouseOver='overTh(this)' onmouseOut='outTh(this)'><a href='?y={$year} &m= {$mon}&d={$dayindex}'>{$dayindex}</a></th>";

                                                                                                                                                        th>                                                                                                                                                                                                                                         =$mon;

si( $prem<=1){

$prem=12;

$prey--;

}else{

$prem--;

}

if($nextm&gt ;=12){

$ nextm=1;

$nexty++;

}else{

$nextm++;

}

$prey=$year-1;//Année précédente

$nexty= $year+1;//Année suivante

//Hyperlien

echo "<tr onmouseOver='overTr(this)'onmouseOut='outTr(this)'><td colspan='7'align ='center'>";

echo "<a href='calendar.php?y={$prey}&m={$mon}&d={$day}'><<</ a> ";

echo "<font face='official script'color='#663399'>{$year}年</font> ";

echo "<a href='calendar.php? y={$nexty}&m={$ mon}&d={$jour}'>>></a>

echo" ";

echo"<a href='calendar.php?y={$year}&m={$prem}&d={$day}'><</a> ";

echo "<font face='隶书'color='#663399'>{$mon}月</font> ";

echo "<a href='calendar.php?y={$year }&m={$nextm}&d={$day}'>></a>";

echo "</td></tr>";

echo "<tr onmouseOver= 'overTr(this)'onmouseOut='outTr(this)'><td colspan='7'>";

echo "<div>$convert 对应的农历时间:$time</div>" ;

echo "</td></tr>";

echo "</table>";

echo "</div>";

?>

<script>

var oriCol=null;

function  overTr(obj){

oriCol=obj.bgColor;

obj.bgColor='#0f0';

}

function outTr(obj){

obj.bgColor =oriCol;

}

fonction overTh(obj) {

    oriCol=obj.bgColor;

    obj.bgColor='red';

}

fonction outTh(obj){

    obj.bgColor=oriCol ;

}

</script>

</body>

</html>


Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!