Ejemplo n.º 1
0
function generateRows($fields, $requirePost = false)
{
    $generatedHtml = "";
    foreach ($fields as $field => $typeArr) {
        $type = $typeArr['type'];
        $title = $typeArr['title'];
        if (!$requirePost || $requirePost && isset($_POST[$field])) {
            $generatedHtml .= createRow($title, createTextField($field, $type));
        }
    }
    return $generatedHtml;
}
            }
        }
        $dropDown .= "</select>";
        return $dropDown;
    }
    /**************************************************************************************
    		Show the contact information for all contacts or selected Organization 
    ***************************************************************************************/
    echo "<hr><table style='width: 100%; font-size: 80%; border: none; padding: 0px; margin: auto; border-collapse: collapse; text-align: center;'>";
    $orglength = count($hierarchyarray);
    foreach ($hierarchyarray as $org) {
        $arealength = count($org) - 5;
        createRow($org['name'], $org['id'], $org['higherUp'], $org['priority'], $org['ddbox'], $orglength, 0);
        foreach ($org as $area) {
            $deptlength = count($area) - 5;
            if (is_array($area)) {
                createRow($area['name'], $area['id'], $area['higherUp'], $area['priority'], $area['ddbox'], $arealength, 4);
                foreach ($area as $dept) {
                    if (is_array($dept)) {
                        createRow($dept['name'], $dept['id'], $dept['higherUp'], $dept['priority'], $dept['ddbox'], $deptlength, 8);
                    }
                }
            }
        }
    }
    echo "</table>";
    echo "</div>";
} else {
    echo '<br /><br /><h1 style="text-align: center;"> You Do Not Have Rights To View This Page! </h1><br /><h2 style="text-align: center;">If this is an error please speak with your manager to get your rights granted.<br /><br />Thank you for not trying to hack the site!<br />~The OPS Dev Team</h2>';
}
include "../includes/includeAtEnd.php";
Ejemplo n.º 3
0
}
//echo $mysqli->host_info . "\n";
$minimumRowCount = 20;
$res = $mysqli->query("SELECT * FROM log WHERE (DATE(NOW()) = DATE(date)) OR ((SELECT id FROM log ORDER BY id DESC LIMIT 1) - id < " . $minimumRowCount . ") ORDER BY id DESC");
//print_r($res);
$rows = array();
while ($row = $res->fetch_assoc()) {
    array_push($rows, $row);
}
if (count($rows) > 0) {
    $first = $rows[0];
    if ($first['state'] == "0") {
        $text = "csukva";
        $color = "greenyellow";
    } else {
        if ($first['state'] == "1") {
            $color = "orangered";
            $text = "nyitva";
        }
    }
    echo "<div style='padding-bottom: 14px;'>";
    echo "<span style='padding:4px; border:1px solid black; background-color:" . $color . ";'>" . $text . "</span>";
    echo "</div>";
}
echo "<table style='background-color: aliceblue; border-collapse: collapse;'>";
echo "<tr><th>id</th><th>state</th><th>date</th></tr>";
foreach ($rows as $row) {
    echo "<tr>" . createRow($row) . "</tr>";
}
echo "</table>";
echo "</body></html>";
Ejemplo n.º 4
0
<?php

include "db.php";
include "patient.php";
include "functions.php";
if (isset($_POST['submitStart'])) {
    createRow('submitStart', 'namePatient');
}
if (isset($_POST['submit1']) && isset($_POST['answer1'])) {
    updateTable('1', 'answer1');
    $answer1 = $_POST['answer1'];
    if ($answer1 === "Yes") {
        header('Location: doubleConsult.php');
    } elseif ($answer1 = "No") {
        header('Location: question2.php');
    } else {
        echo "error";
    }
}
?>

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
    <link rel="stylesheet" type="text/css" href="style.css">

</head>
<body>