Exemple #1
0
function getStatus($wait = false, $i = 0)
{
    global $_dev;
    $t = wpa_cli("status");
    if (trim($t) == "" || preg_match("/(Failed to connect)/i", $t)) {
        _l("wpa_supplicant not running, trying to start...");
        start_wpa_supplicant();
        sleep(1);
        return getStatus();
    } else {
        $v = parseVars($t);
        if ($wait) {
            if ($v["wpa_state"] != "COMPLETED") {
                _l("wpa_state = {$v["wpa_state"]} - retrying");
                sleep(1);
                $i++;
                if ($i >= 20) {
                    return $v;
                } else {
                    return getStatus(true, $i);
                }
            } else {
                return $v;
            }
        } else {
            return $v;
        }
    }
}
function transferSettingsToTable()
{
    $settings_section = db_get_row("SELECT section_id FROM ?:settings_sections WHERE type = 'ADDON' AND name = 'hybrid_auth'");
    $settings = db_get_array("SELECT * FROM ?:settings_objects WHERE section_id = " . $settings_section['section_id']);
    $companies = db_get_array("SELECT company_id FROM ?:companies;");
    $_settings = array();
    foreach ($settings as $setting) {
        $_settings[$setting['name']] = $setting;
    }
    $settings = $_settings;
    if (!empty($settings)) {
        foreach ($settings as $setting) {
            if (strpos($setting['name'], '_status')) {
                $provider_id = str_replace('_status', '', $setting['name']);
                foreach ($companies as $company_data) {
                    list($status, $is_vendor) = getStatus($provider_id, $settings, $company_data['company_id']);
                    if ($status == 'Y') {
                        $app_id = getSetting($provider_id, 'id', $settings, $company_data['company_id'], $is_vendor);
                        if (empty($app_id)) {
                            $app_id = getSetting($provider_id, 'key', $settings, $company_data['company_id'], $is_vendor);
                        }
                        $secret_key = getSetting($provider_id, 'secret', $settings, $company_data['company_id'], $is_vendor);
                        $public_key = getSetting($provider_id, 'public', $settings, $company_data['company_id'], $is_vendor);
                        db_query("INSERT INTO ?:hybrid_auth_providers SET " . "provider = '" . $provider_id . "'" . ", company_id = " . $company_data['company_id'] . ", app_id = '" . $app_id . "'" . ", app_secret_key = '" . $secret_key . "'" . ", app_public_key = '" . $public_key . "'" . ", status = 'A'" . " ON DUPLICATE KEY UPDATE provider_id = VALUES(provider_id)");
                    }
                }
            }
        }
    }
}
Exemple #3
0
function github($format)
{
    // location of cached file
    $file = 'assets/cache/contributors.json';
    // whatever this does, but it works
    stream_context_set_default(array("http" => array("header" => "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/601.3.9 (KHTML, like Gecko) Version/9.0.2 Safari/601.3.9")));
    // update cached file if it's older than half a day
    if (time() - filemtime($file) > 3600 * 12) {
        // || $_GET['forcerefresh']) {
        // get most recent json data
        $url = 'https://api.github.com/repos/thm/uinames/contributors?per_page=100';
        // check status
        if (getStatus($url) == 200) {
            // update cached file
            $data = file_get_contents($url);
            file_put_contents($file, $data, LOCK_EX);
        } else {
            $data = file_get_contents($file);
        }
        // prepare fresh data for implementation
        $data = json_decode($data, true);
    } else {
        // prepare cached data for implementation
        $data = json_decode(file_get_contents($file), true);
    }
    // shuffle people up so they're in a different spot every time
    shuffle($data);
    // loop: render faces
    for ($i = 0; $i < count($data); $i++) {
        $needles = ['$href', '$img', '$user', '$contributions'];
        $details = [$data[$i]['html_url'], $data[$i]['avatar_url'], $data[$i]['login'], $data[$i]['contributions']];
        echo str_replace($needles, $details, $format);
    }
}
Exemple #4
0
function run()
{
    $status = getStatus();
    for ($i = 1; $i < 20; $i++) {
        $currentFile = 'Problem' . $i . '.c';
        $programSource = file_get_contents($currentFile);
        // replace some stuff that is not needed at all
        $preprocessedSource = str_replace('#include <stdio.h>', '', $programSource);
        $preprocessedSource = str_replace('#include <assert.h>', '', $preprocessedSource);
        $preprocessedSource = str_replace('#include <math.h>', '', $preprocessedSource);
        $preprocessedSource = str_replace(': assert(0);', ':;', $preprocessedSource);
        $preprocessedSource = 'extern int __VERIFIER_nondet_int();' . $preprocessedSource;
        $preprocessedSource = replaceMain($preprocessedSource);
        // default error labels (0 - 59)
        for ($j = 0; $j < 60; $j++) {
            $finalProgramSource = setErrorLabel($j, $preprocessedSource);
            $state = 'unknown';
            if (isset($status[$i][$j])) {
                $state = $status[$i][$j];
            }
            file_put_contents(getNewFileName($i, $j, $state), $finalProgramSource);
        }
        // global error label
        $state = 'unknown';
        if (isset($status[$i][$j])) {
            $state = $status[$i][$j];
        }
        $finalProgramSource = str_replace('globalError:;', 'ERROR: goto ERROR;', $preprocessedSource);
        file_put_contents(getNewFileName($i, 60, $state), $finalProgramSource);
    }
}
function getControls($entity, $type)
{
    global $ENTRADA_TEMPLATE;
    $controls_file = $ENTRADA_TEMPLATE->absolute() . "/modules/common/mspr/controls.xml";
    $control_template = new Template($controls_file);
    $user = $entity->getUser();
    $user_id = $user->getID();
    $control_bind = array("user_id" => $user_id, "entity_id" => $entity->getID(), "image_dir" => ENTRADA_URL . "/images", "form_url" => ENTRADA_URL . "/admin/users/manage/students?section=mspr&id=" . $user_id);
    $controls = array();
    switch ($type) {
        //the differences below are due to the fact that students can only edit approvable items, while staff can only edit non-approvable items
        case "admin":
            if ($entity instanceof Approvable) {
                $status = getStatus($entity);
                switch ($status) {
                    case 'approved':
                        $controls[] = $control_template->getResult($control_bind, array("lang" => DEFAULT_LANGUAGE, "type" => "unapprove"));
                        break;
                    case 'unapproved':
                        $controls[] = $control_template->getResult($control_bind, array("lang" => DEFAULT_LANGUAGE, "type" => "reject"));
                        $controls[] = $control_template->getResult($control_bind, array("lang" => DEFAULT_LANGUAGE, "type" => "approve"));
                        break;
                    case 'rejected':
                    case 'rejected_reason':
                        $controls[] = $control_template->getResult($control_bind, array("lang" => DEFAULT_LANGUAGE, "type" => "approve"));
                        break;
                }
            } else {
                $controls[] = $control_template->getResult($control_bind, array("lang" => DEFAULT_LANGUAGE, "type" => "remove"));
            }
            if ($entity instanceof Editable) {
                $controls[] = $control_template->getResult($control_bind, array("lang" => DEFAULT_LANGUAGE, "type" => "edit"));
            }
            break;
        case "public":
            //fall through
        //fall through
        default:
            if ($entity instanceof Approvable) {
                if ($entity instanceof Editable) {
                    $controls[] = $control_template->getResult($control_bind, array("lang" => DEFAULT_LANGUAGE, "type" => "edit"));
                }
                $controls[] = $control_template->getResult($control_bind, array("lang" => DEFAULT_LANGUAGE, "type" => "remove"));
            }
            if ($entity instanceof Observership) {
                if ($entity->getStart() >= time()) {
                    $controls[] = $control_template->getResult($control_bind, array("lang" => DEFAULT_LANGUAGE, "type" => "remove"));
                    $controls[] = $control_template->getResult($control_bind, array("lang" => DEFAULT_LANGUAGE, "type" => "edit"));
                }
            }
            break;
    }
    $control_content = implode("\n", $controls);
    if ($control_content) {
        $control_set_file = $ENTRADA_TEMPLATE->absolute() . "/modules/common/mspr/control_set.xml";
        $control_set_template = new Template($control_set_file);
        $control_set_bind = array("controls" => $control_content);
        return $control_set_template->getResult($control_set_bind, array("lang" => DEFAULT_LANGUAGE));
    }
}
Exemple #6
0
function get_status_list($target = null)
{
    $states = array();
    $result = '';
    $target = isset($target) ? $target : get_username();
    // Default to showing own status.
    $statuses = getStatus($target);
    $health = getHealth($target);
    if ($health < 1) {
        $states[] = "Dead";
    } else {
        // *** Other statuses only display if not dead.
        if ($health < 80) {
            $states[] = "Injured";
        } else {
            $states[] = "Healthy";
        }
        if ($statuses['Stealth']) {
            $states[] = "Stealthed";
        }
        if ($statuses['Poison']) {
            $states[] = "Poisoned";
        }
        if ($statuses['Frozen']) {
            $states[] = "Frozen";
        }
    }
    return $states;
}
function stopTool()
{
    if (getStatus() == "running") {
        //当脚本未执行态的时候才能执行stop命令
        echo "wait for command stop ...<br>";
        system(STOP);
        system("echo stopped > ../status.txt");
        echo "stopped...";
        return TRUE;
    } else {
        echo "<br/>Already stoped, no need to stop again.<br/>";
        return FALSE;
    }
}
Exemple #8
0
 /**
  * Get info about the current database
  *
  * @return unknown
  */
 public function getInfo()
 {
     $response = Sopha_Http_Request::get($this->_db_uri);
     if (!$response->isSuccess()) {
         require_once 'Sopha/Db/Exception.php';
         switch ($response->getStatus()) {
             case 404:
                 throw new Sopha_Db_Exception("Database does not exist");
                 break;
             default:
                 throw new Sopha_Db_Exception("Unexpected response from server: " . "{$response->getStatus()} {$response->getMessage()}", $response > getStatus());
                 break;
         }
     }
     return $response->getDocument();
 }
Exemple #9
0
function getOrders($companyID)
{
    global $conn;
    if ($stmtOrders = $conn->prepare("SELECT o.`orde_id`, o.`Users_user_id`, o.`orde_price`, o.`orde_status`, o.`orde_stars`, o.`orde_address`, ohp.`Products_prod_id`, p.`prod_description`, p.`prod_price`, u.`user_name` FROM orders o, orders_has_products ohp, products p, users u WHERE o.`Companies_comp_id`=? AND ohp.`Orders_orde_id`=o.`orde_id` AND p.`prod_id`=ohp.`Products_prod_id` AND u.`user_id`=o.`Users_user_id` ORDER BY o.`orde_id` DESC")) {
        $stmtOrders->bind_param("i", $companyID);
        $stmtOrders->execute();
        $stmtOrders->bind_result($orderID, $orderUserID, $orderPrice, $orderStatus, $orderStars, $orderAddress, $productID, $productDescription, $productPrice, $userName);
        $stmtOrders->store_result();
        while ($stmtOrders->fetch()) {
            $statusClass = getStatusClass($orderStatus);
            $orderStatus = getStatus($orderStatus);
            $orderStars = getStars($orderStars);
            echo "<tr class=\"{$statusClass}\">\n\n            <td>{$orderID}</td>\n\n            <td class=\"text-center\">{$userName}</td>\n\n            <td>{$productDescription}</td>\n\n            <td class=\"text-center\">" . $orderPrice / $productPrice . "</td>\n\n            <td class=\"text-right\">R\$ " . number_format($orderPrice, 2, ',', ' ') . "</td>\n\n            <td class=\"text-center\">{$orderStatus}</td>\n\n            <td class=\"text-center\">{$orderStars}</td>\n\n            <td>{$orderAddress}</td>\n\n            <td class=\"text-center\"><a class=\"btn btn-primary btn-xs\" href=\"../../controllers/sendOrder.php?order={$orderID}\" role=\"button\" data-toggle=\"modal\" data-target=\"#order\">Enviar</a></td>\n\n            </tr>";
        }
    } else {
        echo "Falha na conexão: " . $conn->error;
    }
}
Exemple #10
0
 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function index()
 {
     $clients = $this->client->count();
     $invoices = $this->invoice->count();
     $estimates = $this->estimate->count();
     $products = $this->product->count();
     $recentInvoices = $this->invoice->with('client')->limit(10)->get();
     foreach ($recentInvoices as $count => $invoice) {
         $recentInvoices[$count]['totals'] = $this->invoice->invoiceTotals($invoice->id);
     }
     $recentEstimates = $this->estimate->with('client')->limit(10)->get();
     foreach ($recentEstimates as $count => $invoice) {
         $recentEstimates[$count]['totals'] = $this->estimate->estimateTotals($invoice->id);
     }
     $invoice_stats['unpaid'] = $this->invoice->where('status', getStatus('label', 'unpaid'))->count();
     $invoice_stats['paid'] = $this->invoice->where('status', getStatus('label', 'paid'))->count();
     $invoice_stats['partiallyPaid'] = $this->invoice->where('status', getStatus('label', 'partially paid'))->count();
     $invoice_stats['overdue'] = $this->invoice->where('status', getStatus('label', 'overdue'))->count();
     return view('home', compact('clients', 'invoices', 'products', 'estimates', 'recentInvoices', 'recentEstimates', 'invoice_stats'));
 }
Exemple #11
0
function getOrders($userID)
{
    global $conn;
    if ($stmtOrders = $conn->prepare("SELECT o.`orde_id`, o.`Companies_comp_id`, o.`orde_price`, o.`orde_status`, o.`orde_stars`, o.`orde_address`, ohp.`Products_prod_id`, p.`prod_description`, p.`prod_price`, c.`comp_name` FROM orders o, orders_has_products ohp, products p, companies c WHERE o.`Users_user_id`=? AND ohp.`Orders_orde_id`=o.`orde_id` AND p.`prod_id`=ohp.`Products_prod_id` AND c.`comp_id`=o.`Companies_comp_id` ORDER BY o.`orde_id` DESC")) {
        $stmtOrders->bind_param("i", $userID);
        $stmtOrders->execute();
        $stmtOrders->bind_result($orderID, $orderCompanyID, $orderPrice, $orderStatus, $orderStars, $orderAddress, $productID, $productDescription, $productPrice, $compName);
        $stmtOrders->store_result();
        while ($stmtOrders->fetch()) {
            $showReceiveOption = $orderStatus;
            $statusClass = getStatusClass($orderStatus);
            $orderStatus = getStatus($orderStatus);
            $orderStars = getStars($orderStars);
            echo "<tr class=\"{$statusClass}\">\n\n            <td>{$compName}</td>\n\n            <td class=\"text-center\">{$orderID}</td>\n\n            <td>{$productDescription}</td>\n\n            <td class=\"text-center\">" . $orderPrice / $productPrice . "</td>\n\n            <td class=\"text-right\">R\$ " . number_format($orderPrice, 2, ',', ' ') . "</td>\n\n            <td class=\"text-center\">{$orderStatus}</td>\n\n            <td class=\"text-center\">{$orderStars}</td>\n\n            <td>{$orderAddress}</td>\n";
            echo getOption($showReceiveOption, $orderID);
            echo "</tr>";
        }
    } else {
        echo "Falha na conexão: " . $conn->error;
    }
}
Exemple #12
0
function runlike($DB)
{
    $cookie = "";
    $status = getStatus($DB);
    $uid = $status['cur'];
    $user = $DB->Query("tl_sid", "uid", $uid);
    $qq = $user['qq'];
    $sid = $user['sid'];
    $re = '/href="(http:\\/\\/blog[0-9]*?.z.qq.com\\/like.*?)">赞/';
    $url = "http://ish.z.qq.com/infocenter_v2.jsp?B_UID=" . $qq . "&sid=" . $sid . "&g_ut=1";
    $page = url_fetch($url);
    preg_match_all($re, $page, $matches);
    $ia = count($matches[1]);
    for ($i = 0; $i < $ia; $i++) {
        sleep(5);
        $cookie2 = like_click($matches[1][$i], $url, $cookie);
        if (!empty($cookie2)) {
            $cookie = $cookie2;
        }
    }
    echo "ok";
}
<?php

// *** include require setting files ***
include_once "lib/ini.setting.php";
include_once "ini.config.php";
include_once "ini.dbstring.php";
include_once "ctrl.admin.php";
sec_session_start();
include_once "mod.login.php";
include_once "ctrl.login.php";
// check user role and authentication
checkSession($_SESSION['sess_user_id']);
$sta = getStatus($db);
$rf = getRf($db);
$os = getOS($db);
$app = getApp($db);
?>
<html lang="en-US">
<head>
    <meta charset="utf-8">
    <link href="<?php 
echo CSS;
?>
import.css" type="text/css" rel="stylesheet"/>
    <link href="<?php 
echo CSS;
?>
style.css" type="text/css" rel="stylesheet"/>
    <script src="<?php 
echo JS;
?>
            ?>
</td>
				<td><?php 
            echo $vo['fudaoyuan'];
            ?>
</td>
				<td><?php 
            echo $vo['rxsj'];
            ?>
</td>
				<td><?php 
            echo $vo['bysj'];
            ?>
</td>
	            <td class="text-center" ><?php 
            echo getStatus($vo['status']);
            ?>
</td>
                <td><input type="checkbox" name="ids" class="j-icheck" value="<?php 
            echo $vo['id'];
            ?>
"></td>
                <td>
                <div class="mrg0A">
                 <a href="<?php 
            echo U('edit', array('id' => $vo['id']));
            ?>
" rel="editstudent<?php 
            echo $vo['id'];
            ?>
"   class="btn small bg-blue" target="dialog"  width="440px" height="400px" ><span class="button-content"><i class="glyph-icon icon-edit"></i> 编辑</span></a>
Exemple #15
0
// boolean for attacking again
$target = $attackee = either(in('target'), in('attackee'));
$username = get_username();
// Pulls from an internal source.
$attacker = $username;
// *** Target's stats. ***
$attackee_health = getHealth($target);
$attackee_level = getLevel($target);
$attackee_str = getStrength($target);
$attackee_status = getStatus($target);
// *** Attacker's stats. ***
$attacker_health = getHealth($username);
$attacker_level = getLevel($username);
$user_turns = getTurns($username);
$attacker_str = getStrength($username);
$attacker_status = getStatus($username);
$class = getClass($username);
// *** Attack System Initialization ***
$starting_attackee_health = $attackee_health;
$starting_turns = $user_turns;
$killpoints = 0;
// *** Starting state for killpoints. ***
$attack_turns = 1;
// *** Default cost, will go to zero if an error prevents combat. ***
$required_turns = $attack_turns;
$level_check = $attacker_level - $attackee_level;
$what = "";
// *** This will be the attack type string, e.g. "duel". ***
$loot = 0;
$duel = in('duel') ? true : NULL;
$blaze = in('blaze') ? true : NULL;
Exemple #16
0
 public function getStatus()
 {
     return getStatus($this->vo->uname);
 }
 /**
  * 
  * Get photo set
  *
  * @param string $photoset_id  The photoset ID to chose random photo from.
  * @param string $per_page  The number of photos to display per page
  *
  * @return object
  */
 public function fetchPhotoset($id, $per_page = null)
 {
     static $method = 'flickr.photosets.getPhotos';
     if (empty($id)) {
         // @see Zend_Service_Exception
         require_once 'Zend/Service/Exception.php';
         throw new Zend_Service_Exception('You must supply a photo set ID');
     }
     // Get page number from the url - if there isn't one - we're on page 1
     $cws_page = isset($_GET['cws_page']) ? $_GET['cws_page'] : 1;
     $options = array('api_key' => $this->consumer_key, 'method' => $method, 'photoset_id' => $id, 'extras' => 'license, date_upload, date_taken, owner_name, icon_server, original_format, last_update, geo, tags, machine_tags, o_dims, views, media, path_alias, url_sq, url_t, url_s, url_m, url_o', 'per_page' => "{$per_page}", 'page' => $cws_page, 'media' => 'photo');
     // Add some caching...
     try {
         // Setup Zend Cache for 24hrs...
         // TODO: make cache duration user configurable...
         $frontendOptions = array('lifetime' => 86400, 'automatic_serialization' => true);
         $backendOptions = array('cache_dir' => WPFLICKR_PLUGIN_PATH . 'cache/');
         $cache = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);
         // If we don't have cached version, grab em from Flickr
         if (($response = $cache->load('photo_set_' . $id . '_' . $options['page'] . '_' . $options['per_page'])) === false) {
             if ($this->debug) {
                 error_log('Inside: CWS_FlickrApi::get_photo_set() - This one is from Flickr servers.');
             }
             $options['privacy_filter'] = '1';
             // Now search for photos
             $consumer = new Zend_Oauth_Consumer();
             $client = $consumer->getHttpClient();
             $client->setUri("http://api.flickr.com/services/rest/");
             $client->setMethod(Zend_Http_Client::GET);
             $client->setConfig(array('timeout' => 30));
             // TODO: check this stopped the time out issue
             $client->setParameterGet($options);
             $response = $client->request();
             // Uses Zend_Config_Xml to parse xml to array
             require_once 'Zend/Config/Xml.php';
             $photoset = new Zend_Config_Xml($response->getBody());
             $cache->save($photoset, 'photo_set_' . $id . '_' . $options['page'] . '_' . $options['per_page']);
             return $photoset;
             if ($response->isError()) {
                 // @see Zend_Service_Exception
                 require_once 'Zend/Service/Exception.php';
                 throw new Zend_Service_Exception('An error occurred sending request. Status code: ' . $response > getStatus());
             }
         } else {
             if ($this->debug) {
                 error_log('Inside: CWS_FlickrApi::get_photo_set() - This one is from cache.');
             }
             $cache->save($response, 'photo_set_' . $id . '_' . $options['page']);
             return $response;
         }
     } catch (Zend_Gdata_App_Exception $ex) {
         $this->errors[] = $ex->getMessage();
         $this->get_errors($this->errors);
     }
 }
Exemple #18
0
function getCurrentInfo($d)
{
    // gets the current info for the thermostat with the id $d
    require 'logininfo.php';
    login($username, $password);
    $data = getStatus($device_array[$d]);
    return $data;
}
Exemple #19
0
                                            <!-- START list group-->
                                            <div class="list-group">
                                                <!-- list item-->
                                                <a href="#" class="list-group-item">
                                                    <div class="media-box">
                                                        <div class="pull-left">
                                                            <em class="fa fa-user fa-2x text-info"></em>
                                                        </div>
                                                        <div class="media-box-body clearfix">
                                                            <p class="m0">Logged in as <?php 
echo $_SESSION['name'];
?>
</p>
                                                            <p class="m0 text-muted">
                                                                <small>Status: <?php 
echo getStatus();
?>
</small>
                                                            </p>
                                                        </div>
                                                    </div>
                                                </a>
                                            </div>
                                        </li>
                                    </ul>
                                    <!-- END User avatar toggle-->
                                    <!-- START lock screen-->

                                    <!-- END lock screen-->
                            </ul>
                            <!-- END Left navbar-->
Exemple #20
0
         if (empty($_SESSION['cometchat']['cometmessagesafter'])) {
             $_SESSION['cometchat']['cometmessagesafter'] = getTimeStamp() . '999';
         }
         $response['initialize'] = 0;
         $response['init'] = '1';
     } else {
         $sql = "select id from cometchat order by id desc limit 1";
         $query = mysqli_query($GLOBALS['dbh'], $sql);
         if (defined('DEV_MODE') && DEV_MODE == '1') {
             echo mysqli_error($GLOBALS['dbh']);
         }
         $result = mysqli_fetch_assoc($query);
         $response['init'] = '1';
         $response['initialize'] = $result['id'];
     }
     getStatus();
     if (!empty($_COOKIE[$cookiePrefix . 'state'])) {
         $states = explode(':', urldecode($_COOKIE[$cookiePrefix . 'state']));
         $openChatboxId = '';
         if ($states[2] != '' && $states[2] != ' ') {
             $openChatboxId = $states[2];
         }
         getChatboxData($openChatboxId);
     }
 }
 if (!empty($_REQUEST['buddylist']) && $_REQUEST['buddylist'] == 1 && $processFurther) {
     getBuddyList();
 }
 if (USE_COMET == 0) {
     getLastTimestamp();
 }
Exemple #21
0
 }
 $privacy = checkBugViewAuth($row['bID'], $id);
 if ($privacy[1]) {
     $picon = "<img src = '" . $SITE_PREFIX . "imgs/locked.png' alt = 'Private' />";
 } else {
     $picon = "<img src = '" . $SITE_PREFIX . "imgs/unlocked.png' alt = 'Public' />";
 }
 if (!$privacy[0]) {
     if ($i < $Count) {
         $CONTENT .= "\t<tr>\n<td>" . $row['bID'] . "<td>Unknown</td><td>Unknown</td></td><td>Unknown</td><td>Private</td><td>" . $picon . "</td><td>Private</td>\n\t</tr>\n";
     } else {
         break;
     }
 } else {
     if ($i < $Count) {
         $status = getStatus($row['bug_status']);
         $severity = getSeverity($row['bug_severity']);
         $statusClass = "goodthings";
         $severityClass = "goodthings";
         $overrideOne = False;
         $overrideTwo = False;
         if ($status['critical']) {
             $statusClass = "badthings";
         }
         if ($severity['critical']) {
             $severityClass = "badthings";
         }
         if ($status['critical']) {
             $CONTENT .= "\t<tr onclick=\"document.location.href = '" . $SITE_PREFIX . "t/bug/" . $row['bID'] . "'\" >\n<td>" . $row['bID'] . "</td><td class = '" . $statusClass . "' >" . $status['status_name'] . "</td><td class = '" . $severityClass . "'>" . $severity['severity_name'] . "</td><td>" . $owner['real_name'] . "</td><td>" . $package['project_name'] . "</td><td>" . $picon . "</td><td><a href = '" . $SITE_PREFIX . "t/bug/" . $row['bID'] . "' >" . $row['title'] . "</a></td>\n\t</tr>\n";
         }
         $i++;
Exemple #22
0
            $e_email = $r1['email'];
            $e_address = $r1['address'];
            $e_title = $r1['title'];
            $e_name = $r1['name'];
            $e_logo = $r1['image_logo'];
        }
    }
    $stt = getStatus($_GET["id"]);
    $rowCountStt = mysql_num_rows($stt);
    if ($rowCountStt > 0) {
        while ($r1 = mysql_fetch_array($stt)) {
            $currentdate = $r1['modified'];
        }
    } else {
        insertFirstStatus($_GET["id"]);
        $stt = getStatus($_GET["id"]);
        while ($r1 = mysql_fetch_array($stt)) {
            $currentdate = $r1['modified'];
        }
    }
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <title>:: Welcome to Broadway Medical Centre ::</title>
    <meta name="generator" content="Bootply" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
Exemple #23
0
		$testOutput .= getStatus($gdInfo['PNG Support'], 'PNG support', 'You won\'t be able to upload PNG images for your website', true, false);	
	}

	// upload sizes ...
	$isOk = floatval(ini_get('upload_max_filesize')) >= 256 && floatval(ini_get('post_max_size')) >= 256;
	/*$listOk &= $isOk;*/ $listHasErrors |= !$isOk;
	$testOutput .= getStatus($isOk, 'Large file uploads (for videos) allowed', 
			'Your server runs PHP in CGI mode, which doesn\'t allow tweaking PHP options in .htaccess files. Please tell this to your server administrator and ask for bigger file uploads (over 200Mb for larger videos).', false, false);


	$testOutput .= '<p><br /><strong>Have you installed your website properly?</strong></p>';

	// storage writable ...
	$isOk = file_exists($SITE_ROOT . 'storage') && is_writable($SITE_ROOT . 'storage');
	$listOk &= $isOk; $listHasErrors |= !$isOk;
	$testOutput .= getStatus($isOk, 'Storage folder exists and is writable', 'Please make sure the folder called "storage" in your Berta installation exists and is writable. Check step (3) in the installing instructions (located in the INSTALL folder) for details.');
	
	$testOutput .= '</ul>';
	$testOutput .= '<p>A green <span class="xVisualStatusOK">YES</span> means that you don\'t even need to read what it is about - it\'s just all fine. A yellow <span class="xVisualStatusWarning">NO</span> means that ' . 
		'Berta will still work, but the feature will not be available to you. The red <span class="xVisualStatusFail">NO</span> is the bad one - if there is one, it will have a suggestion ' . 
		'what can be done to correct the situation.</p>';



	// if the test was ok without any warnings then redirect to the next step
	if($listOk && !$listHasErrors) {
		header('Location: .?_berta_install_step=2');
		exit;
	}
}
/**
 * author:coster
 * date:21.10.05
 * zeigt ein einzelnes monat für das webinterface in einer tabelle
 * */
function showWeek($day, $month, $year, $vermieter_id, $mietobjekt_id, $modus)
{
    global $root;
    global $ansicht;
    //anzahl der tage des monats:
    $anzahlTage = getNumberOfDaysOfMonth($month, $year);
    include_once $root . "/include/reservierungFunctions.inc.php";
    include_once $root . "/include/mieterFunctions.inc.php";
    $lastDayOfWeek = getLastDayOfWeek($day, $month, $year);
    $lastDayMonth = $month;
    $lastDayYear = $year;
    if ($lastDayOfWeek < $day) {
        $lastDayMonth++;
    }
    if ($lastDayMonth > 12) {
        $lastDayMonth = 1;
        $lastDayYear++;
    }
    $firstDayOfWeek = getFirstDayOfWeek($day, $month, $year);
    $firstDayMonth = $month;
    $firstDayYear = $year;
    if ($firstDayOfWeek > $day) {
        $firstDayMonth--;
    }
    if ($firstDayMonth < 1) {
        $firstDayMonth = 12;
        $firstDayYear--;
    }
    ?>
			<table border="0" width="100%" cellspacing="1" cellpadding="0" class="<?php 
    echo TABLE_COLOR;
    ?>
">
			<?php 
    $status = getStatus($mietobjekt_id, 0, 0, $day, $month, $year, 59, 23, $day, $month, $year);
    if (isset($status) && sizeof($status) >= 1) {
        $statusString = BELEGT;
    } else {
        $statusString = FREI;
    }
    $mieter_id = -1;
    ?>
					<tr class="<?php 
    echo TABLE_COLOR;
    ?>
"> 
						<!-- wochentag anzeigen -->
						<td class="<?php 
    echo TABLE_COLOR;
    ?>
" valign="left" class="<?php 
    echo TABLE_STANDARD;
    ?>
">
							<?php 
    echo getUebersetzung("Woche") . " ";
    echo getUebersetzung("von") . " ";
    echo getUebersetzung(getDayName($firstDayOfWeek, $firstDayMonth, $firstDayYear));
    ?>
				 		</td>
						<!-- datum anzeigen -->
						<td class="<?php 
    echo TABLE_COLOR;
    ?>
" valign="left" class="<?php 
    echo TABLE_STANDARD;
    ?>
">
							<?php 
    echo $firstDayOfWeek . ".";
    echo $firstDayMonth . ".";
    echo $firstDayYear;
    ?>
						</td>	
						<td class="<?php 
    echo TABLE_COLOR;
    ?>
" valign="left" class="<?php 
    echo TABLE_STANDARD;
    ?>
">
							<?php 
    echo getUebersetzung("bis") . " ";
    echo getUebersetzung(getDayName($lastDayOfWeek, $lastDayMonth, $lastDayYear));
    ?>
				 		</td>
						<!-- datum anzeigen -->
						<td class="<?php 
    echo TABLE_COLOR;
    ?>
" valign="left" class="<?php 
    echo TABLE_STANDARD;
    ?>
">
							<?php 
    echo $lastDayOfWeek . ".";
    echo $lastDayMonth . ".";
    echo $lastDayYear;
    ?>
						</td>							
						<!-- grafische reservierung anzeigen -->
						<td class="<?php 
    echo TABLE_COLOR;
    ?>
" class="<?php 
    echo TABLE_STANDARD;
    ?>
">
							<?php 
    //wie viele reservierungen sind in dieser Woche?
    $resIds = getReservierungIDs($mietobjekt_id, 0, 0, $firstDayOfWeek, $firstDayMonth, $firstDayYear, 59, 23, $lastDayOfWeek, $lastDayMonth, $lastDayYear);
    $anzahlRes = mysqli_num_rows($resIds);
    ?>
					
						  <table cellpadding="0" cellspacing="0" border="0">
						    <tr>
						    	<td width="5" class="<?php 
    echo FREI;
    ?>
">&nbsp;</td>
							    <?php 
    for ($l = 0; $l < $anzahlRes; $l++) {
        ?>
							      <td width="5" class="<?php 
        echo BELEGT;
        ?>
">&nbsp;</td>
							    <?php 
    }
    ?>
						    </tr>
						  </table>
						</td>
					</tr>
			</table>
			<br/>	
			<table cellpadding="0" cellspacing="1" border="0" class="<?php 
    echo TABLE;
    ?>
" width="100%">
			<tr>
				<th>Tag</th>
				<th>Datum</th>
				<th></th>
				<th></th>
				<th></th>
				<th></th>
			</tr>		
			<?php 
    //anzeige der einzelnen wochentage:
    for ($iz = $firstDayOfWeek; $iz < $firstDayOfWeek + 7; $iz++) {
        $i_month = $firstDayMonth;
        $i_year = $firstDayYear;
        $i_day = $iz;
        if ($i_day > getNumberOfDaysOfMonth($firstDayMonth, $firstDayYear)) {
            $i_month++;
            $i_day = $iz - getNumberOfDaysOfMonth($firstDayMonth, $firstDayYear);
        }
        if ($i_month > 12) {
            $i_year++;
        }
        $anzahlResOnDayI = countReservierungIDs($mietobjekt_id, 0, 0, $i_day, $i_month, $i_year, 59, 23, $i_day, $i_month, $i_year);
        if ($anzahlResOnDayI > 0) {
            $resIds = getReservierungIDs($mietobjekt_id, 0, 0, $i_day, $i_month, $i_year, 59, 23, $i_day, $i_month, $i_year);
            while ($d = mysqli_fetch_array($resIds)) {
                $reservierungs_id = $d["RESERVIERUNG_ID"];
                $mieter_id = getMieterIdOfReservierung($reservierungs_id);
                $mietdauer = getNumberOfDaysOfReservation($reservierungs_id);
                $isFirstDay = isFirstDayOfReservation($reservierungs_id, $i_day, $i_month, $i_year);
                $isLastDay = isLastDayOfReservation($reservierungs_id, $i_day, $i_month, $i_year);
                $timeVon = getTimeVonOfReservierung($reservierungs_id);
                $timeBis = getTimeBisOfReservierung($reservierungs_id);
                $allDay = false;
                if ($mietdauer > 1 && !$isFirstDay && !$isLastDay) {
                    $allDay = true;
                } else {
                    if ($timeVon == "00:00" && $timeBis == "24:00") {
                        $allDay = true;
                    }
                }
                ?>
						<form action="./mieterInfos/index.php" method="post" name="form<?php 
                echo $day;
                ?>
" target="_self">
						<input type="hidden" name="mietobjekt_id" value="<?php 
                echo $mietobjekt_id;
                ?>
" />
						<input type="hidden" name="monat" value="<?php 
                echo $month;
                ?>
" />
						<input type="hidden" name="jahr" value="<?php 
                echo $year;
                ?>
" />
						<input type="hidden" name="tag" value="<?php 
                echo $day;
                ?>
" />
						<input type="hidden" name="ansicht" value="<?php 
                echo $ansicht;
                ?>
" />
						<tr>
							<!-- wochentag anzeigen -->
							<td class="<?php 
                echo TABLE_STANDARD;
                ?>
" valign="left" class="<?php 
                echo TABLE_STANDARD;
                ?>
">
								<?php 
                echo getUebersetzung(getDayName($i_day, $i_month, $i_year));
                ?>
					 		</td>
							<!-- datum anzeigen -->
							<td class="<?php 
                echo TABLE_STANDARD;
                ?>
" valign="left" class="<?php 
                echo TABLE_STANDARD;
                ?>
">
								<?php 
                echo $i_day . ".";
                echo $i_month . ".";
                echo $i_year;
                ?>
							</td>	
							<!-- grafische reservierung anzeigen -->
							<td class="<?php 
                echo TABLE_STANDARD;
                ?>
">				
							  <table cellpadding="0" cellspacing="0" border="0">
							    <tr>
							    	<?php 
                if (!$allDay) {
                    ?>
							    	<td width="5" class="<?php 
                    echo FREI;
                    ?>
">&nbsp;</td>
								    <?php 
                }
                for ($z = 0; $z < $anzahlResOnDayI; $z++) {
                    ?>
								      <td width="5" class="<?php 
                    echo BELEGT;
                    ?>
">&nbsp;</td>
								    <?php 
                }
                ?>
							    </tr>
							  </table>
							</td>
							<!-- text -->
							<?php 
                if ($modus == MODUS_WEBINTERFACE) {
                    ?>
							<td class="<?php 
                    echo TABLE_STANDARD;
                    ?>
">
								<input name="mieter_id" type="hidden" value="<?php 
                    echo $mieter_id;
                    ?>
">						  
								 <?php 
                    //gast-namen ausgeben:
                    if ($mieter_id != ANONYMER_MIETER_ID) {
                        echo getNachnameOfMieter($mieter_id);
                        echo ", ";
                        echo getMieterOrt($mieter_id);
                    } else {
                        echo getUebersetzung("anonymer Mieter");
                    }
                    ?>
							</td>
							<?php 
                } else {
                    if ($modus == MODUS_BELEGUNGSPLAN) {
                        ?>
							<td class="<?php 
                        echo TABLE_STANDARD;
                        ?>
">
								<?php 
                        echo getUebersetzung("reserviert");
                        ?>
							</td>
							<?php 
                    }
                }
                if ($modus == MODUS_BELEGUNGSPLAN && $mieter_id != ANONYMER_MIETER_ID) {
                    ?>
							<td class="<?php 
                    echo TABLE_STANDARD;
                    ?>
">
							<?php 
                } else {
                    ?>
							<td class="<?php 
                    echo TABLE_STANDARD;
                    ?>
" colspan="2">
							<?php 
                }
                //zeit ausgeben:
                //wenn mietdauer mehr als 3 tage, braucht nur bei
                //tag 1 und tag 3 die zeit ausgegeben werden:
                if ($mietdauer >= 2) {
                    if ($isFirstDay) {
                        echo $timeVon . " - 24:00 " . getUebersetzung("Uhr");
                    } else {
                        if ($isLastDay) {
                            echo "00:00 - " . $timeBis . " " . getUebersetzung("Uhr");
                        } else {
                            ?>
										00:00 - 24:00 <?php 
                            echo getUebersetzung("Uhr");
                            ?>
										<?php 
                        }
                    }
                }
                ?>
							</td>
							<?php 
                if ($modus == MODUS_WEBINTERFACE) {
                    ?>
							<td class="<?php 
                    echo TABLE_STANDARD;
                    ?>
">
								<?php 
                    //button für mieter infos  ausgeben:
                    if ($mieter_id != ANONYMER_MIETER_ID) {
                        ?>
								<input type="submit" name="Submit" class="<?php 
                        echo BUTTON;
                        ?>
" 
									onMouseOver="this.className='<?php 
                        echo BUTTON_HOVER;
                        ?>
';"
			   						onMouseOut="this.className='<?php 
                        echo BUTTON;
                        ?>
';" 
			   						value="<?php 
                        echo getUebersetzung("Mieter-Info");
                        ?>
"/>
		   						<?php 
                    }
                    ?>
							</td>
							<?php 
                }
                //ende wenn modus webinterface
                ?>
						</tr>
						</form>	
						<?php 
            }
            ?>
				
					<?php 
        } else {
            ?>
							<tr>
								<!-- wochentag anzeigen -->
								<td class="<?php 
            echo TABLE_STANDARD;
            ?>
" valign="left" class="<?php 
            echo TABLE_STANDARD;
            ?>
">
									<?php 
            echo getUebersetzung(getDayName($i_day, $i_month, $i_year));
            ?>
						 		</td>					 		
								<!-- datum anzeigen -->
								<td valign="left" class="<?php 
            echo TABLE_STANDARD;
            ?>
" class="<?php 
            echo TABLE_STANDARD;
            ?>
">
									<?php 
            echo $i_day . ".";
            echo $i_month . ".";
            echo $i_year;
            ?>
								</td>	
								<!-- grafische reservierung anzeigen -->
								<td class="<?php 
            echo TABLE_STANDARD;
            ?>
">				
								  <table cellpadding="0" cellspacing="0" border="0">
								    <tr>
								    	<td width="5" class="<?php 
            echo FREI;
            ?>
">&nbsp;</td>
								    </tr>
								  </table>
								</td>
								<td colspan="3" class="<?php 
            echo TABLE_STANDARD;
            ?>
"><?php 
            echo getUebersetzung("Keine Reservierung an diesem Tag vorhanden");
            ?>
.</td>	
							</tr>
						<?php 
        }
        //ende anzahl reservierungen < 0
    }
    //ende for alle tage der woche
    ?>
	
			</table>
<?php 
}
Exemple #25
0
		}
		';
// ouput confirmation for wake up email
if ($wake_up_sent) {
    $head_extra .= "alert('Wake Up email sent');\n    ";
} elseif (isset($_POST['wakeID']) && !$wake_up_sent) {
    $head_extra .= "alert('Wake Up email FAILED !!');\n    ";
}
// transfer game data to javacript vars
$head_extra .= getJSFEN();
// writes 'FEN' array, and 'result' (gui.inc.php)
$head_extra .= getTurn();
// writes 'isBoardDisabled', 'isPlayersTurn', and 'perspective' (gui.inc.php)
$head_extra .= getMoves();
// writes the 'moves' array (gui.inc.php)
$head_extra .= getStatus();
// writes 'whosMove', 'gameState', and 'statusMsg' (gui.inc.php)
$head_extra .= "var DEBUG = " . JS_DEBUG . ";\n    ";
$head_extra .= "var numMoves = FEN.length - 1;\n    ";
// if it's not the player's turn, enable auto-refresh
$autoRefresh = !$isPlayersTurn && !isBoardDisabled() && !$_SESSION['shared'];
$head_extra .= "var autoreload = ";
if (!$autoRefresh || 0 == $CFG_MINAUTORELOAD) {
    $head_extra .= "0";
} elseif ($_SESSION['pref_auto_reload'] >= $CFG_MINAUTORELOAD) {
    $head_extra .= $_SESSION['pref_auto_reload'];
} else {
    $head_extra .= $CFG_MINAUTORELOAD;
}
$head_extra .= ";\n\t\t\tvar gameId = '{$_SESSION['game_id']}';\n\t\t\tvar players = '{$_SESSION['white']['p_username']} - {$_SESSION['black']['p_username']}';\n\t\t\tvar promoting = '{$promoting}';\n\t\t\tvar isGameOver = '{$isGameOver}';\n\t\t\tvar lastMoveIndicator = '{$_SESSION['pref_show_last_move']}';\n\t\t\tvar id960 = '{$_SESSION['id960']}';\n\t\t\tvar initpos = '{$initpos}';\n\t\t";
$head_extra .= "var currentTheme = '";
Exemple #26
0
function instagram($param)
{
    // required parameters
    $token = $param["token"];
    // possible parameters
    $count = $param["count"];
    if (!$count) {
        $count = 10;
    }
    $column = $param["column"];
    if (!$column) {
        $column = 'column-33';
    } else {
        $column = 'column-' . $column;
    }
    // location of cached file
    $file = ROOT . 'assets/cache/instagram.json';
    // update cached file if it's older than 30 minutes
    if (time() - filemtime($file) > 1800) {
        // get most recent json data
        $url = 'https://api.instagram.com/v1/users/self/media/recent/?access_token=' . $token;
        // check status
        if (getStatus($url) == 200) {
            // update cached file
            $data = file_get_contents($url);
            file_put_contents($file, $data, LOCK_EX);
        } else {
            $data = file_get_contents($file);
        }
        // prepare fresh data for implementation
        $data = json_decode($data, true);
    } else {
        // prepare cached data for implementation
        $data = json_decode(file_get_contents($file), true);
    }
    // render photos
    for ($i = 0; $i < min($count, count($data['data'])); $i++) {
        $title = $data['data'][$i]['caption']['text'];
        $url = $data['data'][$i]['link'];
        $img = $data['data'][$i]['images']['standard_resolution']['url'];
        // echo the html for each item
        echo '<div class="' . $column . '"><p><a href="' . $url . '"><img src="' . $img . '" alt="' . $title . '"></a></p></div>';
    }
}
Exemple #27
0
 /**
  * Returns the status of the player
  * 
  * @author Ross Carlson
  * @version 2/9/05
  * @since 2/9/05
  */
 function getPlayerStatus($type = "playback")
 {
     return getStatus($type);
 }
<?php

include "interface.php";
$status = getStatus();
if ($status == "running") {
    $status = "<font color='red'>{$status} ...</font>";
} else {
    $status = "<font color='blue'>{$status}</font>";
}
echo "状态: ", $status;
		function add_student_to_watchlist($cid,$uid)
		{
			$status=getStatus($uid,$cid);
				if($status)
				$status=0;
				else
				$status=1;
			echo updateStatus($status,$uid,$cid);
		}
                    send_kill_mails($username, $target, $attacker_id, $article, $item->getName(), $today, $loot);
                } else {
                    $attacker_id = $username;
                }
                if ($target != $username) {
                    $target_email_msg = "{$attacker_id} has used {$article} {$item->getName()} on you at {$today} and caused you to {$result}.";
                    sendMessage($attacker_id, $target, $target_email_msg);
                }
            }
            $turns_to_take = 1;
            // *** remove Item ***
            echo "<br>Removing {$item->getName()} from your inventory.<br>\n";
            $sql->Update("UPDATE inventory set amount = amount-1 WHERE owner = '" . $username . "' AND item ='{$item->getName()}' AND amount>0");
            // *** Decreases the item amount by 1.
            // Unstealth
            if (!$item->isCovert() && $give != "on" && $give != "Give" && getStatus($username) && $status_array['Stealth']) {
                //non-covert acts
                subtractStatus($username, STEALTH);
                echo "Your actions have revealed you. You are no longer stealthed.<br>\n";
            }
            if ($victim_alive == true && $using_item == true) {
                $self_targetting = $selfTarget ? '&amp;selfTarget=1' : '';
                echo "<br><a href=\"inventory_mod.php?item=" . urlencode($item->getName()) . "&amp;target={$target}{$self_targetting}\">Use {$item->getName()} again?</a><br>\n";
                //Repeat Usage
            }
        }
    }
}
// *** Take away at least one turn even on attacks that fail. ***
if ($turns_to_take < 1) {
    $turns_to_take = 1;