<?php

include '../config.php';
include '../function.php';
$alert = array();
$isSuccess = true;
$data = array();
if (isset($_POST)) {
    $fhref = 'debt_payment.php';
    $fcurrpage = getCurrentPageData($mysqli, $fhref);
    if ($_SESSION['access'][$fcurrpage['id']]['read'] == 1) {
        $data = array('tabledata' => array(), 'totalpage' => 0);
        $frecord = 10;
        $fpage = intval($mysqli->real_escape_string($_POST['search']['currentpage'])) - 1;
        $fsearch = $mysqli->real_escape_string($_POST['search']['text']);
        if (isset($_POST['search']['status'])) {
            $fstatus = $mysqli->real_escape_string($_POST['search']['status']);
        } else {
            $fstatus = 'posted';
        }
        $flimit = "LIMIT " . $frecord * $fpage . ", {$frecord}";
        $fcondition = "(p.debtpayment_id LIKE '%{$fsearch}%' OR\n\t\t\t\t\t\t\t\t\t\t\tDATE_FORMAT(p.debtpayment_date,'%d-%m-%Y') LIKE '%{$fsearch}%' OR\n\t\t\t\t\t\t\t\t\t\t\td.debt_id LIKE '%{$fsearch}%' OR\n\t\t\t\t\t\t\t\t\t\t\tu.user_name LIKE '%{$fsearch}%' OR\n\t\t\t\t\t\t\t\t\t\t\tu.user_id LIKE '%{$fsearch}%' OR\n\t\t\t\t\t\t\t\t\t\t\tp.debtpayment_nominal LIKE '%{$fsearch}%' OR\n\t\t\t\t\t\t\t\t\t\t\tp.debtpayment_description LIKE '%{$fsearch}%') AND\n\t\t\t\t\t\t\t\t\t\t\tp.debtpayment_status = '{$fstatus}' AND\n\t\t\t\t\t\t\t\t\t\t\tp.debtpayment_deletedate IS NULL\n\t\t\t\t\t\t\t\t\t\t";
        /* Table Data Query */
        $query = "SELECT p.*, u.user_id, u.user_name, d.debt_id\n\t\t\t\t\t\t\t\tFROM tdebtpayment p\n\t\t\t\t\t\t\t\tLEFT JOIN tdebt d ON d.debt_id = p.debt_id\n\t\t\t\t\t\t\t\tLEFT JOIN tuser u ON u.user_id = p.user_id\n\t\t\t\t\t\t\t\tWHERE {$fcondition}\n\t\t\t\t\t\t\t\tORDER BY p.debtpayment_id ASC\n\t\t\t\t\t\t\t\t{$flimit}\n\t\t\t\t\t\t\t ";
        if ($result = $mysqli->query($query)) {
            if ($result->num_rows > 0) {
                while ($row = $result->fetch_assoc()) {
                    $newRow = array('debtpayment_id' => $row['debtpayment_id'], 'debtpayment_date' => $row['debtpayment_date'], 'debt_id' => $row['debt_id'], 'user_id' => $row['user_id'], 'user_name' => $row['user_name'], 'debtpayment_description' => $row['debtpayment_description'], 'debtpayment_nominal' => $row['debtpayment_nominal']);
                    $data['tabledata'][] = $newRow;
                }
                $result->free();
示例#2
0
文件: main.php 项目: Galinijay/PAS
    } else {
        phpCAS::setNoCasServerValidation();
    }
    phpCAS::logout(array('service' => ROOT . 'index.php?msg=LANG_SUCCESS_LOGOUT'));
    session_destroy();
}
/**
    Etablis le status de visiteur si non connecté
     **/
if (!isset($_SESSION['rang'])) {
    $_SESSION['rang'] = 0;
}
/**
		Récupération des informations sur la page actuelle
	**/
if ($currentPageData = getCurrentPageData()) {
    if ($currentPageData['fullRight'][$_SESSION['rang']] == 0) {
        // On invite l'utilisateur à se connecter au CAS
        phpCAS::client(CAS_VERSION_2_0, CAS_SERVER_URI, (int) constant('CAS_SERVER_PORT'), '');
        phpCAS::setServerServiceValidateURL(CAS_SERVER_VALIDATEURI);
        if (is_file(CAS_SERVER_CERTIFICATPATH)) {
            phpCAS::setCasServerCACert(CAS_SERVER_CERTIFICATPATH);
        } else {
            phpCAS::setNoCasServerValidation();
        }
        phpCAS::forceAuthentication();
        if (phpCAS::getUser()) {
            //Si l'utilisateur s'est connecté
            // Récupération des données serveur
            $test = phpCAS::checkAuthentication();
            // Récupération des données utilisateur