Sponsor-Board.de

Normale Version: Sendeplan Zeitabfrage
Du siehst gerade eine vereinfachte Darstellung unserer Inhalte. Normale Ansicht mit richtiger Formatierung.
Hallo ihr lieben ich habe ein Problem mit meinem Sendeplan Script und zwar kann ich zur Zeit nur 2h Sendungen eintragen wird aber etwas Problematisch bei 1h bzw. 3h Sendungen. hier der Quellcode (Aussschnitt) aus der PHP-Datei:

PHP-Code:
...

include (
"plan/config.php");
$zeit date("G");
$datum getdate();

if(
$datum[weekday] == "Monday") { $tag=1; }
if(
$datum[weekday] == "Tuesday") { $tag=2;}
if(
$datum[weekday] == "Wednesday") { $tag=3; }
if(
$datum[weekday] == "Thursday") { $tag=4; }
if(
$datum[weekday] == "Friday") { $tag=5; }
if(
$datum[weekday] == "Saturday") { $tag=6; }
if(
$datum[weekday] == "Sunday") { $tag=7; }

//zeit dummy
if($zeit == 0) { $zeit="00-01"; }
else {
if(
$zeit == 0) { $zeit="00-02"; }
}
if(
$zeit == 1) { $zeit="01-02"; }
else {
if(
$zeit == 1) { $zeit="00-02"; }
}
if(
$zeit == 2) { $zeit="02-03"; }
else {
if(
$zeit == 2) { $zeit="02-04"; }
}
if(
$zeit == 3) { $zeit="03-04"; }
else {
if(
$zeit == 3) { $zeit="02-04"; }
}
if(
$zeit == 4) { $zeit="04-05"; }
else {
if(
$zeit == 4) { $zeit="04-06"; }
}
if(
$zeit == 5) { $zeit="05-06"; }
else {
if(
$zeit == 5) { $zeit="04-06"; }
}
if(
$zeit == 6) { $zeit="06-07"; }
else {
if(
$zeit == 6) { $zeit="06-08"; }
}
if(
$zeit == 7) { $zeit="07-08"; }
else {
if(
$zeit == 7) { $zeit="06-08"; }
}
if(
$zeit == 8) { $zeit="08-09"; } 
else {
if(
$zeit == 8) { $zeit="08-10"; }
}
if(
$zeit == 9) { $zeit="09-10"; }
else {
if(
$zeit == 9) { $zeit="08-10"; }
}
if(
$zeit == 10) { $zeit="10-11"; }
else {
if(
$zeit == 10) { $zeit="10-12"; }

if(
$zeit == 11) { $zeit="11-12"; }
else {
if(
$zeit == 11) { $zeit="10-12"; }
}
if(
$zeit == 12) { $zeit="12-13"; } 
else {
if(
$zeit == 12) { $zeit="12-14"; }
}
if(
$zeit == 13) { $zeit="13-14"; }
else {
if(
$zeit == 13) { $zeit="12-14"; }
}
if(
$zeit == 14) { $zeit="14-15"; }
else {
if(
$zeit == 14) { $zeit="14-16"; }
}
if(
$zeit == 15) { $zeit="15-16"; }
else {
if(
$zeit == 15) { $zeit="14-16"; }
}
if(
$zeit == 16) { $zeit="16-17"; }
else {
if(
$zeit == 16) { $zeit="16-18"; }
}
if(
$zeit == 17) { $zeit="17-18"; }
else {
if(
$zeit == 17) { $zeit="16-18"; }
}
if(
$zeit == 18) { $zeit="18-19"; }
else {
if(
$zeit == 18) { $zeit="18-20"; }
}
if(
$zeit == 19) { $zeit="19-20"; }
else {
if(
$zeit == 19) { $zeit="18-20"; }
}
if(
$zeit == 20) { $zeit="20-21"; }
else {
if(
$zeit == 20) { $zeit="20-22"; }
}
if(
$zeit == 21) { $zeit="21-22"; }
else {
if(
$zeit == 21) { $zeit="20-22"; }
}
if(
$zeit == 22) { $zeit="22-23"; }
else {
if(
$zeit == 22) { $zeit="22-24"; }
}
if(
$zeit == 23) { $zeit="23-24"; }
else {
if(
$zeit == 23) { $zeit="22-24"; }
}


 
$sendplan=$DB->query("SELECT sende_id,  sende_datum, sende_zeitstempel, sende_dj, sende_sendung, sende_djid, sende_zeit FROM ".$db_tab['sendeplan']."
 WHERE sende_tag='"
.$tag."' AND sende_zeit='".$zeit."' LIMIT 1");
  while (
$top=$DB->fetch_array($sendplan)) {
     
$datum=htmlentities($top['sende_datum']);
    
$online=htmlentities($top['sende_zeit']);
     
$sendung=htmlentities($top['sende_sendung']);
     
$dj=htmlentities($top['sende_dj']);
     
$djid=htmlentities($top['sende_djid']);
     
$id=htmlentities($top['sende_id']);
   
$sende_counter_2=$DB->fetch_array($DB->query("SELECT COUNT(*) FROM ".$db_tab['sendeplan']." WHERE sende_tag"));
   
$sende_counter=$sende_counter_2[0];
    }

... 


Hier noch der Ausschnitt aus der PHP-Datei wo man sich in den Sendeplan eintragen kann:

PHP-Code:
...

$site_body .= '
<script language="Javascript" src="admin/lib/mycode.js"></script>
<table class="userbody" width="100%" cellspacing="1" cellpadding="4">
  
    <form name="myform" method="post" action="include.php?path=plan/eintragen.php">
    <input type="hidden" name="mode" value="0" onFocus="mymode()" />
    <input type="hidden" name="mode" value="0" onFocus="mymode()" />
    
    <tr> 
    <td height="12" colspan="8" class="heads"> 
      <p>Sendung Eintragen als DJ: '
.$nick.'</p></td>
  </tr>
  <tr> 
    <td width="24%" class="standard">Wochentag* :<br /> 
      <font class="small">Nicht wählen bei Sonder Sendung. </font></td>
    <td width="76%" align="left" class="standard"><p> 
          <select name="tag" >
    <option value="">Wähle dein Sende Tag</option>      
    <option value="1">Montag</option>
    <option value="2">Dienstag</option>
    <option value="3">Mittwoch</option>
    <option value="4">Donnerstag</option>
    <option value="5">Freitag</option>
    <option value="6">Samstag</option>
    <option value="7">Sonntag</option>
    
  </select> 
      </td>
  </tr>
<tr> 
    <td width="24%" class="standard">Uhrzeit* :<br /> 
      <font class="small">  </font></td>
    <td width="76%" align="left" class="standard"><p> 
        
        <select name="zeit" >
    <option value="">Wähle die Sende Zeit</option>
    <option value="08-10">08-10 Uhr</option>
    <option value="10-12">10-12 Uhr</option>
    <option value="12-14">12-14 Uhr</option>
    <option value="14-16">14-16 Uhr</option>    
    <option value="16-18">16-18 Uhr</option>
    <option value="18-20">18-20 Uhr</option>
    <option value="20-22">20-22 Uhr</option>
    <option value="22-24">22-24 Uhr</option>
    <option value="24-08">24-08 Uhr</option>
  </select>
    
    </td>
  </tr>

  <tr> 
    <td class="standard">Sendungs Name* :<br /> <font class="small"> Max. 60 Zeichen</font></td>
    <td class="standard" align="left"><p> 
        <input type="text" name="sendung" size="60" maxlength="60" value="'
.$sende_sendung.'">
      </p></td>
  </tr>
  <tr> 
    <td height="8" colspan="8" class="standard" align="right"> 
       <font class="small"><p>*Pflichtfelder</p></font></td>
  </tr>

    
    <tr>
      <td width="24%" valign="top" class="left">Sendebeschreibung <br><br><b>(BB-Code erlaubt)</b><br><b>(HTML nein)</b></td>
      <td width="76%" class="right"><table border="0" cellspacing="2" cellpadding="0" width="100%">
        <tr>
          <td width="80%" valign="top"><textarea name="content" cols="15" rows="10" style="width: 100%" wrap="soft" onFocus=myselection(this) onclick=myselection(this) onChange=myselection(this)></textarea></td>
          <td width="20%" valign="top">
            <table class="bbsmilies" border="0" cellspacing="1" cellpadding="0" width="145">
              <tr>
                <td valign="top">'
.$sign_format.'</td>
              </tr>
            </table>
        </tr>
      </table></td>
      </tr>
    <tr>
    <td class="heads" colspan="2" align="center">
    <input type="submit" name="action" value="Eintragen" />
    <input type="hidden" name="save" value="Eintragen" />
    </td>
  </tr></form>
</table>
'
;
 }

.. 


Wenn ich im Sendeplan eine Sendung eintrage und gebe da an z.B. 14-16 Uhr dann speichert er das so in die DB ab. Nur in der OnAir Box auf der Startseite bei mir wird angezeigt das keiner OnAir wäre.

Weiß hier ggf. einer eine Lösung dafür?!

Danke schon mal im Vorraus.

LG

Hm , also ich würd sagen da fehlen ab und zu abfragen. Beispiel wenn es 14 Uhr ist, dann gibt er aus 14-15 und 14-16 aber was ist mit 13-15 ?

PHP-Code:
$zeit date("G"); 


Den hab ich ja hier da fragt er die Serverzeit ab.

Nun ja zu 13 - 15 Uhr hab ich noch nicht eingetragen weil will ja erst mal schauen das es im allgemeinen Funktioniert.


aber wie du im 2. Quellcode siehst vielleicht:

Code:
<select name="zeit" >
    <option value="">Wähle die Sende Zeit</option>
    <option value="08-10">08-10 Uhr</option>
    <option value="10-12">10-12 Uhr</option>
    <option value="12-14">12-14 Uhr</option>
    <option value="14-16">14-16 Uhr</option>    
    <option value="16-18">16-18 Uhr</option>
    <option value="18-20">18-20 Uhr</option>
    <option value="20-22">20-22 Uhr</option>
    <option value="22-24">22-24 Uhr</option>
    <option value="24-08">24-08 Uhr</option>
</select>


Das ich das aus Testgründen noch nicht verbaut habe. Weil was du hier siehst wird in die DB geschrieben.


EDIT: Bin auch gerne mit einer Alternativlösung zufrieden sonst wird der Quellcode zu lange wenn ich jetzt für Jede Uhrzeit nen Check machen muss.

PHP-Code:
if($zeit == 0)
{
    
$zeit="00-01";
}
else
{
    if(
$zeit == 0) { $zeit="00-02"; }


Wenn $zeit == 0, dann soll $zeit="00-01";
Wenn $zeit != 0 ist, dann soll nochmal geprüft werden ob $zeit == 0 ist?

Irgendwas ist doch hier ganz falsch Biggrin

öhm also wenn ich die "else" weg lasse dann läuft alles wie es sein soll aber halt eben immer nur im 2h std. takt
Referenz-URLs