0

我希望它在页面首次加载时,日期和星期元素下方的所有内容都不可见或不可访问;但是当我从页面日期部分的周元素中选择周时,页面的整个其余部分会自动生成。

我知道这可能涉及javascript,但除此之外我真的不知道。

网页

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<style type="text/css">
<!--
.style1 {
    font-size: 12px;
    font-weight: bold;
}
-->
</style>

</head>
<body>

<div id="pageContainer">

    <br class="clearfloat">
    <div id="contentArea">

        <div id="backgroundLines">
            <div id="mainContentAdmin">
                <div style="width: 830px;text-align: center;">
                    <div style="margin: 0px auto; width: 280px;">
                        <div class="contentdiv">

                            <div id="pageContainer">
                                <div id="header">

                                    <!--Header-->
                                    <h1 style="text-align:left;">After Action Report</h1>

     </div>                 
     <br class="clearfloat">

     <div id="contentArea">

        <?php 
        if (!isset($_POST["btn_submit"])) {
            ?>

            <form action="<?php echo $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data" method="post" id="FileUploader">

                <table border="0" cellpadding="4" cellspacing="2" width="500">
                    <tbody>

                        <!--Name text box-->
                        <tr>
                            <td align="left">First and Last Name</td>
                            <td align="left">
                                <input type="text" name="name" id="name">
                            </td>
                        </tr>

                        <!--Email text box-->
                        <tr>
                            <td align="left">Email Address</td>
                            <td align="left">
                                <input type="text" name="email" id="email">
                            </td>
                        </tr>

                        <!--Date calendar (user chooses first monday of the week-->
                        <tr>
                            <td align="left">Date</td>
                            <td align="left">
                                <input type="week" name="week" id="week">
                            </td>
                        </tr>           
                        <br>
                        <h2 style="text-align:left">Weekly Report</h2>


                        <!--Shift Drop Down Box (Monday)-->
                        <tr>
                            <td align="left"><b>Monday</b> (AUTO DATE)</td>
                            <td align="left">

                                <select name="mondayShift" id="mondayShift" 
                                onchange=
                                "if (this.value=='1' || this.value=='3' || this.value=='5' || this.value=='8' || this.value=='9' || this.value=='10' || this.value=='11' || this.value=='12'){
                                this.form['ddSTBM'].style.display='none'
                                this.form['ddLTBM'].style.display='inline'
                            }
                            if (this.value=='2' || this.value=='7'){
                            this.form['ddSTBM'].style.display='none'
                            this.form['ddLTBM'].style.display='none'
                        }
                        if (this.value=='4' || this.value=='6'){
                        this.form['ddSTBM'].style.display='inline'
                        this.form['ddLTBM'].style.display='none'
                    }                                 
                    ">    
                    <option selected disabled hidden value=''></option>
                    <option value="1">In Office</option><!--Generates large text box-->     
                    <option value="2">Not Scheduled</option>          
                    <option value="3">Worked Remotely</option><!--Generates large text box-->
                    <option value="4">On Call (Not called in)</option><!--Generates small text box-->   
                    <option value="5">On Call (Called in)</option><!--Generates large text box-->
                    <option value="6">Holiday</option><!--Generates small text box--> 
                    <option value="7">Unpaid Time Off-Approved</option>
                    <option value="8">Unpaid Time Off-Extreme Circumstances</option><!--Generates large text box-->
                    <option value="9">Sick</option><!--Generates large text box-->
                    <option value="10">Suspended</option><!--Generates large text box-->
                    <option value="11">No Show</option><!--Generates large text box-->
                    <option value="12">No Call/No Show</option> <!--Generates large text box-->
                </select>
            </td>
        </tr>

<!--Dropdown Small Text Box (Monday)-->
<tr>
    <td align="left">
        <input type="text" name="ddSTBM" id="ddSTBM" style="display: none;">
    </td>
</tr>

<!--Dropdown Large Text Box (Monday)-->
<tr>
    <td align = "right">
        <textarea rows="10" cols="50" name="ddLTBM" id="ddLTBM" style="display: none;">
</textarea>
    </td>
</tr>

<!--Shift Drop Down Box (Tuesday)-->
<tr>
    <td align="left"><b>Tuesday</b> (AUTO DATE)</td>
    <td align="left">
        <select name="tuesdayShift" id="tuesdayShift" 
        onchange=
        "if (this.value=='1' || this.value=='3' || this.value=='5' || this.value=='8' || this.value=='9' || this.value=='10' || this.value=='11' || this.value=='12'){
        this.form['ddSTBT'].style.display='none'
        this.form['ddLTBT'].style.display='inline'
    }
    if (this.value=='2' || this.value=='7'){
    this.form['ddSTBT'].style.display='none'
    this.form['ddLTBT'].style.display='none'
}
if (this.value=='4' || this.value=='6'){
this.form['ddSTBT'].style.display='inline'
this.form['ddLTBT'].style.display='none'
}                                 
">    
<option selected disabled hidden value=''></option>
<option value="1">In Office</option><!--Generates large text box-->     
<option value="2">Not Scheduled</option>          
<option value="3">Worked Remotely</option><!--Generates large text box-->
<option value="4">On Call (Not called in)</option><!--Generates small text box-->   
<option value="5">On Call (Called in)</option><!--Generates large text box-->
<option value="6">Holiday</option><!--Generates small text box--> 
<option value="7">Unpaid Time Off-Approved</option>
<option value="8">Unpaid Time Off-Extreme Circumstances</option><!--Generates large text box-->
<option value="9">Sick</option><!--Generates large text box-->
<option value="10">Suspended</option><!--Generates large text box-->
<option value="11">No Show</option><!--Generates large text box-->
<option value="12">No Call/No Show</option> <!--Generates large text box-->
</select>
</td>
</tr>

<!--Dropdown Small Text Box (Tuesday)-->
<tr>
    <td align="left">
        <input type="text" name="ddSTBT" id="ddSTBT" style="display: none;">
    </td>
</tr>

<!--Dropdown Large Text Box (Tuesday)-->
<tr>
    <td align = "right">
        <textarea rows="10" cols="50" name="ddLTBT" id="ddLTBT" style="display: none;">
</textarea>
    </td>
</tr>

<!--Shift Drop Down Box (Wednesday)-->
<tr>
    <td align="left"><b>Wednesday</b> (AUTO DATE)</td>
    <td align="left">
        <select name="wednesdayShift" id="wednesdayShift" 
        onchange=
        "if (this.value=='1' || this.value=='3' || this.value=='5' || this.value=='8' || this.value=='9' || this.value=='10' || this.value=='11' || this.value=='12'){
        this.form['ddSTBW'].style.display='none'
        this.form['ddLTBW'].style.display='inline'
    }
    if (this.value=='2' || this.value=='7'){
    this.form['ddSTBW'].style.display='none'
    this.form['ddLTBW'].style.display='none'
}
if (this.value=='4' || this.value=='6'){
this.form['ddSTBW'].style.display='inline'
this.form['ddLTBW'].style.display='none'
}                                 
">    
<option selected disabled hidden value=''></option>
<option value="1">In Office</option><!--Generates large text box-->     
<option value="2">Not Scheduled</option>          
<option value="3">Worked Remotely</option><!--Generates large text box-->
<option value="4">On Call (Not called in)</option><!--Generates small text box-->   
<option value="5">On Call (Called in)</option><!--Generates large text box-->
<option value="6">Holiday</option><!--Generates small text box--> 
<option value="7">Unpaid Time Off-Approved</option>
<option value="8">Unpaid Time Off-Extreme Circumstances</option><!--Generates large text box-->
<option value="9">Sick</option><!--Generates large text box-->
<option value="10">Suspended</option><!--Generates large text box-->
<option value="11">No Show</option><!--Generates large text box-->
<option value="12">No Call/No Show</option> <!--Generates large text box-->
</select>
</td>
</tr>

<!--Dropdown Small Text Box (Wednesday)-->
<tr>
    <td align="left">
        <input type="text" name="ddSTBW" id="ddSTBW" style="display: none;">
    </td>
</tr>

<!--Dropdown Large Text Box (Wednesday)-->
<tr>
    <td align = "right">
        <textarea rows="10" cols="50" name="ddLTBW" id="ddLTBW" style="display: none;">
</textarea>
    </td>
</tr>

<!--Shift Drop Down Box (Thursday)-->
<tr>
    <td align="left"><b>Thursday</b> (AUTO DATE)</td>
    <td align="left">
    <select name="thursdayShift" id="thursdayShift" 
    onchange=
    "if (this.value=='1' || this.value=='3' || this.value=='5' || this.value=='8' || this.value=='9' || this.value=='10' || this.value=='11' || this.value=='12'){
    this.form['ddSTBTR'].style.display='none'
    this.form['ddLTBTR'].style.display='inline'
}
if (this.value=='2' || this.value=='7'){
this.form['ddSTBTR'].style.display='none'
this.form['ddLTBTR'].style.display='none'
}
if (this.value=='4' || this.value=='6'){  
this.form['ddSTBTR'].style.display='inline'
this.form['ddLTBTR'].style.display='none'
}                                 
">    
<option selected disabled hidden value=''></option>
<option value="1">In Office</option><!--Generates large text box-->     
<option value="2">Not Scheduled</option>          
<option value="3">Worked Remotely</option><!--Generates large text box-->
<option value="4">On Call (Not called in)</option><!--Generates small text box-->   
<option value="5">On Call (Called in)</option><!--Generates large text box-->
<option value="6">Holiday</option><!--Generates small text box--> 
<option value="7">Unpaid Time Off-Approved</option>
<option value="8">Unpaid Time Off-Extreme Circumstances</option><!--Generates large text box-->
<option value="9">Sick</option><!--Generates large text box-->
<option value="10">Suspended</option><!--Generates large text box-->
<option value="11">No Show</option><!--Generates large text box-->
<option value="12">No Call/No Show</option> <!--Generates large text box-->
</select>
</td>
</tr>

<!--Dropdown Small Text Box (Thursday)-->
<tr>
    <td align="left">
        <input type="text" name="ddSTBTR" id="ddSTBTR" style="display: none;">
    </td>
</tr>

<!--Dropdown Large Text Box (Thursday)-->
<tr>
    <td align = "right">
        <textarea rows="10" cols="50" name="ddLTBTR" id="ddLTBTR" style="display: none;">
</textarea>
    </td>
</tr>
<!--Shift Drop Down Box (Friday)-->
<tr>
    <td align="left"><b>Friday</b> (AUTO DATE)</td>
    <td align="left">
        <select name="fridayShift" id="fridayShift" 
        onchange=
        "if (this.value=='1' || this.value=='3' || this.value=='5' || this.value=='8' || this.value=='9' || this.value=='10' || this.value=='11' || this.value=='12'){
        this.form['ddSTBF'].style.display='none'
        this.form['ddLTBF'].style.display='inline'
    }
    if (this.value=='2' || this.value=='7'){
    this.form['ddSTBF'].style.display='none'
    this.form['ddLTBF'].style.display='none'
}
if (this.value=='4' || this.value=='6'){
this.form['ddSTBF'].style.display='inline'
this.form['ddLTBF'].style.display='none'
}                                 
">    
<option selected disabled hidden value=''></option>
<option value="1">In Office</option><!--Generates large text box-->     
<option value="2">Not Scheduled</option>          
<option value="3">Worked Remotely</option><!--Generates large text box-->
<option value="4">On Call (Not called in)</option><!--Generates small text box-->   
<option value="5">On Call (Called in)</option><!--Generates large text box-->
<option value="6">Holiday</option><!--Generates small text box--> 
<option value="7">Unpaid Time Off-Approved</option>
<option value="8">Unpaid Time Off-Extreme Circumstances</option><!--Generates large text box-->
<option value="9">Sick</option><!--Generates large text box-->
<option value="10">Suspended</option><!--Generates large text box-->
<option value="11">No Show</option><!--Generates large text box-->
<option value="12">No Call/No Show</option> <!--Generates large text box-->
</select>
</td>
</tr>



<!--Dropdown Small Text Box (Friday)-->
<tr>
<td align="left">
    <input type="text" name="ddSTBF" id="ddSTBF" style="display: none;">
</td>
</tr>

<!--Dropdown Large Text Box (Friday)-->
<tr>
    <td align = "right">
        <textarea rows="10" cols="50" name="ddLTBF" Box id="ddLTBF" style="display: none;">
</textarea>
    </td>
</tr>
<!--Shift Drop Down Box (Saturday)-->
<tr>
    <td align="left"><b>Saturday</b> (AUTO DATE)</td>
    <td align="left">
        <select name="saturdayShift" id="saturdayShift" 
        onchange=
        "if (this.value=='1' || this.value=='3' || this.value=='5' || this.value=='8' || this.value=='9' || this.value=='10' || this.value=='11' || this.value=='12'){
        this.form['ddSTBSA'].style.display='none'
        this.form['ddLTBSA'].style.display='inline'
    }
    if (this.value=='2' || this.value=='7'){
    this.form['ddSTBSA'].style.display='none'
    this.form['ddLTBSA'].style.display='none'
}
if (this.value=='4' || this.value=='6'){
this.form['ddSTBSA'].style.display='inline'
this.form['ddLTBSA'].style.display='none'
}                                 
">    
<option selected disabled hidden value=''></option>
<option value="1">In Office</option><!--Generates large text box-->     
<option value="2">Not Scheduled</option>          
<option value="3">Worked Remotely</option><!--Generates large text box-->
<option value="4">On Call (Not called in)</option><!--Generates small text box-->   
<option value="5">On Call (Called in)</option><!--Generates large text box-->
<option value="6">Holiday</option><!--Generates small text box--> 
<option value="7">Unpaid Time Off-Approved</option>
<option value="8">Unpaid Time Off-Extreme Circumstances</option><!--Generates large text box-->
<option value="9">Sick</option><!--Generates large text box-->
<option value="10">Suspended</option><!--Generates large text box-->
<option value="11">No Show</option><!--Generates large text box-->
<option value="12">No Call/No Show</option> <!--Generates large text box-->
</select>
</td>
</tr>

<!--Dropdown Small Text Box (Saturday)-->
<tr>
    <td align="left">
        <input type="text" name="ddSTBSA" id="ddSTBSA" style="display: none;">
    </td>
</tr>

<!--Dropdown Large Text Box (Saturday)-->
<tr>
    <td align = "right">
        <textarea rows="10" cols="50" name="ddLTBSA" id="ddLTBSA" style="display: none;">
</textarea>
    </td>
</tr>
<!--Shift Drop Down Box (Sunday)-->
<tr>
    <td align="left"><b>Sunday</b> (AUTO DATE)</td>
    <td align="left">
        <select name="sundayShift" id="sundayShift" 
        onchange=
        "if (this.value=='1' || this.value=='3' || this.value=='5' || this.value=='8' || this.value=='9' || this.value=='10' || this.value=='11' || this.value=='12'){
        this.form['ddSTBSU'].style.display='none'
        this.form['ddLTBSU'].style.display='inline'
    }
    if (this.value=='2' || this.value=='7'){
    this.form['ddSTBSU'].style.display='none'
    this.form['ddLTBSU'].style.display='none'
}
if (this.value=='4' || this.value=='6'){
this.form['ddSTBSU'].style.display='inline'
this.form['ddLTBSU'].style.display='none'
}                                 
">    
<option selected disabled hidden value=''></option>
<option value="1">In Office</option><!--Generates large text box-->     
<option value="2">Not Scheduled</option>          
<option value="3">Worked Remotely</option><!--Generates large text box-->
<option value="4">On Call (Not called in)</option><!--Generates small text box-->   
<option value="5">On Call (Called in)</option><!--Generates large text box-->
<option value="6">Holiday</option><!--Generates small text box--> 
<option value="7">Unpaid Time Off-Approved</option>
<option value="8">Unpaid Time Off-Extreme Circumstances</option><!--Generates large text box-->
<option value="9">Sick</option><!--Generates large text box-->
<option value="10">Suspended</option><!--Generates large text box-->
<option value="11">No Show</option><!--Generates large text box-->
<option value="12">No Call/No Show</option> <!--Generates large text box-->
</select>
</td>
</tr>

<!--Dropdown Small Text Box (Sunday)-->
<tr>
    <td align="left">
        <input type="text" name="ddSTBSU" id="ddSTBSU" style="display: none;">
    </td>
</tr>

<!--Dropdown Large Text Box (Sunday)-->
<tr>
    <td align = "right">
        <textarea rows="10" cols="50" name="ddLTBSU" id="ddLTBSU" style="display: none;">
</textarea>
    </td>
</tr>
<tr>

<!--Troubled Areas Large Text Box-->
<tr>
    <td align = "left">
        <h2 style="text-align:left">Troubled Areas</h2>
        <textarea rows="10" cols="50" name="problems" id="problems">Explain any issues that occurred here</textarea>
    </td>
</tr>       

<!--Improvement Large Text Box-->
<tr>
    <td align = "left">
        <h2 style="text-align:left">Improvement</h2>
        <textarea rows="10" cols="50" name="improvement" id="improvement">Explain what you want to do better here</textarea>
    </td>
</tr>       

<!--Submit button-->
<tr>
    <td align = "left;">
        <input type="submit" name="btn_submit" id="btn_submit" style="width:300px; height:50px; font:bold 25px Venetian" value="Submit Report" >
    </td>
</tr>
</tbody></table>
</form><br>

<?php           
     } else {  // the user has submitted the form
        if( isset($_POST['btn_submit']) ) {

            $name = $_POST['name'];
            $email = $_POST['email'];
            $week = $_POST['week'];

           $mondayShift = $_POST['mondayShift'];
           $ddSTBM = $_POST['ddSTBM'];
           $ddLTBM = $_POST['ddLTBM'];

            if($mondayShift == 1){
            $mondayShift = "In Office";
            }
            if($mondayShift == 2){
            $mondayShift = "Not Scheduled";
            }
            if($mondayShift == 3){
            $mondayShift = "Worked Remotely";
            }
            if($mondayShift == 4){
            $mondayShift = "On Call (Not Called in)";
            }
            if($mondayShift == 5){
            $mondayShift = "On Call (Called in)";
            }   
            if($mondayShift == 6){
            $mondayShift = "Holiday";
            }
            if($mondayShift == 7){
            $mondayShift = "Unpaid Time Off-Approved";
            }
            if($mondayShift == 8){
            $mondayShift = "Unpaid Time Off-Extreme Circumstances";
            }
            if($mondayShift == 9){
            $mondayShift = "Sick";
            }
            if($mondayShift == 10){
            $mondayShift = "Suspended";
            }
            if($mondayShift == 11){
            $mondayShift = "No Show";
            }
            if($mondayShift == 12){
            $mondayShift = "No Call/No Show";
            }

        $tuesdayShift = $_POST['tuesdayShift'];
        $ddSTBT = $_POST['ddSTBT'];
        $ddLTBT = $_POST['ddLTBT'];

            if($tuesdayShift == 1){
            $tuesdayShift = "In Office";
            }
            if($tuesdayShift == 2){
            $tuesdayShift = "Not Scheduled";
            }
            if($tuesdayShift == 3){
            $tuesdayShift = "Worked Remotely";
            }
            if($tuesdayShift == 4){
            $tuesdayShift = "On Call (Not Called in)";
            }
            if($tuesdayShift == 5){
            $tuesdayShift = "On Call (Called in)";
            }   
            if($tuesdayShift == 6){
            $tuesdayShift = "Holiday";
            }
            if($tuesdayShift == 7){
            $tuesdayShift = "Unpaid Time Off-Approved";
            }
            if($tuesdayShift == 8){
            $tuesdayShift = "Unpaid Time Off-Extreme Circumstances";
            }
            if($tuesdayShift == 9){
            $tuesdayShift = "Sick";
            }
            if($tuesdayShift == 10){
            $tuesdayShift = "Suspended";
            }
            if($tuesdayShift == 11){
            $tuesdayShift = "No Show";
            }
            if($tuesdayShift == 12){
            $tuesdayShift = "No Call/No Show";
            }

        $wednesdayShift = $_POST['wednesdayShift'];
        $ddSTBW = $_POST['ddSTBW'];
        $ddLTBW = $_POST['ddLTBW'];

            if($wednesdayShift == 1){
            $wednesdayShift = "In Office";
            }
            if($wednesdayShift == 2){
            $wednesdayShift = "Not Scheduled";
            }
            if($wednesdayShift == 3){
            $wednesdayShift = "Worked Remotely";
            }
            if($wednesdayShift == 4){
            $wednesdayShift = "On Call (Not Called in)";
            }
            if($wednesdayShift == 5){
            $wednesdayShift = "On Call (Called in)";
            }   
            if($wednesdayShift == 6){
            $wednesdayShift = "Holiday";
            }
            if($wednesdayShift == 7){
            $wednesdayShift = "Unpaid Time Off-Approved";
            }
            if($wednesdayShift == 8){
            $wednesdayShift = "Unpaid Time Off-Extreme Circumstances";
            }
            if($wednesdayShift == 9){
            $wednesdayShift = "Sick";
            }
            if($wednesdayShift == 10){
            $wednesdayShift = "Suspended";
            }
            if($wednesdayShift == 11){
            $wednesdayShift = "No Show";
            }
            if($wednesdayShift == 12){
            $wednesdayShift = "No Call/No Show";
            }

        $thursdayShift = $_POST['thursdayShift'];
        $ddSTBTR = $_POST['ddSTBTR'];
        $ddLTBTR = $_POST['ddLTBTR'];

            if($thursdayShift == 1){
            $thursdayShift = "In Office";
            }
            if($thursdayShift == 2){
            $thursdayShift = "Not Scheduled";
            }
            if($thursdayShift == 3){
            $thursdayShift = "Worked Remotely";
            }
            if($thursdayShift == 4){
            $thursdayShift = "On Call (Not Called in)";
            }
            if($thursdayShift == 5){
            $thursdayShift = "On Call (Called in)";
            }   
            if($thursdayShift == 6){
            $thursdayShift = "Holiday";
            }
            if($thursdayShift == 7){
            $thursdayShift = "Unpaid Time Off-Approved";
            }
            if($thursdayShift == 8){
            $thursdayShift = "Unpaid Time Off-Extreme Circumstances";
            }
            if($thursdayShift == 9){
            $thursdayShift = "Sick";
            }
            if($thursdayShift == 10){
            $thursdayShift = "Suspended";
            }
            if($thursdayShift == 11){
            $thursdayShift = "No Show";
            }
            if($thursdayShift == 12){
            $thursdayShift = "No Call/No Show";
            }

        $fridayShift = $_POST['fridayShift'];
        $ddSTBF = $_POST['ddSTBF'];
        $ddLTBF = $_POST['ddLTBF'];

            if($fridayShift == 1){
            $fridayShift = "In Office";
            }
            if($fridayShift == 2){
            $fridayShift = "Not Scheduled";
            }
            if($fridayShift == 3){
            $fridayShift = "Worked Remotely";
            }
            if($fridayShift == 4){
            $fridayShift = "On Call (Not Called in)";
            }
            if($fridayShift == 5){
            $fridayShift = "On Call (Called in)";
            }   
            if($fridayShift == 6){
            $fridayShift = "Holiday";
            }
            if($fridayShift == 7){
            $fridayShift = "Unpaid Time Off-Approved";
            }
            if($fridayShift == 8){
            $fridayShift = "Unpaid Time Off-Extreme Circumstances";
            }
            if($fridayShift == 9){
            $fridayShift = "Sick";
            }
            if($fridayShift == 10){
            $fridayShift = "Suspended";
            }
            if($fridayShift == 11){
            $fridayShift = "No Show";
            }
            if($fridayShift == 12){
            $fridayShift = "No Call/No Show";
            }

        $saturdayShift = $_POST['saturdayShift'];
        $ddSTBSA = $_POST['ddSTBSA'];
        $ddLTBSA = $_POST['ddLTBSA'];

            if($saturdayShift == 1){
            $saturdayShift = "In Office";
            }
            if($saturdayShift == 2){
            $saturdayShift = "Not Scheduled";
            }
            if($saturdayShift == 3){
            $saturdayShift = "Worked Remotely";
            }
            if($saturdayShift == 4){
            $saturdayShift = "On Call (Not Called in)";
            }
            if($saturdayShift == 5){
            $saturdayShift = "On Call (Called in)";
            }   
            if($saturdayShift == 6){
            $saturdayShift = "Holiday";
            }
            if($saturdayShift == 7){
            $saturdayShift = "Unpaid Time Off-Approved";
            }
            if($saturdayShift == 8){
            $saturdayShift = "Unpaid Time Off-Extreme Circumstances";
            }
            if($saturdayShift == 9){
            $saturdayShift = "Sick";
            }
            if($saturdayShift == 10){
            $saturdayShift = "Suspended";
            }
            if($saturdayShift == 11){
            $saturdayShift = "No Show";
            }
            if($saturdayShift == 12){
            $saturdayShift = "No Call/No Show";
            }

        $sundayShift = $_POST['sundayShift'];
        $ddSTBSU = $_POST['ddSTBSU'];
        $ddLTBSU = $_POST['ddLTBSU'];

            if($sundayShift == 1){
            $sundayShift = "In Office";
            }
            if($sundayShift == 2){
            $sundayShift = "Not Scheduled";
            }
            if($sundayShift == 3){
            $sundayShift = "Worked Remotely";
            }
            if($sundayShift == 4){
            $sundayShift = "On Call (Not Called in)";
            }
            if($sundayShift == 5){
            $sundayShift = "On Call (Called in)";
            }   
            if($sundayShift == 6){
            $sundayShift = "Holiday";
            }
            if($sundayShift == 7){
            $sundayShift = "Unpaid Time Off-Approved";
            }
            if($sundayShift == 8){
            $sundayShift = "Unpaid Time Off-Extreme Circumstances";
            }
            if($sundayShift == 9){
            $sundayShift = "Sick";
            }
            if($sundayShift == 10){
            $sundayShift = "Suspended";
            }
            if($sundayShift == 11){
            $sundayShift = "No Show";
            }
            if($sundayShift == 12){
            $sundayShift = "No Call/No Show";
            }

        $problems = $_POST['problems'];
        $improvement = $_POST['improvement'];

        $email_from = $_POST['email'];
        $to = 'th3on3fr33man@gmail.com';
        $email_subject = "$name's AAR";
        $email_body =  "<html>
                        <head>
                            <title>After Action Report for the week of $week</title>
                        </head>
                        <body>
                        <header>
                            <h1>After Action Report for the week of $week</h1> 
                        </header>
                        <tr>
                            <td>
                                <h2>Weekly Report</h2>
                                    <p style = padding-left: 5em>
                                        <b>Shift Type:</b> <i>$mondayShift.</i> <br><br>$ddSTBM$ddLTBM<br><br>
                                        <b>Shift Type:</b> <i>$tuesdayShift.</i> <br><br>$ddSTBT$ddLTBT<br><br>
                                        <b>Shift Type:</b> <i>$wednesdayShift.</i> <br><br>$ddSTBW$ddLTBW<br><br>
                                        <b>Shift Type:</b> <i>$thursdayShift.</i> <br><br>$ddSTBTR$ddLTBTR<br><br>
                                        <b>Shift Type:</b> <i>$fridayShift.</i> <br><br>$ddSTBF$ddLTBF<br><br>
                                        <b>Shift Type:</b> <i>$saturdayShift.</i> <br><br>$ddSTBSA$ddLTBSA<br><br>
                                        <b>Shift Type:</b> <i>$sundayShift.</i> <br><br>$ddSTBSU$ddLTBSU<br><br>
                                    </p>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <h2>Troubled Areas</h2> 
                                    <p style = padding-left: 5em>
                                        $problems<br>
                                    </p>
                            </td>
                        </tr>
                        <tr>    
                            <td>
                                <h2>Improvement</h2> 
                                    <p style = padding-left: 5em>
                                        $improvement<br>
                                    </p>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <p>
                                    Regards,<br><br>
                                    $name
                                </p>
                            </td>
                        </tr>
                    </body>
                    </html>";

        $headers = array();
        $headers[] = "MIME-Version: 1.0";
        $headers[] = "Content-type: text/html; charset=iso-8859-1";
        $headers[] = "To: Michael <th3on3fr33man@gmail.com>";
        $headers[] = "From: $name <$email_from>"; 
        $headers[] = "Cc: Peggy <dexter.morrigan@gmail.com>";
        $headers[] = "Reply-To: $name <$email_from>";
        $headers[] = "Subject: {$email_subject}";
        $headers[] = "X-Mailer: PHP/".phpversion();

        mail($to,$email_subject,$email_body,implode("\r\n", $headers));
    }
 }
 ?>
 <br class="clearfloat">

 Copyright &copy; <script language="javascript" type="text/javascript">
 var today = new Date()
 var year = today.getFullYear()
 document.write(year)
 </script>
4

1 回答 1

0
      <input type="week" onchange="sub();" name="week" id="week">

sub 将是您的 javascript 调用,用于在每周更改时在 DIV 中创建和显示您想要的数据。

于 2014-09-22T16:35:29.187 回答