예제 #1
0
 public static function getFriendByFid($_fid)
 {
     $arr = array();
     require "opendb.php";
     require "history.php";
     require "account.php";
     require "user.php";
     array_push($arr, array("user" => UserManager::getUserById($_fid), "lastlocation" => HistoryManager::getLastUserHistory($_fid), "state" => UserManager::getAvailable($_fid), "numberlist" => AccountManager::getNumbersById($_fid), "share" => "-1"));
     //require("closedb.php");
     return $arr[0];
 }
예제 #2
0
//classes loading begin
function classLoad($myClass)
{
    if (file_exists('../model/' . $myClass . '.php')) {
        include '../model/' . $myClass . '.php';
    } elseif (file_exists('../controller/' . $myClass . '.php')) {
        include '../controller/' . $myClass . '.php';
    }
}
spl_autoload_register("classLoad");
include '../config.php';
include '../lib/image-processing.php';
//classes loading end
session_start();
$historyManager = new HistoryManager($pdo);
$projetManager = new ProjetManager($pdo);
//post input processing
$idProjet = htmlentities($_POST['idProjet']);
$idSociete = htmlentities($_POST['idSociete']);
$type = htmlentities($_POST['type']);
if (!empty($_POST['idProjet'])) {
    if (!empty($_POST['numeroTitre'])) {
        $id = htmlentities($_POST['id']);
        $numeroTitre = htmlentities($_POST['numeroTitre']);
        $nom = htmlentities($_POST['nom']);
        $superficie = htmlentities($_POST['superficie']);
        $surplan = htmlentities($_POST['surplan']);
        $prix = htmlentities($_POST['prix']);
        if (isset($_POST['niveau'])) {
            $niveau = htmlentities($_POST['niveau']);
    } elseif (file_exists('../controller/' . $myClass . '.php')) {
        include '../controller/' . $myClass . '.php';
    }
}
spl_autoload_register("classLoad");
include '../config.php';
include '../lib/image-processing.php';
//classes loading end
session_start();
//post input processing
$action = htmlentities($_POST['action']);
//This var contains result message of CRUD action
$actionMessage = "";
$typeMessage = "";
//Component Class Manager
$historyManager = new HistoryManager($pdo);
//Action Add Processing Begin
if ($action == "add") {
    if (!empty($_POST['action'])) {
        $action = htmlentities($_POST['action']);
        $target = htmlentities($_POST['target']);
        $description = htmlentities($_POST['description']);
        $createdBy = $_SESSION['userMerlaTrav']->login();
        $created = date('Y-m-d h:i:s');
        //create object
        $history = new History(array('action' => $action, 'target' => $target, 'description' => $description, 'created' => $created, 'createdBy' => $createdBy));
        //add it to db
        $historyManager->add($history);
        $actionMessage = "Opération Valide : History Ajouté(e) avec succès.";
        $typeMessage = "success";
    } else {
 public function validateData($package, $input, $user)
 {
     $settings = Settings::get('general');
     $email = $settings->sandbox ? $settings->sandbox_email : $settings->paypal_email;
     $error = '';
     if (!$package) {
         $error .= "'Item_number' was not found: {$input->item_number}<br>";
     } else {
         if ($input->mc_gross != $package->cost) {
             $error .= "'Mc_gross' does not match: {$input->mc_gross}<br>";
         }
     }
     if ($input->receiver_email != $email) {
         $error .= "'Receiver_email' does not match: {$input->receiver_email}<br>";
     }
     if ($input->txn_type != "subscr_payment") {
         return new Result($error);
     }
     //Only continues checking if the type is a payment
     if ($input->mc_currency != "USD") {
         $error .= "'Mc_currency' does not match: {$input->mc_currency}<br>";
     }
     if (count($user) == 0) {
         $error .= "'Custom' does not match a user: {$input->custom}<br>";
     }
     if ($input->payment_status != "Completed") {
         $error .= "'Payment_status' is not completed: {$input->payment_status}<br>";
     }
     $record = \HistoryManager::get(array('meta' => array('type' => 'made_purchase', 'user' => $input->custom), 'conditions' => [['txn_id', '=', $input->txn_id]]));
     if (count($record) != 0) {
         $error .= "'Txn_id' has already been processed: {$input->txn_id}<br>";
     }
     return new Result($error);
 }
예제 #5
0
//classes loading begin
function classLoad($myClass)
{
    if (file_exists('model/' . $myClass . '.php')) {
        include 'model/' . $myClass . '.php';
    } elseif (file_exists('controller/' . $myClass . '.php')) {
        include 'controller/' . $myClass . '.php';
    }
}
spl_autoload_register("classLoad");
include 'config.php';
include 'lib/pagination.php';
//classes loading end
session_start();
if (isset($_SESSION['userMerlaTrav'])) {
    $historyManager = new HistoryManager($pdo);
    $histories = $historyManager->getHistorys();
    ?>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <meta charset="utf-8" />
    <title>ImmoERP - Management Application</title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport" />
    <meta content="" name="description" />
    <meta content="" name="author" />
    <link href="assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="assets/css/metro.css" rel="stylesheet" />
예제 #6
0
        $_hx = array("uid", "fid", "share");
        $_tbx = FriendManager::getAllFriendList();
        show($_hx, $_tbx);
        break;
    case "c":
        echo "<h1 style='color:#09C'>CHAT DATA</h1>";
        require_once "chats.php";
        $_hx = array("timest", "sender", "recipient", "msg");
        $_tbx = ChatsManager::getAllChats();
        show($_hx, $_tbx);
        break;
    case "h":
        echo "<h1 style='color:#09C'>HISTORY DATA</h1>";
        require_once "history.php";
        $_hx = array("timest", "lat", "lng");
        $_tbx = HistoryManager::getAllUserHistory();
        show($_hx, $_tbx);
        break;
    case "l":
        echo "<h1 style='color:#09C'>LOCATION DATA</h1>";
        require_once "location.php";
        $_hx = array("lat", "lng", "street", "sublocality", "locality", "adminstrative_area", "country", "fulladdr");
        $_tbx = LocationManager::getAllLocationData();
        show($_hx, $_tbx);
        break;
    default:
        break;
}
?>
</body>
</html>
예제 #7
0
파일: history.php 프로젝트: aassou/gelm
{
    if (file_exists('model/' . $myClass . '.php')) {
        include 'model/' . $myClass . '.php';
    } elseif (file_exists('controller/' . $myClass . '.php')) {
        include 'controller/' . $myClass . '.php';
    }
}
spl_autoload_register("classLoad");
include 'config.php';
include 'lib/pagination.php';
//classes loading end
session_start();
if (isset($_SESSION['userMerlaTrav'])) {
    $mois = $_GET['mois'];
    $annee = $_GET['annee'];
    $historyManager = new HistoryManager($pdo);
    $histories = $historyManager->getHistoryByMonthYear($mois, $annee);
    ?>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <meta charset="utf-8" />
    <title>GELM - Management Application</title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport" />
    <meta content="" name="description" />
    <meta content="" name="author" />
    <link href="assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="assets/css/metro.css" rel="stylesheet" />
예제 #8
0
function classLoad($myClass)
{
    if (file_exists('model/' . $myClass . '.php')) {
        include 'model/' . $myClass . '.php';
    } elseif (file_exists('controller/' . $myClass . '.php')) {
        include 'controller/' . $myClass . '.php';
    }
}
spl_autoload_register("classLoad");
include 'config.php';
include 'lib/pagination.php';
//classes loading end
session_start();
if (isset($_SESSION['userMerlaTrav'])) {
    //les sources
    $historyManager = new HistoryManager($pdo);
    $histories = $historyManager->getHistoryGroupByMonth();
    ?>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <meta charset="utf-8" />
    <title>GELM - Management Application</title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport" />
    <meta content="" name="description" />
    <meta content="" name="author" />
    <link href="assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="assets/css/metro.css" rel="stylesheet" />
<?php

require 'history.php';
require "appmanager.php";
require "location.php";
if (AppManager::checkAppCode($_REQUEST['appcode'])) {
    switch ($_REQUEST['type']) {
        case 'GET_HISTORY':
            echo json_encode(array("history" => HistoryManager::getUserHistory($_REQUEST['id'])));
            break;
        case 'GET_LAST_LOCATION':
            echo json_encode(HistoryManager::getLastUserHistory($_REQUEST['id']));
            break;
        case 'CREATE_HISTORY':
            $rs = HistoryManager::addNewHistory($_REQUEST['id'], new History(NULL, $_REQUEST['latitude'], $_REQUEST['longtitude']));
            if ($rs > 0) {
                $rs = LocationManager::updateNewLocation($_REQUEST['id'], $_REQUEST['latitude'], $_REQUEST['longtitude']);
            }
            echo $rs;
            break;
        case 'REMOVE_HISTORY':
            echo HistoryManager::removeHistory($_REQUEST['id']);
            break;
        default:
            echo "Unknown type";
            break;
    }
}
예제 #10
0
//classes loading begin
function classLoad($myClass)
{
    if (file_exists('../model/' . $myClass . '.php')) {
        include '../model/' . $myClass . '.php';
    } elseif (file_exists('../controller/' . $myClass . '.php')) {
        include '../controller/' . $myClass . '.php';
    }
}
spl_autoload_register("classLoad");
include '../config.php';
//classes loading end
session_start();
if (isset($_SESSION['userMerlaTrav'])) {
    //classes managers
    $historyManager = new HistoryManager($pdo);
    $dateBegin = htmlentities($_POST['dateBegin']);
    $dateEnd = htmlentities($_POST['dateEnd']);
    $histories = $historyManager->getHistorysByDate($dateBegin, $dateEnd);
    ob_start();
    ?>
<style type="text/css">
    p, h1, h2, h4{
        text-align: center;
        font-family : Arial;
        font-weight: 100;
        margin-bottom: 0px;
    }
    h2{
        font-size: 20px;
    }