Exemplo n.º 1
0
function getmeasures($typeid)
{
    $measures = getdata('http://www.weather.com.cn/data/alarminfo/' . $typeid . '.html');
    $measures = parsejsjson($measures);
    $measures = explode('<br>', $measures[3]);
    return $measures;
}
Exemplo n.º 2
0
function email_send($to, $sub, $msg, $cc = '', $bcc = '', $attach = '') {
    $CI = get_instance();
    $email_conf = getdata('*', 'email_config', array('active' => 1));
    $config = Array(
        'protocol' => 'smtp',
        'smtp_host' => $email_conf[0]['host'],
        'smtp_port' => $email_conf[0]['port'],
        'smtp_user' => $email_conf[0]['username'], // change it to yours
        'smtp_pass' => $email_conf[0]['password'], // change it to yours
        'mailtype' => 'html',
        'charset' => 'iso-8859-1',
        'wordwrap' => TRUE);

    $CI->load->library('email', $config);
    $CI->email->from($email_conf[0]['from']);
    $CI->email->to($to);
    $CI->email->subject($sub);
    $CI->email->message($msg);

    if ($attach != "") {
        $CI->email->attach($attach);
    }
    if ($cc != "") {
        $CI->email->cc($cc);
    }
    if ($bcc != "") {
        $CI->email->bcc($bcc);
    }

    if (!$CI->email->send()) {
        echo $CI->email->print_debugger();
    }
}
Exemplo n.º 3
0
 public function getFirstResult($search, $filename)
 {
     //print "http://www.chartlyrics.com/search.aspx?q=".replace_space($search);
     $getdata_source = getdata("http://www.chartlyrics.com/search.aspx?q=" . replace_space($search), $curl);
     $getdata = explode('<th style="width: auto">', $getdata_source);
     $getdata = explode('[END] Page', $getdata[1]);
     $getdata = explode('<a href="', $getdata[0]);
     $achou = false;
     if (count($getdata) > 1) {
         $pecah = $getdata[1];
         //foreach($getdata as $pecah){
         $data = explode('</a>', $pecah);
         $data = explode('<td>', $data[0]);
         $data = array_unique(explode('</th>', $data[0]));
         //$gay = $data[0];
         foreach ($data as $gay) {
             $gay = explode('">', $gay);
             if (!strpos($gay[0], "add.aspx")) {
                 if (isset($gay[1])) {
                     $string = $gay[0] . ":" . $gay[1] . ":" . str_replace(".php", "", str_replace("_", ".", $filename));
                     //echo "<center><a href='?lyrics=".encode_url($string, 'encode')."'>$gay[1]</a><br /></center>";
                     //print encode_url($string, 'encode');
                     $achou = true;
                     $this->get_result(encode_url($string, 'encode'));
                 }
             }
         }
         //}
     }
     if (!$achou) {
         echo "0";
     }
 }
Exemplo n.º 4
0
function update_datos($screenname, $update_id)
{
    global $code_app, $cont_access_token;
    shuffle($code_app);
    echo '<br>Twitter user: '******'user'];
    //include("../config/config_cronjob.php");
    //Fetch Data From Twitter
    $url = "https://api.twitter.com/1.1/users/lookup.json";
    $parameters1 = "screen_name=" . $screenname;
    $retdata = getdata($url, $parameters1);
    if ($retdata) {
        $twdatas = json_decode($retdata, true);
        foreach ($twdatas as $twdata) {
            if ($twdata[0]["message"]) {
            } else {
                $hfflag = 0;
                $twitter_id = $twdata["id"];
                $twitter_name = $twdata["name"];
                $screen_name = $twdata["screen_name"];
                $profile_image_url = mysql_real_escape_string($twdata["profile_image_url"]);
                $description = mysql_real_escape_string($twdata["description"]);
                $location = mysql_real_escape_string($twdata["location"]);
                $timezone = mysql_real_escape_string($twdata["time_zone"]);
                $creationdate = $twdata["created_at"];
                $lang = mysql_real_escape_string($twdata["lang"]);
                $verified = $twdata["verified"];
                $followers_count = $twdata["followers_count"];
                $following_count = $twdata["friends_count"];
                $tweetcount = $twdata["statuses_count"];
                $listedcount = $twdata["listed_count"];
                $qry = "";
                $qry = "Update owloo_user_master Set ";
                $qry = $qry . " owloo_user_twitter_id = '" . $twitter_id . "',";
                $qry = $qry . " owloo_user_name = '" . $twitter_name . "',";
                $qry = $qry . " owloo_screen_name = '" . $screen_name . "',";
                $qry = $qry . " owloo_user_photo = '" . $profile_image_url . "',";
                $qry = $qry . " owloo_user_description = '" . $description . "',";
                $qry = $qry . " owloo_user_location = '" . $location . "',";
                $qry = $qry . " owloo_user_language = '" . $lang . "',";
                $qry = $qry . " owloo_user_verified_account = '" . $verified . "',";
                $qry = $qry . " owloo_user_timezone = '" . $timezone . "',";
                $qry = $qry . " owloo_user_created_on = '" . $creationdate . "',";
                $qry = $qry . " owloo_followers_count = '" . $followers_count . "',";
                $qry = $qry . " owloo_following_count = '" . $following_count . "',";
                $qry = $qry . " owloo_tweetcount = '" . $tweetcount . "',";
                $qry = $qry . " owloo_listed_count = '" . $listedcount . "',";
                $qry = $qry . " owloo_updated_on = '" . Date("Y-m-d") . "'";
                $qry = $qry . " Where owloo_user_twitter_id = '" . $twitter_id . "'";
                $qry = $qry . " AND owloo_screen_name = '" . $screen_name . "'";
                echo '<br>SQL 3: ' . $qry . '<br>';
                mysql_query($qry);
                update_tweets($update_id, $screen_name, $tweetcount);
            }
        }
    }
}
Exemplo n.º 5
0
 public function get_result($request)
 {
     $request = encode_url($request, "decode");
     $getname = explode(':', $request);
     $url = replace_space("http://www.chartlyrics.com" . $getname[0]);
     $getlyrics = getdata("{$url}", $curl);
     $getlyrics = explode('alt="" title="', $getlyrics);
     $getlyrics = explode('" />', $getlyrics[1]);
     $getlyrics = explode('<div id="adlyric">', $getlyrics[1]);
     echo "<center><br><font size=60><b>{$getname['1']}</b></font><br><br>{$getlyrics['0']}</center>";
 }
Exemplo n.º 6
0
 public function get_result($request)
 {
     $request = encode_url($request, "decode");
     $getname = explode(':', $request);
     $url = replace_space("http://www.lyrics007.com" . $getname[0]);
     $getlyrics = getdata("{$url}", $curl);
     $getlyrics = explode('display:block;float:left;padding-top:5px;', $getlyrics);
     $getlyrics = explode('/print.php?id=TWpnNE1qVTE', $getlyrics[1]);
     $getlyrics = explode('</fb:like>', $getlyrics[0]);
     $getlyrics = explode('<script type="text/javascript">', $getlyrics[1]);
     echo "<center><br><font size=60><b>{$getname['1']}</b></font><br><br>{$getlyrics['0']}</center>";
 }
Exemplo n.º 7
0
function phase1($db)
{
    global $PHPSEA_ERROR;
    echo "<H2> 实例 1 - 将上一步的数组写入csv文件</H2>";
    $db->new_rows = getdata();
    $db->append();
    if ($db->write_csv(false, true)) {
        // Write database to file forcing overwrite/ file creation
        echo "<pre>";
        $cf = "{$db->dir}/{$db->data_file}";
        readfile($cf);
        echo "</pre>";
        echo "将一个二维数组写入文件,并读出显示。<br />\n";
        echo "<a href='{$PHP_SELF}?phase=0' > 上一步</a>\n&nbsp;&nbsp;&nbsp;";
        echo "<a href='{$PHP_SELF}?phase=2' > 下一步</a>\n";
    } else {
        echo "<Hr>" . $PHPSEA_ERROR['FileCsv_Error'];
    }
    endpage();
}
Exemplo n.º 8
0
<?php

require 'inc/config_w.php';
require 'inc/data_w.php';
$type = $_GET['type'];
$first = (int) $_GET['first'];
$eid = (int) $_GET['eid'];
if (!$first) {
    $first = 0;
}
$con = getdata($type, $first, "", $eid);
$c = count($con);
$str = '[';
if ($c) {
    for ($i = 0; $i < $c; ++$i) {
        $con[$i]['title'] = str_replace("\n", '\\n', addslashes(htmlspecialchars($con[$i]['title'], ENT_QUOTES)));
        $con[$i]['des'] = str_replace("\n", '\\n', addslashes(htmlspecialchars($con[$i]['des'], ENT_QUOTES)));
        $str .= '{"id":"' . $con[$i]['id'] . '","type":"' . $con[$i]['type'] . '","lou":"' . $con[$i]['lou'] . '","view":"' . $con[$i]['click'] . '","comc":"' . $con[$i]['comc'] . '","title":"' . $con[$i]['title'] . '","timey":"' . date('Y年', $con[$i]['time']) . '","timem":"' . date('m', $con[$i]['time']) . '","timed":"' . date('d', $con[$i]['time']) . '","week":"' . date('D', $con[$i]['time']) . '","time":"' . date('H:i', $con[$i]['time']) . '","des":"' . $con[$i]['des'] . '","color":"' . $con[$i]['color'] . '","ext":"' . ($i + $first + 1) . '"},';
    }
    $str .= '"' . mysql_errno() . '"]';
} else {
    $str .= '"' . mysql_errno() . '"]';
}
echo $str;
<?php

include 'db.php';
include 'fetchproduct.php';
include 'head.php';
$package = $_REQUEST["package"];
if (isset($_COOKIE["eshop"])) {
    $user = $_COOKIE["eshop"];
    $result = mysqli_query($con, "select * from delivery where byuser='******' and package='{$package}' order by id desc");
    while ($row = mysqli_fetch_array($result)) {
        echo "\n\t<script>\n\t\$(document).ready(function()\n\t{\n\t\$('.meter').hide().fadeIn(1000);\n\t});\n\t</script>\n\n";
        echo "<img height=\"10%\" width=\"10%\" src='images/" . getdata($row["productid"], "imgurl") . '\'> - <h3>' . getdata($row["productid"], "name");
        echo "<br /></h3>Order Placed&nbsp;&nbsp;&nbsp;Item Packed&nbsp;&nbsp;&nbsp;Item Shipped&nbsp;&nbsp;&nbsp;Delivered Item&nbsp;&nbsp;&nbsp;Order Completed&nbsp;&nbsp;&nbsp;<br />";
        if ($row["deliverystatus"] == "Order Placed Successfully") {
            echo "<div class='meter'><img src='blinkon.png' height='2%' width='2%'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img height='2%' width='2%' src='blinkoff.png'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img height='2%' width='2%' src='blinkoff.png'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img  height='2%' width='2%' src='blinkoff.png'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img height='2%' width='2%' src='blinkoff.png'>";
        }
        if ($row["deliverystatus"] == "Item is Packed") {
            echo "<div class='meter'><img src='blinkon.png'  height='2%' width='2%'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img height='2%' width='2%' src='blinkon.png'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img height='2%' width='2%' src='blinkoff.png'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img height='2%' width='2%' src='blinkoff.png'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src='blinkoff.png'>";
        }
        if ($row["deliverystatus"] == "Item is Shipped") {
            echo "<div class='meter'><img src='blinkon.png'  height='2%' width='2%'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src='blinkon.png' height='2%' width='2%'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img  height='2%' width='2%' src='blinkon.png'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img height='2%' width='2%' src='blinkoff.png'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img height='2%' width='2%' src='blinkoff.png'>";
        }
        if ($row["deliverystatus"] == "Item is Delivered") {
            echo "<div class='meter'><img src='blinkon.png'  height='2%' width='2%'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img height='2%' width='2%'src='blinkon.png'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img height='2%' width='2%' src='blinkon.png'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img height='2%' width='2%' src='blinkon.png'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img height='2%' width='2%' src='blinkon.png'>";
        }
        echo "</div><hr />";
    }
} else {
}
Exemplo n.º 10
0
<header class="header">
	<div><a href="javascript:history.back();"><i class="icon-arrow-back"></i></a></div>
	<h1>散货发布</h1>
	<div><a href="index.php"><i class="icon-home"></i></a></div>
</header>
<?php 
//$dump_array=$wood->dumpposition; lj-
if (isset($_SESSION['user'])) {
    //用户或管理员登录后才可以发表信息
    $cdkey = $_GET["cdkey"];
    $dump = array();
    if ($cdkey != "") {
        $isnew = 0;
        $sqlstr = "select userid,kindid,stuffid,productlen,diameterlen,wide,thinckness," . "tolerance,widerange,thincknessrange,refcapacity,timber," . "dry,newold,timbertype,knob,blue,worm,decay,climb,slash,ring,oil,black" . ",dumpposition,part,device,fromid,portid,publishtime," . "updatetime,goodtype,cdkey,content,contact,contactphone from t_product where cdkey='" . $cdkey . "'";
        $mydump = getdata($sqlstr);
        if (!is_array($mydump)) {
            echo "<p>对不起,没有查找到您要查找的内容!</p>";
            return;
        } else {
            $dump = $mydump[0];
        }
    } else {
        $isnew = 1;
        $dump = array("refcapacity" => "", "refnum" => "", "refwight" => "", "contact" => "", "contactphone" => "", "diameterlen" => "0", "thinckness" => "", "price" => "", "wide" => "", "device" => "", "worm" => "", "decay" => "", "widerange" => "", "thincknessrange" => "", "xielie" => "", "huanlie" => "", "chouyou" => "", "heixin" => "", "content" => "", "display" => "0", "stuffid" => "0", "kindid" => "0", "productlen" => "0", "dumpposition" => "0", "timber" => "0", "timbertype" => "0", "tolerance" => "-99", "knob" => "0", "climb" => "0", "part" => "0", "dry" => "0", "newold" => "0", "blue" => "0", "slash" => "0", "oil" => "0", "black" => "0", "ring" => "0", "fromid" => "0");
    }
    ?>
<form class="onoff" id="submitform">
	<ul class="list">
		<li>
			<ul class="upImg-display">
Exemplo n.º 11
0
$yzblog = new smarty_yzblog();
$yzblog->setTemplateDir('../tpl/w/');
$type = $_GET['type'];
$id = (int) $_GET['id'];
$con = getdata($type, 0, $id);
$text = nl2br(htmlspecialchars($con[0]['content']));
#ubb放在这之后
if ($con[0]['type'] == "article") {
    $text = straddubb($text);
}
$link = mysql_connect(HOST . ':' . PORT, USER, PASSWORD);
if ($link) {
    mysql_select_db(DATABASE, $link);
    mysql_query('UPDATE ' . WALL . ' SET click=' . ($con[0]['click'] + 1) . ' where id=' . $con[0]['id']);
}
$comment = getdata('comment', 0, "", $id);
$c = count($comment);
if ($c) {
    for ($i = 0; $i < $c; ++$i) {
        $comment[$i]['title'] = htmlspecialchars($comment[$i]['title'], ENT_QUOTES);
        $comment[$i]['des'] = htmlspecialchars($comment[$i]['des'], ENT_QUOTES);
        $a = 'div';
        $view = '';
        $str .= '<' . $a . ' class="item" style="background:' . $comment[$i]['color'] . ';" href="article.php?id=' . $comment[$i]['id'] . '"><img class="point" src="../img/point.png" /><div class="num none">' . ($i + $first + 1) . '</div><div class="view left">#' . $comment[$i]['lou'] . '</div>' . $view . '<div class="time right"><span class="timed">' . date('d', $comment[$i]['time']) . '</span>日<span class="timem">' . date('m', $comment[$i]['time']) . '</span>月' . date('Y年 D H:i', $comment[$i]['time']) . '</div><div class="des feeling">' . $comment[$i]['des'] . '</div><h1 class="title">' . $comment[$i]['title'] . '</h1></' . $a . '>';
    }
} else {
    $note = '没有评论,来一条吧~';
}
$tttt = CLASS_1;
if ($con[0]['class'] == 1001) {
    $tttt = CLASS_2;
Exemplo n.º 12
0
      <th class="col-md-1 text-center">No</th>
      <th class="col-md-2 text-center">Program / Instansi</th>
      <th class="col-md-2 text-center">Jurusan</th>
      <th class="col-md-2 text-center">Topik/Referensi</th>
      <th class="col-md-2 text-center">Periode</th>
      <th class="text-center">Status</th>
      <th class="col-md-1 text-center">Aksi</th>
    </tr>
  </thead>
  <tbody>
  <?php 
    $i = 1;
    $q = mysql_query("select * from internship_registration where USER_DETAIL_ID='" . $_SESSION['iddetail'] . "'");
    while ($d = mysql_fetch_array($q)) {
        $idins = getdata('user_education', "USER_DETAIL_ID='" . $_SESSION['iddetail'] . "'", 'INSTITUTE_ID');
        $idmajor = getdata('user_education', "USER_DETAIL_ID='" . $_SESSION['iddetail'] . "'", 'MAJOR_ID');
        ?>
    <tr>
      <td class="text-center"><?php 
        echo $i;
        ?>
</td>
      <td class="text-center"><?php 
        echo ambildata($d['EDUCATION_LEVEL_ID'], 'education_level', 'EDUCATION_LEVEL_NAME');
        ?>
 / <?php 
        echo ambildata($idins, 'institute', 'INSTITUTE_NAME');
        ?>
</td>
      <td class="text-center"><?php 
        echo ambildata($idmajor, 'major', 'MAJOR_NAME');
Exemplo n.º 13
0
<?php

if (isset($_GET['act'])) {
    $act = $_GET['act'];
    switch ($act) {
        case 'addnew':
            // UNIT_ID
            $unitid = ambildata($_SESSION['iddetail'], 'user_detail', 'UNIT_ID');
            // UNIT_NAME
            $unitname = ambildata($unitid, 'unit', 'UNIT_NAME');
            // INTERNSHIP ID
            $internid = getdata('internship_registration', "USER_DETAIL_ID='" . $_SESSION['iddetail'] . "' and STATUS!='REJECTED' and STATUS!='PENDING'", 'GUID');
            if (isset($_POST['judul'])) {
                /*/ UNIT_ID
                		$unitid = ambildata($_SESSION['iddetail'],'user_detail','UNIT_ID');
                		// UNIT_NAME
                		$unitname = ambildata($unitid,'unit','UNIT_NAME');*/
                $judul = mysql_real_escape_string($_POST['judul']);
                $pesan = mysql_real_escape_string($_POST['pesan']);
                $quid = mysql_query("select uuid() as uuid");
                $duid = mysql_fetch_array($quid);
                $uuid = $duid['uuid'];
                $q = mysql_query("insert into message(GUID,UNIT_ID,INTERN_ID,TITLE,SENDER_ID,MESSAGE_ID,MESSAGE,DTMCRT,STATUS) values('{$uuid}','{$unitid}','{$internid}','{$judul}','" . $_SESSION['iddetail'] . "','{$uuid}','{$pesan}',now(),'Waiting reply')");
                if ($q) {
                    eksyen('', 'inside.php#comment');
                } else {
                    eksyen('Error!', 'inside.php#comment');
                }
            }
            ?>
			<br><h1>Kirim Pesan Baru <small>| <a href="inside.php#comment">kembali</a></small></h1>
Exemplo n.º 14
0
function featuredList() {
    //echo FEATURED_LIST; exit;
    $result = getdata(FEATURED_LIST);
    if (count($result) > 0) {
        return $result;
    } else {
        return false;
    }
}
Exemplo n.º 15
0
            $product = array("refcapacity" => "", "refnum" => "", "refwight" => "", "contact" => "", "contactphone" => "", "diameterlen" => "0", "thinckness" => "", "price" => "", "wide" => "", "device" => "", "worm" => "", "decay" => "", "widerange" => "", "thincknessrange" => "", "xielie" => "", "huanlie" => "", "chouyou" => "", "heixin" => "", "content" => "", "display" => "0");
        }
        //判断修改权限
        if ($ismgr == 1 or $isowner == 1 or $isnew == 1) {
            $modifyright = 1;
        }
        ?>
<!--以下是自动把手机号输出到文件的代码-->
	<?php 
        $phone_arr = array();
        $chged = getdata('select phonechg from t_cs where sn=1');
        //手机号是否被更新
        if (is_array($chged)) {
            $phoneadd = $chged[0];
            if ($phoneadd["phonechg"] != 2) {
                $phone_arr = getdata('select contactphone from t_ownphone order by contactphone');
                //echo json_encode( $json_arr );
                $phonestr = "";
                $phone_array = array();
                $i = 0;
                //生成文件内容
                foreach ($phone_arr as $row) {
                    $phonestr .= $row["contactphone"];
                    $phone_array[$i] = $row["contactphone"];
                    $i++;
                }
                if ($phonestr != "") {
                    $phonestr = "[" . $phonestr . "]";
                    $phonestr = str_replace(",]", "]", $phonestr);
                }
            }
        $params[$item[0]] = $item[1];
    }
    return $params;
}
for ($i = 957; $i < 1541;) {
    $data = getdata("http://www.flipkart.com/home-kitchen/pr?p%5B%5D=sort%3Dprice_desc&sid=j9e&layout=grid&start=" . $i . "&ajax=true");
    $data = str_replace("<textarea id='ajax'>", "", $data);
    $data = str_replace("</textarea>", "", $data);
    $data = html_entity_decode($data);
    $html = str_get_html($data);
    foreach ($html->find('.fk-anchor-link') as $element) {
        $link = 'http://www.flipkart.com' . $element->href;
        if ($url = parse_url($link)) {
            $urlquery = convertUrlQuery($url['query']);
            $url = $url['scheme'] . '://' . $url['host'] . $url['path'] . '?pid=' . $urlquery['pid'];
            // put all your logic here
            $itemdata = getdata($url);
            $product_url = (string) $url;
            //sqlite save command
            scraperwiki::sqliteexecute("insert into flipkart_home_and_kitchen_dump values (?,?)", array($product_url, $itemdata));
            //sqlite save command
            scraperwiki::sqlitecommit();
        }
    }
    // ending for loop
    if ($i > 20) {
        $i = $i + 20;
    } else {
        $i = $i + 21;
    }
}
Exemplo n.º 17
0
function UDTasksAdmin()
{
    global $Administrator, $cxn, $unexpectederrormessage, $writeerrormessage;
    if (!isset($_POST['TheUserID'])) {
        echo '<html><head><title>No User ID specified</title><body>Error: This page does not appear to have been called in the correct fashion; no User ID is specified in the _POST array.</body></html>';
        die('');
    }
    $EscapedUserID = (int) $_POST['TheUserID'];
    $EscapedNewUserName = clean(@$_POST['NewUserName']);
    $EscapedNewUserName = htmlspecialchars($EscapedNewUserName);
    $URow = getdata($cxn, 1, 'SELECT `Administrator` FROM `User` WHERE `UserID` = ' . $EscapedUserID) or die($readerrormessage);
    if ($URow === 'NONE') {
        die($unexpectederrormessage);
    } else {
        if ($URow['Administrator'] == 2 and $Administrator == 1) {
            $QueryResult = mysqli_query($cxn, 'UPDATE `User` SET `Administrator` = 0, `Banned` = 1, `LockPS` = 1 WHERE `UserID` = ' . $_SESSION['MyUserID']) or die($readerrormessage);
            $subject = 'An Administrator attempted to alter your account and was de-admin\'d and banned';
            $thetime = date('Y-m-d H:i:s', strtotime(now));
            $body = 'At ' . $thetime . ', Administrator ' . $_SESSION['MyUserName'] . ' (User ID ' . $_SESSION['MyUserID'] . ') attempted to alter your account and was de-admin\'d and banned.';
            // send_email($subject,$body,???????????????????,null);
            die('lol i dont think so. owned scrub.');
        } else {
            if ($Administrator) {
                if (strlen($EscapedNewUserName) > 20 and $_POST['ChangeUsername']) {
                    echo '<html><head><title>New user name too long</title><body>Error: New user name is too long.<p>Click <a href="index.php">here</a> to return to the Main Page.</body></html>';
                    die;
                }
                if (strlen($EscapedNewUserName) < 3 and $_POST['ChangeUsername']) {
                    echo '<html><head><title>New user name too short</title><body>Error: New user name is too short.<p>Click <a href="index.php">here</a> to return to the Main Page.</body></html>';
                    die;
                }
                if (@$_POST['BanUser']) {
                    $QueryResult = mysqli_query($cxn, 'UPDATE User SET Banned = 1 WHERE UserID = ' . $EscapedUserID) or die($writeerrormessage);
                }
                if (@$_POST['UnbanUser']) {
                    $QueryResult = mysqli_query($cxn, 'UPDATE User SET Banned = 0 WHERE UserID = ' . $EscapedUserID) or die($writeerrormessage);
                }
                if (@$_POST['LockPS']) {
                    $QueryResult = mysqli_query($cxn, 'UPDATE User SET LockPS = 1 WHERE UserID = ' . $EscapedUserID) or die($writeerrormessage);
                }
                if (@$_POST['UnlockPS']) {
                    $QueryResult = mysqli_query($cxn, 'UPDATE User SET LockPS = 0 WHERE UserID = ' . $EscapedUserID) or die($writeerrormessage);
                }
                if (@$_POST['ClearPS']) {
                    $QueryResult = mysqli_query($cxn, 'UPDATE User SET PersonalStatement = \'</i></b>\' WHERE UserID = ' . $EscapedUserID) or die($writeerrormessage);
                }
                /*        if ( @$_POST['AllKick'] ) {
                            $QueryResult = getdata ($cxn,0,'SELECT Game.*, UserR.UserID AS UserIDR, UserR.Name AS NameR, UserR.Pronoun AS PronounR, UserR.Email AS EmailR, UserR.EmailPrompt AS EmailPromptR, UserR.EmailPromptAgain AS EmailPromptAgainR, UserR.HasBeenEmailed AS HasBeenEmailedR, UserY.UserID AS UserIDY, UserY.Name AS NameY, UserY.Pronoun AS PronounY, UserY.Email AS EmailY, UserY.EmailPrompt AS EmailPromptY, UserY.EmailPromptAgain AS EmailPromptAgainY, UserY.HasBeenEmailed AS HasBeenEmailedY, UserG.UserID AS UserIDG, UserG.Name AS NameG, UserG.Pronoun AS PronounG, UserG.Email AS EmailG, UserG.EmailPrompt AS EmailPromptG, UserG.EmailPromptAgain AS EmailPromptAgainG, UserG.HasBeenEmailed AS HasBeenEmailedG, UserP.UserID AS UserIDP, UserP.Name AS NameP, UserP.Pronoun AS PronounP, UserP.Email AS EmailP, UserP.EmailPrompt AS EmailPromptP, UserP.EmailPromptAgain AS EmailPromptAgainP, UserP.HasBeenEmailed AS HasBeenEmailedP, UserF.UserID AS UserIDF, UserF.Name AS NameF, UserF.Pronoun AS PronounF, UserF.Email AS EmailF, UserF.EmailPrompt AS EmailPromptF, UserF.EmailPromptAgain AS EmailPromptAgainF, UserF.HasBeenEmailed AS HasBeenEmailedF FROM Game LEFT JOIN User AS UserR ON Game.UserR = UserR.UserID LEFT JOIN User AS UserY ON Game.UserY = UserY.UserID LEFT JOIN User AS UserG ON Game.UserG = UserG.UserID LEFT JOIN User AS UserP ON Game.UserP = UserP.UserID LEFT JOIN User AS UserF ON Game.UserF = UserF.UserID WHERE ( UserR = '.$EscapedUserID.' OR UserY = '.$EscapedUserID.' OR UserG = '.$EscapedUserID.' OR UserP = '.$EscapedUserID.' OR UserF = '.$EscapedUserID.' ) AND Game.GameStatus = \'In Progress\'');
                            if ( $QueryResult != 'NONE' ) {
                                require(HIDDEN_FILES_PATH.'getgamedata.php');
                                require(HIDDEN_FILES_PATH.'kraftwerk.php');
                                while ( $row = mysqli_fetch_assoc( $QueryResult ) ) {
                                    $row[GameTicker] = '';
                                    extract(providegamedata($row,0));
                                    for ($i=0;$i<5;$i++) {
                                        if ( $PlayerUserID[$i] == $EscapedUserID ) { $ThePlayerToKick = $i; }
                                        if ( $ThePlayerToKick == $PlayerToMove ) { $Delayed = 0; }
                                        else                                     { $Delayed = 1; }
                                    }
                                    KickPlayer($ThePlayerToKick,1,1,$Delayed);
                                    dbformatgamedata();
                                }
                            }
                        } This is really outdated and should be redone. */
                if (@$_POST[AllRemove]) {
                    $QueryResult = mysqli_query($cxn, 'UPDATE `Game` SET `GameStatus` = \'Cancelled\' WHERE `GameCreator` = ' . $EscapedUserID . ' AND GameStatus = \'Recruiting\'') or die($writeerrormessage);
                    $QueryResult = getdata($cxn, 0, 'SELECT GameID, PlayerExists, UserR, UserY, UserG, UserP, UserF FROM Game WHERE ( UserR = ' . $EscapedUserID . ' OR UserY = ' . $EscapedUserID . ' OR UserG = ' . $EscapedUserID . ' OR UserP = ' . $EscapedUserID . ' OR UserF = ' . $EscapedUserID . ' ) AND GameStatus = \'Recruiting\'');
                    if ($QueryResult != 'NONE') {
                        while ($row = mysqli_fetch_assoc($QueryResult)) {
                            $PlayerExists = explode('|', $row[PlayerExists]);
                            if ($row[UserR] == $EscapedUserID) {
                                $PlayerExists[0] = 0;
                                $ColourLetter = 'R';
                            }
                            if ($row[UserY] == $EscapedUserID) {
                                $PlayerExists[1] = 0;
                                $ColourLetter = 'Y';
                            }
                            if ($row[UserG] == $EscapedUserID) {
                                $PlayerExists[2] = 0;
                                $ColourLetter = 'G';
                            }
                            if ($row[UserP] == $EscapedUserID) {
                                $PlayerExists[3] = 0;
                                $ColourLetter = 'P';
                            }
                            if ($row[UserF] == $EscapedUserID) {
                                $PlayerExists[4] = 0;
                                $ColourLetter = 'F';
                            }
                            $PlayerExists = implode('|', $PlayerExists);
                            $QueryResult = mysqli_query($cxn, 'UPDATE Game SET PlayerExists = \'' . $PlayerExists . '\', User' . $ColourLetter . ' = NULL, CurrentPlayers = CurrentPlayers - 1 WHERE GameID = ' . $row[GameID]) or die($writeerrormessage);
                        }
                    }
                }
                if (@$_POST[ClearMsgs]) {
                    $QueryResult = mysqli_query($cxn, 'UPDATE Message SET DeletedByAdmin = 1 WHERE User = '******'UPDATE Thread SET TitleDeletedByAdmin = 1 WHERE OriginalPoster = ' . $EscapedUserID) or die($writeerrormessage);
                    $QueryResult = mysqli_query($cxn, 'UPDATE Game SET GTitleDeletedByAdmin = 1 WHERE GameCreator = ' . $EscapedUserID) or die($writeerrormessage);
                }
                if (@$_POST[ClearEmail]) {
                    $QueryResult = mysqli_query($cxn, 'UPDATE User SET Email = \'\', EmailPrompt = 0 WHERE UserID = ' . $EscapedUserID) or die($writeerrormessage);
                }
                if (@$_POST[DenyUserAccess]) {
                    $QueryResult = mysqli_query($cxn, 'UPDATE User SET DenyAccess = 1 WHERE UserID = ' . $EscapedUserID) or die($writeerrormessage);
                }
                if (@$_POST[UndenyUserAccess]) {
                    $QueryResult = mysqli_query($cxn, 'UPDATE User SET DenyAccess = 0 WHERE UserID = ' . $EscapedUserID) or die($writeerrormessage);
                }
                if (@$_POST[ChangeUsername]) {
                    $QueryResult = mysqli_query($cxn, 'UPDATE User SET Name = \'' . $EscapedNewUserName . '\' WHERE UserID = ' . $EscapedUserID) or die($writeerrormessage);
                }
                if (@$_POST[MakeAdmin]) {
                    $QueryResult = mysqli_query($cxn, 'UPDATE User SET Administrator = 1 WHERE UserID = ' . $EscapedUserID) or die($writeerrormessage);
                }
                if (@$_POST[UnmakeAdmin]) {
                    $QueryResult = mysqli_query($cxn, 'UPDATE User SET Administrator = 0 WHERE UserID = ' . $EscapedUserID) or die($writeerrormessage);
                }
                if (@$_POST[ValidateUser]) {
                    $QueryResult = mysqli_query($cxn, 'UPDATE User SET UserValidated = 1 WHERE UserID = ' . $EscapedUserID) or die($writeerrormessage);
                }
                echo "<html><head><title>Changes successful</title><script type=\"text/javascript\"><!--\nfunction delayer(){\nwindow.location =\"userdetails.php?UserID={$EscapedUserID}\"\n}\n//-->\n</script>\n</head><body onLoad=\"setTimeout('delayer()', 2000)\">Successfully executed changes. This page will redirect to the User Details page in 2 seconds. (If you do not have JavaScript enabled for this site, this will not happen; <a href=\"userdetails.php?UserID={$EscapedUserID}\">click here</a> instead to return to the User Details page.)</body></html>";
            } else {
                echo 'What\'s this? You are not an Administrator! <a href="index.php">Begone with you!</a></body></html>';
            }
        }
    }
}
Exemplo n.º 18
0
        //date variable user to select a date for arrivals to do
        break;
    case "arrivals":
        $sql = "Select guests.guestid,concat_ws(' ',guests.firstname,guests.middlename,guests.lastname) as guest,guests.pp_no,\n\t\tguests.idno,guests.address,guests.town,guests.postal_code,guests.phone,\n\t\tguests.email,guests.mobilephone,countries.country,reservation.reserve_checkindate\n\t\t\tFrom guests\n\t\t\tInner Join countries ON guests.countrycode = countries.countrycode\n\t\t\tInner Join reservation ON guests.guestid = reservation.guestid\n\t\t\tWhere reservation.reserve_checkindate >= current_date()";
        break;
    case "departures":
        $sql = "Select guests.guestid,concat_ws(' ',guests.firstname,guests.middlename,guests.lastname) as guest,guests.pp_no,\n\t\tguests.idno,guests.address,guests.town,guests.postal_code,guests.phone,\n\t\tguests.email,guests.mobilephone,countries.country\n\t\t\tFrom guests\n\t\t\tInner Join countries ON guests.countrycode = countries.countrycode\n\t\t\tInner Join booking ON guests.guestid = booking.guestid\n\t\t\tWhere booking.checkout_date=current_date()";
        guestslist($sql);
        break;
    case "dep_summ":
        $sql = "Select rooms.roomno as RoomNo,transactions.doc_no as DocNo,transactions.doc_type,concat_ws(' ',guests.firstname,guests.middlename,guests.lastname) AS Name,\n\t\ttransactions.dr as Debit,transactions.cr as Credit,details.item as Remarks,transactions.doc_date as DocDate\n\t\t\tFrom transactions\n\t\t\tleft Join details ON transactions.details = details.itemid\n\t\t\tleft Join bills ON transactions.billno = bills.billno\n\t\t\tInner Join booking ON bills.book_id = booking.book_id\n\t\t\tInner Join guests ON booking.guestid = guests.guestid\n\t\t\tInner Join rooms ON booking.roomid = rooms.roomid";
        //Where transactions.details = '$details' and transactions.doc_date = '$date'
        echo "<table>\n\t\t<tr><td><h2>Departmental Summary Control Sheet</h2></td></tr>\n\t\t<tr>\n\t\t<td>Department: <select name=\"itemid\" id=\"itemid\"\">\n\t\t<option value=\"All\" >All</option>";
        populate_select("details", "itemid", "item", $details);
        echo "</select></td>\n\t\t<td>Date:<input name=\"date\" id=\"date\" type=\"text\" size=\"10\" readonly=\"true\">\n\t\t<small><a href=\"javascript:showCal('Calendar8')\"> <img src=\"images/ew_calendar.gif\" width=\"16\" height=\"15\" border=\"0\"/></a></small>\n\t\t</td>\n\t\t<td><input name=\"submit\" type=\"submit\" value=\"Submit\"></td>\n\t\t</tr>\n\t\t</table>";
        getdata();
        break;
    default:
        echo "<h2>Under construction</h2>";
}
/**
 *getting all guestlist from database based upon sql query<br>
 *@param $sql [in] sql query<br>
 *Connecto to the database and the result display in web page<br>
 *uses constants <b>HOST</b>,<b>USER</b>,<b>PASS</b>,<b>DB</b>,<b>PORT</b> to connecto to the database <br>
 *Generate HTML output by table in web page.<br>
 */
function guestslist($sql)
{
    //global $gueststatus;
    $conn = connect_Hotel_db(HOST, USER, PASS, DB, PORT);
$prev = 0;
$total = 0;
$exist = "f";
while ($row = mysqli_fetch_array($result)) {
    $exist = "t";
    if ($prev == $row["package"] && $prev != 0) {
    } else {
        echo "</table><hr><h4>Placed By:" . $row["byuser"] . "</h4> <h4>Total: " . packagetotal($row["package"]);
        echo "</h4><a class=\"btn btn-success\" href='status.php?id=" . $row["package"] . "'>Change Status</a>";
        echo "<a target='_blank' align=\"right\" class=\"btn btn-success\" href='invoice.php?package=" . $row["package"] . "'>View Invoice</a><br />";
        echo '
<table border="2">
<tr>
<th>Image</th>
<th>CustomerID</th>
<th>PackageID</th>
<th>Delivery Phone Number</th>
<th>Delivery Address</th>
<th>Product Name</th>
<th>Product Quantity</th>
<th>Total Amount [Cost of 1 X QTY]</th>
</tr>';
    }
    echo "<tr><td><img src='../images/" . getdata($row["productid"], "imgurl") . "' height='7%' width='7%'></td><td>" . $row["byuser"] . "</td><td>" . $row["package"] . "</td><td>" . $row["deliveryphone"] . "</td><td>" . $row["deliveryaddress"] . "</td>";
    echo "<td>" . getdata($row["productid"], "name") . "</td><td>" . $row["qty"] . "<td>" . $row["totalamount"] . "</td></tr>";
    $prev = $row["package"];
    echo "";
}
if ($exist == "f") {
    echo "<center>Hey! There are no Orders Here. Kindly Check In Other Sections. </center>";
}
Exemplo n.º 20
0
    $first = 0;
}
switch ($type) {
    case 'article':
        $tp = 1;
        break;
    case 'feeling':
        $tp = 2;
        break;
    case 'message':
        $tp = 3;
        break;
    default:
        $tp = 0;
}
$con = getdata($type, $first);
$c = count($con);
if ($c) {
    for ($i = 0; $i < $c; ++$i) {
        $con[$i]['title'] = htmlspecialchars($con[$i]['title'], ENT_QUOTES);
        $con[$i]['des'] = htmlspecialchars($con[$i]['des'], ENT_QUOTES);
        $a = 'a';
        $view = '<div class="view left"> 点:' . (int) $con[$i]['click'] . ' 评:' . (int) $con[$i]['comc'] . '</div>';
        if ($con[$i]['type'] == 'message') {
            $a = 'div';
            $view = '';
        }
        $str .= '<div class="item" style="background:' . $con[$i]['color'] . ';"><a href="articleadmin.php?id=' . $con[$i]['id'] . '"><img class="point" src="../img/point.png" /><div class="num none">' . ($i + $first + 1) . '</div><div class="view left">#' . $con[$i]['lou'] . '</div>' . $view . '<div class="time right"><span class="timed">' . date('d', $con[$i]['time']) . '</span>日<span class="timem">' . date('m', $con[$i]['time']) . '</span>月' . date('Y年 D H:i', $con[$i]['time']) . '</div><h1 class="title">' . $con[$i]['title'] . '</h1><div class="des feeling">' . $con[$i]['des'] . '</div></a><a style="color: #fff;" href="del.php?id=' . $con[$i]['id'] . '">删除它</a></div>';
    }
} else {
    $note = '没有内容!';
<?php

include 'fetchproduct.php';
include 'head.php';
if (isset($_COOKIE["eshop"])) {
    echo "<hr>";
    include 'db.php';
    $user = $_COOKIE["eshop"];
    $result = mysqli_query($con, "SELECT * FROM cart where byuser='******'");
    $total = 0;
    $conf = "f";
    while ($row = mysqli_fetch_array($result)) {
        $conf = "t";
        echo "<h2>" . getdata($row["productid"], "name") . "</h2><br />";
        echo "<h5 style='color:grey'><br /> &nbsp; X " . $row["qty"] . "</h5>";
        echo "<h4>Price  " . getdata($row["productid"], "price") . "</h4>";
        $totpr = getdata($row["productid"], "price") * $row["qty"];
        $total = $total + $totpr;
        echo "<hr>";
    }
    if ($conf == "t") {
        echo "<h1>Total: " . $total . "</h1>";
        echo "<a class='btn btn-success' href='checkoutme.php'>Check Out</button>";
    } else {
        echo "Nothing In Cart. ";
    }
} else {
    Header('Location: login.py');
}
Exemplo n.º 22
0
function getdata($cnt, $repository, $data, $sevendayissues, $onedayissues, $total)
{
    global $pulls;
    $cnt2 = 1;
    //$data = array();
    $date = strtotime(date('Y-m-d H:i:s')) - 24 * 7 * 60 * 60;
    $date2 = date('c', $date);
    //$date =	$date->format(DateTime::ISO8601);
    //var_dump($date2);
    $url = "https://api.github.com/repos/" . $repository . "/issues?page=" . $cnt . "&per_page=100&state=open&since=" . $date2;
    $objs = get_web_json($url);
    foreach ($objs as $key => $obj) {
        $data[$key + ($cnt - 1) * 100] = $obj;
    }
    //var_dump($data);
    // echo("Success");
    if (count($objs) == 100) {
        $cnt += 1;
        getdata($cnt, $repository, $data, $sevendayissues, $onedayissues, $total);
    } else {
        foreach ($data as $key => $issues) {
            if (date("U", strtotime($issues->created_at)) > strtotime(date('Y-m-d H:i:s')) - 24 * 7 * 60 * 60) {
                $sevendayissues += 1;
                if (date("U", strtotime($issues->created_at)) > strtotime(date('Y-m-d H:i:s')) - 24 * 60 * 60) {
                    $onedayissues += 1;
                }
            }
        }
        //var_dump($data);
        ?>
    	<div class="row" style="padding:40px; height:250px; margin: 42px -50px 37px -50px; border: 2px solid #808080; background-color:white;">

    		<div class="col-md-3" style="text-align:center">
    			<div style="height:150px; width:150px; background-image:url('6.GIF'); text-align:center; padding-top:40px; margin-left:60px">
    			<h2>
    				<?php 
        echo $total - $pulls;
        ?>
    			</h2>
    			</div>
    			<p  style="margin-top:10px" ><b>Total Issues</b></p>
    		</div>
    		<div class="col-md-3" style="text-align:center">
    			<div style="height:150px; width:150px; background-image:url('6.GIF'); text-align:center; padding-top:40px; margin-left:60px">
    			<h2>
    				<?php 
        echo $total - $sevendayissues - $pulls;
        ?>
    			</h2></div>
    			<p style="margin-top:10px" ><b>After Seven Days</b></p>
    		</div>
    		<div class="col-md-3" style="text-align:center">
    			<div style="height:150px; width:150px; background-image:url('6.GIF'); text-align:center; padding-top:40px; margin-left:60px">
    			<h2> 
    				<?php 
        echo $sevendayissues - $onedayissues;
        ?>

    			</h2></div>
    			<p style="margin-top:10px" > <b>24 Hours to Seven Days </b></p>
    		</div>
    		<div class="col-md-3" style="text-align:center">
    			<div style="height:150px; width:150px; background-image:url('6.GIF'); text-align:center; padding-top:40px; margin-left:60px">
    			<h2> 
    				<?php 
        echo $onedayissues;
        ?>
    			</h2></div>
    			<p style="margin-top:10px" > <b>Till 24 Hours </b></p>
    		</div>

    	</div>
    	
    	<?php 
    }
}
Exemplo n.º 23
0
$qry = $qry . " from owloo_user_master";
$qry = $qry . " Where owloo_screen_name = '" . mysql_real_escape_string($screenname) . "' AND owloo_updated_on = '" . Date("Y-m-d") . "'";
$chk_oldpass = mysql_query($qry);
$fetch_cntr = mysql_fetch_array($chk_oldpass);
if ($fetch_cntr['owloo_user_id'] == "") {
    if (isset($_REQUEST["txttwittername"]) && $_REQUEST["txttwittername"]) {
        $screenname = $_REQUEST["txttwittername"];
        $url = "https://api.twitter.com/1.1/users/lookup.json";
        $parameters = "screen_name=" . $screenname;
        $retdata = getdata($url, $parameters);
    } else {
        if (isset($_GET["twittername"]) && $_GET["twittername"]) {
            $screenname = $_GET["twittername"];
            $url = "https://api.twitter.com/1.1/users/lookup.json";
            $parameters = "screen_name=" . $screenname;
            $retdata = getdata($url, $parameters);
        } else {
            echo "<script>window.location='" . URL_ROOT . "twitter-stats/'</script>";
        }
    }
    if ($retdata) {
        $twdatas = json_decode($retdata, true);
        foreach ($twdatas as $twdata) {
            if (isset($twdata[0]["message"]) && $twdata[0]["message"]) {
                //echo "<br/>Error : " . $twdata[0]["message"];
                //echo "<br/>Code : " . $twdata[0]["code"];
                if ($twdata[0]["code"] == 34) {
                    echo '<div class="owloo_msj_alert">
					           <div>Puede que <strong>@' . ($_REQUEST["txttwittername"] ? $_REQUEST["txttwittername"] : $_GET["twittername"]) . '</strong> no esté registrado en Twitter.</div>
					           <div>Favor verifique el perfil ingresado y vuelve a intentarlo!</div>
					      </div>';
Exemplo n.º 24
0
$qry .= " Order By 1;";
$qrydata = mysql_query($qry);
$cont = 1;
$informe_errores .= "INICIO: " . date("H:i:s");
//echo '<br/>INICIO: '.date("H:i:s");
$informe_errores .= "\n    \tTwitter user: "******"owloo_screen_name"];
    $url = "https://api.twitter.com/1.1/users/lookup.json";
    //$parameters = "screen_name=" . $screenname;
    $parameters = "user_id=" . $fetch_cntr["owloo_user_twitter_id"];
    $ban_success = false;
    while (!$ban_success) {
        $retdata = getdata($url, $parameters, $code_app[$cont_access_token]['Consumer_Key'], $code_app[$cont_access_token]['Consumer_Secret'], $code_app[$cont_access_token]['Access_Token'], $code_app[$cont_access_token]['Access_Token_Secret']);
        if ($retdata) {
            $twdatas = json_decode($retdata, true);
            foreach ($twdatas as $twdata) {
                if ($twdata[0]["message"]) {
                    $informe_errores .= "\n    \t\t\t\t\t\tTwitter code error: " . $twdata[0]["code"] . " - " . $twdata[0]["message"] . " - " . $fetch_cntr["owloo_screen_name"] . " - " . $cont;
                    //echo '<br/>Twitter code error: '.$twdata[0]["code"].' - '.$twdata[0]["message"].' - '.$fetch_cntr["owloo_screen_name"].' - '.$cont;
                    if ($twdata[0]["code"] != 34) {
                        next_access_token();
                        $informe_errores .= "\n    \t\t\t\t\t\t\tTwitter user: "******" - " . $cont;
                        //echo '<br/>Twitter user: '******'user'];
                    } else {
                        $ban_success = true;
                        $cont++;
                    }
                } else {
Exemplo n.º 25
0
        }
        unset($array[0]);
        return array_sum($array) / count($array);
    }
    //get standard deviation
    public function standardArray($File)
    {
        $avg = $this->avgArray($File);
        $standard_deviation = 0;
        for ($i = 1; $i < count($File); $i++) {
            $standard_deviation = $standard_deviation + ($File[$i][1] - $avg) * ($File[$i][1] - $avg);
        }
        return sqrt($standard_deviation / (count($File) - 1));
    }
}
$File = getdata('./test.csv');
function getdata($File)
{
    $handle = fopen($File, 'r');
    while (!feof($handle)) {
        $csv[] = fgetcsv($handle);
    }
    fclose($handle);
    return $csv;
}
$read = new readCSV();
$max = $read->maxArray($File);
$min = $read->minArray($File);
$mean = $read->meanArray($File);
$avg = $read->avgArray($File);
$standard = $read->standardArray($File);
Exemplo n.º 26
0
/**
 * Get data for channel and announce parsing
 *
 * @param Channel ID $channel
 * @param 2 for announce, 3 for channel $type
 * @param path for file $path
 */
function get_html($channel, $path)
{
    global $message, $week;
    //$message .= "Get stream of type=$type" . PHP_EOL;
    $referer_channel = 'http://www.kulichki.tv/cgi-bin/gpack.cgi';
    $post_url_channel = 'http://www.kulichki.tv/andgon/cgi-bin/itv.cgi';
    $post_data_channel = "week={$week}&day=1&day=2&day=3&day=4&day=5&day=6&day=7&chanel={$channel}";
    $html = getdata($post_url_channel, 'POST', $referer_channel, $post_data_channel);
    $html = preg_replace("/><pre>/u", ">\n<pre>", $html);
    if (write_html($html, $path) == 0) {
        print $message;
    }
}
Exemplo n.º 27
0
include_once 'system/model/db_fns.php';
session_start();
//header("Content-Type: text/html; charset=utf-8");
$phone_arr = array();
$chged = getdata('select phonechg from t_cs where sn=1');
//手机号是否被更新
if (is_array($chged)) {
    $phoneadd = $chged[0];
    if ($phoneadd["phonechg"] == 1) {
        $phone_arr = getdata('select concat(\'"\',contactphone,\'",\') as contactphone from t_ownphone order by contactphone');
        //echo json_encode( $json_arr );
        $phonestr = "";
        //生成文件内容
        foreach ($phone_arr as $row) {
            $phonestr .= $row["contactphone"];
        }
        if ($phonestr != "") {
            $phonestr = "[" . $phonestr . "]";
            $phonestr = str_replace(",]", "]", $phonestr);
        }
        //echo $phonestr;
        //写文件
        $phonefile = fopen('data.html', 'w');
        if ($phonefile) {
            fwrite($phonefile, $phonestr);
            fclose($phonefile);
        }
        getdata('update t_cs set phonechg=0 where sn=1');
        //更改标记
    }
}
Exemplo n.º 28
0
		        }
		    ],
		    yAxis : [
		        {
		            type : 'value',
		            scale:true,
		            boundaryGap: [0.01, 0.01]
		        }
		    ],
		    series : [
		        {
		            name:'股市指數',
		            type:'k',
		            data:[ // 开盘,收盘,最低,最高
				    <?php 
getdata('172037', 2);
?>
		            ]
		        }
		    ]
		};
		                // 为echarts对象加载数据 
		                myChart.setOption(option); 
		            }
		        );
			</script>

<?php 
function getdata($class, $period)
{
    $filename = "database/" . $class . ".csv";
Exemplo n.º 29
0
    $filtervalue = $filtervalue . " and (TIMESTAMPDIFF(day,\\'" . $startTime . "\\',DATE_FORMAT(p.publishtime,\\'%Y-%m-%d\\'))>=0 and TIMESTAMPDIFF(day,DATE_FORMAT(p.publishtime,\\'%Y-%m-%d\\'),\\'" . $endTime . "\\')>=0)";
} elseif (strlen($startTime) > 0) {
    $bdate = $startTime;
    $edate = $startTime;
    $filtervalue = $filtervalue . " and (TIMESTAMPDIFF(day,\\'" . $startTime . "\\',DATE_FORMAT(p.publishtime,\\'%Y-%m-%d\\'))>=0 and TIMESTAMPDIFF(day,DATE_FORMAT(p.publishtime,\\'%Y-%m-%d\\'),\\'" . $startTime . "\\')>=0)";
} elseif (strlen($endTime) > 0) {
    $bdate = $endTime;
    $edate = $endTime;
    $filtervalue = $filtervalue . " and (TIMESTAMPDIFF(day,\\'" . $endTime . "\\',DATE_FORMAT(p.publishtime,\\'%Y-%m-%d\\'))>=0 and TIMESTAMPDIFF(day,DATE_FORMAT(p.publishtime,\\'%Y-%m-%d\\'),\\'" . $endTime . "\\')>=0)";
}
//error_log(date('Y-m-d H:i:s').'报警查询:'.$filtervalue."\n",3,$_SERVER['DOCUMENT_ROOT']."/log/sqlrun.log");
if (strlen(trim($filtervalue)) > 0) {
    //echo $filtervalue;
}
$json_arr = array();
$result = getdata("call p_myspot1(" . $userid . ",'" . $filtervalue . "','" . $bdate . "','" . $edate . "')");
//$result = @$conn->query($query);
/*if ((!$result) ||($result->num_rows ==0))
	{
		//echo "<meta http-equiv='Content-Type'' content='text/html; charset=utf-8'>";
      //  echo  $noconnect;
	    echo json_encode( $json_arr );
		return;
    }*/
/*$temp_arr = array();
	 while($row = $result->fetch_assoc()){
		 $temp_arr[] = $row;
	 }
     
	 foreach($temp_arr as $k=>$v){
		 $json_arr[]  = $v;
Exemplo n.º 30
0
<head>
<title>Crime Categories</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="container">
 <?php 
include 'header.php';
?>
   <h2 id='browse'>Crime Categories</h2>
 <div id="content">

  <?php 
echolinks($init, $num, 'crime_category', $limit);
getdata($init, $limit, 'crime_category', $db);
echolinks($init, $num, 'crime_category', $limit);
?>
</div>
<?php 
include 'footer.php';
?>
</div>
  <script src="js/hilightservice.js" type="text/javascript"></script>
  <script src="js/ajax.js" type="text/javascript"></script>
  <script type="text/javascript">
  unhide = document.getElementsByClassName('unhideme');
   for (var i = 0; i < unhide.length; i++) {
      unhide[i].className='styled-button-6';
     };
  </script>