session_start();
include_once('../include/header_functions.php');
show_header("Edit Survey for $session_client_name - $session_job_name");
show_job_header();
require_once('../Connections/connection.php');
function display_all_questions_for_category($cat_id){
global $connection;
// building the query
$query = "SELECT * FROM tbl_questions WHERE ";
for ($i=1; $i <= $cat_id; $i++){
if ($i < $cat_id){
$query .= ( "category_" . $i . " = 0 AND ");
}
else {
$query .= ( "category_" . $i . " = 1");
}
}//end of the for loop
//end of building the query
// now get all the questions that should be displayed under that category, using the query we built
$result2 = mysql_query($query, $connection) or die("could not query tbl_questions
" . mysql_error());
// print the question and the categories associated with it
while ($row2 = mysql_fetch_array($result2)){
$question_id = $row2['question_id'];
$question_text = $row2['question_text'];
$cat_1 = $row2['category_1'];
$cat_2 = $row2['category_2'];
$cat_3 = $row2['category_3'];
$cat_4 = $row2['category_4'];
$cat_5 = $row2['category_5'];
$cat_6 = $row2['category_6'];
$cat_7 = $row2['category_7'];
$cats_to_display = "";
if ($cat_1){
$cats_to_display .= "1 ";
}
if ($cat_2){
$cats_to_display .= "2 ";
}
if ($cat_3){
$cats_to_display .= "3 ";
}
if ($cat_4){
$cats_to_display .= "4 ";
}
if ($cat_5){
$cats_to_display .= "5 ";
}
if ($cat_6){
$cats_to_display .= "6 ";
}
if ($cat_7){
$cats_to_display .= "7 ";
}
echo "
| Question Pool |
//beginning of right-hand column
?>
Survey |