"survey_list.php", "name" => get_lang('Survey')); $default_group = '0'; $new_group = '1'; $existing_group = '2'; $surveyid = $_REQUEST['surveyid']; $sname = surveymanager::pick_surveyname($surveyid); $groupid = $_REQUEST['groupid']; $newgroupid = $_REQUEST['newgroupid']; $messege = $_REQUEST['messege']; $flag = $_REQUEST['flag']; $action1 = $_REQUEST['action1']; $sort = $_REQUEST['sortby']; if(!isset($page_nr)||!isset($column)||!isset($per_page)) { $page_nr =1; $column =0; $per_page = 10; } else { $page_nr = $_REQUEST['page_nr']; $column = $_REQUEST['column']; $per_page = $_REQUEST['per_page']; } /* $sql="SELECT * FROM $table_question WHERE gid='$groupid' AND survey_id = '$surveyid'"; $res=api_sql_query($sql,__FILE__,__LINE__); $obj=mysql_fetch_object($res); $number=mysql_num_rows($res); for($i=1;$i<=$number;$i++) { $up="up"; $down="down"; if(isset($_POST[$up])||isset($_POST[$down])) { $flag=0; if(isset($_POST[$up])) { $tempmutlichkboxtext=$_POST['boxtext']; if($tempradiodefault==$i) $tempradiodefault--; elseif($tempradiodefault==$i-1) $tempradiodefault++; $tempchkboxpoint=$_POST['chkboxpoint']; if($tempradiotrue==$i) $tempradiotrue--; elseif($tempradiotrue==$i-1) $tempradiotrue++; $tempm= $tempmutlichkboxtext[$i-2]; $tempchkboxp=$tempchkboxpoint[$i-2]; $tempmutlichkboxtext[$i-2]=$tempmutlichkboxtext[$i-1]; $tempchkboxpoint[$i-2]=$tempchkboxpoint[$i-1]; $tempmutlichkboxtext[$i-1]=$tempm; $tempchkboxpoint[$i-1]=$tempchkboxp; $_POST['mutlichkboxtext']=$tempmutlichkboxtext; $_POST['chkboxpoint']=$tempchkboxpoint; } if(isset($_POST[$down])) { $tempmutlichkboxtext=$_POST['mutlichkboxtext']; if($tempradiodefault==$i) $tempradiodefault++; elseif($tempradiodefault==$i+1) $tempradiodefault--; $tempchkboxpoint=$_POST['chkboxpoint']; if($tempradiotrue==$i) $tempradiotrue++; elseif($tempradiotrue==$i+1) $tempradiotrue--; $tempm= $tempmutlichkboxtext[$i]; $tempchkboxp=$tempchkboxpoint[$i]; $tempmutlichkboxtext[$i]=$tempmutlichkboxtext[$i-1]; $tempchkboxpoint[$i]=$tempchkboxpoint[$i-1]; $tempmutlichkboxtext[$i-1]=$tempm; $tempchkboxpoint[$i-1]=$tempchkboxp; $_POST['mutlichkboxtext']=$tempmutlichkboxtext; $_POST['chkboxpoint']=$tempchkboxpoint; } //echo ",while checking up/down end=".$end; $jd=0; break; } } */ if ($_POST['action'] == 'selectquestion_group') { $surveyid = $_POST['newsurveyid']; $questiongroup = $_POST['question_group']; if (isset($questiongroup)) { $cidReq=$_REQUEST['cidReq']; $exiztinggroup = $_POST['exiztinggroup']; header("Location:existing_surveys_new.php?cidReq=$cidReq&surveyid=$surveyid"); exit; } } //from question_added if (isset($_POST['back'])) { $groupid = $_POST['groupid']; $surveyid = $_POST['surveyid']; $cidReq=$_REQUEST['cidReq']; $page = $_REQUEST['page']; header("Location:create_new_survey.php?surveyid=$surveyid&cidReq=$cidReq&page=$page"); //header("Location:select_question_type.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq"); exit; } if (isset($_POST['addanother'])) { $groupid = $_POST['groupid']; $surveyid = $_POST['surveyid']; $cidReq=$_REQUEST['cidReq']; header("Location:addanother.php?surveyid=$surveyid&cidReq=$cidReq"); //header("Location:select_question_type.php?groupid=$groupid&surveyid=$surveyid&cidReq=$cidReq"); exit; } if (isset($_POST['addanotherg'])) { //$groupid = $_POST['groupid']; $surveyid = $_POST['surveyid']; $cidReq=$_REQUEST['cidReq']; header("Location:create_new_group.php?surveyid=$surveyid&cidReq=$cidReq"); exit; } if(isset($_REQUEST['delete'])) { if(isset($_REQUEST['qid'])) { $endloop=count($_REQUEST['qid']); $qid1=$_REQUEST['qid']; for($i=0;$i<$endloop;$i++) { $qid2=$qid1[$i]; $query="DELETE FROM $table_question WHERE qid='$qid2'"; api_sql_query($query); header("Location:select_question_group.php?surveyid=$surveyid&cidReq=$cidReq"); exit; } } } if (isset($_POST['finish'])) { $cidReq=$_REQUEST['cidReq']; header("Location:survey_list.php?cidReq=$cidReq"); exit; } if(isset($action1)) { $groupid = $_REQUEST['gid']; $surveyid = $_REQUEST['surveyid']; $qid = $_GET['qid']; $pre_qid = $_GET['pre_qid']; $post_qid = $_GET['post_qid']; $direction = $_GET['direction']; $pre_sort = $_GET['pre_sort']; $sort = $_GET['sortby']; $post_sort = $_GET['post_sort']; if($direction=="up") { $sql_update2="UPDATE $table_question SET sortby='".$sort."' WHERE qid='".$pre_qid."'"; mysql_query($sql_update2); $sql_update1="UPDATE $table_question SET sortby='".$pre_sort."' WHERE qid='".$qid."'"; mysql_query($sql_update1); } else { $sql_update1="UPDATE $table_question SET sortby='".$sort."' WHERE qid='".$post_qid."'"; mysql_query($sql_update1); $sql_update2="UPDATE $table_question SET sortby='".$post_sort."' WHERE qid='".$qid."'"; mysql_query($sql_update2); } //surveymanager::move_question($direction,$qid,$pre_sort,$sort,$post_sort,$curr_dbname); } Display::display_header($tool_name1); api_display_tool_title("Survey Name : ".$sname); api_display_tool_title($tool_name); if($flag==1) { ?>
 
qid; $q_type=mysql_result($res1,$k,'qtype');//$obj->qid; $pre_qid=mysql_result($res1,$k-1,'qid'); $post_qid=mysql_result($res1,$k+1,'qid'); $question=stripslashes(mysql_result($res1,$k,'caption'));//$obj->caption; $question = eregi_replace('^]*>(.*)

','\\1', $question); $question = eregi_replace('(<[^ ]*) (style=."."[^>]*)(>)','\\1\\3', $question); $question = eregi_replace('(<[^ ]*) (style=""[^>]*)(>)','\\1\\3', $question); $question = eregi_replace('(<[^ ]*)( style=."[^"]*")([^>]*)(>)','\\1\\2\\4', $question); $sort=mysql_result($res1,$k,'sortby');//$obj->sortby; $pre_sort=$k==0?mysql_result($res1,$k,'sortby'):mysql_result($res1,$k-1,'sortby');//$obj->sortby; $post_sort=$k==$num1?mysql_result($res1,$k,'sortby'):mysql_result($res1,$k+1,'sortby');//$obj->sortby; $course = array (); $course[] = $question_number.' - '.$question; if($num1==1) { $course[] = '   '.''; } elseif($k==0){ $course[] = '   '.''; }elseif($k==$num1-1){ $course[] = '        '.''; } else{ $course[] = '   '.''; } $course[] = mysql_result($res1,$k,'qtype');//$obj->qtype; $course[] = @mysql_result($res,$i,'groupname'); $course[]=''.get_lang('Edit').''.''.get_lang('Delete').''; $courses[] = $course; $x++; } } } ?>