<?php

global $vqData;
try {
    // Delete a single player
    if (isset($_GET['playerId']) && is_numeric($_GET['playerId']) && isset($_GET['wpvq_quizId']) && is_numeric($_GET['wpvq_quizId'])) {
        global $wpdb;
        $wpdb->delete(WPViralQuiz::getTableName('players'), array('id' => $_GET['playerId']));
        $url_redirect = esc_url_raw(remove_query_arg(array('playerId', 'id', 'element', 'action', 'wp_nonce', 'noheader'), add_query_arg(array('referer' => 'remove', 'element' => 'players', 'action' => 'show', 'wpvq_quizId' => $_GET['wpvq_quizId']))));
        wp_redirect(url_origin($_SERVER) . $url_redirect);
    } elseif (isset($_GET['playerId']) && $_GET['playerId'] == 'all' && isset($_GET['wpvq_quizId']) && is_numeric($_GET['wpvq_quizId'])) {
        global $wpdb;
        $wpdb->delete(WPViralQuiz::getTableName('players'), array('quizId' => $_GET['wpvq_quizId']));
        $url_redirect = esc_url_raw(remove_query_arg(array('playerId', 'id', 'element', 'action', 'wp_nonce', 'noheader'), add_query_arg(array('referer' => 'removeAll', 'element' => 'players', 'action' => 'show', 'wpvq_quizId' => $_GET['wpvq_quizId']))));
        wp_redirect(url_origin($_SERVER) . $url_redirect);
    } else {
        throw new Exception(__("This player/quiz doesn't exist.", 'wpvq'));
    }
} catch (Exception $e) {
    echo $e->getMessage();
}
//include dirname(__FILE__) . '/../views/WPVQAddQuizz.php';
Example #2
0
function full_url($s, $use_forwarded_host = false)
{
    return url_origin($s, $use_forwarded_host) . $s['REQUEST_URI'];
}
Example #3
0
function full_url($s = null, $use_forwarded_host = false)
{
    if (is_null($s)) {
        $s = $_SERVER;
    }
    $request_uri = isset($s) && isset($s['REQUEST_URI']) ? $s['REQUEST_URI'] : "";
    return url_origin($s, $use_forwarded_host) . $request_uri;
}
Example #4
0
                $appr = $quiz->addAppreciation($param, intval($appreciation['id']));
                // Link label with ID for the next step
                // $appreciationsAssoc[$appreciation['label']] = intval($appr->getId());
                // $i++;
            }
        } else {
            if ($quizType == 'WPVQGameTrueFalse' && isset($_POST['vqappreciations'])) {
                $i = 0;
                foreach ($_POST['vqappreciations'] as $appreciation) {
                    // Empty appreciation
                    if ($appreciation['content'] == '' && $appreciation['scoreCondition'] == '') {
                        continue;
                    }
                    $param = array();
                    $param['label'] = '';
                    $param['content'] = $appreciation['content'];
                    $param['scoreCondition'] = intval($appreciation['scoreCondition']);
                    $appr = $quiz->addAppreciation($param, intval($appreciation['id']));
                    $i++;
                }
            }
        }
    }
    // end of tab=APPRECIATIONS
    // Redirect
    $url_quizzes_show = esc_url_raw(add_query_arg(array('referer' => 'update', 'tab' => $activeTab, 'element' => 'quiz', 'action' => 'edit', 'id' => $quizId), remove_query_arg(array('type', 'noheader'))));
    wp_redirect(url_origin($_SERVER) . $url_quizzes_show);
    die;
}
// VIEW
include dirname(__FILE__) . '/../views/WPVQAddQuizz.php';
		<?php 
if (!empty($subname)) {
    echo $subname . ' - ';
}
?>
		<?php 
echo PAGE_NAME;
?>
	</title>
</head>
<body style='font-family: "GloberSemibold","GloberRegular",Helvetica,Arial,sans-serif;'>
	<div class="container">
		<header>
			<div class="header-top">
				<a href="http://siecobywatelska.pl"><img src="<?php 
echo htmlspecialchars(url_origin($_SERVER));
?>
/img/watchdog.png" width="259" height="61" alt="Logo Watchdog"></a>
				<a href="http://siecobywatelska.pl/wlacz-sie-5min/#wspieraj_siec" class="support-button" style="position: relative; float: right; right: auto" target="_blank">Wspieraj nas</a>
			</div>
			<?php 
$current_path = $_SERVER["SCRIPT_NAME"];
if ($current_path == '/index.php') {
    $current_path = '/';
}
$menu_items = [];
$menu_items['/'] = 'Dołącz';
$menu_items['/ambassadors.php'] = 'Ambasadorzy';
$menu_items['/withus.php'] = 'Są z nami';
$menu_items['/firmy.php'] = 'Dla firm';
$menu_items['/download.php'] = 'Do pobrania';
Example #6
0
function full_url()
{
    return url_origin($_SERVER, false);
}
function showHead($subname, $header = "Ambasadorzy Jawności")
{
    ?>

	<!DOCTYPE html>

	<html>
	<head>
	    <meta charset="utf-8">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	    <meta name="viewport" content="width=device-width, initial-scale=1">
	    <meta name="description" content="<?php 
    echo META_DESC;
    ?>
">
	    <meta property="og:site_name" content="<?php 
    echo PAGE_NAME;
    ?>
"/>
	    <meta property="og:description" content="<?php 
    echo META_DESC;
    ?>
" />
	    <meta property="og:locale" content="pl_PL" />
	    <meta property="og:image" content="<?php 
    echo htmlspecialchars(url_origin($_SERVER));
    ?>
/img/facebook.jpg" />

	    <link rel="stylesheet" href="<?php 
    echo htmlspecialchars(url_origin($_SERVER));
    ?>
/css/reset.min.css">
	    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
	    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
	    <link rel="stylesheet" href="http://siecobywatelska.pl/font-wybory/MyFontsWebfontsKit.css">
	    <link rel="stylesheet" href="<?php 
    echo htmlspecialchars(url_origin($_SERVER));
    ?>
/css/cc-icons.min.css">
	    <link rel="stylesheet" href="<?php 
    echo htmlspecialchars(url_origin($_SERVER));
    ?>
/css/style.css">
	    
	    <title>
	    <?php 
    echo PAGE_NAME;
    if (!empty($subname)) {
        echo " - " . $subname;
    }
    ?>
	    </title>
	    </head>
	    <body>
        	<div id="container">
		    <header>
		    <a href="http://siecobywatelska.pl"><img src="<?php 
    echo htmlspecialchars(url_origin($_SERVER));
    ?>
/img/watchdog.png" width="259" height="61" alt="Logo Watchdog"></a>
		        
		        <nav id="mainMenu">
		            <ul>
		            <a href="/"><li><i class="fa fa-home fa-2x"></i></li></a>
		            <a href="ambassadors.php"><li>Nasi Ambasadorzy</li></a>
		            <a href="contact.php"><li>Kontakt</li></a>
		            <a href="kancelarie.php"><li>Dla kancelarii</li></a>
		            </ul>
		        </nav>
		    </header> 
		    
		    <div id="contentContainer">
                	<h1><?php 
    echo $header;
    ?>
</h1>
	    <?php 
}