$fname = reset($fnames);
 do {
     //$dataentryoutput .= "<pre>"; print_r($fname);$dataentryoutput .= "</pre>";
     if (isset($idrow[$fname['fieldname']])) {
         $answer = $idrow[$fname['fieldname']];
     }
     $question = $fname['question'];
     $dataentryoutput .= "\t<tr";
     if ($highlight) {
         $dataentryoutput .= " class='odd'";
     } else {
         $dataentryoutput .= " class='even'";
     }
     $highlight = !$highlight;
     $dataentryoutput .= ">\n" . "<td valign='top' align='right' width='25%'>" . "\n";
     $dataentryoutput .= "\t<strong>" . strip_javascript($question) . "</strong>\n";
     $dataentryoutput .= "</td>\n" . "<td valign='top' align='left'>\n";
     //$dataentryoutput .= "\t-={$fname[3]}=-"; //Debugging info
     switch ($fname['type']) {
         case "completed":
             // First compute the submitdate
             if ($private == "Y") {
                 // In case of anonymized responses survey with no datestamp
                 // then the the answer submitdate gets a conventional timestamp
                 // 1st Jan 1980
                 $mysubmitdate = date("Y-m-d H:i:s", mktime(0, 0, 0, 1, 1, 1980));
             } else {
                 $mysubmitdate = date_shift(date("Y-m-d H:i:s"), "Y-m-d H:i:s", $timeadjust);
             }
             $completedate = empty($idrow['submitdate']) ? $mysubmitdate : $idrow['submitdate'];
             $dataentryoutput .= "                <select name='completed'>\n";
Ejemplo n.º 2
0
]]></summary>
		<author>
			<name><?php 
        echo $post->author_name;
        ?>
</name>
		</author>
		<content type="html" xml:lang="<?php 
        echo $this->fuel_blog->language(TRUE);
        ?>
" xml:base="<?php 
        echo $link;
        ?>
/article">
			<![CDATA[<?php 
        echo strip_javascript($post->excerpt_formatted);
        ?>
]]> 
		</content>
		<updated><?php 
        echo standard_date('DATE_ATOM', strtotime($post->last_modified));
        ?>
</updated>
	</entry> 
	<?php 
    }
    ?>
	
	<?php 
}
?>
Ejemplo n.º 3
0
<?php

$vars['body'] = '<div class="preview_body">' . markdown(strip_javascript($body)) . '</div>';
$this->load->view('_layouts/main', $vars);
//echo $body;
Ejemplo n.º 4
0
         $assessmentsoutput .= "<tr class='evenrow'>\n";
     }
     $assessmentsoutput .= "<td>" . $assess['id'] . "</td>\n";
     $assessmentsoutput .= "<td><form method='post' action='{$scriptname}?sid={$surveyid}'>\n                 <input type='image' src='{$imagefiles}/token_edit.png' alt='" . $clang->gT("Edit") . "' />\n                 <input type='hidden' name='action' value='assessmentedit' />\n                 <input type='hidden' name='id' value='" . $assess['id'] . "' />\n                 </form><form method='post' action='{$scriptname}?sid={$surveyid}'>\n                 <input type='image' src='{$imagefiles}/token_delete.png' alt='" . $clang->gT("Delete") . "' onclick='return confirm(\"" . $clang->gT("Are you sure you want to delete this entry?", "js") . "\")' />\n                 <input type='hidden' name='action' value='assessmentdelete' />\n                 <input type='hidden' name='id' value='" . $assess['id'] . "' />\n                 </form>\n                 </td>\n";
     $assessmentsoutput .= "<td>" . $assess['sid'] . "</td>\n";
     if ($assess['scope'] == "T") {
         $assessmentsoutput .= "<td>" . $clang->gT("Total") . "</td>\n";
         $assessmentsoutput .= "<td>-</td>\n";
     } else {
         $assessmentsoutput .= "<td>" . $clang->gT("Question group") . "</td>\n";
         $assessmentsoutput .= "<td>" . $groups[$assess['gid']]['group_name'] . " (" . $assess['gid'] . ")</td>\n";
     }
     $assessmentsoutput .= "<td>" . $assess['minimum'] . "</td>\n";
     $assessmentsoutput .= "<td>" . $assess['maximum'] . "</td>\n";
     $assessmentsoutput .= "<td>" . stripslashes($assess['name']) . "</td>\n";
     $assessmentsoutput .= "<td>" . strip_tags(strip_javascript($assess['message'])) . "</td>\n";
     $assessmentsoutput .= "</tr></tbody>\n";
 }
 $assessmentsoutput .= "</table>";
 //now present edit/insert form
 $assessmentsoutput .= "<br /><form method='post' class='form30' id='assessmentsform' name='assessmentsform' action='{$scriptname}?sid={$surveyid}'><div class='header'>\n";
 $assessmentsoutput .= "{$actiontitle}</div>\n";
 $assessmentsoutput .= "<ul><li><label>" . $clang->gT("Scope") . "</label><input type='radio' id='radiototal' name='scope' value='T' ";
 if (!isset($editdata) || $editdata['scope'] == "T") {
     $assessmentsoutput .= " checked='checked' ";
 }
 $assessmentsoutput .= " /><label for='radiototal'>" . $clang->gT("Total") . "</label>\n                         <input type='radio' id='radiogroup' name='scope' value='G'";
 if (isset($editdata) && $editdata['scope'] == "G") {
     $assessmentsoutput .= " checked='checked' ";
 }
 $assessmentsoutput .= "/><label for='radiogroup'>" . $clang->gT("Group") . "</label></li>";
 }
 $tableheader .= "\t<thead><tr valign='top'>\n" . "<th><input type='checkbox' id='selectall'></th>\n" . "<th>" . $clang->gT('Actions') . "</th>\n";
 foreach ($fnames as $fn) {
     if (!isset($currentgroup)) {
         $currentgroup = $fn[1];
         $gbc = "oddrow";
     }
     if ($currentgroup != $fn[1]) {
         $currentgroup = $fn[1];
         if ($gbc == "oddrow") {
             $gbc = "evenrow";
         } else {
             $gbc = "oddrow";
         }
     }
     $tableheader .= "<th class='{$gbc}'><strong>" . strip_javascript("{$fn['1']}") . "</strong></th>\n";
 }
 $tableheader .= "\t</tr></thead>\n\n";
 $tableheader .= "\t<tfoot><tr><td colspan=" . ($fncount + 2) . ">" . "<img id='imgDeleteMarkedResponses' src='{$imageurl}/token_delete.png' alt='" . $clang->gT('Delete marked responses') . "' />" . "\t</tr></tfoot>\n\n";
 $start = returnglobal('start');
 $limit = returnglobal('limit');
 if (!isset($limit) || $limit == '') {
     $limit = 50;
 }
 if (!isset($start) || $start == '') {
     $start = 0;
 }
 //LETS COUNT THE DATA
 $dtquery = "SELECT count(t.id) FROM {$surveytimingstable} t INNER JOIN {$surveytable} ON t.id={$surveytable}.id WHERE submitdate IS NOT NULL ";
 $dtresult = db_execute_num($dtquery) or safe_die("Couldn't get response data<br />{$dtquery}<br />" . $connect->ErrorMsg());
 while ($dtrow = $dtresult->FetchRow()) {
/**
 *  This functions removes all HTML tags, Javascript, CRs, linefeeds  and other strange chars from a given text. CRs, linefeeds are not removed for .csv files
 *
 * @param string $sTextToFlatten  Text you want to clean
 * @param boolan $bDecodeHTMLEntities If set to true then all HTML entities will be decoded to the specified charset. Default: false
 * @param string $sCharset Charset to decode to if $decodeHTMLEntities is set to true
 *
 * @return string  Cleaned text
 */
function FlattenText($sTextToFlatten, $bDecodeHTMLEntities = false, $sCharset = 'UTF-8', $is_csv = false)
{
    $sNicetext = strip_javascript($sTextToFlatten);
    $sNicetext = strip_tags($sNicetext);
    if ($is_csv == true) {
        $sNicetext = str_replace(array("\r\n", "\r", "\n"), array(PHP_EOL, PHP_EOL, PHP_EOL), $sNicetext);
    } elseif ($sCharset == 'UTF-8') {
        $sNicetext = preg_replace('/[\\x0a\\x0b\\x0c\\x0d\\x85\\x{2028}\\x{2029}]/u', ' ', $sNicetext);
        $sNicetext = str_replace(array("\n", "\r"), array('', ''), $sNicetext);
    } else {
        $sNicetext = str_replace(array("\n", "\r"), array('', ''), $sNicetext);
    }
    if ($bDecodeHTMLEntities == true) {
        $sNicetext = str_replace('&nbsp;', ' ', $sNicetext);
        // html_entity_decode does not properly convert &nbsp; to spaces
        $sNicetext = html_entity_decode($sNicetext, ENT_QUOTES, $sCharset);
    }
    $sNicetext = trim($sNicetext);
    return $sNicetext;
}
Ejemplo n.º 7
0
/**
*  This functions removes all HTML tags, Javascript, CRs, linefeeds  and other strange chars from a given text. CRs, linefeeds are not removed for .csv files
*
* @param string $sTextToFlatten  Text you want to clean
* @param boolan $bDecodeHTMLEntities If set to true then all HTML entities will be decoded to the specified charset. Default: false
* @param string $sCharset Charset to decode to if $decodeHTMLEntities is set to true
*
* @return string  Cleaned text
*/
function FlattenText($sTextToFlatten, $bDecodeHTMLEntities = false, $sCharset = 'UTF-8', $bStripNewLines = true)
{
    $sNicetext = strip_javascript($sTextToFlatten);
    $sNicetext = strip_tags($sNicetext);
    if ($bStripNewLines) {
        $sNicetext = preg_replace('~\\Ru~', '', $sNicetext);
    } else {
        $sNicetext = preg_replace('~\\Ru~', "\r\n", $sNicetext);
    }
    if ($bDecodeHTMLEntities == true) {
        $sNicetext = str_replace('&nbsp;', ' ', $sNicetext);
        // html_entity_decode does not convert &nbsp; to spaces
        $sNicetext = html_entity_decode($sNicetext, ENT_QUOTES, $sCharset);
    }
    return trim($sNicetext);
}
Ejemplo n.º 8
0
/**
*  This functions removes all HTML tags, Javascript, CRs, linefeeds and other strange chars from a given text
*
* @param string $sTextToFlatten  Text you want to clean
* @param boolan $bDecodeHTMLEntities If set to true then all HTML entities will be decoded to the specified charset. Default: false
* @param string $sCharset Charset to decode to if $decodeHTMLEntities is set to true
*
* @return string  Cleaned text
*/
function FlattenText($sTextToFlatten, $bDecodeHTMLEntities = false, $sCharset = 'UTF-8', $bStripNewLines = true, $keepSpan = false)
{
    $sNicetext = strip_javascript($sTextToFlatten);
    // When stripping tags, add a space before closing tags so that strings with embedded HTML tables don't get concatenated
    $sNicetext = str_replace('</td', ' </td', $sNicetext);
    if ($keepSpan) {
        // Keep <span> so can show EM syntax-highlighting; add space before tags so that word-wrapping not destroyed when remove tags.
        $sNicetext = strip_tags($sNicetext, '<span><table><tr><td><th>');
    } else {
        $sNicetext = strip_tags($sNicetext);
    }
    if ($bStripNewLines) {
        // strip new lines
        $sNicetext = preg_replace(array('~\\Ru~'), array(' '), $sNicetext);
    } else {
        $sNicetext = preg_replace(array('~\\Ru~'), array("\r\n"), $sNicetext);
    }
    if ($bDecodeHTMLEntities == true) {
        $sNicetext = str_replace('&nbsp;', ' ', $sNicetext);
        // html_entity_decode does not convert &nbsp; to spaces
        $sNicetext = html_entity_decode($sNicetext, ENT_QUOTES, $sCharset);
    }
    $sNicetext = trim($sNicetext);
    return $sNicetext;
}
Ejemplo n.º 9
0
        $i = 0;
        $highlight = false;
        for ($i; $i < $nfncount + 1; $i++) {
            $inserthighlight = '';
            if ($highlight) {
                $inserthighlight = "class='highlight'";
            }
            $browseoutput .= "\t<tr {$inserthighlight}>\n" . "<th align='right' width='50%'>" . strip_tags(strip_javascript($fnames[$i][1])) . "</th>\n" . "<td align='left' >";
            if ($i == 2) {
                if ($idrow['submitdate'] == NULL || $idrow['submitdate'] == "N") {
                    $browseoutput .= "N";
                } else {
                    $browseoutput .= "Y";
                }
            } else {
                $browseoutput .= htmlspecialchars(strip_tags(strip_javascript(getextendedanswer($fnames[$i][0], $idrow[$fnames[$i][0]], '', $dateformatdetails['phpdate']))), ENT_QUOTES);
            }
            $browseoutput .= "</td>\n\t</tr>\n";
            $highlight = !$highlight;
        }
    }
    $browseoutput .= "</table>\n";
} elseif ($subaction == "all") {
    /**
     * fnames is used as informational array
     * it containts
     *             $fnames[] = array(<dbfieldname>, <some strange title>, <questiontext>, <group_id>, <questiontype>);
     */
    $browseoutput .= "\n<script type='text/javascript'>\n                          var strdeleteconfirm='" . $clang->gT('Do you really want to delete this response?', 'js') . "'; \n                          var strDeleteAllConfirm='" . $clang->gT('Do you really want to delete all marked responses?', 'js') . "'; \n                        </script>\n";
    if (!isset($_POST['sql'])) {
        $browseoutput .= $surveyoptions;
Ejemplo n.º 10
0
/**
 *  This functions removes all HTML tags, Javascript, CRs, linefeeds and other strange chars from a given text
 *
 * @param string $sTextToFlatten  Text you want to clean
 * @param boolan $bDecodeHTMLEntities If set to true then all HTML entities will be decoded to the specified charset. Default: false
 * @param string $sCharset Charset to decode to if $decodeHTMLEntities is set to true
 *
 * @return string  Cleaned text
 */
function FlattenText($sTextToFlatten, $bDecodeHTMLEntities = false, $sCharset = 'UTF-8')
{
    $sNicetext = strip_javascript($sTextToFlatten);
    $sNicetext = strip_tags($sNicetext);
    $sNicetext = str_replace(array("\n", "\r"), array('', ''), $sNicetext);
    if ($bDecodeHTMLEntities == true) {
        $sNicetext = str_replace('&nbsp;', ' ', $sNicetext);
        // html_entity_decode does not properly convert &nbsp; to spaces
        $sNicetext = html_entity_decode($sNicetext, ENT_QUOTES, $sCharset);
    }
    $sNicetext = trim($sNicetext);
    return $sNicetext;
}