Hi,
I have this site where user submits their questions and based on the quality I select or reject them. IF the user's submitted qn is selected he get +1 points for 1 questions otherwise none.
But in my admin panel when I get a questions, due to the radio button I can select/reject only one question at a time. It takes me a lot of time since everyday people submit a lot of question. So I want to change the "radio option" to "checkbox option" in the code so that I can select/reject multiple question at once. I have pasted the code. Any help would be really appreciated. IF I am at the wrong forums, could you please suggest me the right place. thanks a lot.
<body>
<?php
print_r($POST);
//if( isset($REQUEST['hdnAcceptSubmit']) ){
if( isset($_SESSION['user']['email'] ) ){
$counter=0;
?>
<div class="formHeading">List of Questions need to Accept / Reject</div><br/><br/>
<!--<form id="frmAccept" onsubmit="postHTML('mainContent','accept.php', 'frmAccept' )" >-->
<form id="frmAccept" method="post" action="process.php" name="frmAccept">
<div id="topScores">
<div class="header row" style="background-color: <?=($counter%2 == 0)?"#CBD48F": "#CBD481"?>; line-height: 18px; float:left; width:10px;">#</div>
<div class="header row" style="background-color: <?=($counter%2 == 0)?"#CBD48F": "#CBD481"?>; line-height: 18px; float:left; width: 55px;">Name</div>
<div class="header row" style="background-color: <?=($counter%2 == 0)?"#CBD48F": "#CBD481"?>; line-height: 18px; float:left; width: 55px;">Question</div>
<div class="header row" style="background-color: <?=($counter%2 == 0)?"#CBD48F": "#CBD481"?>; line-height: 18px; float:left; width: 75px;">Answer </div>
<div class="header row" style="background-color: <?=($counter%2 == 0)?"#CBD48F": "#CBD481"?>; line-height: 18px; float:left; width: 95px;">Option 1</div>
<div class="header row" style="background-color: <?=($counter%2 == 0)?"#CBD48F": "#CBD481"?>; line-height: 18px; float:left; width: 65px;">Option 2</div>
<div class="header row" style="background-color: <?=($counter%2 == 0)?"#CBD48F": "#CBD481"?>; line-height: 18px; float:left; width: 65px;">Option 3</div>
<br style="clear:both;"/>
<?
$db->connect();
$counter = 1;
$totalpoints = new User();
$sql = "SELECT U.first_name,Q.question,Q.answer,Q.opt_1,Q.opt_2,Q .opt_3,Q.enabled,Q.question_id,Q.user_id FROM ".$db->pre."quiz_questions Q,".$db->pre."quiz_users U WHERE Q.enabled = 0 and Q.user_id = U.user_id";
$results = $db->query($sql);
while ($user = $db->fetch_array($results) ) {
?>
<div class="row" style="background-color: <?=($counter%2 == 0)?"#CBD48F": "#CBD481"?>; line-height: 18px; float:left; width: 10px; padding-top:5px;">
<input type="radio" name="group1" value="<?=$user['question_id']?>" align="absmiddle" /></div>
<input type="hidden" name="<?=$user['question_id']?>" id="<?=$user['question_id']?>" value="<?=$user['user_id']?>" />
<div class="row" style="background-color: <?=($counter%2 == 0)?"#CBD48F": "#CBD4FF"?>; line-height: 18px; float:left; width: 55px;"><?=$user['first_name']?></div>
<div class="row" style="background-color: <?=($counter%2 == 0)?"#CBD48F": "#CBD4FF"?>; line-height: 18px; float:left; width: 55px;"><?=$user['question']?></div>
<div class="row" style="background-color: <?=($counter%2 == 0)?"#CBD48F": "#CBD4FF"?>; line-height: 18px; float:left; width: 75px;"><?=$user['answer']?></div>
<div class="row" style="background-color: <?=($counter%2 == 0)?"#CBD48F": "#CBD4FF"?>; line-height: 18px; float:left; width: 95px;"><?=$user['opt_1']?></div>
<div class="row" style="background-color: <?=($counter%2 == 0)?"#CBD48F": "#CBD4FF"?>; line-height: 18px; float:left; width: 65px;"><?=$user['opt_2']?></div>
<div class="row" style="background-color: <?=($counter%2 == 0)?"#CBD48F": "#CBD4FF"?>; line-height: 18px; float:left; width: 65px;"><?=$user['opt_3']?></div>
<br style="clear:both;"/>
<?
$counter++;
}
//$db->close();
?>
<input type="submit" class="button" style="margin-left: 65px; margin-top: 15px;" value="Accept" id="btnaccept" name="btnaccept" />
<input type="submit" class="button" style="margin-left: 65px; margin-top: 15px;" value="Reject" id="btnreject" name="btnreject"/>
<!-- <input type="hidden" id="hdnAcceptSubmit" name="hdnAcceptSubmit" value="true"/> -->
</div>
</form>
<? } else {?>
<div class="header">Please login to View the Submitted Questions<br/></div>
<?
}
?>
</body>
</html>