2014-09-22 5 views
0

페이지를 처음로드 할 때 날짜 및 요일 요소 아래의 모든 항목이 보이지 않거나 액세스 할 수 없도록하려는 경우. 그러나 페이지의 날짜 부분에서 week 요소에서 week를 선택하면 나머지 페이지 전체가 자동으로 생성됩니다.요소가 선택 될 때 html로 페이지 세그먼트를 생성하는 방법

나는 이것이 아마 자바 스크립트와 관련되어 있다는 것을 알고 있지만 그 이외에는 정말로 모른다.

Webpage

<!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 = '[email protected]'; 
     $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 <[email protected]>"; 
     $headers[] = "From: $name <$email_from>"; 
     $headers[] = "Cc: Peggy <[email protected]>"; 
     $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> 
+0

[jquery] (http://api.jquery.com/)를 사용하여 click 이벤트를 catch 한 다음 나중에 $ ('div_with_you_dates')를 사용하십시오. –

+0

"클릭 이벤트를 잡는 방법"에 대해 좀 더 구체적으로 설명 할 수 있습니까 날짜 요소의 onchange 부분에서 jquery 스크립트를 실행한다는 것을 알고 있지만 그 외 ... –

답변

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

경우 하위 당신 DIV 때마다 주 변화를 원하는 데이터를 생성하고 표시하려면 자바 스크립트 호출을 할 것이다.