Exemplo n.º 1
0
function fix_time($label = false, $print = false)
{
    if (!($timing = show_time())) {
        return;
    }
    $bt = debug_backtrace();
    static $entries = array();
    $entry = array('file' => $bt[0]['file'], 'line' => $bt[0]['line'], 'global' => $timing[0], 'diff' => $timing[1], 'label' => $label);
    $entries[] = $entry;
    if ($print) {
        $droot = preg_replace("~[/\\\\]~", DIRECTORY_SEPARATOR, $_SERVER['DOCUMENT_ROOT']);
        ?>
		<style type="text/css">
		table.timing {
			border-collapse:collapse;
		}
		table.timing td {
			border:1px solid #333;
			font-size:11px;
			font-family:arial;
			padding:2px 4px;
		}
		</style>
		<table class="timing">
			<?php 
        foreach ($entries as $e) {
            $file = str_replace($droot, '', $e['file']);
            ?>
<tr>
					<td><?php 
            echo "<pre>" . htmlspecialchars(print_r($e['label'], 1)) . "</pre>";
            ?>
</td>
					<td><?php 
            echo $e['global'];
            ?>
</td>
					<td>+<?php 
            echo $e['diff'];
            ?>
</td>
					<td><?php 
            echo $file;
            ?>
</td>
					<td><?php 
            echo $e['line'];
            ?>
</td>
				</tr>
				<?php 
        }
        ?>
		</table>
		<?php 
    }
}
Exemplo n.º 2
0
            <h4>Inport</h4>
            <a href="inport.php"><img src="img/inport3.jpg" /></a>
        </div>


    </div>
    <br />

    <div class="row">
        <div class="large-12 columns">
            <div class="panel">
                <h4>Mededelingen</h4>
<?php 
echo "Overzicht van sommatie die een week oud zijn:<br /><br />";
//Haal alle sommatie op die een week oud zijn en zet deze in een tabel
if ($data = one_week_old_sommatie()) {
    echo "\n<table id='datatables' class='display'>\n    <thead>\n        <tr>\n            <th>\n                Hostaname\n            </th>\n            <th>\n                Time report\n            </th>\n            <th>\n                Time check\n            </th>\n            <th>\n                Status\n            </th>\n            <th>\n                Times checked\n            </th>\n            <th>\n                Number links\n            </th>\n            <th>\n                Check now!\n            </th>\n        </tr>\n    </thead>\n    <tbody>";
    //Loop voor elke sommatie die meer dan een week oud is en maak er een rij voor aan in table
    foreach ($data as $row) {
        //Laat allen de regels zien waar bij de stats niet op down is gezet anders sla het gewoon over
        if ($row['status'] != 'down') {
            echo "\n        <tr>\n            <td>\n                " . $row['hostname'] . "\n            </td>\n            <td>\n                " . show_time($row['time_report']) . "\n            </td>\n            <td>\n                " . show_time($row['time_check']) . "\n            </td>\n            <td>\n                " . $row['status'] . "\n            </td>\n            <td>\n                " . $row['times_checked'] . "\n            </td>\n            <td>\n                " . $row['number_links'] . "\n            </td>\n            <td>\n                <a href='melding.php?id=" . $row['uid'] . "'>Check</a>\n            </td>\n        </tr>\n\n    ";
        }
    }
    echo '
    </tbody>
</table>';
} else {
    echo "Er zijn geen sommaties die ouder zijn dan 1 week";
}
footer();
Exemplo n.º 3
0
	case 6: fatal("File corrupted");
	case 7: fatal("No Excel data found in file");
	case 8: fatal("Unsupported file version");

	default:
		fatal("Unknown error");
}

/*
print '<pre>';
print_r( $exc );
print '</pre>';
exit;
*/

show_time();

echo <<<LEG
<b>Legend:</b><br><br>
<table border=1 cellspacing=0 cellpadding=3>
<tr><td>Data type</td><td>Description</td></tr>
<tr><td class=empty>&nbsp;</td><td class=index>An empty cell</td></tr>
<tr><td class=dt_string>ABCabc</td><td class=index>String</td></tr>
<tr><td class=dt_int>12345</td><td class=index>Integer</td></tr>
<tr><td class=dt_float>123.45</td><td class=index>Float</td></tr>
<tr><td class=dt_date>123.45</td><td class=index>Date</td></tr>
<table>
<br><br>

LEG;
Exemplo n.º 4
0
                </th>
                <th>
                    Times check
                </th>
                <th>
                    Controleer
                </th>
            </tr>
        </thead>
        <tbody>
        <?php 
//Loop voor elke gevodnen soammtie
foreach ($data as $row) {
    //Lata allen de sommatie zien die niet op down zijn gezet
    if ($row['status'] != "down") {
        echo "<tr align='right'>\n                    <td>\n                         " . $row['hostname'] . "\n                    </td>\n\n                    <td>\n                         " . show_time($row['time_report']) . "\n                    </td>\n\n                    <td>\n                         " . show_time($row['timeCheck']) . "\n                    </td>\n\n                    <td>\n                         " . $row['number_links'] . "\n                    </td>\n\n                    <td>\n                         " . $row['status'] . "\n                    </td>\n\n                    <td>\n                         " . $row['times_checked'] . "\n                    </td>\n\n                    <td>";
        //Controllere of er een HTML tag is
        $sql = "SELECT HTML FROM filehoster WHERE url = '" . $row['hostname'] . "'";
        if ($query = mysql_query($sql)) {
            //Zet de html tag in een string
            $html = mysql_fetch_array($query);
            //Controller of er iets in de string staat zo ja dan is er een HTML tag zo niet dan is er geen HTML tag
            if (empty($html[0])) {
                echo "No HTML tag || <a href='add_htmltag.php?fid=" . $row['filehoster_uid'] . "'>Add</a> || <a href='force.php?sid=" . $row['uid'] . "'>Force</a>";
            } else {
                echo " <a href='melding.php?id=" . $row['uid'] . "&total=" . $row['number_links'] . "&html=" . $html[0] . "'>Check</a> || <a href='force.php?sid=" . $row['uid'] . "'>Force</a>";
            }
        } else {
            exit('Er gaat iest fout met het selecteren van de filehoster');
        }
        echo "</td>\n                </tr>";
Exemplo n.º 5
0
 $mf_id = find_mitfahrer($angebot_id, $mf_email);
 if ($mf_id == 0) {
     //problem with database, return 2
     echo 2;
 } else {
     //everything is ok return 0
     echo 0;
     //everyone involved should get an email
     $angebot = fetch_one_ride($angebot_id);
     $f_name = $angebot['name'];
     $f_tel = $angebot['tel'];
     $f_email = $angebot['email'];
     $von = $angebot['von'];
     $nach = $angebot['nach'];
     $datum = show_date($angebot['time']);
     $zeit = show_time($angebot['time']);
     $treffpunkt = $angebot['treffpunkt'];
     $dtstart = make_dtcomponent($angebot['time']);
     $dtend = make_dtcomponent($angebot['time'] + 30 * 60);
     //duration 30 minutes
     $ics = make_ics($dtstart, $dtend, $treffpunkt, $von, $nach);
     $mitfahrer_msg = make_mitfahrer_message($mf_name, $von, $nach, $datum, $zeit, $f_name, $f_tel, $f_email);
     $subject = "Mitfahrgelegenheit ({$von} -> {$nach}) am {$datum}, {$zeit}";
     $from = "*****@*****.**";
     $mitfahrer_email = make_email($mf_email, $from, $subject, $mitfahrer_msg);
     $mitfahrer_email = add_attachment($mitfahrer_email, $ics);
     send_mail($mitfahrer_email);
     $fahrer_msg = make_neuer_mitfahrer_message($f_name, $von, $nach, $datum, $zeit, $mf_name, $mf_tel, $mf_email);
     $fahrer_email = make_email($f_email, $from, $subject, $fahrer_msg);
     $fahrer_email = add_encoding($fahrer_email);
     send_mail($fahrer_email);
Exemplo n.º 6
0
        //Als de link wel down zijn
    } else {
        //Zet status op down
        if (!set_sommatie_down($_GET['id'])) {
            exit('Er gaat iets fout met update');
        } else {
            echo "Location: index.php";
        }
    }
}
top($title);
?>
</head>
<body>
<?php 
logo($title);
echo "INFO:<table>";
//De info waar die je aant controlleren bent
echo "\n    <tr>\n        <td>\n            UID\n        </td>\n         <td>\n            " . $row[0] . "\n        </td>\n    </tr>\n    <tr>\n        <td>\n            Hostename\n        </td>\n         <td>\n            " . $row[2] . "\n        </td>\n    </tr>\n    <tr>\n        <td>\n            Time report\n        </td>\n        <td>\n            " . show_time($row[3]) . "\n        </td>\n    </tr>\n    <tr>\n        <td>\n            staus\n        </td>\n        <td>\n            " . $row[7] . "\n        </td>\n    </tr>\n        <tr>\n        <td>\n            Links\n        </td>\n        <td>\n            " . $row[9] . "\n        </td>\n    </tr>\n</table><br />Links:<br />";
//worden de link opgehaalt en getaant
if ($links = all_link_by_sid($_GET['sid'])) {
    //Toon links
    foreach ($links as $link) {
        echo "<a href='" . $link . "'>" . $link . "</a> <br />";
    }
} else {
    echo "er gaat iets mis met ophalen van de data";
}
//De knoppen om aan te geven of alles wel of niet up is
echo "<br />Up or Down:\n\n<form method='POST'>\n<select name='update'>\n    <option value='up'>up</option>\n    <option value='down'>down</option>\n</select>\n<br />\n<input type='submit' name='submit' value='Update' class='button' />\n</form>";
footer();
Exemplo n.º 7
0
foreach ($rides as $r) {
    $plaetze_frei = free_seats($r['id']);
    ?>

<div class="toggle mfahrt <?php 
    echo toolate($r['time']);
    ?>
 <?php 
    echo notfree($plaetze_frei);
    ?>
">
    <p><?php 
    echo show_date($r['time']);
    ?>
 um <?php 
    echo show_time($r['time']);
    ?>
; <?php 
    echo $r['von'];
    ?>
 &#8680; <?php 
    echo $r['nach'];
    ?>
</p>
    <p>&#8942; Plätze frei: <?php 
    echo $plaetze_frei;
    ?>
</p>
    <div class="short"></div>
    <div class="long">
        <div class="mf-longinfo">
Exemplo n.º 8
0
 private function write_log($message, $with_time = TRUE)
 {
     if ($with_time) {
         $message = date('Y-m-d H:i:s') . ' --  [ Memory=' . show_memory() . ',Time=' . show_time($this->time_start) . ' ] ' . ' -- ' . $message;
     }
     $message .= "\n";
     echo $message;
     $this->log->write($message);
 }
Exemplo n.º 9
0
include 'mf-core.php';
$name = $_POST['name'];
$anzahl = $_POST['anzahl'];
$von = $_POST['von'];
$nach = $_POST['nach'];
$treffpunkt = $_POST['treffpunkt'];
$fahrzeug = $_POST['fahrzeug'];
$preis = $_POST['preis'];
$tel = $_POST['tel'];
$email = $_POST['email'];
$timestamp = $_POST['timestamp'];
add_ride($name, $von, $nach, $treffpunkt, $anzahl, $fahrzeug, $preis, $tel, $email, $timestamp);
$angebot_id = find_ride($name, $timestamp);
echo $angebot_id == 0 ? '0' : '1';
$datum = show_date($timestamp);
$zeit = show_time($timestamp);
//send email to fahrer
//send ics with it
//recipient, subject, separator
$to = $email;
$subject = "Mitfahrgelegenheit ({$von} -> {$nach}) am {$datum}, {$zeit}";
$from = "*****@*****.**";
$fahrer_msg = make_fahrer_msg($name, $datum, $zeit, $von, $nach, $treffpunkt, $anzahl, $preis);
$fahrer_mail = make_email($to, $from, $subject, $fahrer_msg);
$dtstart = make_dtcomponent($timestamp);
$dtend = make_dtcomponent($timestamp + 30 * 60);
//duration 30 minutes
$ics = make_ics($dtstart, $dtend, $treffpunkt, $von, $nach);
$fahrer_mail = add_attachment($fahrer_mail, $ics);
send_mail($fahrer_mail);
Exemplo n.º 10
0
Arquivo: func.php Projeto: hubs/yuncms
function show_trace()
{
    if (!Base_Request::is_ajax() && C('config', 'show_trace')) {
        $trace_page_tabs = array('BASE' => '基本', 'FILE' => '文件', 'INFO' => '流程', 'ERR|NOTIC' => '错误', 'SQL' => 'SQL', 'DEBUG' => '调试');
        // 页面Trace可定制的选项卡
        // 系统默认显示信息
        $files = get_included_files();
        $info = array();
        foreach ($files as $key => $file) {
            $info[] = $file . ' ( ' . number_format(filesize($file) / 1024, 2) . ' KB )';
        }
        $trace = array();
        $base = array('请求信息' => date('Y-m-d H:i:s', $_SERVER['REQUEST_TIME']) . ' ' . $_SERVER['SERVER_PROTOCOL'] . ' ' . $_SERVER['REQUEST_METHOD'] . ' : ' . $_SERVER['REQUEST_URI'], '运行时间' => show_time(), '内存开销' => MEMORY_LIMIT_ON ? number_format((memory_get_usage() - START_MEMORY) / 1024, 2) . ' kb' : '不支持', '查询信息' => N('db_query') . ' queries ' . N('db_write') . ' writes ', '文件加载' => count(get_included_files()), '缓存信息' => N('cache_read') . ' gets ' . N('cache_write') . ' writes ', '会话信息' => 'SESSION_ID=' . session_id());
        $debug = trace();
        foreach ($trace_page_tabs as $name => $title) {
            switch (strtoupper($name)) {
                case 'BASE':
                    // 基本信息
                    $trace[$title] = $base;
                    break;
                case 'FILE':
                    // 文件信息
                    $trace[$title] = $info;
                    break;
                default:
                    // 调试信息
                    $name = strtoupper($name);
                    if (strpos($name, '|')) {
                        // 多组信息
                        $array = explode('|', $name);
                        $result = array();
                        foreach ($array as $name) {
                            $result += isset($debug[$name]) ? $debug[$name] : array();
                        }
                        $trace[$title] = $result;
                    } else {
                        $trace[$title] = isset($debug[$name]) ? $debug[$name] : '';
                    }
            }
        }
    }
    include FW_PATH . 'errors' . DIRECTORY_SEPARATOR . 'trace.php';
}