/**
 * @param $arrayA
 * @param $arrayB
 */
function analyze($arrayA, $arrayB, &$newLemmas)
{
    foreach ($arrayA as $index => $element) {
        if (!is_array($element)) {
            if (empty($element)) {
                $otherLemma = $arrayB[$index];
                if (empty($otherLemma)) {
                    echo "Lemma " . $index . " vacio.\n";
                } else {
                    $newLemmas[$index] = $otherLemma;
                }
            }
        } else {
            analyze($element, $arrayB[$index], $newLemmas[$index]);
        }
    }
}
Esempio n. 2
0
function parser($eml_file = '')
{
    $tempdir = get_config('TempDir');
    if (!is_dir($tempdir)) {
        die('The temporary directory "' . $tempdir . '" doesn\'t exist.');
    }
    // get a unique temporary file name
    $tmpfilepath = tempnam($tempdir, strval(mt_rand(1000, 9999)));
    // read the mail that is forwarded to the script
    // then save the mail to a temporary file
    save_forward_mail($tmpfilepath, $eml_file);
    if (file_exists($tmpfilepath) === FALSE) {
        die('Failed to save the mail as ' . $tmpfilepath . '.');
    }
    $ret = analyze($tmpfilepath, $tempdir);
    //die (print_r($ret));
    return $ret;
}
Esempio n. 3
0
function compare($sercret_number, $answer_number)
{
    $crct = 0;
    //◎の個数
    $cont = 0;
    //○の個数
    $bad = 0;
    //×の個数
    $sn = analyze($sercret_number);
    $an = analyze($answer_number);
    for ($i = 0; $i < 4; $i++) {
        for ($j = 0; $j < 4; $j++) {
            if ($i == $j && $sn[$i] == $an[$j]) {
                $crct++;
            } else {
                if ($sn[$i] == $an[$j]) {
                    $cont++;
                }
            }
        }
    }
    $bad = 4 - ($crct + $cont);
    return array($crct, $cont, $bad);
}
Esempio n. 4
0
<?php

if (!isset($_GET["tree"]) || !isset($_GET["id"])) {
    die("tree or id not set");
}
if (!preg_match('/^[a-zA-Z0-9\\.-]+$/', $_GET["tree"])) {
    die("invalid tree");
}
echo analyze($_GET["tree"], $_GET["id"]);
function analyze($tree, $id)
{
    $file = "../summaries/LeakAnalysis_" . $tree . "_" . $id;
    if (file_exists($file)) {
        return file_get_contents($file);
    }
    $usetinderbox = 0;
    if (isset($_GET["usetinderbox"])) {
        $usetinderbox = $_GET["usetinderbox"];
    }
    $fp = NULL;
    $lines = array();
    $fileExistedAfterAll = false;
    $windows = array();
    $lastTestName = '';
    if ($usetinderbox == 1) {
        if (!preg_match('/^\\d+\\.\\d+\\.\\d+\\.gz$/', $_GET["id"])) {
            die("invalid id");
        }
        $host = "tinderbox.mozilla.org";
        $page = "/showlog.cgi?log=" . $tree . "/" . $id;
        // . 1233853948.1233859186.27458.gz";
opentable("User Charts - ADMIN");
echo '<link rel="stylesheet" href="' . INFUSIONS . 'user_charts/css/my.css">';
echo '<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">';
$uc_interpret = "";
$uc_titel = "";
$daten = '';
$status = '';
$status = new StatusMessage();
$_SESSION['status'] = $status;
if (array_key_exists('coverMake', $_POST)) {
    $res = coverMake($status);
    var_dump($res);
}
if (array_key_exists('auswertung', $_POST)) {
    $analyseDaten = $_POST;
    $erg = json_encode(analyze($analyseDaten, $status));
    $_SESSION['erg'] = $erg;
}
if (array_key_exists('neueintrag', $_POST)) {
    databaseWrite($_POST, $status);
}
if (array_key_exists('delete', $_POST)) {
    $delSong = $_POST['songid'];
    dbDelte($delSong, $status);
}
?>
    <script src="//code.jquery.com/jquery-1.10.2.js"></script>
    <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
    <script>
        $(function() {
            var index = 'activeTab';
Esempio n. 6
0
function check($expr, $given)
{
    $eq['left'] = postfix($expr[0]);
    $eq['right'] = postfix($expr[1]);
    $eq = distribute($eq);
    $eq = firststep($eq);
    $eq['left'] = analyze($eq['left'], 'left');
    $eq['right'] = analyze($eq['right'], 'right');
    $eq['left'] = array_pop($eq['left']);
    $eq['right'] = array_pop($eq['right']);
    if ($eq['left'] == "x") {
        $resultExpr = $eq['right'] / 1;
    } else {
        $resultExpr = $eq['right'] / $eq['left'];
    }
    $eq['left'] = postfix($given[0]);
    $eq['right'] = postfix($given[1]);
    $eq = distribute($eq);
    $eq = firststep($eq);
    $eq['left'] = analyze($eq['left'], 'left');
    $eq['right'] = analyze($eq['right'], 'right');
    $eq['left'] = array_pop($eq['left']);
    $eq['right'] = array_pop($eq['right']);
    if ($eq['left'] == "x") {
        $resultGiven = $eq['right'] / 1;
    } else {
        $resultGiven = $eq['right'] / $eq['left'];
    }
    if ($resultGiven == $resultExpr) {
        return true;
    }
    return false;
}
Esempio n. 7
0
	/** Main AJAX callback, constructs an XML message with the frequency data
	 *  TODO replace XML with JSON	
	 */
	 
	$text = $_POST['text'];
	$ignore = ($_POST['ignore'] == 'true') ? True : False;
	$max  = 50;
	$err = "";
	
	// Construct the XML response
	echo '<packet>';	
	
	// Construct the data portion
	if($text != ""){
		
		$data = analyze($text,$max);
		
		$freq = $data["freq"];
		
		echo '<data>';
		// Replace me with XML
		foreach($freq as $key => $value){
			echo '<item title="' . $key .'" hits="'.$value.'"/>';		
		}
		echo '</data>';	
		
		echo '<stops>' . $data['stops'] . '</stops>';
		echo '<total>' . $data['total'] . '</total>';
	}else{
		$err ="Please ... enter some text in the text box ;)";
	}
Esempio n. 8
0
include "auth.inc";
include "../mysql.php";
include "../analyze.php";
?>
<html>
<head>
<title>Tree Scheduling Analysis</title>
<meta name="viewport" content="width=device-width, user-scalable=no" />
<link href="../trees.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="colmask fullpage">
<div class="col1">
<h2><a href="index.php">Admin</a> &gt; Schedule Analysis</h2>
<?php 
$arr = analyze();
print "Parents: " . $arr['parents'] . ", shifts: " . $arr['parent_shifts'];
print " =&gt; " . $arr['shifts_per_parent'] . " =&gt; " . $arr['spp'];
print " (slop " . ($arr['spp'] * $arr['parents'] - $arr['parent_shifts']) . ")";
print " (" . $arr['parent_shifts'] / $arr['spp'] . " parents to fill)";
print " override = " . $arr['min_p'] . "<br/>\n";
print "Scouts: " . $arr['scouts'] . ", shifts: " . $arr['scout_shifts'];
print " =&gt; " . $arr['shifts_per_scout'] . " =&gt; " . $arr['sps'];
print " (slop " . ($arr['sps'] * $arr['scouts'] - $arr['scout_shifts']) . ")";
print " (" . $arr['scout_shifts'] / $arr['sps'] . " scouts to fill)";
print " override = " . $arr['min_s'] . "<br/>\n";
$people = $arr['scouts'] + $arr['parents'];
$shifts = $arr['scout_shifts'] + $arr['parent_shifts'];
$shifts_per_person = $shifts / $people;
$spp = ceil($shifts_per_person);
print "Everyone: {$people}, shifts: {$shifts}";
Esempio n. 9
0
        $parentid = $arr['parentid'];
        $shiftid = $arr['shiftid'];
        $snow_shifts[$parentid][$shiftid] = 1;
    }
    $result->close();
}
$query = "SELECT * FROM scout_shifts";
if (($result = $mysqli->query($query)) !== FALSE) {
    while ($arr = $result->fetch_array()) {
        $scoutid = $arr['scoutid'];
        $shiftid = $arr['shiftid'];
        $scout_shifts[$scoutid][$shiftid] = 1;
    }
    $result->close();
}
$stats = analyze();
print "<form action='nag.php' method='post'>";
print "<table>";
print "<tr>";
print "<th>Name</th>";
print "<th>Do Not Nag</th>";
print "<th>Adult Shifts</th>";
print "<th>Scout Shifts</th>";
if ($stats['min'] > 0) {
    print "<th>Total Shifts</th>";
}
print "<th>Snow Shift</th>\n";
print "</th>";
foreach ($parents as $parentid => $parent) {
    $complete = true;
    $total_shifts = 0;
Esempio n. 10
0
function send_the_email($pname, $password, $email, $dirname, $snow_state, $parent_state, $scout_state, $total_state)
{
    global $START;
    $stats = analyze();
    $subject = "Please complete your Tree Scheduling";
    $myemail = '*****@*****.**';
    $boundary = "TreesTreesBeautifulTrees";
    $headers = 'From: Todd Short <*****@*****.**>' . "\r\n";
    $headers .= 'Bcc: todd.short@me.com' . "\r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: multipart/alternative;boundary={$boundary}\r\n";
    $message = "This is a multi-part message in MIME format.\n";
    $message .= "\r\n\r\n--{$boundary}\r\n";
    $message .= "Content-Type: text/plain;charset=utf-8\r\n\r\n";
    $message .= "Plain text - read the HTML-encoded email!!\n";
    $message .= "\r\n\r\n--{$boundary}\r\n";
    $message .= "Content-Type: text/html;charset=utf-8\r\n\r\n";
    $message .= "<p>Hello {$pname},</p>\n\n";
    $message .= "<p style='font-weight:bold'>This is a reminder that you still need to complete your schedule for the annual Boy Scout Tree Sale.</p>\n";
    $message .= "<p><b>Requirements:</b></p>\n";
    $message .= "<ol>\n";
    $message .= "<li>Each <i>family</i> is required to work (" . $stats['spp'] . ") adult shifts (minimum). Either parent may work this shift.</li>\n";
    $message .= "<ul>{$parent_state}</ul>\n";
    $message .= "<li>Each <i>scout</i> is required to work (" . $stats['sps'] . ") scout shifts (minimum).</li>\n";
    $message .= "<ul>{$scout_state}</ul>\n";
    if ($stats['min'] > 0) {
        $message .= "<li>Each <i>family</i> is required to work (" . $stats['min'] . ") shifts per person. A scout or a parent may fulfill these extra shifts.</li>\n";
        $message .= "<ul>{$total_state}</ul>\n";
    }
    $message .= "<li>Each <i>family</i> is required to sign up for an <b>On-Call Snow Removal</b> shift.</li>\n";
    $message .= "<ul>{$snow_state}</ul>\n";
    $message .= "</ol>\n";
    $message .= "<p><b>If you cannot fulfill your shift</b>, it is your responsibility to find a replacement or a trade. The website does not limit ";
    $message .= "the number of shifts you may sign up for; but you cannot remove a shift. If possible, please sign up for another shift. ";
    $message .= " If you need a shift traded, removed or modified; please contact <a href=\"mailto:{$myemail}\">me via email</a>.</p>\n";
    $message .= "<p><b><i>Here is the link you need to complete your Tree Sale scheduling.</i></b></p>\n";
    $link = $dirname . "/home.php/{$password}";
    $message .= "<p><a href=\"{$link}\">{$link}</a></p>\n";
    $message .= "<p><b>Note:</b></p>\n";
    $message .= "<ul>";
    $message .= "<li>There is no password to the site.</li>\n";
    $message .= "<li>The link above is unique for your family. Please do not share this link with anyone outside your family, as it will give them access to your schedule.</li>\n";
    $message .= "<li>Your schedule is <b>not</b> emailed to you; it is available at the link above.</li>\n";
    $message .= "<li>The website does not enforce any limitations on the number of shifts you choose. If you choose too few or too many, the website will tell you.</li>\n";
    $message .= "<li>If you do not sign up for enough shifts, you will get nag emails until you do. <i>This is a nag email.</i></li>\n";
    $message .= "</ul>\n";
    $message .= "<p>If you have any questions, please don't hesitate to email me.</p>\n";
    $message .= "<p>Thank you,</p>\n<p>Todd Short<br/><a href=\"mailto:{$myemail}\">{$myemail}</a></p>\n";
    $message .= "<p>This email was sent to {$email}</p>\n";
    $message .= "\r\n\r\n--{$boundary}--\r\n\r\n";
    $toemail = $email;
    //$toemail = "*****@*****.**"; // temp
    $ret = mail($toemail, $subject, $message, $headers);
    if ($ret === FALSE) {
        print "Unable to send nag email to {$pname}! ({$email})\n";
    } else {
        print "Sent nag email to {$pname} ({$email})\n";
    }
}
Esempio n. 11
0
    if (!$n) {
        echo "No done results for that app";
        exit;
    }
    ksort($hist);
    show_stats($hist);
    echo "<hr>\n";
    show_as_table();
    echo "<hr>\n";
    show_as_xml();
}
function show_form()
{
    echo "\r\n\t\t<form method=get action=job_times.php>\r\n\t\tApp ID: <input name=appid>\r\n\t\t<br>platform ID (0 for all): <input name=platformid value=0>\r\n\t\t<br>FLOP quantum: <input name=quantum value=1e12>\r\n\t\t<br># of results: <input name=nresults value=1000>\r\n\t\t<br><input type=submit name=submit value=OK>\r\n\t\t</form>\r\n\t";
    show_platforms();
    show_apps();
}
if ($_GET['submit'] == 'OK') {
    set_time_limit(0);
    $appid = $_GET['appid'];
    if (!$appid) {
        echo "Must supply an appid";
        exit;
    }
    $platformid = $_GET['platformid'];
    $quantum = $_GET['quantum'];
    $nresults = $_GET['nresults'];
    analyze($appid, $platformid, $nresults);
} else {
    show_form();
}
Esempio n. 12
0
	include_once('ressources/class.squid.inc');
	include_once('ressources/class.ccurl.inc');
	
	
	header("Pragma: no-cache");	
	header("Expires: 0");
	header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
	header("Cache-Control: no-cache, must-revalidate");	
	$user=new usersMenus();
	if(!$user->AsWebStatisticsAdministrator){
		$tpl=new templates();
		echo "alert('".$tpl->javascript_parse_text("{ERROR_NO_PRIVS}").");";
		exit;
		
	}
	if(isset($_GET["analyze"])){analyze();exit;}
	
page();


function page(){
	$page=CurrentPageName();
	$tpl=new templates();		
	$html="<div class=text-info>{webalyzer_howto}</div>
	<table class=form>
	<tbody>
	<tr>
		<td class=legend>{url}:</td>
		<td>". Field_text("webalizer-uri",null,"font-size:16px;width:100%")."</td>
		<td width=1%>". button("{analyze}", "WebalyzerPerform()")."</td>
	</tr>
}
opentable("User Charts - ADMIN");
echo '<link rel="stylesheet" href="' . INFUSIONS . 'user_charts/css/my.css">';
echo '<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">';
$uc_interpret = "";
$uc_titel = "";
$status = '';
$status = new StatusMessage();
if (array_key_exists('coverMake', $_POST)) {
    $coverdaten = unserialize($_POST['daten']);
    //  var_dump($_POST['daten']."<br>");
    coverMake($coverdaten, $status);
}
if (array_key_exists('auswertung', $_POST)) {
    $analyseDaten = $_POST;
    analyze($analyseDaten, $status);
}
if (array_key_exists('auswertung', $_POST)) {
    $view = "auswertung";
}
if (array_key_exists('neueintrag', $_POST)) {
    databaseWrite($_POST, $status);
}
if (array_key_exists('delete', $_POST)) {
    $delSong = $_POST['songid'];
    dbDelte($delSong, $status);
}
?>
    <script src="//code.jquery.com/jquery-1.10.2.js"></script>
    <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
    <script>
Esempio n. 14
0
include_once 'ressources/class.artica.inc';
include_once 'ressources/class.rtmm.tools.inc';
include_once 'ressources/class.squid.inc';
include_once 'ressources/class.ccurl.inc';
header("Pragma: no-cache");
header("Expires: 0");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
$user = new usersMenus();
if (!$user->AsWebStatisticsAdministrator) {
    $tpl = new templates();
    echo "alert('" . $tpl->javascript_parse_text("{ERROR_NO_PRIVS}") . ");";
    exit;
}
if (isset($_GET["analyze"])) {
    analyze();
    exit;
}
page();
function page()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $html = "<div class=explain>{webalyzer_howto}</div>\n\t<table class=form>\n\t<tbody>\n\t<tr>\n\t\t<td class=legend>{url}:</td>\n\t\t<td>" . Field_text("webalizer-uri", null, "font-size:16px;width:100%") . "</td>\n\t\t<td width=1%>" . button("{analyze}", "WebalyzerPerform()") . "</td>\n\t</tr>\n\t</table>\n\t<div id='webalyzer-results' style='width:100%;height:350px;overlow:auto'></div>\n\t\n\t<script>\t\n\t\tfunction WebalyzerPerform(){\n\t\t\t\tvar uri=escape(document.getElementById('webalizer-uri').value);\n\t\t\t\tLoadAjax('webalyzer-results','{$page}?analyze=yes&uri='+uri);\n\t\t}\t\n\t\n\t</script>\n\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
function analyze()
{
    if ($GLOBALS["VERBOSE"]) {
        echo "analyze<br>\n";
    }
Esempio n. 15
0
    echo "<br><br><input type=submit value=OK>";
    admin_page_tail();
}
function show_form($appid)
{
    admin_page_head("Show FLOPS distribution");
    echo "\n        <form method=get action=job_times.php>\n        <input type=hidden name=appid value={$appid}>\n    ";
    start_table();
    row2("App version:", version_select($appid));
    row2("Resolution:<br><span class=note>(if you see only one bar, use a smaller value)</span>", "<input name=quantum value=1e12>");
    row2("Sample size (# of jobs):", "<input name=nresults value=1000>");
    row2("", "<input type=submit name=submit value=OK>");
    end_table();
    echo "\n        </form>\n    ";
    admin_page_tail();
}
if (get_str('submit', true) == 'OK') {
    set_time_limit(0);
    $appid = get_int('appid');
    $app_version_id = get_int('app_version_id');
    $quantum = (double) get_str('quantum');
    $nresults = get_int('nresults');
    analyze($appid, $app_version_id, $nresults);
} else {
    $appid = get_int('appid', true);
    if ($appid) {
        show_form($appid);
    } else {
        show_app_select();
    }
}
Esempio n. 16
0
#http://www.accounting-123.com/a.php?a=153/GPLv3
#
#
#
#
#
#
#
#
#
#
#
# get settings
require "settings.php";
require "core-settings.php";
$OUTPUT = analyze("../accstruct/" . $_GET["file"]);
# get templete
require "template.php";
# View details
function analyze($filename)
{
    # check if folder exist
    if (!file_exists($filename)) {
        return "<li> File does not exist.";
    }
    # check if folder is a folder
    if (is_dir($filename)) {
        return "<li> Selected file is a directory.";
    }
    $file = file($filename);
    // Layout
Esempio n. 17
0
            echo "\t\t\t<content type=\"html\"><![CDATA[" . $item . "]]></content>\n";
            echo "\t\t</entry>\n";
        }
    }
    if ($_GET['type'] == "rss") {
        echo "\t\t</channel>\n";
        echo "\t</rss>";
    } elseif ($_GET['type'] == "atom") {
        echo "\t</feed>";
    }
    /* On termine le cache */
    finCache();
} else {
    http::head(301);
    http::redirect(BP_PLANET_URL . "/feed.php?type=rss");
}
$root_url = BP_PLANET_URL;
$analytics = $blog_settings->get('planet_analytics');
if (!empty($analytics)) {
    $analyzed_url = $root_url . '/feed/' . $_GET['type'];
    if (!empty($tags)) {
        $analyzed_url .= '/tags/' . implode(',', $tags);
    }
    if (!empty($users)) {
        $analyzed_url .= '/users/' . implode(',', $users);
    }
    if (!empty($period)) {
        $analyzed_url .= '/period/' . $period;
    }
    analyze($analytics, $analyzed_url, T_('Feed'), "", 0);
}
Esempio n. 18
0
<?php

include "auth.inc";
include "../mysql.php";
include "../shifttypes.php";
include "../analyze.php";
$LIMITS = analyze();
?>
<html>
<head>
<title>Tree Scheduling Admin</title>
<meta name="viewport" content="width=device-width, user-scalable=no" />
<link href="../trees.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="colmask fullpage">
<div class="col1">
<h2><a href="index.php">Admin</a> &gt; Schedule by Person</h2>
<table border>
<tr><th>Person</th><th>Date/Time - Shift</th><th>Status</th></tr>
<?php 
date_default_timezone_set("America/New_York");
$mysqli = db_connect();
if ($mysqli === FALSE) {
    print "<b>Error connecting to database</b><br/>\n";
}
$query = "SELECT * FROM parents";
if (($result = $mysqli->query($query)) !== FALSE) {
    while ($arr = $result->fetch_array()) {
        $idx = $arr['id'];
        $parents[$idx] = $arr;
Esempio n. 19
0
function send_the_email($pname, $password, $troop, $email, $dirname, $orig_email = "")
{
    global $START;
    $stats = analyze();
    /* if there's an updated email, use it */
    if (!empty($orig_email)) {
        $email = $orig_email;
    }
    $subject = "Here is the link to start Tree Scheduling";
    $myemail = '*****@*****.**';
    $boundary = "TreesTreesBeautifulTrees";
    $headers = 'From: Todd Short <*****@*****.**>' . "\r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: multipart/alternative;boundary={$boundary}\r\n";
    $message = "This is a multi-part message in MIME format.\n";
    $message .= "\r\n\r\n--{$boundary}\r\n";
    $message .= "Content-Type: text/plain;charset=utf-8\r\n\r\n";
    $message .= "Plain text - read the HTML-encoded email!!\n";
    $message .= "\r\n\r\n--{$boundary}\r\n";
    $message .= "Content-Type: text/html;charset=utf-8\r\n\r\n";
    $message .= "<p>Hello {$pname},</p>\n\n";
    $message .= "<p style='color:red;font-weight:bold;font-style:italic'>Please read this entire email, it contains important information about the Tree Sale.</p>\n";
    $message .= "<p>We are ready to organize volunteer shifts for the <b>Annual Boy Scout Holiday Tree Sale</b>. We have around 1055 trees to sell. ";
    $message .= "This is the ONLY fundraiser for our Troop. Participation of our scouts and their families is ";
    $message .= "expected and mandatory, with no exceptions. As it has been the custom for many years, all active members of the Troop, ";
    $message .= "including Eagle members, are required to serve the required number of shifts. Remember, <b><i>Tree Sales are fun!</i></b></p>\n";
    $message .= "<p>We will using the same online system as last year for scheduling tree sales. I have developed a website that is specifically designed for ";
    $message .= "Unit {$troop}'s sales schedules. Your <i>personalized</i> link is at the bottom of this email. Please do not email me asking for the schedule in email ";
    $message .= "or send your shift requests via email. Shift assignments fill up very quickly, so please go to the site shortly after it ";
    $message .= "goes live.</p>\n";
    $message .= "<p><b>Requirements:</b></p>\n";
    $message .= "<ol>";
    $message .= "<li>Each <i>family</i> is required to work (" . $stats['spp'] . ") adult shifts (minimum). Either parent may work these shifts.</li>";
    $message .= "<li>Each <i>scout</i> is required to work (" . $stats['sps'] . ") scout shifts (minimum).</li>";
    if ($stats['min'] > 0) {
        $message .= "<li>However, each <i>family</i> is required to work (" . $stats['min'] . ") shifts per person. A scout or a parent may fulfill these extra shifts.</li>";
    }
    $message .= "<li>Each <i>family</i> is required to sign up for an <b>On-Call Snow Removal</b> shift.</li>";
    $message .= "</ol>";
    $message .= "<p>We have several kinds of shifts: corral setup, tree unloading/tagging, drilling trees (we need older scouts for this), ";
    $message .= "opening and closing of the tree site (a.k.a. Cash shifts, adults only), and corral breakdown.</p>\n";
    $message .= "<p><b>Opening and Closing Cash shifts:</b> This year, (" . $stats['cash_value'] . ") of the opening or closing shifts will count ";
    $message .= "as one (1) adult shift.</p>\n";
    $message .= "<ul><li><u>Opening</u> the tree site involves arriving 15 minutes before the first shift of the day and completing a checklist to set ";
    $message .= "up the site. You will also be required to bring the starting cash to the site.</li><li><u>Closing</u> the site at the end of the sales ";
    $message .= "day involves a checklist to secure the site and dropping off the money collected that day to the treasurer. You should ";
    $message .= "arrive 15 minutes before closing. The treasurer for the Tree Sale is Dan DiFelice, from our Troop. I will send separate ";
    $message .= "instructions for this.</li><li>There are only (" . $stats['cash_shifts'] . ") of these shifts.</li></ul>";
    $message .= "<p><b>On-Call Snow Removal shifts:</b> If there has been a big snow on one of the days our Troop has the first selling shift of the ";
    $message .= "day, our Troop is responsible for shoveling around the trees and the pathways around the site. The scouts and parents ";
    $message .= "scheduled to be <i>on-call</i> that day come to the site at the begining of the shift to clear snow and leave once the job is done. ";
    $message .= "Bring your shovel with your name on it! A suggestion is to choose a date when you are going to be on a sales shift.</p>\n";
    $message .= "<p><b>If you cannot fulfill your shift</b>, it is your responsibility to find a replacement or a trade. The website does not limit ";
    $message .= "the number of shifts you may sign up for; but you can only edit them for a short period of time. If possible, please sign up for another shift. ";
    $message .= " If you need a shift traded, removed or modified; please contact <a href=\"mailto:{$myemail}\">me via email</a>.</p>\n";
    $message .= "<p><b><i>Here is the link you need to start your Tree Sale scheduling.</i></b></p>\n";
    if ($dirname == "/") {
        $dirname = "";
    }
    $link = "https://" . $_SERVER['SERVER_NAME'] . $dirname . "/home.php/{$password}";
    $message .= "<p><a href=\"{$link}\">{$link}</a></p>\n";
    $message .= "<p><b>Note:</b></p>\n";
    $message .= "<ul>";
    $message .= "<li>There is no password to the site.</li>";
    $message .= "<li>The avove link is for Unit {$troop}. If you belong to more than one Uint you will receive multiple emails.</li>";
    $message .= "<li>The link above is unique for your family. Please do not share this link with anyone outside your family, as it will give them access to your schedule.</li>";
    $message .= "<li>Your schedule is <b>not</b> emailed to you; it is available at the link above.</li>";
    $message .= "<li>The website does not enforce any limitations on the number of shifts you choose. But, if you choose too few or too many, the website will tell you.</li>";
    $message .= "<li>If you do not sign up for enough shifts, you will get nag emails until you do.</li>";
    $message .= "</ul>";
    $message .= "<p>The website will go live on <b>{$START}</b>, just like Ticketmaster. You should review the available shifts before the site goes live.</p>\n";
    $message .= "<p>Although it will work on a phone, the site works best in a regular web browser.</p>\n";
    $message .= "<p>If you have any questions, please don't hesitate to email me.</p>\n";
    $message .= "<p>Thank you,</p>\n<p>Todd Short<br/><a href=\"mailto:{$myemail}\">{$myemail}</a></p>\n";
    $message .= "<p>This email was sent to {$email}</p>\n";
    $message .= "\r\n\r\n--{$boundary}--\r\n\r\n";
    //$email = "*****@*****.**"; // TODO remove this!!
    $ret = mail($email, $subject, $message, $headers);
    if ($ret === FALSE) {
        print "Unable to send email!<br/>\n";
    }
}