summaryrefslogblamecommitdiffstats
path: root/main/survey/edit_anketa.php
blob: 24632e9e647f35e1fba4712074a021f922a477de (plain) (tree)
1
2
3
4
5
6
7
8
9



                                    


                                             
                           
                                                              







                                                                             
                                                              






                                      
                                                                                                                                           

                                                         
                                                                                                     

  
<?php

include_once('../../function.php');

$anketa_hash = $_GET['anketa'];
$anketa = getSurveyIdFromHash($anketa_hash);

$usr_id = $_GET['usr_id'];
$preview = isset($_GET['preview']) ? $_GET['preview'] : null;
$code = isset($_GET['code']) ? '&code='.$_GET['code'] : '';

$sql1 = sisplet_query("SELECT cookie FROM srv_anketa WHERE id = '$anketa'");
$row1 = mysqli_fetch_array($sql1);

$sql = sisplet_query("SELECT cookie FROM srv_user WHERE id = '$usr_id'");
$row = mysqli_fetch_array($sql);

if (isset($_GET['quick_view']) && $_GET['quick_view'] == 1) {
	$urejanje = '&quick_view=1'; 
} else {
	$urejanje = '&urejanje=1';
}

if ($row1['cookie'] == -1) {
	
	header("Location: ".$site_url."main/survey/index.php?anketa=".$anketa_hash."&survey-".$anketa."=".$row['cookie'].$urejanje.$code);
} else {
	setcookie('survey-'.$anketa, $row['cookie'], 0);
	header("Location: ".$site_url."main/survey/index.php?anketa=".$anketa_hash.$urejanje.$code);
}
?>