/**
 * author:coster
 * date:26.10.05
 * funktion gibt den status dieses zimmers an
 * diesem tag als string für die css-class zurück
 *  
 */
function getStatusString($mietobjekt_id, $minute = 0, $stunde = 0, $tag, $monat, $jahr)
{
    global $link;
    global $root;
    include_once $root . "/include/datumFunctions.inc.php";
    $datum = constructMySqlTimestamp($minute, $stunde, $tag, $monat, $jahr);
    //daten aus datenbank abrufen...
    $query = "select \n\t\t\t\tSTATUS\n\t\t\t\tfrom \n\t\t\t\tREZ_GEN_RESERVIERUNG\n\t\t\t\twhere \t\t\n\t\t\t\tMIETOBJEKT_ID = '{$mietobjekt_id}' and\n\t\t\t\t('{$datum}' >= VON and '{$datum}' <= BIS)\t\t\t\t\n\t\t\t\t";
    $res = mysqli_query($link, $query);
    if (!$res) {
        echo "Anfrage {$query} scheitert.";
        echo mysqli_error($link);
        return false;
    }
    $d = mysqli_fetch_array($res);
    $stat = $d["STATUS"];
    //wenn kein eintrag vorhanden ist,
    //frei zurückgeben:
    if (mysqli_num_fields($res) < 1 || $stat == "") {
        return parseStatus(STATUS_FREI);
    }
    return parseStatus($stat);
}
Esempio n. 2
0
{
    $out = "";
    switch ($code) {
        case 0:
            $out = "In transit";
            break;
        case 1:
            $out = "Lost";
            break;
        case 2:
            $out = "Picked up";
            break;
        case 3:
            $out = "Checked in";
            break;
    }
    return $out;
}
if ($db_conn) {
    $q = "select h.bid, h.status, h.weight_kg, h.last_update, l.code \n\t\t\t\tfrom has_B h, last_location l\n\t\t\t\t where cid = '" . $_COOKIE['cid'] . "' and h.bid = l.bid";
    $options = executePlainSQL($q);
    $bids = array();
    echo "<table class='pure-table pure-table-bordered'>\n\t\t\t<tr>\n\t\t\t\t<thead>\n\t\t\t\t<td>bid</td>\n\t\t\t\t<td>status</td>\n\t\t\t\t<td>weight_kg</td>\n\t\t\t\t<td>last_update</td>\n\t\t\t\t<td>last ap</td>\n\t\t\t\t</thead>\n\t\t\t</tr>";
    while ($row = oci_fetch_array($options, OCI_BOTH)) {
        echo "<tr>" . "<td>" . $row[0] . "</td>" . "<td>" . parseStatus($row[1]) . "</td>" . "<td>" . $row[2] . "</td>" . "<td>" . $row[3] . "</td>" . "<td>" . $row[4] . "</td>" . "</tr>";
    }
    echo "</table>";
}
?>
</div>
</body>
Esempio n. 3
0
function GetFPPStatus()
{
    $status = SendCommand('s');
    if ($status == false || $status == 'false') {
        $status = exec("if ps cax | grep -q git_pull; then echo \"updating\"; else echo \"false\"; fi");
        returnJSON(['fppd' => 'Not Running', 'status' => -1, 'status_name' => $status == 'updating' ? $status : 'stopped']);
    }
    $data = parseStatus($status);
    returnJson($data);
}
/**
 * @author coster
 * @date 30.9.06
 * Hilfsfunktionen für die Gesamtübersicht
*/
function printResAdmin($zimmer_id, $i, $month, $year, $saAktiviert, $link)
{
    global $unterkunft_id;
    if (getDayName($i, $month, $year) == "SA" && $saAktiviert) {
        $isSamstag = true;
    } else {
        $isSamstag = false;
    }
    $status = getStatus($zimmer_id, $i, $month, $year, $link);
    if (sizeof($status) < 1 && hasChildRooms($zimmer_id) && getPropertyValue(RES_HOUSE, $unterkunft_id, $link) == "true") {
        //if room is a parent, check if the child has another status:
        $childs = getChildRooms($zimmer_id);
        while ($c = mysqli_fetch_array($childs)) {
            $child_zi_id = $c['PK_ID'];
            $status = getStatus($child_zi_id, $i, $month, $year, $link);
            if (sizeof($status) > 0) {
                break;
            }
        }
    }
    /////////////////////////////////////////////////////////
    //urlauberwechsel genau an diesem tag:
    /////////////////////////////////////////////////////////
    if (isset($status) && sizeof($status) > 1) {
        //an diesem tag ist ein urlauberwechsel:
        ?>
			<table border="0" cellspacing="0" cellpadding="0" width="100%">
				<tr>
					<td class="<?php 
        echo parseStatus($status[0], $isSamstag);
        ?>
" align="right" width="50%"></td>
					<td class="<?php 
        echo parseStatus($status[1], $isSamstag);
        ?>
" align="right" width="50%">&nbsp;</td>
				</tr>
			</table>
		<?php 
    } else {
        if (isset($status) && sizeof($status) == 1) {
            //schauen ob der letzte tag halb-frei ist:
            $nTag = $i + 1;
            $nMonat = $month;
            $nJahr = $year;
            $anzahlTage = getNumberOfDays($month, $year);
            if ($nTag > $anzahlTage) {
                $nTag = 1;
                $nMonat = $month + 1;
            }
            //ende if tag zu gross
            if ($nMonat > 12) {
                $nMonat = 1;
                $nJahr = $year + 1;
            }
            //ende if monat zu gross
            $nStatus = getStatus($zimmer_id, $nTag, $nMonat, $nJahr, $link);
            if (sizeof($nStatus) < 1 && hasChildRooms($zimmer_id) && getPropertyValue(RES_HOUSE, $unterkunft_id, $link) == "true") {
                //if room is a parent, check if the child has another status:
                $childs = getChildRooms($zimmer_id);
                while ($c = mysqli_fetch_array($childs)) {
                    $child_zi_id = $c['PK_ID'];
                    $nStatus = getStatus($child_zi_id, $nTag, $nMonat, $nJahr, $link);
                    if (sizeof($nStatus) > 0) {
                        break;
                    }
                }
            }
            //if (!(isset($nStatus)) && isset($status)){
            if (sizeof($nStatus) == 0) {
                //am nächsten tag ist es frei:
                ?>
				<table border="0" cellspacing="0" cellpadding="0" width="100%">
					<tr>
						<td class="<?php 
                echo parseStatus($status[0], $isSamstag);
                ?>
" align="right" width="50%">&nbsp;</td>
						<td class="<?php 
                echo parseStatus(0, $isSamstag);
                ?>
" align="right" width="50%"></td>
					</tr>
				</table>
			<?php 
            } else {
                //schauen ob der tag vorher frei ist:
                $vTag = $i - 1;
                $vMonat = $month;
                $vJahr = $year;
                if ($vTag < 1) {
                    $vMonat = $month - 1;
                    if ($vMonat < 1) {
                        $vMonat = 12;
                        $vJahr = $year - 1;
                    }
                    //ende if monat zu klein
                    $vTag = getNumberOfDays($vMonat, $vJahr);
                }
                //ende if tag zu klein
                $vStatus = getStatus($zimmer_id, $vTag, $vMonat, $vJahr, $link);
                if (sizeof($vStatus) < 1 && hasChildRooms($zimmer_id) && getPropertyValue(RES_HOUSE, $unterkunft_id, $link) == "true") {
                    //if room is a parent, check if the child has another status:
                    $childs = getChildRooms($zimmer_id);
                    while ($c = mysqli_fetch_array($childs)) {
                        $child_zi_id = $c['PK_ID'];
                        $vStatus = getStatus($child_zi_id, $vTag, $vMonat, $vJahr, $link);
                        if (sizeof($vStatus) > 0) {
                            break;
                        }
                    }
                }
                if (sizeof($vStatus) == 0) {
                    //am vorherigen tag ist es frei:
                    ?>
					<table border="0" cellspacing="0" cellpadding="0" width="100%">
						<tr>
							<td class="<?php 
                    echo parseStatus(0, $isSamstag);
                    ?>
" align="right" width="50%"></td>
							<td class="<?php 
                    echo parseStatus($status[0], $isSamstag);
                    ?>
" align="right" width="50%">&nbsp;</td>
						</tr>
					</table>
				<?php 
                } else {
                    ?>
&nbsp;<?php 
                }
            }
            //ende else schauen ob tag vorher frei
        } else {
            //tag ausgeben:
            ?>
&nbsp;<?php 
        }
    }
    //ende else tag ausgeben
}
		    <td><?php 
    echo getUebersetzung("Die Reservierungsanfrage und der Gast wurde aus der Datenbank entfernt");
    ?>
.</td>
		  </tr>
		</table>
		<br/>
		<?php 
} else {
    if ($mieterEntfernen == "true" && hasMieterReservations($mieter_id)) {
        $mieterEntfernen = "false";
        ?>
		<table  border="0" cellpadding="0" cellspacing="3">
		  <tr>
		    <td><span class="<?php 
        echo parseStatus($status);
        ?>
"><?php 
        echo getUebersetzung("Die Reservierungsanfrage wurde gelöscht, der Gast kann nicht entfernt werden, es sind weitere Reservierungen für diesen Gast eingetragen");
        ?>
!</span></td>
		  </tr>
		</table>
    <?php 
    }
}
?>

<table  border="0" cellpadding="0" cellspacing="3" class="<?php 
echo TABLE_STANDARD;
?>
/**
 * author:coster
 * date:26.10.05
 * funktion gibt den status dieses zimmers an
 * diesem tag als string f�r die css-class zur�ck
 *  
 */
function getStatusString($mietobjekt_id, $minute = 0, $stunde = 0, $tag, $monat, $jahr)
{
    global $db;
    global $root;
    include_once $root . "/include/datumFunctions.inc.php";
    $datum = constructMySqlTimestamp($minute, $stunde, $tag, $monat, $jahr);
    //daten aus datenbank abrufen...
    $query = "select \n\t\t\t\tSTATUS\n\t\t\t\tfrom \n\t\t\t\tBOOKLINE_RESERVIERUNG\n\t\t\t\twhere \t\t\n\t\t\t\tTISCH_ID = '{$mietobjekt_id}' and\n\t\t\t\t('{$datum}' >= VON and '{$datum}' <= BIS)\t\t\t\t\n\t\t\t\t";
    $res = $db->Execute($query);
    if (!$res) {
        print $db->ErrorMsg();
        return false;
    }
    $d = $res->FetchNextObject();
    $stat = $d->STATUS;
    //wenn kein eintrag vorhanden ist,
    //frei zur�ckgeben:
    if (mysqli_num_fields($res) < 1 || $stat == "") {
        return parseStatus(STATUS_FREI);
    }
    return parseStatus($stat);
}
function printResAdminAJAX($zimmer_id, $i, $month, $year, $saAktiviert, $link, $unterkunft_id)
{
    //global $unterkunft_id;
    $response = "";
    $status = getStatus($zimmer_id, $i, $month, $year, $link);
    if (sizeof($status) < 1 && hasChildRooms($zimmer_id) && getPropertyValue(RES_HOUSE, $unterkunft_id, $link) == "true") {
        //if room is a parent, check if the child has another status:
        $childs = getChildRooms($zimmer_id);
        while ($c = mysqli_fetch_array($childs)) {
            $child_zi_id = $c['PK_ID'];
            $status = getStatus($child_zi_id, $i, $month, $year, $link);
            if (sizeof($status) > 0) {
                break;
            }
        }
    }
    if (getDayName($i, $month, $year) == "SA" && $saAktiviert) {
        $isSamstag = true;
    } else {
        $isSamstag = false;
    }
    if (isset($status) && sizeof($status) > 1) {
        //an diesem tag ist ein urlauberwechsel:
        $response .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
        $response .= "<tr>";
        $response .= "<td class=\"" . parseStatus($status[0], $isSamstag) . "\" align=\"right\" width=\"50%\">";
        $response .= $i;
        $response .= "</td>";
        $response .= "<td class=\"" . parseStatus($status[1], $isSamstag) . "\" align=\"right\" width=\"50%\">&nbsp;";
        $response .= "</td>";
        $response .= "</tr>";
        $response .= "</table>";
    } else {
        if (isset($status) && sizeof($status) == 1) {
            //schauen ob der letzte tag halb-frei ist:
            $nTag = $i + 1;
            $nMonat = $month;
            $nJahr = $year;
            $anzahlTage = getNumberOfDays($month, $year);
            if ($nTag > $anzahlTage) {
                $nTag = 1;
                $nMonat = $month + 1;
            }
            //ende if tag zu gross
            if ($nMonat > 12) {
                $nMonat = 1;
                $nJahr = $year + 1;
            }
            //ende if monat zu gross
            $nStatus = getStatus($zimmer_id, $nTag, $nMonat, $nJahr, $link);
            //echo("nächster Tag: ");var_dump($nStatus);
            if (sizeof($nStatus) < 1 && getPropertyValue(RES_HOUSE, $unterkunft_id, $link) == "true" && hasChildRooms($zimmer_id)) {
                //if room is a parent, check if the child has another status:
                $childs = getChildRooms($zimmer_id);
                while ($c = mysqli_fetch_array($childs)) {
                    $child_zi_id = $c['PK_ID'];
                    $nStatus = getStatus($child_zi_id, $nTag, $nMonat, $nJahr, $link);
                    if (sizeof($nStatus) > 0) {
                        break;
                    }
                }
            }
            if (sizeof($nStatus) == 0) {
                $response .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                $response .= "<tr>";
                $response .= "<td class=\"" . parseStatus($status[0], $isSamstag) . "\" align=\"right\" width=\"50%\">";
                $response .= "</td>";
                $response .= "<td class=\"frei\" align=\"right\" width=\"50%\">&nbsp;";
                $response .= $i;
                $response .= "</td>";
                $response .= "</tr>";
                $response .= "</table>";
            } else {
                //schauen ob der tag vorher frei ist:
                $vTag = $i - 1;
                $vMonat = $month;
                $vJahr = $year;
                if ($vTag < 1) {
                    $vMonat = $month - 1;
                    if ($vMonat < 1) {
                        $vMonat = 12;
                        $vJahr = $year - 1;
                    }
                    //ende if monat zu klein
                    $vTag = getNumberOfDays($vMonat, $vJahr);
                }
                //ende if tag zu klein
                $vStatus = getStatus($zimmer_id, $vTag, $vMonat, $vJahr, $link);
                if (sizeof($vStatus) < 1 && hasChildRooms($zimmer_id) && getPropertyValue(RES_HOUSE, $unterkunft_id, $link) == "true") {
                    //if room is a parent, check if the child has another status:
                    $childs = getChildRooms($zimmer_id);
                    while ($c = mysqli_fetch_array($childs)) {
                        $child_zi_id = $c['PK_ID'];
                        $vStatus = getStatus($child_zi_id, $vTag, $vMonat, $vJahr, $link);
                        if (sizeof($vStatus) > 0) {
                            break;
                        }
                    }
                }
                if (sizeof($vStatus) == 0) {
                    //am vorherigen tag ist es frei:
                    $response .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">";
                    $response .= "<tr>";
                    $response .= "<td class=\"frei\" align=\"right\" width=\"50%\">";
                    $response .= $i;
                    $response .= "</td>";
                    $response .= "<td class=\"" . parseStatus($status[0], $isSamstag) . "\" align=\"right\" width=\"50%\">&nbsp;";
                    $response .= "</td>";
                    $response .= "</tr>";
                    $response .= "</table>";
                } else {
                    $response .= $i;
                }
            }
            //ende else schauen ob tag vorher frei
        } else {
            //tag ausgeben:
            $response .= $i;
        }
    }
    //ende else tag ausgeben
    return $response;
}
echo $bisMinute;
?>
 <?php 
echo getUebersetzung("Uhr");
?>
</span>
        	<br/>
        <?php 
echo getUebersetzung("Status");
?>
: 
        <span class="<?php 
echo parseStatus($status);
?>
"><?php 
echo getUebersetzung(parseStatus($status));
?>
</span>
    </td>
  </tr>
</table>
<?php 
//wenn belegt oder reserviert eingabe des mieters fordern:
if ($status != STATUS_FREI) {
    ?>
  <br/>	
  <form action="./resEintragen.php" method="post" name="noAdressForm" target="_self" id="noAdressForm">
  <input type="hidden" name="ansicht" value="<?php 
    echo $ansicht;
    ?>
"/>