예제 #1
0
//Count the no. of unread messages...
$count = User::count_unread_messages($_SESSION['user_id']);
?>

<?php 
if (isset($_GET['id'])) {
    $question = Question::find_by_id($_GET['id']);
    if ($question == '') {
        redirect_to('extra-404');
    }
}
?>

<?php 
if (isset($_POST['submit_option'])) {
    $survey_data_obj = new SurveyData();
    $survey_data_obj->respondent_id = $_SESSION['user_id'];
    $survey_data_obj->question_id = $_GET['id'];
    $survey_data_obj->option_id = $_POST['user_response'];
    $survey_data_obj->create();
}
?>

<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<meta name="description" content="Neon Admin Panel" />
	<meta name="author" content="" />
	
예제 #2
0
<hr />
			
			

<h2>Choose a survey to respond</h2>

<br />

<div class="row">
<?php 
$question_array = Question::find_all();
$survey_array = SurveyData::find_all();
$empty = 0;
foreach ($question_array as $question_obj) {
    $question = SurveyData::find_by_question_response($question_obj->question_id, $_SESSION['user_id']);
    $count = 0;
    foreach ($survey_array as $survey) {
        if ($survey->question_id == $question_obj->question_id) {
            $count++;
        }
    }
    $percent = $count / 7 * 100;
    if (!$question && $question_obj->is_enabled == "true") {
        $empty++;
        ?>
	<!-- Use the below div class="col-sm-3" for Loop's body.. --> 
	<div class="col-sm-3">	
		<div class="tile-progress tile-primary">
			<div class="tile-header">
				<h3><?php 
예제 #3
0
			</li>
		</ul>
		
	</div>
	
</div>

<hr />
			
			


<div class="row">
<?php 
$question_array = Question::find_all();
$survey_array = SurveyData::find_all();
$empty = 0;
foreach ($question_array as $question_obj) {
    if ($question_obj->creator_id == $_SESSION['user_id']) {
        $empty++;
        $count = 0;
        foreach ($survey_array as $survey) {
            if ($survey->question_id == $question_obj->question_id) {
                $count++;
            }
        }
        $percent = $count / 7 * 100;
        ?>
			<!-- Use the below div class="col-sm-3" for Loop's body.. --> 
			<div class="col-sm-3">	
				<div class="tile-progress tile-primary">