Changeset 19058 for trunk/www


Ignore:
Timestamp:
07/18/18 00:09:04 (6 years ago)
Author:
Daniela Dorner
Message:
fixed small bugs, included sanity checks
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/dch/download.php

    r19047 r19058  
    1111</head>
    1212<body>
    13     <!--
    14     <hr>
    15     <p style='font-size:xx-large'> MAINTENANCE ONGOING </p>
    16     <p>check again in a few hours...</p>
    17     <p>
    18     <hr>
    19     <p>
    20     <p>
    21      -->
    2213<?php
     14
     15function print_popup($text)
     16{
     17    echo "<script type=\"text/javascript\" language=\"Javascript\">\n";
     18    echo "alert(\"".$text."\")\n";
     19    echo "</script>\n";
     20}
     21$maintenance=0;
     22//$maintenance=1;
     23
     24if ($maintenance)
     25{
     26    echo "<hr>\n <p style='font-size:xx-large'> MAINTENANCE ONGOING </p>\n";
     27    echo "<p>check again in a few hours...</p>\n<p>\n<hr>\n<p>\n<p>\n";
     28}
     29
    2330
    2431$tables=array(
     
    2835
    2936$times=array(
    30       "time"   => "timestamp",
     37      "timestamp"   => "timestamp",
    3138      "unix"   => "unixtime",
    3239      "mjd"   => "MJD",
     
    220227mysql_free_result($result);
    221228
     229if (strpos($email, "@")!= false && $source<0)
     230    print_popup("Please select a source.");
     231
     232if (strpos($email, "@")!= false && $time=="novalue")
     233    print_popup("Please select a time format.");
     234
     235if (strpos($email, "@")!= false && $timebin=="novalue")
     236    print_popup("Please select a time binning.");
     237
     238if (empty($email) && $time!="novalue" && $timebin!="novalue" && $source>0)
     239    print_popup("Please provide an email address.");
     240
     241
    222242if (strpos($email, "@")!= false && $source>0)
    223243{
    224244    echo "<h2>Sending data...</h2>\n";
    225     printf("Sent email to %s containing the data of %s from %d till %d for %s binning.<br>\n", $email, $sources[$source], $start, $stop, $timebins[$timebin]);
    226     //printf("Sending email to %s containing the data of %s from %d till %d for %s binning...<br>\n", $email, $sources[$source], $start, $stop, $timebins[$timebin]);
    227     //echo "<input class='Width' type='button' value='Reset' onClick='self.location.href=\"download.php";
    228     //if ($expert == "yes")
    229     //    echo "?expert=yes";
    230     //echo "\"'><br>\n";
    231     //echo $start." ".$stop." ".$source." ".$timebin." ".$email." ".$table." ".$time." ".$expert." ".$dch." ".$zd." ".$th." ".$light." ".$dust."<br>\n";
     245    //print_popup("Sent email to ".$email." containing the data of ".$sources[$source]." from ".$start." till ".$stop." for ".$timebins[$timebin]." binning.");
     246    print_popup("Email with data sent to ".$email);
     247    if ($maintenance)
     248        echo $start." ".$stop." ".$source." ".$timebin." ".$email." ".$table." ".$time." ".$expert." ".$dch." ".$zd." ".$th." ".$light." ".$dust."<br>\n";
    232249    $sent=shell_exec("/users/fact/SW.automatic.processing/DataCheck/Tools/get_data.sh ".$start." ".$stop." ".$source." ".$timebin." ".$email." ".$table." ".$time." ".$expert." ".$dch." ".$zd." ".$th." ".$light." ".$dust);
    233250    echo $sent;
     
    340357
    341358    //ZD
    342     echo "<select name='zdcut' size='1'>\n";
     359    echo "<select name='zd' size='1'>\n";
    343360    if ($zd == "novalue")
    344361        printf("<option value='novalue' selected>Select Zd-Cut</option>\n");
     
    355372
    356373    //TH
    357     echo "<select name='thcut' size='1'>\n";
     374    echo "<select name='th' size='1'>\n";
    358375    if ($th == "novalue")
    359376        printf("<option value='novalue' selected>Select Threshold-Cut</option>\n");
     
    376393    foreach ($lights as $key => $name)
    377394    {
    378         if ($lightt == $key)
     395        if ($light == $key)
    379396            printf("<option value='%s' selected>%s</option>\n", $key, $name);
    380397        else
     
    399416
    400417
    401 if ($expert="yes")
     418if ($expert=="yes")
    402419{
    403420    echo "<ul>\n";
Note: See TracChangeset for help on using the changeset viewer.