Example #1
0
function ex($pytanie)
{
    con();
    $result = mysql_query($pytanie);
    if ($result > 0) {
        return 1;
    } else {
        return 0;
    }
}
Example #2
0
/**
 *
 */
function regMatch($pattern, $str)
{
    con(is_string($pattern), "regMatch()", "pattern must be string: ", $pattern);
    con(is_string($str), "regMatch()", "str must be string: ", $str);
    $retval = preg_match($pattern, $str, $matches);
    con($retval !== false, "regMatch()", "preg_match() returned false: ", $str);
    $r1 = $retval === 1;
    $r2 = $retval !== 0;
    $r3 = count($matches) !== 0;
    con($r1 === $r2, "regMatch()", "invariance test 1 failed: ", $r1, $r2);
    con($r1 === $r3, "regMatch()", "invariance test 2 failed: ", $r1, $r3);
    return $r1;
}
Example #3
0
 function _tpl_act_changes(&$event, $param)
 {
     global $TEXT;
     global $PRE;
     global $SUF;
     if ('changes' != $event->data) {
         return;
     }
     html_edit($TEXT);
     echo '<br id="scroll__here" />';
     html_diff(con($PRE, $TEXT, $SUF));
     $event->preventDefault();
     return;
 }
function geraJsonCidades($estadosId)
{
    $query = con()->query("Select * from cidades where estado_id = {$estadosId} order by cidade_nome");
    $cidades = $query->fetchAll();
    $stringJson = "{\"Cidades\":[";
    for ($i = 0; $i < count($cidades); $i++) {
        $stringJson .= "{\"id\":\"" . $cidades[$i]["cidade_id"] . "\",\"nome\":\"" . utf8_encode($cidades[$i]["cidade_nome"]) . "\"}";
        if ($i < count($cidades) - 1) {
            $stringJson .= ",";
        }
    }
    $stringJson .= "]}";
    return $stringJson;
}
Example #5
0
/**
 * Handle 'save'
 *
 * Checks for spam and conflicts and saves the page.
 * Does a redirect to show the page afterwards or
 * returns a new action.
 *
 * @author Andreas Gohr <*****@*****.**>
 */
function act_save($act)
{
    global $ID;
    global $DATE;
    global $PRE;
    global $TEXT;
    global $SUF;
    global $SUM;
    global $lang;
    global $INFO;
    //spam check
    if (checkwordblock()) {
        msg($lang['wordblock'], -1);
        return 'edit';
    }
    //conflict check
    if ($DATE != 0 && $INFO['meta']['date']['modified'] > $DATE) {
        return 'conflict';
    }
    //save it
    saveWikiText($ID, con($PRE, $TEXT, $SUF, 1), $SUM, $_REQUEST['minor']);
    //use pretty mode for con
    //unlock it
    unlock($ID);
    //delete draft
    act_draftdel($act);
    session_write_close();
    // when done, show page
    return 'show';
}
Example #6
0
function pointsGagne($question, $auteur)
{
    $con = con();
    $res = mysqli_query($con, "select count(id) from votes where auteur=''");
    $row = mysqli_fetch_array($res);
    if ($row == NULL) {
        return FALSE;
    }
    return TRUE;
    mysqli_close($con);
}
Example #7
0
            <hr>
            
 <div class="flatlistcontainer">
 <?php 
$query = "SELECT * FROM `filter` WHERE  `display` = '1' AND `userid`='{$userid}'";
$con = con();
$res = $con->query($query);
while ($arr = $res->fetch_array()) {
    $id = $arr['id'];
    $query2 = "SELECT * FROM `notification` WHERE `sho` = '1' AND `filterid` = '{$id}' AND `userid`='{$userid}' ";
    $con2 = con();
    $res2 = $con2->query($query2);
    while ($arr2 = $res2->fetch_array()) {
        $houseid = $arr2['houseid'];
        $query3 = "SELECT * FROM `flat` WHERE `id` = '{$houseid}' ";
        $con3 = con();
        $res3 = $con3->query($query3);
        while ($arr3 = $res3->fetch_array()) {
            if ($arr2['view'] == '1') {
                echo "<div class=\"row flatlist\" style=\"background-color:blue\">";
            } else {
                echo "<div class=\"row flatlist\" style=\"background-color:white\">";
            }
            ?>
            
                   <div class="col-md-12"><a href="modify.php?id=<?php 
            echo $id;
            ?>
&idd=<?php 
            echo $houseid;
            ?>
Example #8
0
<?php

//Connect to multiple addresses using a single file
//useful for cronjobs
//By Thunder33345(twitter.com/thunder33345)
//2016/1/17
$site = array("https://192.168.1.1");
function con($site)
{
    if (file_get_contents("{$site}")) {
        echo 1;
        echo $site;
        echo "||";
    } else {
        echo 0;
        echo $site;
        echo "||";
    }
}
foreach ($site as &$val) {
    con($val);
}
unset($val);
Example #9
0
<?php

function con()
{
    mysql_connect() or die('Could not connect: ' . mysql_error);
    mysql_select_db('sloisel_numeric') or die('Could not select db: ' . mysql_error());
}
con();
if (isset($_POST['savedata'])) {
    $data = $_POST['savedata'];
    if (get_magic_quotes_gpc()) {
        $data = stripslashes($data);
    }
    json_decode($data) or die("json error");
    $f = hash('sha256', $data);
    if ($f === "") {
        exit;
    }
    $d = mysql_real_escape_string($data);
    $q = "insert ignore into blobs value ('{$f}','{$d}')";
    $result = mysql_query($q) or die('Could not save script: ' . mysql_error());
    header('Location: workshop.php?link=' . $_GET['link']);
    exit;
}
?>

WORKSHOPHTML

<script>
<?php 
$incs = NULL;
Example #10
0
 /**
  * Hard to generalise together with get_single_row(), because they call different functions.
  */
 function get_single_assoc($sql)
 {
     $query = $this->query($sql);
     $row1 = $query->tryGetAssoc();
     con(is_array($row1), "get_single_assoc()", "Denne query gav intet resultat.");
     $row2 = $query->tryGetAssoc();
     con($row2 === false, "get_single_assoc()", "query må kun returneres én row: ", $row1, $row2);
     return $row1;
 }
Example #11
0
function supprVote2($reponse)
{
    $con = con();
    $stmt = mysqli_prepare($con, "DELETE FROM votes WHERE reponse = ? ");
    mysqli_stmt_bind_param($stmt, 'i', $reponse);
    mysqli_stmt_execute($stmt);
    mysqli_close($con);
}
Example #12
0
<?php 
session_start();
$id1 = $_SESSION['userid'];
include 'function.php';
$query = "select distinct user1,user2 from messages where user1='{$id1}' OR user2='{$id1}'";
$con = con();
$res = $con->query($query);
while ($arr = $res->fetch_array()) {
    if ($id1 == $arr['user1']) {
        $user2 = $arr['user2'];
        $query1 = "select * from user where id='{$user2}'";
        $con1 = con();
        $res1 = $con1->query($query1);
        while ($arr1 = $res1->fetch_array()) {
            echo "<a href=\"chatindex.php?id2=" . $arr['user2'] . "\">" . $arr1['name'] . "</a>";
            echo "<br>";
        }
    } else {
        $user1 = $arr['user1'];
        $query1 = "select * from user where id='{$user1}'";
        $con1 = con();
        $res1 = $con1->query($query1);
        while ($arr1 = $res1->fetch_array()) {
            echo "<a href=\"chatindex.php?id2=" . $arr['user1'] . "\">" . $arr1['name'] . "</a>";
            echo "<br>";
        }
    }
}
?>
</body>
</html>
Example #13
0
            
            </div>

            
            </div>
        </div>

        </div>

        <div class="wlistdetails">
           <h1 style="font-family: 'PT Sans Narrow', sans-serif;">Wishlist</h1>
            <hr>
            <div class="wlistcontainer">
                <?php 
$query7 = "select * from wishlist where buyerid='{$userid}' AND sho='1' ";
$con7 = con();
$res7 = $con7->query($query7);
while ($arr7 = $res7->fetch_array()) {
    $sellerid = $arr7['sellerid'];
    $houseid = $arr7['houseid'];
    $wishid = $arr7['id'];
    $query8 = "select * from user where id='{$sellerid}'";
    $res8 = $con->query($query8);
    while ($arr8 = $res8->fetch_array()) {
        $sellername = $arr8['name'];
        $sellernum = $arr8['phnno'];
    }
    $query9 = "select * from flat where id='{$houseid}'";
    $res9 = $con->query($query9);
    while ($arr9 = $res9->fetch_array()) {
        $houseno = $arr9['houseno'];
function qry($sql)
{
    $con = con();
    $res = mysql_query($sql, $con);
    return $res;
}
Example #15
0
/**
 * Handle 'save'
 *
 * Checks for spam and conflicts and saves the page.
 * Does a redirect to show the page afterwards or
 * returns a new action.
 *
 * @author Andreas Gohr <*****@*****.**>
 */
function act_save($act)
{
    global $ID;
    global $DATE;
    global $PRE;
    global $TEXT;
    global $SUF;
    global $SUM;
    //spam check
    if (checkwordblock()) {
        return 'wordblock';
    }
    //conflict check //FIXME use INFO
    if ($DATE != 0 && @filemtime(wikiFN($ID)) > $DATE) {
        return 'conflict';
    }
    //save it
    saveWikiText($ID, con($PRE, $TEXT, $SUF, 1), $SUM, $_REQUEST['minor']);
    //use pretty mode for con
    //unlock it
    unlock($ID);
    //delete draft
    act_draftdel($act);
    session_write_close();
    // when done, show page
    return 'show';
}
Example #16
0
function tpl_content_core()
{
    global $ACT;
    global $TEXT;
    global $PRE;
    global $SUF;
    global $SUM;
    global $IDX;
    switch ($ACT) {
        case 'show':
            html_show();
            break;
        case 'locked':
            html_locked();
        case 'edit':
        case 'recover':
            html_edit();
            break;
        case 'preview':
            html_edit();
            html_show($TEXT);
            break;
        case 'draft':
            html_draft();
            break;
        case 'search':
            html_search();
            break;
        case 'revisions':
            $first = isset($_REQUEST['first']) ? intval($_REQUEST['first']) : 0;
            html_revisions($first);
            break;
        case 'diff':
            html_diff();
            break;
        case 'recent':
            if (is_array($_REQUEST['first'])) {
                $_REQUEST['first'] = array_keys($_REQUEST['first']);
                $_REQUEST['first'] = $_REQUEST['first'][0];
            }
            $first = is_numeric($_REQUEST['first']) ? intval($_REQUEST['first']) : 0;
            html_recent($first);
            break;
        case 'index':
            html_index($IDX);
            #FIXME can this be pulled from globals? is it sanitized correctly?
            break;
        case 'backlink':
            html_backlinks();
            break;
        case 'conflict':
            html_conflict(con($PRE, $TEXT, $SUF), $SUM);
            html_diff(con($PRE, $TEXT, $SUF), false);
            break;
        case 'login':
            html_login();
            break;
        case 'register':
            html_register();
            break;
        case 'resendpwd':
            html_resendpwd();
            break;
        case 'denied':
            print p_locale_xhtml('denied');
            break;
        case 'profile':
            html_updateprofile();
            break;
        case 'admin':
            tpl_admin();
            break;
        case 'subscribe':
            tpl_subscribe();
            break;
        default:
            $evt = new Doku_Event('TPL_ACT_UNKNOWN', $ACT);
            if ($evt->advise_before()) {
                msg("Failed to handle command: " . hsc($ACT), -1);
            }
            $evt->advise_after();
            unset($evt);
            return false;
    }
    return true;
}
Example #17
0
<?php

include 'conn.php';
$os_in = filter_input(INPUT_POST, 'os');
$java_in = filter_input(INPUT_POST, 'java');
$version_in = filter_input(INPUT_POST, 'version');
$log_in = filter_input(INPUT_POST, 'log');
//Find existing bug report
$dbh = con();
//Get connection
$stmt = $dbh->prepare("SELECT * FROM " . table() . " where log = ?");
if ($stmt->execute(array($log_in))) {
    while ($row = $stmt->fetch()) {
        $foundRow = $row;
        break;
    }
}
if (empty($foundRow)) {
    //New bug report
    $count = '1';
    $stmt = $dbh->prepare("INSERT INTO " . table() . " (os,java,version,log,count) VALUES (:os, :java, :version, :log, :count)");
    $stmt->bindParam(':os', $os_in);
    $stmt->bindParam(':java', $java_in);
    $stmt->bindParam(':version', $version_in);
    $stmt->bindParam(':log', $log_in);
    $stmt->bindParam(':count', $count);
    $stmt->execute();
    $id = $dbh->lastInsertId();
    print $id;
    $to = '*****@*****.**';
    $subject = "New " . name() . " bug report";
Example #18
0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<?php 
include 'function.php';
session_start();
$userid = $_SESSION['userid'];
$query = "SELECT * FROM `filter` WHERE  `display` = '1' AND `userid` = '{$userid}' ";
$con = con();
$res = $con->query($query);
while ($arr = $res->fetch_array()) {
    $id = $arr['id'];
    echo $arr['city'];
    echo $arr['price'];
    echo $arr['bhk'];
    echo $arr['plotarea'];
    ?>
     <a href="modifyfilter.php?id=<?php 
    echo $id;
    ?>
" role="button">No show</a>
    <?php 
}
?>
<body>
</body>
</html>
Example #19
0
/**
 * ask the user about how to handle an exisiting draft
 *
 * @author Andreas Gohr <*****@*****.**>
 */
function html_draft()
{
    global $INFO;
    global $ID;
    global $lang;
    global $conf;
    $draft = unserialize(io_readFile($INFO['draft'], false));
    $text = cleanText(con($draft['prefix'], $draft['text'], $draft['suffix'], true));
    echo p_locale_xhtml('draft');
    ?>
  <form id="dw__editform" method="post" action="<?php 
    echo script();
    ?>
"
   accept-charset="<?php 
    echo $lang['encoding'];
    ?>
"><div class="no">
    <input type="hidden" name="id"   value="<?php 
    echo $ID;
    ?>
" />
    <input type="hidden" name="date" value="<?php 
    echo $draft['date'];
    ?>
" /></div>
    <textarea name="wikitext" id="wiki__text" readonly="readonly" cols="80" rows="10" class="edit"><?php 
    echo "\n" . formText($text);
    ?>
</textarea>

    <div id="draft__status"><?php 
    echo $lang['draftdate'] . ' ' . date($conf['dformat'], filemtime($INFO['draft']));
    ?>
</div>

    <input class="button" type="submit" name="do[recover]" value="<?php 
    echo $lang['btn_recover'];
    ?>
" tabindex="1" />
    <input class="button" type="submit" name="do[draftdel]" value="<?php 
    echo $lang['btn_draftdel'];
    ?>
" tabindex="2" />
    <input class="button" type="submit" name="do[show]" value="<?php 
    echo $lang['btn_cancel'];
    ?>
" tabindex="3" />
  </form>
  <?php 
}
Example #20
0
/**
 * Default Action of TPL_ACT_RENDER
 *
 * @return bool
 */
function tpl_content_core()
{
    global $ACT;
    global $TEXT;
    global $PRE;
    global $SUF;
    global $SUM;
    global $IDX;
    global $INPUT;
    switch ($ACT) {
        case 'show':
            html_show();
            break;
            /** @noinspection PhpMissingBreakStatementInspection */
        /** @noinspection PhpMissingBreakStatementInspection */
        case 'locked':
            html_locked();
        case 'edit':
        case 'recover':
            html_edit();
            break;
        case 'preview':
            html_edit();
            html_show($TEXT);
            break;
        case 'draft':
            html_draft();
            break;
        case 'search':
            html_search();
            break;
        case 'revisions':
            html_revisions($INPUT->int('first'));
            break;
        case 'diff':
            html_diff();
            break;
        case 'recent':
            html_recent($INPUT->extract('first')->int('first'), $INPUT->str('show_changes'));
            break;
        case 'index':
            html_index($IDX);
            #FIXME can this be pulled from globals? is it sanitized correctly?
            break;
        case 'backlink':
            html_backlinks();
            break;
        case 'conflict':
            html_conflict(con($PRE, $TEXT, $SUF), $SUM);
            html_diff(con($PRE, $TEXT, $SUF), false);
            break;
        case 'login':
            html_login();
            break;
        case 'register':
            html_register();
            break;
        case 'resendpwd':
            html_resendpwd();
            break;
        case 'denied':
            print p_locale_xhtml('denied');
            break;
        case 'profile':
            html_updateprofile();
            break;
        case 'admin':
            tpl_admin();
            break;
        case 'subscribe':
            tpl_subscribe();
            break;
        case 'media':
            tpl_media();
            break;
        default:
            $evt = new Doku_Event('TPL_ACT_UNKNOWN', $ACT);
            if ($evt->advise_before()) {
                msg("Failed to handle command: " . hsc($ACT), -1);
            }
            $evt->advise_after();
            unset($evt);
            return false;
    }
    return true;
}
Example #21
0
        //echo "<img src= '$target_path' >";
        //mysql_query($query_upload) or die("error in $query_upload == ----> ".mysql_error());
    } else {
        exit("Error While uploading image on the server");
    }
}
$res = $con->query($query);
$query2 = "SELECT * FROM `filter` WHERE  city='{$city}' AND price >= '{$price}' AND bhk='{$bhk}' AND plotarea >= '{$plotarea}' AND userid='{$userid}'";
$con2 = con();
$res2 = $con2->query($query2);
while ($arr2 = $res2->fetch_array()) {
    $filterid = $arr2['id'];
    $query3 = "SELECT * FROM flat WHERE city='{$city}' AND price <= '{$price}' AND bhk='{$bhk}' AND plotarea <= '{$plotarea}'";
    $con3 = con();
    $res3 = $con3->query($query3);
    while ($arr = $res3->fetch_array()) {
        $houseid = $arr['id'];
        $query5 = "SELECT * FROM notification WHERE filterid='{$filterid}' AND houseid = '{$houseid}' AND userid = '{$userid}' ";
        $con5 = con();
        $res5 = $con5->query($query5);
        if ($res5->num_rows == 0) {
            $query4 = "INSERT INTO `notification` (houseid,filterid,sho,userid) VALUES ('{$houseid}','{$filterid}','1','{$userid}')";
            $con4 = con();
            $res4 = $con4->query($query4);
        }
    }
}
header('location:profile.php');
?>
</body>
</html>
Example #22
0
/**
 * ask the user about how to handle an exisiting draft
 *
 * @author Andreas Gohr <*****@*****.**>
 */
function html_draft()
{
    global $INFO;
    global $ID;
    global $lang;
    global $conf;
    $draft = unserialize(io_readFile($INFO['draft'], false));
    $text = cleanText(con($draft['prefix'], $draft['text'], $draft['suffix'], true));
    print p_locale_xhtml('draft');
    $form = new Doku_Form(array('id' => 'dw__editform'));
    $form->addHidden('id', $ID);
    $form->addHidden('date', $draft['date']);
    $form->addElement(form_makeWikiText($text, array('readonly' => 'readonly')));
    $form->addElement(form_makeOpenTag('div', array('id' => 'draft__status')));
    $form->addElement($lang['draftdate'] . ' ' . dformat(filemtime($INFO['draft'])));
    $form->addElement(form_makeCloseTag('div'));
    $form->addElement(form_makeButton('submit', 'recover', $lang['btn_recover'], array('tabindex' => '1')));
    $form->addElement(form_makeButton('submit', 'draftdel', $lang['btn_draftdel'], array('tabindex' => '2')));
    $form->addElement(form_makeButton('submit', 'show', $lang['btn_cancel'], array('tabindex' => '3')));
    html_form('draft', $form);
}
Example #23
0
<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="content-type" content="text/html" />
	<meta name="author" content="shohan" />

	<title>Untitled 6</title>
</head>

<body>
    <div style="width:200px;height:500px;background-color: aquamarine;">
        <p style="text-align: center;"><strong>Product Category</strong></p>

    <?php 
$lin = con();
$p = "SELECT * FROM categoty";
$re = mysqli_query($lin, $p);
while ($row = mysqli_fetch_array($re)) {
    echo "<a href='w.php?id={$row['category_name']} '>{$row['category_name']}</a><br>";
}
?>



    </div>

<div style="width:78.5%;height:500px;background-color: green;left:213px;position:absolute;top:16px">


</div>
Example #24
0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php 
include 'function.php';
session_start();
$userid = $_SESSION['userid'];
$id = validate($_GET['id']);
$idd = validate($_GET['idd']);
//echo "a".$id."";
$query2 = "UPDATE `notification` SET  `view` = '0' WHERE `filterid`='{$id}' AND `houseid`='{$idd}' AND userid='{$userid}'";
$con2 = con();
$res2 = $con2->query($query2);
header('location:flats.php?id=' . $idd);
?>
</body>
</html>
Example #25
0
function search_item($arrayIDs)
{
    con();
    $rs = array();
    for ($i = 0; $i < count($arrayIDs); $i++) {
        //search every item
        $query = "SELECT article_versions.article_versionID, article_versions.articleID, article_versions.title, left(article_versions.article_body, 100) as Summary FROM article_versions WHERE article_versions.articleID = '{$arrayIDs[$i]}'";
        //print($query);
        $result = mysql_query($query);
        if (!$result) {
            echo mysql_error();
        } else {
            while ($row = mysql_fetch_assoc($result)) {
                $rs[] = $row;
            }
        }
    }
    //print_r($rs);
    return $rs;
    //return array or results
}