Example #1
0
 public function run($functionName = '', $functionRun = '')
 {
     $datas = Structure::datas();
     $parameters = $datas['parameters'];
     $isFile = $datas['isFile'];
     $function = $datas['function'];
     if (file_exists($isFile)) {
         if ($functionName === $function) {
             if (is_callable($functionRun)) {
                 if (APP_TYPE === 'local') {
                     set_error_handler('Exceptions::table');
                 }
                 call_user_func_array($functionRun, $parameters);
                 if (APP_TYPE === 'local') {
                     restore_error_handler();
                 }
             } else {
                 // Sayfa bilgisine erişilemezse hata bildir.
                 if (!Config::get('Route', 'show404')) {
                     // Hatayı ekrana yazdır.
                     echo Error::message('Error', 'callUserFuncArrayError', $functionRun);
                     // Hatayı rapor et.
                     report('Error', getMessage('Error', 'callUserFuncArrayError'), 'SystemCallUserFuncArrayError');
                     // Çalışmayı durdur.
                     return false;
                 } else {
                     redirect(Config::get('Route', 'show404'));
                 }
             }
         }
     }
 }
Example #2
0
 public static function run()
 {
     // INI AYARLAR YAPILANDIRILIYOR...
     $iniSet = Config::get('Ini', 'settings');
     if (!empty($iniSet)) {
         Config::iniSet($iniSet);
     }
     // ----------------------------------------------------------------------
     // HTACCESS DOSYASI OLUŞTURULUYOR...
     if (Config::get('Htaccess', 'createFile') === true) {
         createHtaccessFile();
     }
     // ----------------------------------------------------------------------
     // COMPOSER DOSYASI OLUŞTURULUYOR...
     $composer = Config::get('Composer', 'autoload');
     if ($composer === true) {
         $path = 'vendor/autoload.php';
         if (file_exists($path)) {
             require_once $path;
         } else {
             report('Error', getMessage('Error', 'fileNotFound', $path), 'AutoloadComposer');
             die(getErrorMessage('Error', 'fileNotFound', $path));
         }
     } elseif (file_exists($composer)) {
         require_once $composer;
     } elseif (!empty($composer)) {
         report('Error', getMessage('Error', 'fileNotFound', $composer), 'AutoloadComposer');
         die(getErrorMessage('Error', 'fileNotFound', $composer));
     }
     // ----------------------------------------------------------------------
 }
 public function table(string $no = NULL, string $msg = NULL, string $file = NULL, string $line = NULL, array $trace = NULL)
 {
     $lang = lang('Templates');
     $message = $lang['line'] . ':' . $line . ', ' . $lang['file'] . ':' . $file . ', ' . $lang['message'] . ':' . $msg;
     report('ExceptionError', $message, 'ExceptionError');
     $table = $this->_template($msg, $file, $line, $no, $trace);
     // Error Type: TypeHint -> exit
     if (in_array($no, ['0', '2'])) {
         exit($table);
     }
     echo $table;
 }
Example #4
0
 public static function set($errorMessage = '')
 {
     $info = debug_backtrace();
     $className = isset($info[1]['class']) ? str_ireplace(STATIC_ACCESS, '', $info[1]['class']) : $info[5]['class'];
     $methodName = isset($info[1]['function']) ? $info[1]['function'] : $info[5]['function'];
     $line = isset($info[1]['line']) ? $info[1]['line'] : $info[5]['line'];
     $file = isset($info[1]['file']) ? $info[1]['file'] : $info[5]['file'];
     self::$errors[strtolower($className)][strtolower($methodName)]['message'][] = $errorMessage;
     self::$errors[strtolower($className)][strtolower($methodName)]['line'][] = $line;
     self::$errors[strtolower($className)][strtolower($methodName)]['file'][] = $file;
     report(ucfirst($className . 'Error'), $errorMessage, ucfirst($className) . 'Library');
     return false;
 }
Example #5
0
 function login()
 {
     $this->intentos = 0;
     do {
         $this->reqLogin();
         if ($this->error && $this->intentos > 0) {
             $tiempo_espera = $this->tiempoEspera($this->intentos);
             report('err', "ERROR. Login fallido. Intentando volver a loguear en " . segundosCadenaTiempo($tiempo_espera) . "...");
             sleep($tiempo_espera);
         }
     } while ($this->error);
     report('act', "Login satisfactorio.");
 }
Example #6
0
 public function inicializar()
 {
     //Escaneo de actividad e inicialización
     $colas = $this->coordinator->escanearColas();
     if ($colas["construcción"] > 0) {
         $this->builder->finCola = time() + $colas["construcción"];
         report('wait', 'Ya hay algo construyéndose hasta dentro de ' . segundosCadenaTiempo($colas["construcción"]) . ".");
     }
     if ($colas["investigación"] > 0) {
         $this->researcher->finCola = time() + $colas["investigación"];
         report('wait', 'Ya hay algo investigándose hasta dentro de ' . segundosCadenaTiempo($colas["investigación"]) . ".");
     }
     $this->commander->inicializar($this->coordenadas);
 }
Example #7
0
 public static function set($errorMessage = '', $output = false, $object = '')
 {
     //------------------------------------------------------------------------------------------------
     // 2. Parametre metinsel değer alırsa lang() yönteminden verinin çağrılmasını sağlar.
     //------------------------------------------------------------------------------------------------
     if (isChar($output)) {
         $errorMessage = lang($errorMessage, $output, $object);
     }
     $info = debug_backtrace();
     $className = isset($info[1]['class']) ? str_ireplace(STATIC_ACCESS, '', $info[1]['class']) : (isset($info[5]['class']) ? $info[5]['class'] : false);
     $methodName = isset($info[1]['function']) ? $info[1]['function'] : (isset($info[5]['function']) ? $info[5]['function'] : false);
     $line = isset($info[1]['line']) ? $info[1]['line'] : (isset($info[5]['line']) ? $info[5]['line'] : false);
     $file = isset($info[1]['file']) ? $info[1]['file'] : (isset($info[5]['file']) ? $info[5]['file'] : false);
     self::$errors[strtolower($className)][strtolower($methodName)]['message'][] = $errorMessage;
     self::$errors[strtolower($className)][strtolower($methodName)]['line'][] = $line;
     self::$errors[strtolower($className)][strtolower($methodName)]['file'][] = $file;
     report(ucfirst($className . 'Error'), $errorMessage, ucfirst($className) . 'Library');
     return $output === true ? $errorMessage : false;
 }
 public function run(string $functionName, $functionRun = NULL, array $route = NULL)
 {
     if (!empty($this->route)) {
         $route = $this->route;
     }
     if (!empty($route)) {
         Config::set('Services', 'route', ['changeUri' => $route]);
     }
     $datas = Structure::data();
     $parameters = $datas['parameters'];
     $isFile = $datas['file'];
     $function = $datas['function'];
     if (($functionName === 'construct' || $functionName === 'destruct') && is_callable($functionRun)) {
         call_user_func_array($functionRun, $parameters);
     }
     if (file_exists($isFile)) {
         if (strtolower($function) === 'index' && strtolower($functionName) === 'main') {
             $function = 'main';
         }
         if ($functionName === $function) {
             if (is_callable($functionRun)) {
                 call_user_func_array($functionRun, $parameters);
             } else {
                 // Sayfa bilgisine erişilemezse hata bildir.
                 if (!($routeShow404 = Config::get('Services', 'route')['show404'])) {
                     // Hatayı rapor et.
                     report('Error', lang('Error', 'callUserFuncArrayError'), 'SystemCallUserFuncArrayError');
                     // Hatayı ekrana yazdır.
                     die(Errors::message('Error', 'callUserFuncArrayError', $functionRun));
                 } else {
                     redirect($routeShow404);
                 }
             }
         }
     }
 }
Example #9
0
</td>
</tr>
<TD align="center" class="header">ID</TD>
<TD align="center" class="header">User</TD>
<TD align="center" class="header">Downloaded</TD>
<TD align="center" class="header">Uploaded</TD>
<TD align="center" class="header">Ratio</TD>
<TD align="center" class="header">Rank</TD>
<TD align="center" class="header">Difference</TD>
<TD align="center" class="header">Register Date</TD>
<TD align="center" class="header">Last Connect</TD>
<TD align="center" class="header">Edit</TD>
<TD align="center" class="header">Delete</TD>
<TD align="center" class="header">C</TD>
</TR>
<?php 
    if ($kullan == 0) {
        $q = $db->query("SELECT users.id AS fid, username, downloaded, uploaded, level, UNIX_TIMESTAMP(joined) AS joined, UNIX_TIMESTAMP(lastconnect) AS lastconnect FROM users LEFT JOIN users_level ON users.id_level = users_level.id WHERE ((downloaded - uploaded) > '" . $mdiff . "') ORDER BY (uploaded / downloaded) ASC");
    } else {
        $q = $db->query("SELECT users.id AS fid, username, downloaded, uploaded, level, UNIX_TIMESTAMP(joined) AS joined, UNIX_TIMESTAMP(lastconnect) AS lastconnect FROM users LEFT JOIN users_level ON users.id_level = users_level.id WHERE (users.id_level = '" . $kullan . "' AND (downloaded - uploaded) > '" . $mdiff . "') ORDER BY (uploaded / downloaded) ASC");
    }
    while ($user = $q->fetch_object()) {
        if ($user) {
            report($user->fid, $user->username, $user->downloaded, $user->uploaded, $user->level, $user->joined, $user->lastconnect);
            $count++;
        }
    }
    print "</form></table>";
    echo "<br><br> Found <b>" . $count . "</b> users whose difference is higher than <b>" . misc::makesize($mdiff) . "</b>";
}
block_end();
Example #10
0
function myErrorHandler($errno, $errstr, $errfile, $errline)
{
    $report = "Error Number: {$errno}<br/>\n\tError: {$errstr}<br/>\n\tFile: {$errfile}<br/>\n\tLine: {$errline}";
    die($report);
    report($report);
}
function show_page($cur_page, $dbc)
{
    switch ($cur_page) {
        case '/limbo_landing.php':
            # Store current page as number, to send in GET request for quick link item details, the current page will determine what content to filter and which 'go back' to display
            $p = 0;
            # Define query for the homepage records - return the 6 most recent items
            $query = 'SELECT stuff.id, stuff.create_date, stuff.description, stuff.status, stuff.image_url, locations.name
				FROM stuff, locations
				WHERE stuff.location_id = locations.id
				ORDER BY stuff.update_date DESC LIMIT 6';
            # Store the query results in $results
            $results = mysqli_query($dbc, $query);
            check_results($results);
            # Show results
            # But...wait until we know the query succeed before
            # rendering the table start.
            if ($results) {
                # Display homepage banner
                echo '<section id="banner">
						<header>
							<h2>Welcome to Limbo</h2>
							<p>The Ultimate Lost & Found System</p>
						</header>
					</section>';
                # Diplay intro/info and get started/learn more buttons
                # Set up the modal dialog for Get Started, along with javascript to enable actions/button events
                echo '<section id="intro" class="container">';
                echo '<div class="row">
						<div class="4u 12u(mobile)">
							<section class="first">
								<i class="icon featured fa-cog"></i>
								<header>
									<h2>Find Your Lost Items</h2>
								</header>
								<p>Lost something? Let Limbo find your item for you.</p>
							</section>
						</div>
						<div class="4u 12u(mobile)">
							<section class="middle">
								<i class="icon featured alt fa-flash"></i>
								<header>
									<h2>Quick & Easy</h2>
								</header>
								<p>Limbo is a lightweight, user-friendly system, so that you can focus on finding or reporting items as quickly as possible.</p>
							</section>
						</div>
						<div class="4u 12u(mobile)">
							<section class="last">
								<i class="icon featured alt2 fa-star"></i>
								<header>
									<h2>Security & Privacy</h2>
								</header>
								<p>We incorporate several filters to keep your item details secure, so that you can have a peace of mind.</p>
							</section>
						</div>
					</div>
					<footer>
						<ul class="actions">
							<li><input class="button big" type="button" id="getstartedbtn" value="Get Started"></li>
							<li><a href="faq.php" class="button alt big">Learn More</a></li>
						</ul>
						<dialog style="width:25%; height:60%;" id="getstartedDialog">
							<form action="' . $_SERVER['PHP_SELF'] . '" method="post">
							<section class="box">
								<section>
									<p><h3>Did you lose an Item?</h3>
									<a style="font-size:20px;" href="lost.php">Lost Items</a><br>
									<a style="font-size:20px;" href="lost-1.php">Report Lost Item</a><p>
									<br>
									<p><h3>Did you find an Item?</h3>
									<a style="font-size:20px;" href="found.php">Found Items</a><br>
									<a style="font-size:20px;" href="found-1.php">Report found Item</a><p>
						    </section>
						    <menu>
						      <button id="cancelDialogGS" type="reset">Cancel</button>
						    </menu>
								</section>
						  </form>
						</dialog>

						<script>
						  (function() {
						    var Item = document.getElementById(\'getstartedbtn\');
						    var favDialog = document.getElementById(\'getstartedDialog\');
								var cancelButton = document.getElementById(\'cancelDialogGS\');

						    // Update buttons opens a modal dialog
								Item.addEventListener(\'click\', function() {
						      favDialog.showModal();
						    });

						    // Form cancel button closes the dialog box
						    cancelButton.addEventListener(\'click\', function() {
						      favDialog.close();
						    });
							})();
						</script>
					</footer>
					</section>
					</div>
					</div>';
                # Display the main content
                echo '<div id="main-wrapper">';
                echo '<div class="container">';
                echo '<div class="row">
							<div class="12u">
							<!-- Recent Items -->
							<section>
								<header class="major">
									<h2>Recent Items</h2>
								</header>
							</div>
							</div>';
                # Keep track of the iterations, so that it can be determined when a new line is required (after 3 items in a row)
                $count = 0;
                echo '<div class="row">';
                while ($row = mysqli_fetch_array($results, MYSQLI_ASSOC)) {
                    # If three items are already in a row, add new items to next row
                    if ($count % 3 == 0 && $count != 0) {
                        echo '</div>';
                        echo '<div class="row">';
                    }
                    # If there is no image url provided for the item use a default image
                    if (empty($row['image_url'])) {
                        $image_url = 'images/pic01.jpg';
                    } else {
                        $image_url = $row['image_url'];
                    }
                    # Quick links to the item, clicking on the picture should also have the same result
                    $imglink = '<a href="ql.php?id=' . $row['id'] . '&p=' . $p . '" class="image scaled"><img src="' . $image_url . '" alt="" /></a>';
                    $alink = '<A HREF=ql.php?id=' . $row['id'] . '&p=' . $p . '>' . $row['description'] . '</A>';
                    echo '<div class="4u 12u(mobile)">
							<section class="box">
								<p>' . $imglink . '</p>
								<header>
									<h3>' . $alink . '</h3>
								</header>
								<p>Date: ' . $row['create_date'] . '</p>
								<p>Status: ' . $row['status'] . '</p>
								<p>Location: ' . $row['name'] . '</p>
							</section>
						</div>';
                    $count++;
                }
                # Close the row, container and main-wrapper
                echo '</div>
							</section>
							</div></div>';
            }
            break;
            # See comments for /admins.php for details, same applies here
        # See comments for /admins.php for details, same applies here
        case '/found.php':
            $p = 1;
            $query = 'SELECT stuff.id, stuff.create_date, stuff.description, stuff.status, locations.name, stuff.image_url
				FROM stuff, locations
				WHERE stuff.location_id = locations.id
				AND status = \'lost\'';
            $results = mysqli_query($dbc, $query);
            check_results($results);
            # Show results
            if ($results) {
                # But...wait until we know the query succeed before
                # rendering the table start.
                echo '</div></div>';
                echo '<div id="main-wrapper">';
                echo '<div class="container">';
                echo '<div class="row">';
                echo '<div class="4u 12u(mobile)">';
                echo '<section class="box">';
                echo '<H2>Found Something?</H2>';
                echo '<p>If you found something, you\'re in luck! This is the place to report it. Search for the item below:</p>';
                # Show search box
                show_form($dbc, 'found_search');
                echo '</section>';
                echo '</div>';
                $count = 0;
                while ($row = mysqli_fetch_array($results, MYSQLI_ASSOC)) {
                    if ($count % 2 == 0 && $count != 0) {
                        echo '</div>';
                        echo '<div class="row">';
                    }
                    if (empty($row['image_url'])) {
                        $image_url = 'images/pic01.jpg';
                    } else {
                        $image_url = $row['image_url'];
                    }
                    $imglink = '<a href="ql.php?id=' . $row['id'] . '&p=' . $p . '" class="image scaled"><img src="' . $image_url . '" alt="" /></a>';
                    $alink = '<A HREF=ql.php?id=' . $row['id'] . '&p=' . $p . '>' . $row['description'] . '</A>';
                    echo '<div class="4u 12u(mobile)">
							<section class="box">
								<p>' . $imglink . '</p>
								<header>
									<h3>' . $alink . '</h3>
								</header>
								<p>Date: ' . $row['create_date'] . '</p>
								<p>Status: ' . $row['status'] . '</p>
								<p>Location: ' . $row['name'] . '</p>
							</section>
						</div>';
                    $count++;
                }
                echo '</div>';
                echo '</div></div>';
                echo '</div>';
            }
            break;
        case '/found-1.php':
            report($dbc, $cur_page);
            return;
        case '/lost.php':
            $p = 2;
            $query = 'SELECT stuff.id, stuff.create_date, stuff.description, stuff.status, locations.name, stuff.image_url
				FROM stuff, locations
				WHERE stuff.location_id = locations.id
				AND status = \'found\'';
            #AND ' . strtotime('stuff.update_date') . ' > ' . strtotime($date . '  -14 days' 3);
            $results = mysqli_query($dbc, $query);
            check_results($results);
            # Show results
            if ($results) {
                echo '</div></div>';
                echo '<div id="main-wrapper">';
                echo '<div class="container">';
                echo '<div class="row">';
                echo '<div class="4u 12u(mobile)">';
                echo '<section class="box">';
                echo '<H2>Lost Something?</H2>';
                echo '<p>If you lost something, you\'re in luck! This is the place to report it. Search for your item below:</p>';
                show_form($dbc, 'lost_search');
                echo '</section>';
                echo '</div>';
                $count = 0;
                while ($row = mysqli_fetch_array($results, MYSQLI_ASSOC)) {
                    # If three items are already in a row, add new items to next row
                    if ($count % 2 == 0 && $count != 0) {
                        echo '</div>';
                        echo '<div class="row">';
                    }
                    if (empty($row['image_url'])) {
                        $image_url = 'images/pic01.jpg';
                    } else {
                        $image_url = $row['image_url'];
                    }
                    $imglink = '<a href="ql.php?id=' . $row['id'] . '&p=' . $p . '" class="image scaled"><img src="' . $image_url . '" alt="" /></a>';
                    $alink = '<A HREF=ql.php?id=' . $row['id'] . '&p=' . $p . '>' . $row['description'] . '</A>';
                    echo '<div class="4u 12u(mobile)">
							<section class="box">
								<p>' . $imglink . '</p>
								<header>
									<h3>' . $alink . '</h3>
								</header>
								<p>Date: ' . $row['create_date'] . '</p>
								<p>Status: ' . $row['status'] . '</p>
								<p>Location: ' . $row['name'] . '</p>
							</section>
						</div>';
                    $count++;
                }
                #show_records($results, $p);
                echo '</div>';
                echo '</div></div>';
                echo '</div>';
            }
            break;
            # Lost item reporting page
        # Lost item reporting page
        case '/lost-1.php':
            report($dbc, $cur_page);
            return;
        case '/ql.php':
            echo '<TITLE>Limbo - Quick Link</TITLE>';
            echo '</div></div>';
            echo '<div id="main-wrapper">';
            echo '<div class="container">';
            echo '<section>';
            return;
            # Users quick link for admins
        # Users quick link for admins
        case '/ql_users.php':
            echo '<TITLE>Limbo - Users</TITLE>';
            echo '</div></div>';
            echo '<div id="main-wrapper">';
            echo '<div class="container">';
            echo '<section>';
            return;
        case '/admins.php':
            $p = 3;
            $query = 'SELECT stuff.id, stuff.create_date, stuff.description, stuff.status, locations.name, stuff.image_url
				FROM stuff, locations
				WHERE stuff.location_id = locations.id';
            $results = mysqli_query($dbc, $query);
            check_results($results);
            echo '<TITLE>Limbo - Admins</TITLE>';
            echo '</div></div>';
            echo '<div id="main-wrapper">';
            echo '<div class="container">';
            echo '<div class="12u">';
            echo '<section>';
            echo '<p>Click on an Item or User to View/Edit details</p>';
            echo '<header class="major">
							<h2>Items</h2>
						</header>
						</section>';
            if ($results) {
                show_records($results, $p);
            }
            $query = 'SELECT id, user_id, first_name, last_name, email, pass, reg_date
				FROM users';
            $results = mysqli_query($dbc, $query);
            check_results($results);
            echo '<section>';
            echo '<header class="major">
							<h2>Users</h2>
						</header>
						</section>';
            if ($results) {
                show_user_records($results);
            }
            echo '</div></div>';
            echo '</div></div>';
            break;
        case '/faq.php':
            echo '<section id="banner">
					<header>
						<h2>FAQ</h2>
						<p>Welcome to the FAQ section!</p>
					</header>
				</section>';
            echo '</div></div>';
            echo '<div id="main-wrapper">';
            echo '<div class="container">';
            echo '<div class="12u">
						<!-- Recent Items -->
						<section>
							<header class="major">
								<h2>Frequently Asked Questions</h2>
							</header>
						</div>
						<div class="row">
						<div class="6u 12u(mobile)">
						<section class="box">
						<header>
							<h2>How do I report a lost or found item?</h2>
						</header>
						<p>At the home page, you will see a get started button. This will guide you through a series of steps to either report a lost item or claim a found item.</p>
						</section>
						</div>
						<div class="6u 12u(mobile)">
						<section class="box">
						<header>
							<h2>How will I know when someone has found my item?</h2>
						</header>
						<p>When an item has been found, you will receive an e-mail with instructions on claiming your item.</p>
						</div>
						</div>
						</div></div>';
            return;
        case '/search.php':
            echo '</div>
						<div class="main-wrapper">
						<div class="container">
						<div class="12u">
			';
            return;
    }
    # Free up the results in memory
    mysqli_free_result($results);
}
Example #12
0
        // each Line
    }
    return $packages;
}
try {
    $db = new PDO("mysql:dbname=" . MYBASE . ";host=" . MYHOST, MYUSER, MYPASS);
    $sql = "SELECT DISTINCT CONCAT('%',SUBSTRING(name,1,1)) as init\n          FROM rpm\n          ORDER BY init";
    $res = $db->query($sql);
    if ($res) {
        while ($s = $res->fetchObject()) {
            $starts_with[] = $s;
        }
        $smarty->assign('starts_with', $starts_with);
    }
    $sql = "SELECT DISTINCT owner FROM acls ORDER BY owner";
    $res = $db->query($sql);
    if ($res) {
        while ($owner = $res->fetchObject()) {
            $owners[] = $owner;
        }
        $smarty->assign('owners', $owners);
    }
    $rpmrepo = new TableRpmRepo($db);
    $smarty->assign('repositories_update', date("r", $rpmrepo->getMaxStamp()));
    $smarty->assign('packages', report($db));
} catch (PDOException $e) {
    $smarty->assign('error', sprintf("%s ERREUR : %s\n", date("r"), $e->getMessage()));
}
$page_content = $smarty->fetch('all.tpl');
$smarty->assign('page_content', $page_content);
$smarty->display('main.tpl');
Example #13
0
function changepsd($con, $token)
{
    $token = mysql_real_escape_string($token);
    $nowtime = time();
    $statement = "select password from userinfo where token='{$token}' and {$nowtime}-tokentime<={$GLOBALS['validtime']} limit 1";
    $result = mysql_query($statement);
    $result = mysql_fetch_array($result);
    if (!$result) {
        report(1, "会话超时,请重新<a href='../login'>登录</a>");
    }
    $oldpsd = @$_REQUEST['old'];
    if (strtoupper($result['password']) != strtoupper($oldpsd)) {
        report(2, "旧密码不正确,请重新输入");
    }
    $newpsd = @$_REQUEST['new'];
    $newtoken = md5($oldpsd . $nowtime);
    $statement = "update userinfo set password='******',token='{$newtoken}' where token='{$token}' limit 1";
    if (mysql_query($statement)) {
        report(0, $newtoken);
    } else {
        report(3, mysql_error());
    }
}
Example #14
0
 function run_query($connection, $query, $display, $form_is_empty)
 {
     $connection = $connection;
     $query = $query;
     $display = $display;
     $form_is_empty = $form_is_empty;
     function db_interfacing($connection, $query, $form_is_empty)
     {
         $connection = $connection;
         $query = $query;
         $form_is_empty = $form_is_empty;
         function send_query($connection, $query, $empty_form_test)
         {
             $connection = $connection;
             $form_is_empty = $empty_form_test;
             $query = $query;
             if ($form_is_empty == FALSE) {
                 $result = mysqli_query($connection, $query);
                 return $result;
             }
         }
         $result = send_query($connection, $query, $form_is_empty);
         return $result;
     }
     function report($result, $display, $form_is_empty)
     {
         //$result = $result;
         //$display = $display;
         //$form_is_empty = $form_is_empty;
         if ($result) {
             echo "Successfully added {$display}.";
             redirect_to("submission.php?display=personnel", 0);
         } elseif (!empty($_POST) && ($form_is_empty = TRUE)) {
             echo "Please enter data and click 'Add'.";
         }
     }
     $result = db_interfacing($connection, $query, $form_is_empty);
     report($result, $display, $form_is_empty);
 }
Example #15
0
    $site = escapeshellarg($raw_url);
    if ($_SERVER['HTTP_HOST'] == 'localhost') {
        $display = ":0";
    } else {
        $display = ":10";
    }
    report("I have to start a browser and everything ... come on now.");
    exec('DISPLAY=' . $display . ' cutycapt --min-height=768 --min-width=1024 --url=' . $site . ' --out=img/' . $md5 . '.png');
    report("Ok now I need to resize the screen shot...");
    // only continue if the image was successfully made.
    if (file_exists('img/' . $md5 . '.png')) {
        exec('convert img/' . $md5 . '.png -resize 300x -crop 300x320+0+0 -resize 300x img/' . $md5 . '_tn.jpg');
        // remove the big file
        unlink('img/' . $md5 . '.png');
        $title = $db->escapeString(get_title($url));
        $db->exec('
      insert into sites (url, title, up, down, view) 
      values("' . $url . '", "' . $title . '", 1, 0, 1)');
        if ($db->lastErrorCode() !== 0) {
            echo $db->lastErrorMsg();
            exit(0);
        }
    } else {
        report("Oh shit ... couldn't get screen shot.");
        die;
    }
}
report("And now you go back to where you came from! farewell");
sleep(1);
echo "<script>document.location='/?what=new-stuff-thats-what&sort=new-shit'</script>";
flush();
Example #16
0
    return $packages;
}
try {
    switch ($type) {
        case "pecl":
            $filter = 'php-pecl-%';
            break;
        case "composer":
        case "pear":
            $filter = 'php-%';
            break;
        case "R":
            $filter = 'R-%';
            break;
        default:
            $filter = '';
    }
    $db = new PDO("mysql:dbname=" . MYBASE . ";host=" . MYHOST, MYUSER, MYPASS);
    $acl = new TableAcls($db);
    $smarty->assign('owners', $acl->getOwners($filter));
    $acl = new TableUpstream($db);
    $smarty->assign('channels', $acl->getChannels($type));
    $rpmrepo = new TableRpmRepo($db);
    $smarty->assign('repositories_update', date("r", $rpmrepo->getMaxStamp()));
    $smarty->assign('packages', report($db, $type));
} catch (PDOException $e) {
    $smarty->assign('error', sprintf("%s ERREUR : %s\n", date("r"), $e->getMessage()));
}
$page_content = $smarty->fetch('rpm.tpl');
$smarty->assign('page_content', $page_content);
$smarty->display('main.tpl');
Example #17
0
        $attrs = array();
        while ($attr = $attr_result->fetchArray(SQLITE3_ASSOC)) {
            $id = $attr['attributeId'];
            $attrs[$id] = $attr;
        }
        $reportstatus = false;
        if (array_key_exists('attributes', $device)) {
            foreach ($attrs as $attr) {
                if ($attr['value_get'] != $device['attributes'][$attr['attributeId']]['value_get'] || $attr['value_set'] != $device['attributes'][$attr['attributeId']]['value_set']) {
                    $reportstatus = true;
                }
            }
        }
        $devices[$key]['attributes'] = $attrs;
        if ($reportstatus) {
            report($devices[$key]);
        }
    }
    $db->close();
    //$run--;
    sleep(3);
}
function report($device)
{
    print_r($device);
    unset($device['nodeId']);
    $type = $device['genericType'];
    unset($device['genericType']);
    switch ($type) {
        case 64:
            if ($device['attributes'][10]['value_get'] != $device['attributes'][10]['value_set']) {
Example #18
0
        $ret = get_object_vars($ret);
    }
    return $ret;
}
function report($data)
{
    switch ($data['state']) {
        case 0:
            $message = "TIKI OK - " . $data['message'];
            break;
        case 1:
            $message = "TIKI WARNING - " . $data['message'];
            break;
        case 2:
            $message = "TIKI CRITICAL - " . $data['message'];
            break;
        case 3:
            $message = "TIKI UNKNOWN - " . $data['message'];
            break;
    }
    fwrite(STDOUT, $message);
    exit($data['state']);
}
$options = get_opts();
if (empty($options) or isset($options['h'])) {
    help();
    exit(1);
}
$data = get_data($options);
report($data);
Example #19
0
    		    }

    		
    			
    	}
    	
    	
    }
   
    
    

    	
    	switch($view){
    		case 'report':
    			report($story_id);
    			break;
    		case 'reports':
    			echo('<h2>'.$widget['heading'].'</h2>');
    			reports();
    			break;
    			
    		case 'podcast_playlist':
    			echo('<h2>'.$widget['heading'].'</h2>');
    			podcast_playlist($podcast_feed_url);
    			break;
    			
    			
    		case 'youtube_playlist':
    			echo('<h2>'.$widget['heading'].'</h2>');
    			if($youtube_tags){$type='tags';$value=$youtube_tags;}
Example #20
0
         echo $go->ReconstructClipText() . "\n";
     }
     // now flush the current group
     $groupNum = 0;
     $placeInTime = 0;
 }
 if (!isset($currentGroupTimes)) {
     echo $item;
 } else {
     array_push($currentGroup, $o);
     // save the item
     if (in_array($oType, array("Note", "Chord", "Rest", "RestChord"))) {
         $placeInTime += timeTaken($o);
     }
     if (!isset($currentGroupTimes[$groupNum])) {
         report("Bar is too long at bar {$bar} from start\n");
     } elseif ($placeInTime >= $currentGroupTimes[$groupNum]) {
         tryToBeam(&$currentGroup);
         while ($go = array_shift($currentGroup)) {
             echo $go->ReconstructClipText() . "\n";
         }
         // now flush the current group
         $groupNum++;
         // and increment our group number
         // following is a test for when notes or chords exceed groupings
         if ($placeInTime > $currentGroupTimes[$groupNum - 1] && isset($currentGroupTimes[$groupNum])) {
             while ($placeInTime >= $currentGroupTimes[$groupNum] && isset($currentGroupTimes[$groupNum + 1])) {
                 $groupNum++;
             }
         }
     }
Example #21
0
    }
    $iCurrentEpoch = date('U');
    $iDiffEpoch = $iCurrentEpoch - $data['SearchIndexRebuildLast'];
    if (empty($data['SearchIndexRebuildLast'])) {
        update_err_state(3, "Search Index never built");
    } elseif ($data['SearchIndexRebuildLast'] < $iCurrentEpoch - $crit) {
        update_err_state(1, "Search Index older than {$crit} sec|time=" . $iDiffEpoch . "s;;;0");
    } elseif ($data['SearchIndexRebuildLast'] < $iCurrentEpoch - $warn) {
        update_err_state(1, "Search Index older than {$warn} sec|time=" . $iDiffEpoch . "s;;;0");
    } elseif ($data['SearchIndexRebuildLast'] > $iCurrentEpoch - $warn) {
        update_err_state(0, "Search Index is fresh|time=" . $iDiffEpoch . "s;;;0");
    } else {
        update_err_state(3, "Search index state unknown");
    }
}
$options = get_opts();
if (empty($options) or isset($options['h'])) {
    help();
    exit(1);
}
$data = get_data($options);
if (isset($options['c'])) {
    $check = 'check_' . $options['c'];
    $check($data, $options);
} else {
    check_bcc($data, $options);
    check_db($data, $options);
    check_searchindex($data, $options);
}
report();
Example #22
0
     break;
 case "send_recommend":
     send_recommend($link_id, $option);
     break;
     /* Contact Owner */
 /* Contact Owner */
 case "contact":
     contact($link_id, $option);
     break;
 case "send_contact":
     send_contact($link_id, $option);
     break;
     /* Report Listing */
 /* Report Listing */
 case "report":
     report($link_id, $option);
     break;
 case "send_report":
     send_report($link_id, $option);
     break;
     /* Claim Listing */
 /* Claim Listing */
 case "claim":
     claim($link_id, $option);
     break;
 case "send_claim":
     send_claim($link_id, $option);
     break;
     /* Add Listing */
 /* Add Listing */
 case "addlisting":
                $order = getPrepayId($amount, $order_id, $attach);
                $pay_str = pay($order);
                if ($pay_str['success'] == 0) {
                    report(10052, $pay_str['return_msg']);
                } else {
                    report(0, $pay_str);
                    //$result = array("data"=>$order,"success"=>0,"errorcode"=>$errorcode);
                    //echo json_encode($result);
                }
                exit;
            } elseif ($payment == "alipay_wap") {
                $pay_id = 5;
                $payment = mysql_fetch_array(mysql_query("SELECT * FROM ecs_touch_payment WHERE pay_id = '{$pay_id}' AND enabled = 1"));
                include_once $payment['pay_code'] . '.php';
                $pay_obj = new $payment['pay_code']();
                $output = $pay_obj->get_code_url($order, unserialize_config($payment['pay_config']));
                report(0, $output);
                exit;
            } else {
                report(1005, "非法的支付方式");
                exit;
            }
        }
    } catch (Exception $e) {
        report(1000, "非法请求");
        exit;
    }
} else {
    report(1000, "非法请求");
    exit;
}
            $OUTPUT = enter();
            break;
        case "confirm":
            $OUTPUT = confirm($_POST);
            break;
        case "write":
            $OUTPUT = write($_POST);
            break;
        case "receipt":
            $OUTPUT = receipt($_POST);
            break;
        case "receipt-print":
            receipt - (print $_POST);
            break;
        case "workshop-report":
            $OUTPUT = workshop - report($_POST);
            break;
    }
} else {
    $OUTPUT = enter();
}
// Quick links
$OUTPUT .= "\n\t\t\t\t<p>\n\t\t\t\t<table " . TMPL_tblDflts . ">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>Quick Links</th>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<tr class='datacell'>\n\t\t\t\t\t\t<td><a href='workshop-view.php'>View workshop</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr class='datacell'>\n\t\t\t\t\t\t<td><a href='customers-new.php'>Add Customer<a></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr class='datacell'>\n\t\t\t\t\t\t<td><a href='stock-add.php'>Add Stock</a></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr class='datacell'>\n\t\t\t\t\t\t<td><a href='main.php'>Main Menu</a></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>";
require "template.php";
function enter($errors = "")
{
    global $_POST;
    extract($_POST);
    require_lib("validate");
    $v = new validate();
    $fields["search_cus"] = "";
#
#The full software license can be found here:
#http://www.accounting-123.com/a.php?a=153/GPLv3
#
#
#
#
#
#
#
#
#
#
#
require "settings.php";
$OUTPUT = report();
$OUTPUT .= "<p>\r\n<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\r\n<tr><th>Quick Links</th></tr>\r\n<script>document.write(getQuicklinkSpecial());</script>\r\n<tr class='bg-odd'><td><a href='index.php'>My Business</a></td></tr>\r\n</table>";
require "template.php";
function report()
{
    $i = 0;
    $tottot = 0;
    $totout = 0;
    $totfor = 0;
    $totold = 0;
    $date = date("Y-m-d");
    $olddate = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - 30, date("Y")));
    db_conn('crm');
    $Sl = "SELECT id,name FROM teams ORDER BY name";
    $Ry = db_exec($Sl) or errDie("Unable to get teams from system.");
    $out = "<h3>Outstanding Query Statistics</h3>\r\n\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\r\n\t<tr><th>User</th><th>Total</th><th>Outstanding</th><th>Forwarded</th><th>Month or Older</th></tr>";
Example #26
0
if (false) {
    ?>
--><h1>PHP is not enabled!</h1>
Please ensure php and apache are configured properly.
<!--<?php 
} else {
    echo '--';
    echo chr(62);
    echo 'PHP enabled :', report(1);
    echo 'PHP FTP support :', report(function_exists('ftp_connect') ? 1 : 0, 'you do not appear to have FTP support in your version of PHP.' . 'Most Linux distributions will have a package (usually called something' . ' like "php5-ftp") that you can install to fix this.');
    echo 'Permissions :', report(fopen('ftp_cache/f', 'w') != false ? 1 : 0, 'Please allow your web server write access to ftp_cache. See INSTALL.');
    include 'config-core.php';
    if (file_exists('config.php')) {
        echo 'FTP connect :', report(ftp_connect($conf['ftp_server'], $conf['ftp_server_port']) ? 1 : 0, "Can't connect - check your FTP settings");
    }
    echo 'TLS/SSL          :', report(empty($_SERVER['HTTPS']) ? 2 : 1, 'You do not have TLS/SSL enabled. This means you will be at risk ' . 'from eavesdroppers. Configure your webserver for secure (https) access.');
    echo chr(60), 'br /', chr(62);
    echo chr(60), 'br /', chr(62);
    echo chr(60), 'span class="good"', chr(62), 'This looks good to go!', chr(60), '/span', chr(62);
    echo chr(60), 'br /', chr(62);
    if (!file_exists('config.php')) {
        echo chr(60), 'em', chr(62), 'To get started, copy "config-dist.php" to "config.php"';
        echo chr(60) . '/em', chr(62);
    }
}
function report($r, $reason = '')
{
    switch ($r) {
        case 1:
        default:
            $class = 'good';
Example #27
0
ob_end_flush();
ob_implicit_flush();
//INICIO
report('', "Hallö, " . $developer_name . ". Iniciando kOGsmos...");
report('', "Introduciéndose en el servidor " . $server . ". Cuenta: " . $user["login"]);
$logger = new Logger();
$logger->login();
//ESCANEO DE PLANETAS E INICIALIZACIÓN DEL IMPERIO
$coordGen = new Coordinator(null, null);
$pagina = $coordGen->leerMenu('principal');
$coordGen->escanearPlanetas($pagina);
$msg = "Leyendo los planetas de la cuenta... Hay " . count($coordGen->planetas) . " planeta";
if (count($coordGen->planetas) > 1) {
    report('act', $msg . "s.");
} else {
    report('act', $msg . ".");
}
$imperio = new Imperio($coordGen->planetas);
$imperio->actividad();
///////////////////////////////////////////////////////////////////
function report($tipo, $msg)
{
    $hora = "(" . date('H:i:s') . ") ";
    $identificador = '';
    $trace = debug_backtrace();
    if (isset($trace[1]['class'])) {
        $identificador = "[" . $trace[1]['class'];
        $objeto = $trace[1]['object'];
        if ($objeto instanceof Planeta) {
            $nombrePlaneta = $objeto->nombre;
        } elseif ($objeto instanceof Imperio || $objeto instanceof Logger) {
Example #28
0
        }
        $amount = $_POST[$field_name];
        $vr_no = get_new_vrno();
        # insert voucher
        $query = $query_part1 . "('{$vr_no}','{$today}','CR','{$ac1}', '{$ac2}','{$ac3}','{$ac4}','{$ac5}','D','','{$amount}','','opening Balance','{$today}','')";
        $result = mysql_query($query, $db);
        checkMySQLError();
        # insert counterbooking
        $query = $query_part1 . "('{$vr_no}','{$today}','CR','0', '5','0','0','0','C','','{$amount}','','opening Balance','{$today}','')";
        $result = mysql_query($query, $db);
        checkMySQLError();
    }
    report(1, "Everything seems to be fine. Check via Bank and Cash Report!");
} else {
    $db = getDBConnection();
    $result = mysql_query("Select * FROM TRANS");
    if (mysql_num_rows($result) != 0) {
        report(0, "Sorry, opening balance can only be performed when you have no Vouchers entered");
    }
    $accounts_array = get_ac5_sc_array("5(1)", "B");
    beginPrettyTable("2", "enter opening balances");
    openForm("openingbalance", $PHP_SELF);
    makeHiddenField("submitnow", 0);
    foreach ($accounts_array as $ac5 => $desc) {
        makeTextField("account_field_" . $ac5, "", $desc);
    }
    makeSpecialSubmitter("submit", "onClick='this.form.submitnow.value=\"1\"'");
    closeForm();
    endPrettyTable();
}
endDocument();
Example #29
0
function report($name, $time)
{
    static $last = null;
    printf("%-12s: %.8fms", $name, $time);
    if (null !== $last) {
        printf(", %.1f%%", ($time - $last) / $last * 100);
    }
    echo PHP_EOL;
    $last = $time;
}
// fixtures
$a = str_repeat('a', 2 << 8);
class O
{
    public function strcmp($a)
    {
        strcmp($a, $a);
    }
}
// do it
report('direct call', clock(function () use($a) {
    strcmp($a, $a);
}));
report('object call', clock(function () use($a) {
    $o = new O();
    $o->strcmp($a);
}));
report('voodoo call', clock(function () use($a) {
    $o = unserialize('O:1:"O":0:{}');
    $o->strcmp($a);
}));
#
#
#
#
require "settings.php";
require "libs/ext.lib.php";
if (isset($_GET["stkid"])) {
    $OUTPUT = details($_GET);
} else {
    if (isset($_POST["key"])) {
        switch ($_POST["key"]) {
            case "view":
                $OUTPUT = printStk($_POST);
                break;
            case "report":
                $OUTPUT = report($_POST);
                break;
            default:
                $OUTPUT = slct();
                break;
        }
    } else {
        # Display default output
        $OUTPUT = slct();
    }
}
require "template.php";
# Default view
function slct()
{
    //layout