[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

How to make the form processor that will accept the value of multiple checkboxes?

Asked by evibesmusic in PHP and Databases, PHP Scripting Language

Tags: php, mysql

Experts,

I have created a table that places information from the db in each column.  In the loop that creates the table I have also added a checkbox that appears in the last column of each row.  I need to create a form processor that will allow the user to check each box that they would like to show up on another page.

For example, if they click on a check box next to report one, it will show up on page 1.  If they unclick the box, then it will not appear on page 1.  In addition, I need the boxes to remain checked if the value in the database is equal to Yes.  If the value is No, then the box should remain unchecked.  The default value in the database is No.

I have included my code which creates the table below.  Can anyone offer any starting points?

// CALL ALL REPORTS FROM THE DB AND ORDER THEM BY 'Name'
$sql2="SELECT * FROM controller_reports ORDER BY Name";
$data = mysql_query($sql2) or die ("Could not run query: " . $sql2 . "<br />\n" . mysql_error () );
            
// IF 'cmd' HAS NOT BEEN INITIALIZED, SHOW THE LIST OF CONTROLLERS IN MEMORY
if(!isset($_GET['cmd']))
{
      // 'cmd' HAS NOT BEEN INITIALIZED THERFORE SHOW THE LIST OF CONTROLLERS
      echo "Please select the report you would like to edit or delete.  
      Check the box next to each report you would like to appear on the 'Current' reports page.";
      echo "</br></br>";
      echo "<b>Note:</b> You can sort any column by clicking on the column's title.";
      echo "</br></br>";
      echo "PPR =  Pay Period Report";
      echo "<div align='center'>";
      echo "<form name='form' method='post' action='http://diablo.ca.kp.org/dept/controller/show_process.php'>";
      echo '<table id="myTable" width="100%" border="0" cellspacing="3" cellpadding="3" style="font-size:10px;">';
      echo '<thead>';
      echo '<tr><td colspan="8" align="right">
      <input name="submit" type="submit" value="go" style="margin-right:5px;" />
      </td></tr>';
      echo '<tr>';
      echo '<th><b><u>Report Name</u></b></th>';
      echo '<th><b><u>Year</u></b></th>';
      echo '<th><b><u>Month</u></b></th>';
      echo '<th><b><u>Date</u></b></th>';
      echo '<th><b><u>PPR</u></b></th>';
      echo '<th><b><u>PPR Desc.</u></b></th>';
      echo '<th><b><u>Action</u></b></th>';
      echo '<th><b><u>Show</u></b></th>';
      echo '</tr>';
      echo '</thead>';
      echo '<tbody>';
      
      // THIS SETS UP THE COLOR STYLE FOR EACH ROW, INSIDE THE WHILE LOOP WE WILL ASK THE COLORS TO ALTERNATE
      $style = 0;
      
      // THIS WHILE LOOP CREATES ROW AFTER ROW OF CONTROLLER UNTIL THERE ARE NO MORE CONTROLLERS TO LIST
      while ($getinfo2 = mysql_fetch_assoc($data)){
      
      //inside the loop change the class of the row/column
      //(based on a style sheet). you could also directly specify
      //a background colour here
            if($style == 1) {
             $tclass = "row1";
             $style = 0;
            } else {
             $tclass = "row2";
             $style = 1;
            }
      
            // GRAB THE UNIQUE 'id' OF EACH USER
            $id=$getinfo2["id"];//take out the id
            
            echo '
            <tr class="'.$tclass.'" style="padding-top:4px; padding-bottom:4px;">
            <td>'.$getinfo2['Name'].'</td>
            <td>'.$getinfo2['Year'].'</td>
            <td>'.$getinfo2['Month'].'</td>
            <td>'.$getinfo2['Date'].'</td>
            <td>'.$getinfo2['PayPeriod'].'</td>
            <td>'.$getinfo2['Ending'].'</td>
            <td>
            <a href="http://diablo.ca.kp.org/dept/controller/edit_report.php?cmd=edit&id='.$getinfo2['id'].'"
            title="Edit '.$getinfo2['Name'].' of: '.$getinfo2['Date'].'">Edit</a> -
            <a href="http://diablo.ca.kp.org/dept/controller/edit_report.php?cmd=delete&id='.$getinfo2['id'].'"
            ';
            
            // THIS ONCLICK EVENT GIVES YOU THE POP UP MESSAGE TO CONFIRM THAT YOU WANT TO DELETE THIS ACCOUNT
            echo'
            onclick="return confirm(&quot;Are you sure you would like to\nDELETE '.$getinfo2['Name'].' of: '.$getinfo2['Date'].'\n\nPlease click \'OK\' to delete or \'CANCEL\' to go back.&quot;)"
            title="Delete '.$getinfo2['Name'].' of: '.$getinfo2['Date'].'">Delete</a>
            </td>
            <td><input name="Show" type="checkbox" value="Yes" title="Checked = Yes | Unchecked = No" /></td>
            </tr>';
            
      }// END WHILE LOOP
// CLOSE THE TABLE
echo '</tbody>';
echo '<tr><td colspan="8" align="right">
<input name="submit" type="submit" value="go" style="margin-right:5px;" />
</td></tr>';
echo '</table>';
echo '</form>';
echo "</div>";
}
Attachments:
 
An example table to illustrate my question.
An example table to illustrate my question.
 
[+][-]11/06/09 05:30 PM, ID: 25764555Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/06/09 05:34 PM, ID: 25764563Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/06/09 05:35 PM, ID: 25764566Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/06/09 05:37 PM, ID: 25764568Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/06/09 05:44 PM, ID: 25764586Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/06/09 06:20 PM, ID: 25764707Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/06/09 06:57 PM, ID: 25764784Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/06/09 07:42 PM, ID: 25764884Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/07/09 08:50 AM, ID: 25766999Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/07/09 09:39 AM, ID: 25767191Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/07/09 10:11 AM, ID: 25767327Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/07/09 10:38 AM, ID: 25767474Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/07/09 12:11 PM, ID: 25767822Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: PHP and Databases, PHP Scripting Language
Tags: php, mysql
Sign Up Now!
Solution Provided By: elvin66
Participating Experts: 5
Solution Grade: A
 
[+][-]11/07/09 02:36 PM, ID: 25768403Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/09/09 10:55 AM, ID: 25778782Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/09/09 11:17 AM, ID: 25779018Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/09/09 12:20 PM, ID: 25779581Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/09/09 12:37 PM, ID: 25779752Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/09/09 12:50 PM, ID: 25779903Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/09/09 12:55 PM, ID: 25779957Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/09/09 02:19 PM, ID: 25780741Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/09/09 02:27 PM, ID: 25780813Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/09/09 02:39 PM, ID: 25780906Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/09/09 03:42 PM, ID: 25781246Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/09/09 03:42 PM, ID: 25781249Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]11/10/09 10:39 AM, ID: 25788298Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/10/09 02:24 PM, ID: 25790565Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625