예제 #1
1
  function ilMacinatoreOn()
  {
    
    //dbConnect();
    mpdConnect();


    $action = ucfirst ( isset( $_GET['act'] ) ?$_GET['act']:'home' );
    if ( ! file_exists ( ROOT . "/inc/act{$action}.php" ) )
      exit(0);
  
    if ( isset ( $_GET['state'] ) )
    {
      include ( ROOT . "/inc/act{$action}.php" );
      exit(0);
    }
    
    printHeader();
    printMenu();
    printTop();

    echo "<div id='main'>\n";
    include ( ROOT . "/inc/act{$action}.php" );
    echo "</div>\n";

  }
예제 #2
0
    /**
     * Display password reset user form.
     *
     * @since 1.0
     * @package facileManager
     *
     * @param string $message Message to display to the user
     * @return string
     */
    function printUserForm($message = null)
    {
        /** Should not be here if there is no mail_enable defined or if not using builtin auth */
        if (!getOption('mail_enable') || getOption('auth_method') != 1) {
            header('Location: ' . $GLOBALS['RELPATH']);
        }
        global $fm_name;
        printHeader(_('Password Reset'), 'login');
        $branding_logo = $GLOBALS['RELPATH'] . 'fm-modules/' . $fm_name . '/images/fm.png';
        printf('<form id="loginform" action="%s?forgot_password" method="post">
		<input type="hidden" name="reset_pwd" value="1" />
		<div id="fm-branding">
			<img src="%s" /><span>%s</span>
		</div>
		<div id="login_form">
		<table>
			<tr>
				<td>
					<div class="input-wrapper">
						<input type="text" name="user_login" id="user_login" placeholder="%s" style="width: 400px;" />
					</div>
				</td>
				<td><input name="submit" id="forgotbtn" type="submit" value="%s" class="button" /></td>
			</tr>
		</table>
		<p id="forgotton_link"><a href="%s">&larr; %s</a></p>
		<div id="message">%s</div>
		</form>
		</div>', $_SERVER['PHP_SELF'], $branding_logo, _('Reset Password'), _('Username'), _('Submit'), $GLOBALS['RELPATH'], _('Login form'), $message);
    }
예제 #3
0
파일: header.php 프로젝트: rjho/grades
function checkLogin($checkType)
{
    global $db;
    if (!isset($_SESSION['username'])) {
        require_once "login.php";
        // Not logged in. Kick to login page.
        die;
    } else {
        $check = $db->query("SELECT * FROM User WHERE userName='******'username']}' AND passwordHash='{$_SESSION['password']}'");
        $userInfo = $check->fetch_array();
        if ($check->num_rows == 0) {
            // Invalid username or password. Kick to login page.
            require_once "login.php";
            die;
        } elseif (!$userInfo['student'] && $checkType == "student" || !$userInfo['instructor'] && $checkType == "instructor" || !$userInfo['administrator'] && $checkType == "administrator") {
            // Incorrect permissions. Return an error.
            printHeader("Access Denied");
            echo "<p>You do not have permission to view this page.</p>";
            printFooter(true);
            die;
        } else {
            // Everything is ok. Return the user data.
            return $userInfo;
        }
    }
}
function download_cert($this_cert, $cer_ext)
{
    $config = $_SESSION['config'];
    if (!isset($cer_ext)) {
        $cer_ext = 'FALSE';
    }
    if ($this_cert == "zzTHISzzCAzz") {
        $my_x509_parse = openssl_x509_parse(file_get_contents($config['cacert']));
        $filename = $my_x509_parse['subject']['CN'] . ":" . $my_x509_parse['subject']['OU'] . ":" . $my_x509_parse['subject']['O'] . ":" . $my_x509_parse['subject']['L'] . ":" . $my_x509_parse['subject']['ST'] . ":" . $my_x509_parse['subject']['C'];
        $download_certfile = $config['cacert'];
        $ext = ".pem";
        //$application_type="application/x-x509-ca-cert";
        $application_type = 'application/octet-stream';
    } else {
        $filename = substr($this_cert, 0, strrpos($this_cert, '.'));
        $ext = substr($this_cert, strrpos($this_cert, '.'));
        $download_certfile = base64_encode($filename);
        $download_certfile = $config['cert_path'] . $download_certfile . $ext;
        $application_type = 'application/octet-stream';
    }
    if ($cer_ext != 'FALSE') {
        $ext = '.' . $cer_ext;
    }
    if (file_exists($download_certfile)) {
        $myCert = join("", file($download_certfile));
        download_header_code($filename . $ext, $myCert, $application_type);
    } else {
        printHeader("Certificate Retrieval");
        print "<h1> {$filename} - X509 CA certificate not found</h1>\n";
        printFooter();
    }
}
function errorMsg($msg)
{
    printHeader();
    writeBeginningHTML(" Jumble Word Solver Error");
    echo "Your form results could not be processed because " . $msg;
    echo "<HR />" . "<address>" . "Time of Request: " . date("D j M Y h:i:s A") . "\n" . "<a href=\"http://csnew.angelo.edu/~bpearce\">Bryce Pearce</a><br />" . "<a href=\"mailto:bpearce@angelo.edu\">bpearce@angelo.edu</a><br />" . "<br />\n" . "</address>\n" . "</body>\n" . "</html>\n";
    exit(1);
}
예제 #6
0
function showSetupMenu()
{
    //Init header page and rss
    header("Content-type: text/xml");
    echo '<?xml version="1.0" encoding="UTF-16" ?>' . "\n";
    echo '<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://purl.org/dc/elements/1.1/">' . "\n";
    printHeader();
    echo '  <channel>' . "\n";
    echo '  <title>xMegafilm - ' . resourceString("configure") . '</title>' . "\n";
    $link = SERVER_HOST_AND_PATH . "php/config/setup.php?action=";
    showMenuLink(resourceString("title_return_menu"), SERVER_HOST_AND_PATH . "php/index.php", "", 0);
    showMenuLink(resourceString("title_remove_cookie"), $link . 'DELETE_COOKIE', XTREAMER_IMAGE_PATH . "img/cookie_delete.jpg", 1);
    showMenuChangeCookieLink(resourceString("title_modify_user") . " (Username: "******"------") . ")", SERVER_HOST_AND_PATH . "php/config/setup.php?user=%s" . URL_AMP . "action=MODIFY_USER", XTREAMER_IMAGE_PATH . "img/cookie_edit.jpg", 2);
    showMenuChangeCookieLink(resourceString("title_modify_cookie") . " (Cookie: " . (MEGAUPLOAD_COOKIE ? MEGAUPLOAD_COOKIE : "------") . ")", SERVER_HOST_AND_PATH . "php/config/setup.php?pass=%s" . URL_AMP . "user="******"action=MODIFY_COOKIE", XTREAMER_IMAGE_PATH . "img/cookie_edit.jpg", 3);
    //End rss file
    echo '  </channel>' . "\n";
    echo '</rss>';
}
<?php

// This script php implements
// find all artists listened by a user’s friend but not the user, order them by the
// number of friends listening to them, recommend the top 5
// Include library of functions
include "functions.php";
// connection to neo4j
require 'vendor/autoload.php';
$client = new Everyman\Neo4j\Client('localhost', 7474);
printHeader();
printSearchForm($uid);
echo "<b>User: {$uid} - All Artist Listened by my friends</b><br><br>";
$queryString = "MATCH (u:user {id:{$uid}})-[:ADD_FRIEND_TO]-(:user)-[listen: WEIGHT]-(a:artist)\r\nWHERE NOT (u)-[:WEIGHT]-(a)\r\nWITH a, count(u) as count\r\nRETURN a\r\nORDER BY count desc LIMIT 5";
$query = new Everyman\Neo4j\Cypher\Query($client, $queryString);
$result = $query->getResultSet();
foreach ($result as $row) {
    $artist = $client->getNode($row['x']->getId());
    $artistId = $artist->getProperty('id');
    $artistName = $artist->getProperty('name');
    echo "Artist Name: " . $artistName . "</br>";
    printArtistInfo($artistId);
    ?>
	<form action="listen.php" method="post">
	<input type="hidden" name="action" value="addlisten">
	<input type="hidden" name="userId" value="<?php 
    echo $uid;
    ?>
">
	<input type="hidden" name="artistId" value="<?php 
    echo $artistId;
예제 #8
0
		 	}
		 	
		 	e.setAttribute("active", "true"); 
		 	document.getElementById(e.getAttribute("targetid")).style.display = 'block';	
		}
        
        </script>
    </head>
    <body>
        <!--[if lt IE 8]>
            <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
        <![endif]-->
        
        <!-- Nav -->
	    <?php 
echo printHeader(true, true, "beige", "about", "./about.php");
?>
        
	    
	    <div class="container pagecontent news">
	    	<!-- ABOUT -->
			<div class="content-segment" id="content">
				<!-- slagzin -->
				<div class="row">
					<div class="col-md-3 title">
		        		<span class="sidetitle underscore">BINAIR 01</span><br><br>
					</div>
					<div class="col-md-8">
						<div class="nomargin slagzin" id="slagzin">
							<!--Toggle-->
							<h2><a class="red activated" active="false" targetid="bin01" onclick="openInfo(this)">Binair 01&#x25BE</a></h2> 
예제 #9
0
 public function __construct()
 {
     $message = $this->testTheEnvironment();
     if (is__writable("./") && !file_exists(".htaccess")) {
         file_put_contents(".htaccess", htaccess());
     }
     $this->generateSiteUrl();
     if (!empty($message)) {
         printHeader();
         echo $message;
         echo "</body>";
         echo "</html>";
     } elseif ($this->runForm()) {
         unlink(__FILE__);
         header("Location:" . $this->siteUrl . "add/post");
         exit;
     } else {
         $updater = new Updater();
         $version = $updater->getInfos();
         printHeader($version);
         printForm();
         echo "</body>";
         echo "</html>";
     }
 }
예제 #10
0
<?php

printHeader('boutique', false, 'boutique', false);
?>
            <div id="top4-middle" class="block-middle">
                <div class="head-block">top 4</div>
                <table style="width:100%; text-align:center;">
                    <tr><?php 
foreach ($top4Array as $top4) {
    ?>
                        <td><a href="boutique.php?produit=<?php 
    echo $top4['ID'];
    ?>
" class="a-img"><img src="<?php 
    echo $top4['image'];
    ?>
" alt="<?php 
    echo $top4['titre'];
    ?>
" style="max-width:175px; max-height:250px;" /></a><br />
                <a href="boutique.php?produit=<?php 
    echo $top4['ID'];
    ?>
" ><?php 
    echo $top4['titre'];
    ?>
 (acheté <?php 
    echo $top4['achat'];
    ?>
 fois)</a></td><?php 
}
예제 #11
0
<?php

printHeader('admin', false, 'administration : éditer un membre', true);
?>
                    <div id="admin-membre-edit" class="block-middle">
                        <div class="head-block">édition du membre n°<?php 
echo htmlspecialchars($_GET['id']);
?>
</div><br />

                        <?php 
foreach ($membreArray as $infos) {
    ?>
                <form action="membre.php?admin=envoi" method="post" enctype="multipart/form-data"  onsubmit="return verifFormAdminModifMembre(this)">
                    <fieldset style="text-align:left; width:80%; margin:auto;">
                        <legend>Administration - modification d'un membre</legend>
                        <table style="margin:auto;">
                            <tr>
                                <td><label id="pseudoLabel" for="pseudo">Pseudo :</label></td>
                                <td><input type="text" name="pseudo" id="pseudo" size="52" value="<?php 
    echo htmlspecialchars($infos["pseudo"]);
    ?>
" onblur="verifRegex(this, rgxPseudo)" /></td>
                            </tr>
                            <tr>
                                <td><label id="nomLabel" for="nom">Nom :</label></td>
                                <td><input type="text" name="nom" id="nom" size="75" value="<?php 
    echo htmlspecialchars($infos["nom"]);
    ?>
" onblur="verifRegex(this, rgxNom)" /></td>
                            </tr>
예제 #12
0
파일: bank.php 프로젝트: Yanrs/PkmnChan
<?php

include 'config.php';
include 'functions.php';
if (!isLoggedIn()) {
    die;
}
include '_header.php';
printHeader('Bank');
logs($uid, " accessed bank page!");
// other stuff
$user1 = mysql_query("SELECT * FROM `users` WHERE `id`='" . $_SESSION['userid'] . "'");
$user = mysql_fetch_object($user1);
//QUICK DRAW
if ($_GET['d'] == 1) {
    $_POST['deposit'] = 1;
    $_POST['damount'] = $user->money;
} elseif ($_GET['w'] == 1) {
    $_POST['withdraw'] = 1;
    $_POST['wamount'] = $user->bank;
}
if ($_POST['deposit'] != "") {
    $_POST['withdraw'] = "";
    if (strtolower(substr($_POST['damount'], -1)) == "k") {
        $_POST['damount'] = $_POST['damount'] * 1000;
    }
    if (strtolower(substr($_POST['damount'], -1)) == "m") {
        $_POST['damount'] = $_POST['damount'] * 1000000;
    }
    $_POST['damount'] = mysql_real_escape_string($_POST['damount']);
    $dontlike = array(',', '$', '+', '-');
예제 #13
0
function secsToRoughTime($secs)
{
    $seconds = array('days' => 86400, 'hours' => 3600, 'minutes' => 60, 'seconds' => 1);
    foreach ($seconds as $name => $seconds) {
        $amount = intval($secs / $seconds);
        if ($amount > 0) {
            return $amount . ' ' . ($amount == 1 ? rtrim($name, 's') : $name);
        }
    }
    return '-';
}
if (!isLoggedIn()) {
    redirect('login.php');
}
include '_header.php';
printHeader('Auction History');
$uid = (int) $_SESSION['userid'];
$extraSqlArr = array('1' => array('sql' => 'ORDER BY `finish_time` DESC', 'text' => 'Newest Sold'), '2' => array('sql' => 'ORDER BY `winning_bid` DESC', 'text' => 'Most Expensive'), '3' => array('sql' => 'ORDER BY `level` DESC', 'text' => 'Highest Level'), '4' => array('sql' => "WHERE `owner_id`='{$uid}' ORDER BY `finish_time` DESC", 'text' => 'Just My Auctions'));
$key = isset($_GET['s']) && array_key_exists($_GET['s'], $extraSqlArr) ? (int) $_GET['s'] : 1;
$extraSql = $extraSqlArr[$key]['sql'];
$links = array();
foreach ($extraSqlArr as $k => $a) {
    $links[] = $key == $k ? $a['text'] : '<a href="?s=' . $k . '">' . $a['text'] . '</a>';
}
$query = mysql_query("SELECT * FROM `auction_history` {$extraSql} LIMIT 100");
echo '
	<img src="images/auction.png" /><br /><br />
	<a href="auction.php">View Auctions</a><br /><br />
	' . implode(' &bull; ', $links) . '<br /><br />
';
if (mysql_num_rows($query) == 0) {
예제 #14
0
<?php

require_once "header.php";
checkLogin("administrator");
if (isset($_GET['classesFor'])) {
    $instructorId = $db->escape_string($_GET['classesFor']);
    $instructorName = $db->query("SELECT name FROM Instructor WHERE userId='{$instructorId}'")->fetch_array(MYSQLI_ASSOC);
    printHeader("Classes Taught By " . $instructorName['name']);
    // List classes for an instructor
    $classes = $db->query("SELECT * FROM Teaches NATURAL JOIN Class WHERE userId='{$instructorId}'");
    echo "<table><tr><th>ID</th><th>Class Num</th><th>Class Name</th><th>Section</th><th>Semester</th><th>Credit</th><th>Actions</th></tr>";
    while ($currentClass = $classes->fetch_array(MYSQLI_ASSOC)) {
        echo "<tr><td>" . $currentClass['classId'] . "</td><td>" . $currentClass['classNum'] . "</td><td>" . $currentClass['className'] . "</td><td>" . $currentClass['sectionNum'] . "</td>";
        echo "<td>" . $currentClass['semester'] . " " . $currentClass['year'] . "</td><td>" . $currentClass['creditHours'] . "</td>";
        echo "<td><a href='admin_teaches.php?userId={$instructorId}&amp;classId=" . $currentClass['classId'] . "'>Remove</a></td></tr>";
    }
    echo "</table>";
} else {
    printHeader("Instructor List");
    // List all instructors
    $instructors = $db->query("SELECT * FROM Instructor ORDER BY name");
    echo "<table><tr><th>ID#</th><th>Name</th><th>Department</th><th>Tenure</th><th>Classes</th></tr>";
    while ($currentInstructor = $instructors->fetch_array(MYSQLI_ASSOC)) {
        echo "<tr><td>" . $currentInstructor['userId'] . "</td><td>" . $currentInstructor['name'] . "</td><td>" . $currentInstructor['department'] . "</td>";
        $tenure = $currentInstructor['tenure'] ? "Yes" : "No";
        echo "<td>" . $tenure . "</td><td><a href='admin_showinstructors.php?classesFor=" . $currentInstructor['userId'] . "'>Show classes</a></td></tr>";
    }
    echo "</table>";
}
printFooter("admin");
예제 #15
0
파일: spider.php 프로젝트: hoelzro/Bifrost
function index_site($url, $reindex, $maxlevel, $soption, $url_inc, $url_not_inc, $can_leave_domain)
{
    global $mysql_table_prefix, $command_line, $mainurl, $tmp_urls, $domain_arr, $all_keywords;
    if (!isset($all_keywords)) {
        $result = mysql_query("select keyword_ID, keyword from " . $mysql_table_prefix . "keywords");
        echo mysql_error();
        while ($row = mysql_fetch_array($result)) {
            $all_keywords[addslashes($row[1])] = $row[0];
        }
    }
    $compurl = parse_url($url);
    if ($compurl['path'] == '') {
        $url = $url . "/";
    }
    $t = microtime();
    $a = getenv("REMOTE_ADDR");
    $sessid = md5($t . $a);
    $urlparts = parse_url($url);
    $domain = $urlparts['host'];
    if (isset($urlparts['port'])) {
        $port = (int) $urlparts['port'];
    } else {
        $port = 80;
    }
    $result = mysql_query("select site_id from " . $mysql_table_prefix . "sites where url='{$url}'");
    echo mysql_error();
    $row = mysql_fetch_row($result);
    $site_id = $row[0];
    if ($site_id != "" && $reindex == 1) {
        mysql_query("insert into " . $mysql_table_prefix . "temp (link, level, id) values ('{$url}', 0, '{$sessid}')");
        echo mysql_error();
        $result = mysql_query("select url, level from " . $mysql_table_prefix . "links where site_id = {$site_id}");
        while ($row = mysql_fetch_array($result)) {
            $site_link = $row['url'];
            $link_level = $row['level'];
            if ($site_link != $url) {
                mysql_query("insert into " . $mysql_table_prefix . "temp (link, level, id) values ('{$site_link}', {$link_level}, '{$sessid}')");
            }
        }
        $qry = "update " . $mysql_table_prefix . "sites set indexdate=now(), spider_depth = {$maxlevel}, required = '{$url_inc}'," . "disallowed = '{$url_not_inc}', can_leave_domain={$can_leave_domain} where site_id={$site_id}";
        mysql_query($qry);
        echo mysql_error();
    } else {
        if ($site_id == '') {
            mysql_query("insert into " . $mysql_table_prefix . "sites (url, indexdate, spider_depth, required, disallowed, can_leave_domain) " . "values ('{$url}', now(), {$maxlevel}, '{$url_inc}', '{$url_not_inc}', {$can_leave_domain})");
            echo mysql_error();
            $result = mysql_query("select site_ID from " . $mysql_table_prefix . "sites where url='{$url}'");
            $row = mysql_fetch_row($result);
            $site_id = $row[0];
        } else {
            mysql_query("update " . $mysql_table_prefix . "sites set indexdate=now(), spider_depth = {$maxlevel}, required = '{$url_inc}'," . "disallowed = '{$url_not_inc}', can_leave_domain={$can_leave_domain} where site_id={$site_id}");
            echo mysql_error();
        }
    }
    $result = mysql_query("select site_id, temp_id, level, count, num from " . $mysql_table_prefix . "pending where site_id='{$site_id}'");
    echo mysql_error();
    $row = mysql_fetch_row($result);
    $pending = $row[0];
    $level = 0;
    $domain_arr = get_domains();
    if ($pending == '') {
        mysql_query("insert into " . $mysql_table_prefix . "temp (link, level, id) values ('{$url}', 0, '{$sessid}')");
        echo mysql_error();
    } else {
        if ($pending != '') {
            printStandardReport('continueSuspended', $command_line);
            mysql_query("select temp_id, level, count from " . $mysql_table_prefix . "pending where site_id='{$site_id}'");
            echo mysql_error();
            $sessid = $row[1];
            $level = $row[2];
            $pend_count = $row[3] + 1;
            $num = $row[4];
            $pending = 1;
            $tmp_urls = get_temp_urls($sessid);
        }
    }
    if ($reindex != 1) {
        mysql_query("insert into " . $mysql_table_prefix . "pending (site_id, temp_id, level, count) values ('{$site_id}', '{$sessid}', '0', '0')");
        echo mysql_error();
    }
    $time = time();
    $omit = check_robot_txt($url);
    printHeader($omit, $url, $command_line);
    $mainurl = $url;
    $num = 0;
    while ($level <= $maxlevel && $soption == 'level' || $soption == 'full') {
        if ($pending == 1) {
            $count = $pend_count;
            $pending = 0;
        } else {
            $count = 0;
        }
        $links = array();
        $result = mysql_query("select distinct link from " . $mysql_table_prefix . "temp where level={$level} && id='{$sessid}' order by link");
        echo mysql_error();
        $rows = mysql_num_rows($result);
        if ($rows == 0) {
            break;
        }
        $i = 0;
        while ($row = mysql_fetch_array($result)) {
            $links[] = $row['link'];
        }
        reset($links);
        while ($count < count($links)) {
            $num++;
            $thislink = $links[$count];
            $urlparts = parse_url($thislink);
            reset($omit);
            $forbidden = 0;
            foreach ($omit as $omiturl) {
                $omiturl = trim($omiturl);
                $omiturl_parts = parse_url($omiturl);
                if ($omiturl_parts['scheme'] == '') {
                    $check_omit = $urlparts['host'] . $omiturl;
                } else {
                    $check_omit = $omiturl;
                }
                if (strpos($thislink, $check_omit)) {
                    printRobotsReport($num, $thislink, $command_line);
                    check_for_removal($thislink);
                    $forbidden = 1;
                    break;
                }
            }
            if (!check_include($thislink, $url_inc, $url_not_inc)) {
                printUrlStringReport($num, $thislink, $command_line);
                check_for_removal($thislink);
                $forbidden = 1;
            }
            if ($forbidden == 0) {
                printRetrieving($num, $thislink, $command_line);
                $query = "select md5sum, indexdate from " . $mysql_table_prefix . "links where url='{$thislink}'";
                $result = mysql_query($query);
                echo mysql_error();
                $rows = mysql_num_rows($result);
                if ($rows == 0) {
                    index_url($thislink, $level + 1, $site_id, '', $domain, '', $sessid, $can_leave_domain, $reindex);
                    mysql_query("update " . $mysql_table_prefix . "pending set level = {$level}, count={$count}, num={$num} where site_id={$site_id}");
                    echo mysql_error();
                } else {
                    if ($rows != 0 && $reindex == 1) {
                        $row = mysql_fetch_array($result);
                        $md5sum = $row['md5sum'];
                        $indexdate = $row['indexdate'];
                        index_url($thislink, $level + 1, $site_id, $md5sum, $domain, $indexdate, $sessid, $can_leave_domain, $reindex);
                        mysql_query("update " . $mysql_table_prefix . "pending set level = {$level}, count={$count}, num={$num} where site_id={$site_id}");
                        echo mysql_error();
                    } else {
                        printStandardReport('inDatabase', $command_line);
                    }
                }
            }
            $count++;
        }
        $level++;
    }
    mysql_query("delete from " . $mysql_table_prefix . "temp where id = '{$sessid}'");
    echo mysql_error();
    mysql_query("delete from " . $mysql_table_prefix . "pending where site_id = '{$site_id}'");
    echo mysql_error();
    printStandardReport('completed', $command_line);
}
예제 #16
0
파일: index.php 프로젝트: beakid/md
    $e = "86";
}
$rarity["c"] = "commons";
$rarity["u"] = "uncommons";
$rarity["r"] = "rares";
$rarity["all"] = "cards";
$color["w"] = "White";
$color["u"] = "Blue";
$color["b"] = "Black";
$color["r"] = "Red";
$color["g"] = "Green";
$color["l"] = "Land";
$color["a"] = "Artifact";
$color["all"] = "All";
$exp_info = mysql_fetch_array(mysql_query("SELECT * FROM md_exp WHERE pk_exp_id = {$e}"));
echo printHeader("MagicDraft - Draft", "stats");
?>
	<div id="content">
		<div id="left" class="greyback">
			<div class="box greyback">
				<img src="<?php 
echo $path;
?>
/images/header_stats.png" class="headerpic" alt="Statistics" />
				<p class="text">Show stats for:</p>
				<select name="e" size="1" style="width: 140px;" onchange="location.href='?e='+this.value+'&amp;c=<?php 
echo $c;
?>
&amp;r=<?php 
echo $r;
?>
예제 #17
0
파일: help.php 프로젝트: rhaxton/phpki
<?php

include '../config.php';
include STORE_DIR . '/config/config.php';
include '../include/my_functions.php';
include '../include/common.php';
printHeader(false);
?>
<p>
<center>
<table class=menu>
<th class=menu style="font-size: 24px;">PHPki HELP FILE<br>TABLE OF CONTENTS</th>
<tr><td class=menu style="padding: 1em;">
<a href=#WHY>Why PHPki</a><br>
<a href=#OVERVIEW>Overview</a><br>
<a href=#MAIN-MENU>Main Menu</a><br>
<a href=#REQUEST-FORM>Requesting a New Certificate</a><br>
<a href=#MANAGE>Managing Your Certificate With The Control Panel</a><br>
<a href=#REVOKE>Revoking a Certificate</a><br>
<a href=#DISPLAY>Displaying Certificate Details</a><br>
<a href=#RENEW>Renewing a Cettificate</a><br>
<a href=#DOWNLOAD>Downloading a Certificate</a><br>
<a href=../help.php target=help>End User Help Documents</a><br>
<a href=#GLOSSARY>The PHPki Glossary of Terms</a><br>
<a href=#GETTING-HELP>Getting Additional Help</a><br>
</td></tr>
</table>
</center>

<br><br><br><br><br><br>
예제 #18
0
파일: view_box.php 프로젝트: Yanrs/PkmnChan
require_once 'config.php';
require_once 'functions.php';
require_once 'pagination.class.php';
if (!isLoggedIn()) {
    redirect('login.php');
}
$gid = (int) (isset($_GET['id']) ? $_GET['id'] : $_SESSION['userid']);
$query = mysql_query("SELECT `username` FROM `users` WHERE `id`='{$gid}' LIMIT 1");
if (mysql_num_rows($query) == 0) {
    redirect('view_box.php');
}
$boxUsername = mysql_fetch_assoc($query);
$boxUsername = $boxUsername['username'];
include '_header.php';
$headerText = isset($_GET['id']) ? $boxUsername . 's Pokemon' : 'Your Pokemon';
printHeader($headerText);
$sorts = array(1 => ' ORDER BY `name` ASC', 2 => ' ORDER BY `name` DESC', 3 => ' ORDER BY `exp` ASC', 4 => ' ORDER BY `exp` DESC');
$search = isset($_GET['search']) ? $_GET['search'] : '';
$sort = $_GET['sort'];
$sortKey = isset($sort) && in_array($sort, array_keys($sorts)) ? $sort : 1;
$orderSql = $sorts[$sortKey];
$searchSql = '';
if (!empty($search)) {
    $searchSqlSafe = cleanSql($search);
    $searchHtmlSafe = cleanHtml($search);
    $searchSql = " AND `name` LIKE '%{$searchSqlSafe}%' ";
}
$countQuery = mysql_query("SELECT `id` FROM `user_pokemon` WHERE `uid`='{$gid}' {$searchSql}");
$numRows = mysql_num_rows($countQuery);
$pagination = new Pagination($numRows);
if (!empty($search)) {
예제 #19
0
require_once ABSPATH . 'fm-includes/init.php';
require_once ABSPATH . 'fm-includes/version.php';
$app_compat = checkAppVersions(false);
if ($app_compat) {
    bailOut($app_compat);
}
$step = isset($_GET['step']) ? $_GET['step'] : 0;
if (array_key_exists('backup', $_GET)) {
    if (!class_exists('fm_tools')) {
        include ABSPATH . 'fm-modules' . DIRECTORY_SEPARATOR . 'facileManager' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'class_tools.php';
    }
    $fm_tools->backupDatabase();
    header('Location: ' . $GLOBALS['basename']);
}
$branding_logo = $GLOBALS['RELPATH'] . 'fm-modules/' . $fm_name . '/images/fm.png';
printHeader(_('Upgrade'), 'install');
switch ($step) {
    case 0:
    case 1:
        if (!file_exists(ABSPATH . 'config.inc.php') || !file_get_contents(ABSPATH . 'config.inc.php')) {
            header('Location: /fm-install.php');
        }
        printf('<div id="fm-branding">
		<img src="%s" /><span>%s</span>
	</div>
	<div id="window"><p>', $branding_logo, _('Upgrade'));
        $backup_button = findProgram('mysqldump') ? sprintf('<a href="?backup" class="button">%s</a>', _('Backup Database')) : null;
        printf(_("I have detected you recently upgraded %s and its modules, but have not upgraded the database. Click 'Upgrade' to start the upgrade process."), $fm_name);
        printf('</p><p class="step"><a href="?step=2" class="button click_once">%s</a> %s</p></div>', _('Upgrade'), $backup_button);
        break;
    case 2:
예제 #20
0
function printLoginFailure($str = "")
{
    printHeader();
    if (strlen($str) > 0) {
        print "\n" . $str;
    } else {
        print "\nHOBA Login Failed: Session expired or something else broke.";
    }
    printFooter();
}
예제 #21
0
<?php

require_once "header.php";
checkLogin("administrator");
printHeader("Class Management");
function yesOrNo($bool)
{
    if ($bool == 1) {
        return "Yes";
    } else {
        return "No";
    }
}
if (isset($_GET['classId'])) {
    $classId = $db->escape_string($_GET['classId']);
    $classStuff = $db->query("SELECT * FROM Class WHERE classId='{$classId}'");
    $class = $classStuff->fetch_array(MYSQLI_ASSOC);
    $prereqs = $db->query("SELECT DISTINCT Prerequisite.requiredClassNum, Class.className FROM Prerequisite\n\tJOIN Class ON Prerequisite.requiredClassNum=Class.classNum WHERE requiringClassNum='" . $class['classNum'] . "'");
    echo "<h2>Class Info</h2>";
    echo "Class Name: " . $class['className'] . "<br>";
    echo "Class Number: " . $class['classNum'] . "<br>";
    echo "Class Id: " . $class['classId'] . "<br>";
    echo "Semester: " . $class['semester'] . " " . $class['year'] . "<br>";
    echo "Capacity: " . $class['maxEnrollment'] . "<br>";
    echo "<h2>Prerequisites</h2>\n\t<ul>";
    if ($prereqs->num_rows == 0) {
        echo "<li>None</li>";
    }
    while ($required = $prereqs->fetch_array(MYSQLI_ASSOC)) {
        echo "<li>" . $required['requiredClassNum'] . " - " . $required['className'] . "</li>";
    }
예제 #22
0
파일: join.php 프로젝트: qiemem/GovDialogue
<?php

// join.php
require_once "lib/usermanagement.php";
require_once "header.php";
printHeader("Join", "Keywords", "Description", "join");
/* Structure:

Is user logged in? If yes:
	Display error
Else
	Has form data been submitted? If yes:
		Validate fields
		Errors? If yes:
			Display errors
		Else:
			Process form/add user
	Else
		Display join form

*/
// Start error processing
function inError()
{
    global $errors;
    return count($errors) > 0;
}
if (isUserLoggedIn()) {
    // lives in header.php
    // User is already logged in; display error
    echo "You're already logged in!";
예제 #23
0
/**
 * Displays an error page message
 *
 * @since 1.2
 * @package facileManager
 *
 * @param string $message Text to display
 * @param string $link_display Show or Hide the page back link
 * @return string
 */
function fMDie($message = null, $link_display = 'show')
{
    global $fm_name;
    $branding_logo = $GLOBALS['RELPATH'] . 'fm-modules/' . $fm_name . '/images/fm.png';
    if (!$message) {
        $message = _('An unknown error occurred.');
    }
    printHeader('Error', 'install', false, false);
    printf('<div id="fm-branding"><img src="%s" /><span>%s</span></div>
		<div id="window"><p>%s</p>', $branding_logo, _('Oops!'), $message);
    if ($link_display == 'show') {
        echo '<p><a href="javascript:history.back();">' . _('&larr; Back') . '</a></p>';
    }
    echo '</div>';
    exit;
}
예제 #24
0
<?php

include 'config.php';
include 'functions.php';
if (!isLoggedIn()) {
    redirect('login.php');
}
if (!isset($_GET['id'])) {
    redirect('membersarea.php');
}
$pid = (int) $_GET['id'];
$uid = (int) $_SESSION['userid'];
$sqlUsername = cleanSql($_SESSION['username']);
include '_header.php';
printHeader('Start An Auction');
$query = mysql_query("SELECT * FROM `user_pokemon` WHERE `id`='{$pid}' AND `uid`='{$uid}'");
if (mysql_num_rows($query) == 0) {
    echo '<div class="error">Not your pokemon!</div>';
    include '_footer.php';
    die;
}
$pokeRow = mysql_fetch_assoc($query);
if (in_array($pokeRow['id'], getUserTeamIds($uid))) {
    echo '<div class="error">This pokemon is in your team,</div>';
    include '_footer.php';
    die;
}
if (isset($_POST['duration']) && in_array($_POST['duration'], range(0, 4))) {
    $costs = array('0' => 200, '1' => 1000, '2' => 5000, '3' => 10000, '4' => 15000);
    $cost = $costs[$_POST['duration']];
    if (getUserMoney($uid) < $cost) {
예제 #25
0
function displayLocalImage($imgFile, $type = "view")
{
    $filename = basename($imgFile);
    $imgFile = findMedia($imgFile);
    if (!file_exists($imgFile)) {
        $imgFile = findMedia("images/notfound/file.png");
    }
    printHeader($filename, $type);
    printVFile($imgFile);
}
예제 #26
0
<?php

/*
 * Vivo Applications
 *
 * PHP for the playground page.
 */
include "global.php";
ensure_logged_in();
$description = "Hone your cryptography skills to become the very best!";
$keywords = "crypto, vivo, applications, training";
$cssfiles = ["styles/global.css", "styles/playground.css"];
$jsfiles = ["scripts/global.js", "scripts/playground.js"];
printHeader("Playground | Crypto", $description, $keywords, $cssfiles, $jsfiles);
printNavbar();
?>

<div id="main_content">
    <h1>Playground</h1>
    <div class="cryptoGame">
			<div id="leftColumn">
				<div class="tabs">
					<div class="tab-list">
						<ol>
							
							<button type="button" id="challenge_one" class="tab_active">
							<li id="tab_challenge_one">
							Challenge One
							</li>
							</button>
							
예제 #27
0
<?php

include '../config.php';
include '../functions.php';
if (!isLoggedIn()) {
    redirect('index.php');
}
include '../_header.php';
printHeader('Create a clan');
$uid = (int) $_SESSION['userid'];
$user = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id = '{$uid}'"));
$user2 = mysql_fetch_array(mysql_query("SELECT money FROM users WHERE id = '{$uid}'"));
$money = $user2['money'];
$username = $user['username'];
if ($user['clan'] != 0) {
    echo '<div class="error">To create a clan you must leave your current one.</div>';
    include '../_footer.php';
    die;
}
$_POST['name'] = $_POST['name'];
if ($_POST['create'] != "") {
    // if they are wanting to start a new clan
    $error .= $money < 1000000 ? "You don't have enough coins to start a clan. You need at least 1,000,000 money.<br>" : "";
    $error .= ($user['clan'] = 0) ? "You have to leave your clan to start a new clan.<br>" : "";
    $error .= strlen($_POST['name']) < 4 ? "Your clan's name has to be at least 4 characters long.<br>" : "";
    $error .= strlen($_POST['name']) > 20 ? "Your clan's name can only be a max of 20 characters long.<br>" : "";
    if (!preg_match('~^[a-z0-9 ]+$~i', $_POST['name'])) {
        $error .= "Special characters in your clan name isn't allowed.<br>";
    }
    //check if name is taken yet
    $check = mysql_query("SELECT * FROM `clans` WHERE `name`='" . $_POST['name'] . "'");
예제 #28
0
// Generate navigation info
$navigation["0"]["0"] = scriptUrl . "/" . folderBlog;
$navigation["0"]["1"] = $lBlogIndex["Header"];
$navigation["1"]["0"] = scriptUrl . "/" . folderBlog . "/" . fileBlog . "?blogId=" . $post->blog->id;
$navigation["1"]["1"] = $post->blog->title;
if (!empty($post->id)) {
    $navigation["2"]["0"] = scriptUrl . "/" . folderBlog . "/" . fileBlogPost . "?postId=" . $post->id;
    $navigation["2"]["1"] = $post->subject;
    $navigation["3"]["0"] = scriptUrl . "/" . folderBlog . "/" . fileBlogPostEdit . "?postId=" . $post->id;
    $navigation["3"]["1"] = $lBlogEditPost["EditPost"];
} else {
    $navigation["2"]["0"] = scriptUrl . "/" . folderBlog . "/" . fileBlogPostEdit;
    $navigation["2"]["1"] = $lBlogEditPost["NewPost"];
}
// Print common header
printHeader(!empty($post->id) ? $lBlogEditPost["EditPost"] : $lBlogEditPost["NewPost"], folderBlog, $navigation, true);
// Print description
if (empty($post->id)) {
    echo "<p>" . $lBlogEditPost["NewPostText"] . "</p>";
} else {
    printf("<p>" . $lBlogEditPost["EditPostText"] . "</p>", $post->subject);
}
// Print errors
if ($errors->hasErrors()) {
    $errors->printErrorMessages();
}
// Set current path for text fields
define("currentPath", "../");
// Include post form
include scriptPath . "/" . folderBlog . "/include/form/postForm.php";
// Print transactions
예제 #29
0
파일: index.php 프로젝트: gkathir15/catmis
            redirect($_SERVER["HTTP_REFERER"]);
        } else {
            if ($_GET["down"]) {
                $blog->moveBlogDown($blog->id);
                redirect($_SERVER["HTTP_REFERER"]);
            }
        }
    }
}
// Include language
include_once scriptPath . "/" . folderBlog . "/include/language/" . pageLanguage . "/general.php";
// Generate navigation
$navigation[0][0] = scriptUrl . "/" . folderBlog;
$navigation[0][1] = $lBlogIndex["Header"];
// Print common header
printHeader($lBlogIndex["Header"], folderBlog, $navigation, true);
// Print section header
echo "<p>" . $lBlogIndex["HeaderText"] . ($blog->hasEditPermission() ? " " . $lBlogIndex["NewBlog"] . "</p>" : "");
// Fetch blogs the user can administer
$result = $dbi->query("SELECT category FROM " . blogTableName . " GROUP BY category");
// Print categories
if ($result->rows()) {
    for ($i = 0; list($category) = $result->fetchrow_array(); $i++) {
        $result2 = $dbi->query("SELECT id FROM " . blogTableName . " WHERE (category=" . $dbi->quote($category) . ") ORDER BY position");
        // Print blogs in category
        if ($result2->rows()) {
            $headerPrinted = false;
            for ($j = 0; list($blogId) = $result2->fetchrow_array(); $j++) {
                $blogIndex = new Blog($blogId);
                if ($blogIndex->hasReadPermission()) {
                    if (!$headerPrinted) {
예제 #30
0
<?php

printHeader('admin', false, 'administration ~ boutique', false);
?>
            <div id="admin-boutique" class="block-middle">
                <div class="head-block">boutique</div><br />
                <div style="text-align:center;">
                    <a href="boutique.php?admin=index" class="active">[ Geston des produits ]</a> | <a href="boutique.php?admin=produit-add">[ Ajouter un produit ]</a> | <a href="boutique.php?admin=achat">[ Gestion des achats ]</a> | <a href="boutique.php?admin=categorie">[ Gestion des catégories ]</a>
                </div><br />
                <table style="width:100%; text-align:center;">
                <tr>
                    <td><strong>ID</strong></td>
                    <td><strong>Titre</strong></td>
                    <td><strong>Auteur</strong></td>
                    <td><strong>Catégorie</strong></td>
                    <td><strong>Editer</strong></td>
                    <td><strong>Supprimer</strong></td>
                </tr>
                <?php 
foreach ($produitsArray as $produit) {
    ?>
                    <tr>
                        <td>(<?php 
    echo htmlspecialchars($produit["ID"]);
    ?>
)</td>
                        <td><?php 
    echo htmlspecialchars($produit["titre"]);
    ?>
</td>
                        <td><?php