Пример #1
0
 $poll_preview_questions_array = $poll_questions_array;
 if (isset($_POST['preview_form'])) {
     $poll_display = poll_voting_form($poll_preview_questions_array, $poll_data);
 } else {
     $poll_display = "<div align=\"center\">\n";
     $poll_display .= "  <table class=\"box\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n";
     $poll_display .= "    <tr>\n";
     $poll_display .= "      <td align=\"center\">\n";
     $poll_display .= "        <table width=\"100%\">\n";
     foreach ($poll_preview_questions_array as $question_id => $question) {
         foreach (array_keys($question['OPTIONS_ARRAY']) as $option_id) {
             $poll_preview_questions_array[$question_id]['OPTIONS_ARRAY'][$option_id]['VOTES_ARRAY'] = array();
         }
     }
     $total_vote_count = 0;
     if ($random_users_array = poll_get_random_users(mt_rand(10, 20))) {
         while ($random_user = array_pop($random_users_array)) {
             $total_vote_count++;
             foreach ($poll_preview_questions_array as $question_id => $question) {
                 $option = $question['OPTIONS_ARRAY'][array_rand($question['OPTIONS_ARRAY'])];
                 $poll_preview_questions_array[$question_id]['OPTIONS_ARRAY'][$option['OPTION_ID']]['VOTES_ARRAY'][] = $random_user;
             }
         }
     }
     if ($poll_data['POLLTYPE'] == POLL_TABLE_GRAPH) {
         $poll_display .= "          <tr>\n";
         $poll_display .= "            <td align=\"left\" colspan=\"2\">" . poll_table_graph($poll_preview_questions_array, $poll_data, $total_vote_count) . "</td>\n";
         $poll_display .= "           </tr>\n";
     } else {
         foreach ($poll_preview_questions_array as $question_id => $poll_question) {
             $poll_display .= "          <tr>\n";
Пример #2
0
 $poll_preview_questions_array = $poll_questions_array;
 if (isset($_POST['preview_form'])) {
     $poll_display = poll_voting_form($poll_preview_questions_array, $poll_data);
 } else {
     $poll_display = "<div align=\"center\">\n";
     $poll_display .= "  <table class=\"box\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n";
     $poll_display .= "    <tr>\n";
     $poll_display .= "      <td align=\"center\">\n";
     $poll_display .= "        <table width=\"100%\">\n";
     foreach ($poll_preview_questions_array as $question_id => $question) {
         foreach (array_keys($question['OPTIONS_ARRAY']) as $option_id) {
             $poll_preview_questions_array[$question_id]['OPTIONS_ARRAY'][$option_id]['VOTES_ARRAY'] = array();
         }
     }
     $total_vote_count = 0;
     if (($random_users_array = poll_get_random_users(mt_rand(10, 20))) !== false) {
         while (($random_user = array_pop($random_users_array)) !== null) {
             $total_vote_count++;
             foreach ($poll_preview_questions_array as $question_id => $question) {
                 $option = $question['OPTIONS_ARRAY'][array_rand($question['OPTIONS_ARRAY'])];
                 $poll_preview_questions_array[$question_id]['OPTIONS_ARRAY'][$option['OPTION_ID']]['VOTES_ARRAY'][] = $random_user;
             }
         }
     }
     if ($poll_data['POLLTYPE'] == POLL_TABLE_GRAPH) {
         $poll_display .= "          <tr>\n";
         $poll_display .= "            <td align=\"left\" colspan=\"2\">" . poll_table_graph($poll_preview_questions_array, $total_vote_count) . "</td>\n";
         $poll_display .= "           </tr>\n";
     } else {
         foreach ($poll_preview_questions_array as $question_id => $poll_question) {
             $poll_display .= "          <tr>\n";