コード例 #1
0
    echo display_error();
    application_log("error", "Group [" . $_SESSION["permissions"][$ENTRADA_USER->getAccessId()]["group"] . "] and role [" . $_SESSION["permissions"][$ENTRADA_USER->getAccessId()]["role"] . "] does not have access to this module [" . $MODULE . "]");
} else {
    ?>
	<h1>Manage Evaluation Questions</h1>
    <div style="float: right">
        <a href="<?php 
    echo ENTRADA_URL;
    ?>
/admin/evaluations/questions?section=add"  class="btn btn-small btn-success pull-right cursor-pointer space-below"><i class="icon-plus-sign icon-white"></i> Create New Evaluation Question</a>
    </div>
	<div class="clear"></div>
	<a id="false-link" href="#placeholder"></a>
	<div id="placeholder" style="display: none"></div>
	<?php 
    $results = Models_Evaluation::getAuthorEvaluationQuestions();
    if ($results) {
        if (isset($FORM_ID) && $FORM_ID) {
            $query = "SELECT COUNT(*) AS `total` FROM `evaluations` WHERE `eform_id` = " . $db->qstr($FORM_ID);
            $result = $db->GetRow($query);
            if (!$result || (int) $result["total"] === 0) {
                $query = "SELECT `form_title` FROM `evaluation_forms` WHERE `eform_id` = " . $db->qstr($FORM_ID);
                $form_title = $db->GetOne($query);
                $query = "SELECT `equestion_id` FROM `evaluation_form_questions` WHERE `eform_id` = " . $db->qstr($FORM_ID);
                $used_questions = $db->GetAll($query);
                $used_ids = array();
                foreach ($used_questions as $used_question) {
                    $used_ids[] = $used_question["equestion_id"];
                }
                $temp_results = $results;
                $results = array();