当前位置: 首页>>代码示例>>PHP>>正文


PHP log_action函数代码示例

本文整理汇总了PHP中log_action函数的典型用法代码示例。如果您正苦于以下问题:PHP log_action函数的具体用法?PHP log_action怎么用?PHP log_action使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了log_action函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: printOrder

 function printOrder()
 {
     $desk_id = getValue('desk_id', 'int', 'POST', 0);
     check_desk_exist($desk_id);
     $list_menu = getValue('list_menu', 'arr', 'POST', array());
     //cập nhật số lượng thực đơn đã in bếp vào trường cdm_printed_number
     $array_menu_success = array();
     foreach ($list_menu as $menu) {
         $sql = 'UPDATE current_desk_menu
                 SET cdm_printed_number = cdm_printed_number + ' . $menu['print_number'] . '
                 WHERE cdm_menu_id = ' . $menu['men_id'] . '
                 AND cdm_desk_id = ' . $desk_id;
         $db_update = new db_execute($sql);
         if ($db_update->total) {
             $array_menu_success[] = $menu;
         }
     }
     if (!$array_menu_success) {
         return;
     } else {
         $array_return = array('success' => 1, 'list_menu' => $array_menu_success);
     }
     //log action
     log_action(ACTION_LOG_PRINT_ORDER, 'In chế biến xuống bếp - bàn ID ' . $desk_id);
     die(json_encode($array_return));
 }
开发者ID:virutmath,项目名称:crm_local,代码行数:26,代码来源:ajax.php

示例2: debitRequest

function debitRequest()
{
    global $app;
    #http://83.138.190.170/skyeapi/debitrequest?msisdn=2347062385282&sessionid=435654257&endofsesssion=false&userdata=*336*9*750*07062385281#&op=MTNmain
    #msisdn=2348134197100&sessionid=435654257&endofsesssion=false&userdata=*336*5#
    $req = $app->request();
    #$userdata= '*336*9#';
    $userdata = $req->get('userdata');
    $use = explode('*', $userdata);
    if ($use[4]) {
        $amt = $use[3];
        $destMsisdn = $use[4];
        $destMsisdn = rtrim($destMsisdn, "#");
    } else {
        $amt = $use[3];
        $amt = rtrim($amt, '#');
        $destMsisdn = $req->get('msisdn');
    }
    $actMsisdn = $req->get('msisdn');
    $msisdn = $actMsisdn;
    $sessionid = $req->get('sessionid') ? $req->get('sessionid') : time();
    #$amt = $amt * 100;
    $op = $req->get('op');
    $stat_id = 1;
    $length = 15;
    $transId = getToken($length);
    //Log action:
    $logFile = "transaction.log";
    log_action("Logging USSD Request@" . date('Y-m-d h:i:s') . ">> Session id ({$sessionid}), MSISDN ({$actMsisdn})," . "UserData ({$userdata})\n", $logFile);
    #$transId = db_query("select TRANSID_SEQ.NEXTVAL from dual");
    #$log_req = "insert into top_request (transaction_id,act_msisdn,dest_msisdn,status_id,amt,operator) values (TRANSID_SEQ.NEXTVAL,'$actMsisdn','$destMsisdn','$amt','$op' )";
    $log_req = "insert into top_request (transaction_id,act_msisdn,dest_msisdn,status_id,amt,operator,sessionid) values ('{$transId}','{$actMsisdn}','{$destMsisdn}',{$stat_id},'{$amt}','{$op}','{$sessionid}' )";
    $sql = db_execute($log_req);
    if ($sql) {
        $response = array('response' => 'Transaction Successfull:', 'endofsession' => 'true', 'msisdn' => $msisdn);
        #echo '{"success": ' . json_encode($sql) . '}';
    } else {
        $response = array('response' => 'Registration Failed:', 'endofsession' => 'true', 'msisdn' => $msisdn);
        #echo '{"failure":{"text":'. Failed .'}}';
    }
    header('Content-Type: application/json');
    echo json_encode($response);
}
开发者ID:hiroyalty,项目名称:skyeapi,代码行数:43,代码来源:index.php

示例3: change_passwd

function change_passwd($new_passwd1, $new_passwd2, $DEBUG = FALSE)
{
    $PHP_SELF = $_SERVER['PHP_SELF'];
    $session = session_id();
    if (strlen($new_passwd1) == 0 || strlen($new_passwd2) == 0 || $new_passwd1 != $new_passwd2) {
        echo _('user_passwd_error') . "<br>\n";
    } else {
        $passwd_md5 = md5($new_passwd1);
        $sql1 = 'UPDATE conges_users SET  u_passwd=\'' . $passwd_md5 . '\' WHERE u_login=\'' . $_SESSION['userlogin'] . '\' ';
        $result = SQL::query($sql1);
        if ($result) {
            echo _('form_modif_ok') . " <br><br> \n";
        } else {
            echo _('form_mofif_not_ok') . "<br><br> \n";
        }
    }
    $comment_log = 'changement Password';
    log_action(0, '', $_SESSION['userlogin'], $comment_log, $DEBUG);
}
开发者ID:coz787,项目名称:Libertempo,代码行数:19,代码来源:user_changer_mot_de_passe.php

示例4: procesaXmlV32

function procesaXmlV32($factura, &$resultado)
{
    global $SITE_URL, $KEYS_DIR;
    //,$CODIFICACION_UTF8,$DECODIFICACION_UTF8,$CODIFICACION_XML_UTF8, $DECODIFICACION_XML_UTF8;
    $xml = "";
    $resultado = array();
    //version sat 3.2
    $xml = domSATV32($factura);
    if ($xml == null) {
        log_action("ERROR GENERANDO XML ", 0);
        return -1;
    }
    $codifxml = mb_detect_encoding($xml, 'UTF-8', true);
    $cadenaOriginal = cadenaSATV3_2($xml);
    //Version cfdi
    $codifCadena = mb_detect_encoding($cadenaOriginal, 'UTF-8', true);
    if ($codifxml != 'UTF-8' || $codifCadena != 'UTF-8') {
        $msg = "codificacon utf8 invalida ";
        log_action($msg);
        $resultado['error'] = $msg;
        return -1;
    }
    $resultado['cadena'] = $cadenaOriginal;
    //SELLO
    $facej = new Java('cc.lab.SignatureMgmt');
    $pkeyfile = $SITE_URL . $KEYS_DIR . $factura->sello['llavedec'];
    $sello = $facej->sign($cadenaOriginal, $pkeyfile);
    log_action(print_r("***********************  S E L L O **********************", TRUE));
    log_action($cadenaOriginal);
    log_action(print_r($pkeyfile, TRUE));
    if (!(strpos($sello, "ERROR") === false)) {
        log_action("ERROR GENERANDO SELLO: " . $sello, 0);
        $resultado['error'] = "ERROR GENERANDO SELLO: " . $sello;
        return -1;
    }
    $xml = str_replace("%SELLO%", $sello, $xml);
    $resultado['sello'] = $sello;
    $XMLBODY = $xml;
    $resultado['xmlutf8'] = $XMLBODY;
    $resultado['xml'] = $xml;
    return 0;
}
开发者ID:hackdracko,项目名称:Facturacion-Kio,代码行数:42,代码来源:coref5.php

示例5: SOAP_client

function SOAP_client($client_id, $cfdistring)
{
    // URL del Webservice del PAC - viene de constantes.php
    global $PAC_URL;
    $client_id = 'MCO000823CK3';
    // Crea objeto SoapClient
    try {
        $client = new SoapClient($PAC_URL, array('trace' => 1, 'connection_timeout' => 15));
    } catch (Exception $e) {
        log_action("Error creando SoapClient:" . $e->getMessage());
        return 'exception error';
    }
    // Envia peticion de timbrado al PAC
    try {
        $params = array('client_id' => $client_id, 'cfdiString' => $cfdistring);
        $resultado = $client->__soapCall('requestPacCertification', array('parameters' => $params));
    } catch (Exception $e) {
        log_action("Error creando accesando PAC 1:" . $e->getMessage());
        echo "Error creando accesando PAC 1:";
        sleep(10);
        try {
            $params = array('client_id' => $client_id, 'cfdiString' => $cfdistring);
            $resultado = $client->__soapCall('requestPacCertification', array('parameters' => $params));
        } catch (Exception $e) {
            log_action("Error creando accesando PAC 2:" . $e->getMessage());
            echo "Error creando accesando PAC 2:";
            sleep(30);
            try {
                $params = array('client_id' => $client_id, 'cfdiString' => $cfdistring);
                $resultado = $client->__soapCall('requestPacCertification', array('parameters' => $params));
            } catch (Exception $e) {
                log_action("Error creando accesando PAC 3:" . $e->getMessage());
                echo "Error creando accesando PAC 3:";
                return 'exception error';
            }
        }
    }
    // Regresa el XML de la factura de
    $cfdi_xml = base64_decode($resultado->return);
    return $cfdi_xml;
}
开发者ID:hackdracko,项目名称:Facturacion-Kio,代码行数:41,代码来源:face.PAC.client.php

示例6: init_cobalt

//Cobalt on the web: http://cobalt.jvroig.com
//******************************************************************
require 'path.php';
init_cobalt('Delete refstudent');
if (isset($_GET['student_id'])) {
    $student_id = urldecode($_GET['student_id']);
    require_once 'form_data_refstudent.php';
} elseif (xsrf_guard()) {
    init_var($_POST['btn_cancel']);
    init_var($_POST['btn_delete']);
    require 'components/query_string_standard.php';
    if ($_POST['btn_cancel']) {
        log_action('Pressed cancel button', $_SERVER['PHP_SELF']);
        redirect("listview_refstudent.php?{$query_string}");
    } elseif ($_POST['btn_delete']) {
        log_action('Pressed delete button', $_SERVER['PHP_SELF']);
        require_once 'subclasses/refstudent.php';
        $dbh_refstudent = new refstudent();
        $object_name = 'dbh_refstudent';
        require 'components/create_form_data.php';
        $dbh_refstudent->del($arr_form_data);
        redirect("listview_refstudent.php?{$query_string}");
    }
}
require 'subclasses/refstudent_html.php';
$html = new refstudent_html();
$html->draw_header('Delete Refstudent', $message, $message_type);
$html->draw_listview_referrer_info($filter_field_used, $filter_used, $page_from, $filter_sort_asc, $filter_sort_desc);
$html->draw_hidden('student_id');
$html->detail_view = TRUE;
$html->draw_controls('delete');
开发者ID:seans888,项目名称:APC-CPO,代码行数:31,代码来源:delete_refstudent.php

示例7: commit_modif

function commit_modif($tab_new_values, $session, $DEBUG = FALSE)
{
    $PHP_SELF = $_SERVER['PHP_SELF'];
    if ($session == "") {
        $URL = "{$PHP_SELF}";
    } else {
        $URL = "{$PHP_SELF}?session={$session}";
    }
    // update de la table
    foreach ($tab_new_values as $nom_mail => $tab_mail) {
        $subject = addslashes($tab_mail['subject']);
        $body = addslashes($tab_mail['body']);
        $req_update = 'UPDATE conges_mail SET mail_subject=\'' . $subject . '\', mail_body=\'' . $body . '\' WHERE mail_nom=\'' . SQL::quote($nom_mail) . '\' ';
        $result1 = SQL::query($req_update);
    }
    echo "<span class = \"messages\">" . _('form_modif_ok') . "</span><br>";
    $comment_log = "configuration des mails d\\'alerte";
    log_action(0, "", "", $comment_log, $DEBUG);
    if ($DEBUG) {
        echo "<a href=\"{$URL}\" method=\"POST\">" . _('form_retour') . "</a><br>\n";
    } else {
        echo "<META HTTP-EQUIV=REFRESH CONTENT=\"2; URL={$URL}\">";
    }
}
开发者ID:kakargias,项目名称:php-conges,代码行数:24,代码来源:config_mail.php

示例8: basename

    $target_file = basename($_FILES['file_upload']['name']);
    $upload_dir = SITE_ROOT . DS . "uploads";
    $path_filenme = $upload_dir . "/" . $target_file;
    chmod($upload_dir, 0777);
    chmod($path_filenme, 0777);
    chmod($tmp_file, 0777);
    // You will probably want to first use file_exists() to make sure
    // there isn't already a file by the same name.
    // move_uploaded_file will return false if $tmp_file is not a valid upload file
    // or if it cannot be moved for any other reason
    if (move_uploaded_file($tmp_file, $upload_dir . "/" . $target_file)) {
        log_action('Upload file success', "{$_SESSION['username']} uploaded file {$path_filenme} " . $temp_file . " - " . $target_file);
        $message = "File uploaded successfully.";
        chmod($path_filenme, 0777);
    } else {
        log_action('Upload file error', "{$_SESSION['username']} uploaded file {$path_filenme} " . $temp_file . " - " . $target_file);
        $error = $_FILES['file_upload']['error'];
        $message = $upload_errors[$error];
    }
}
?>

	
<?php 
// The maximum file size (in bytes) must be declared before the file input field
// and can't be larger than the setting for upload_max_filesize in php.ini.
//
// This form value can be manipulated. You should still use it, but you rely
// on upload_max_filesize as the absolute limit.
//
// Think of it as a polite declaration: "Hey PHP, here comes a file less than X..."
开发者ID:kamy333,项目名称:kamy,代码行数:31,代码来源:upload.php

示例9: init_cobalt

<?php

//******************************************************************
//This file was generated by Cobalt, a rapid application development
//framework developed by JV Roig (jvroig@jvroig.com).
//
//Cobalt on the web: http://cobalt.jvroig.com
//******************************************************************
require 'path.php';
init_cobalt('View eval dtl');
if (isset($_GET['id'])) {
    $id = urldecode($_GET['id']);
    require 'form_data_eval_dtl.php';
} elseif (xsrf_guard()) {
    init_var($_POST['btn_back']);
    if ($_POST['btn_back']) {
        log_action('Pressed cancel button', $_SERVER['PHP_SELF']);
        require 'components/query_string_standard.php';
        redirect("listview_eval_dtl.php?{$query_string}");
    }
}
require 'subclasses/eval_dtl_html.php';
$html = new eval_dtl_html();
$html->draw_header('Detail View: Eval Dtl', $message, $message_type);
$html->draw_listview_referrer_info($filter_field_used, $filter_used, $page_from, $filter_sort_asc, $filter_sort_desc);
$html->detail_view = TRUE;
$html->draw_controls('view');
$html->draw_footer();
开发者ID:seans888,项目名称:APC-CPO,代码行数:28,代码来源:detailview_eval_dtl.php

示例10: init_cobalt

//****************************************************************************************
require 'path.php';
init_cobalt('View sub doc');
if (xsrf_guard()) {
    init_var($_POST['btn_cancel']);
    init_var($_POST['btn_submit']);
    if ($_POST['btn_cancel']) {
        log_action('Pressed cancel button');
        redirect("listview_sub_doc.php");
    }
    if ($_POST['btn_submit']) {
        log_action('Pressed submit button');
        require 'subclasses/sub_doc.php';
        $dbh_sub_doc = new sub_doc();
        if ($message == "") {
            log_action('Exported table data to CSV');
            $timestamp = date('Y-m-d');
            $token = generate_token(0, 'fs');
            $csv_name = $token . $_SESSION['user'] . '_sub_doc_' . $timestamp . '.csv';
            $filename = TMP_DIRECTORY . '/' . $csv_name;
            $csv_contents = $dbh_sub_doc->export_to_csv();
            $csv_file = fopen($filename, "wb");
            fwrite($csv_file, $csv_contents);
            fclose($csv_file);
            chmod($filename, 0755);
            $csv_name = urlencode($csv_name);
            $message = 'CSV file successfully generated: <a href="/' . BASE_DIRECTORY . '/download_generic.php?filename=' . $csv_name . '">Download the CSV file.</a>';
            $message_type = 'system';
        }
    }
}
开发者ID:seans888,项目名称:Bgy-Project,代码行数:31,代码来源:csv_sub_doc.php

示例11: init_cobalt

//******************************************************************
require 'path.php';
init_cobalt('View accomplishment');
if (xsrf_guard()) {
    init_var($_POST['btn_cancel']);
    init_var($_POST['btn_submit']);
    if ($_POST['btn_cancel']) {
        log_action('Pressed cancel button', $_SERVER['PHP_SELF']);
        redirect("listview_accomplishment.php");
    }
    if ($_POST['btn_submit']) {
        log_action('Pressed submit button', $_SERVER['PHP_SELF']);
        require 'subclasses/accomplishment.php';
        $dbh_accomplishment = new accomplishment();
        if ($message == "") {
            log_action("Exported table data to CSV", $_SERVER['PHP_SELF']);
            $timestamp = date('Y-m-d');
            $token = generate_token(0, 'fs');
            $csv_name = $token . $_SESSION['user'] . '_accomplishment_' . $timestamp . '.csv';
            $filename = TMP_DIRECTORY . '/' . $csv_name;
            $csv_contents = $dbh_accomplishment->export_to_csv();
            $csv_file = fopen($filename, "wb");
            fwrite($csv_file, $csv_contents);
            fclose($csv_file);
            chmod($filename, 0755);
            $csv_name = urlencode($csv_name);
            $message = 'CSV file successfully generated: <a href="/' . BASE_DIRECTORY . '/download_generic.php?filename=' . $csv_name . '">Download the CSV file.</a>';
            $message_type = 'system';
        }
    }
}
开发者ID:seans888,项目名称:APC-CPO,代码行数:31,代码来源:csv_accomplishment.php

示例12: commit_vider_table_logs

function commit_vider_table_logs($session, $DEBUG = FALSE)
{
    //$DEBUG=TRUE;
    $PHP_SELF = $_SERVER['PHP_SELF'];
    $sql_delete = "TRUNCATE TABLE conges_logs ";
    $ReqLog_delete = SQL::query($sql_delete);
    // ecriture de cette action dans les logs
    $comment_log = "effacement des logs de php_conges ";
    log_action(0, "", "", $comment_log, $DEBUG);
    echo "<span class = \"messages\">" . _('form_modif_ok') . "</span><br>";
    if ($session == "") {
        redirect(ROOT_PATH . 'config/config_logs.php');
    } else {
        redirect(ROOT_PATH . 'config/config_logs.php?session=' . $session);
    }
}
开发者ID:kakargias,项目名称:php-conges,代码行数:16,代码来源:config_logs.php

示例13: redirect_to

<?php

require_once '../../includes/initialize.php';
if (!$session->is_logged_in()) {
    redirect_to('login.php');
}
include_once '../layouts/admin-header.php';
$logfile = SITE_ROOT . DS . 'logs' . DS . 'log.txt';
if (!empty($_GET['clear']) == 'true') {
    file_put_contents($logfile, '');
    /** Add the first log entry */
    log_action('Logs cleared', "by User ID {$session->user_id}");
    /** redirect tp this same page so that the URL won't have "clear=true" anymore */
    redirect_to('logfile.php');
}
?>
<a href="index.php">&laquo; Back</a>
<h2>Log File</h2>
<p><a href="logfile.php?clear=true">Clear log file</a></p>
<?php 
if (file_exists($logfile) && is_readable($logfile) && ($handle = fopen($logfile, 'r'))) {
    /** read */
    echo "<ul class='side-nav'>";
    while (!feof($handle)) {
        $entry = fgets($handle);
        if (trim($entry) != "") {
            echo "<li>{$entry}</li>";
        }
    }
    echo "</ul>";
    fclose($handle);
开发者ID:jgacuca567,项目名称:PHPMYSQLBTB,代码行数:31,代码来源:logfile.php

示例14: ajout_global_groupe

function ajout_global_groupe($choix_groupe, $tab_new_nb_conges_all, $tab_calcul_proportionnel, $tab_new_comment_all, $DEBUG = FALSE)
{
    $PHP_SELF = $_SERVER['PHP_SELF'];
    $session = session_id();
    // recup de la liste des users d'un groupe donné
    $list_users = get_list_users_du_groupe($choix_groupe, $DEBUG);
    foreach ($tab_new_nb_conges_all as $id_conges => $nb_jours) {
        if ($nb_jours != 0) {
            $comment = $tab_new_comment_all[$id_conges];
            $sql1 = "SELECT u_login, u_quotite FROM conges_users WHERE u_login IN ({$list_users}) ORDER BY u_login ";
            $ReqLog1 = SQL::query($sql1);
            while ($resultat1 = $ReqLog1->fetch_array()) {
                $current_login = $resultat1["u_login"];
                $current_quotite = $resultat1["u_quotite"];
                if (!isset($tab_calcul_proportionnel[$id_conges]) || $tab_calcul_proportionnel[$id_conges] != TRUE) {
                    $nb_conges = $nb_jours;
                } else {
                    // pour arrondir au 1/2 le + proche on  fait x 2, on arrondit, puis on divise par 2
                    $nb_conges = ROUND($nb_jours * ($current_quotite / 100) * 2) / 2;
                }
                $valid = verif_saisie_decimal($nb_conges, $DEBUG);
                if ($valid) {
                    // 1 : on update conges_solde_user
                    $req_update = 'UPDATE conges_solde_user SET su_solde = su_solde+ ' . intval($nb_conges) . '
							WHERE  su_login = \'' . SQL::quote($current_login) . '\' AND su_abs_id = ' . intval($id_conges) . ';';
                    $ReqLog_update = SQL::query($req_update);
                    // 2 : on insert l'ajout de conges dans la table periode
                    // recup du nom du groupe
                    $groupename = get_group_name_from_id($choix_groupe, $DEBUG);
                    $commentaire = _('resp_ajout_conges_comment_periode_groupe') . " {$groupename}";
                    // ajout conges
                    insert_ajout_dans_periode($DEBUG, $current_login, $nb_conges, $id_conges, $commentaire);
                }
            }
            $group_name = get_group_name_from_id($choix_groupe, $DEBUG);
            if (!isset($tab_calcul_proportionnel[$id_conges]) || $tab_calcul_proportionnel[$id_conges] != TRUE) {
                $comment_log = "ajout conges pour groupe {$group_name} ({$nb_jours} jour(s)) ({$comment}) (calcul proportionnel : No)";
            } else {
                $comment_log = "ajout conges pour groupe {$group_name} ({$nb_jours} jour(s)) ({$comment}) (calcul proportionnel : Yes)";
            }
            log_action(0, "ajout", "groupe", $comment_log, $DEBUG);
        }
    }
}
开发者ID:coz787,项目名称:Libertempo,代码行数:44,代码来源:hr_ajout_conges.php

示例15: message

                message("Best&auml;tigung", '
<form name="theform" method="post" action="' . build_link("postops.php") . '">
  M&ouml;chten Sie diesen Post wirklich l&ouml;schen?<br><br>
  <input type="hidden" name="do_delete" value="1">
  <input type="hidden" name="action" value="delete">
  <input type="hidden" name="post[postid]" value="' . $post['postid'] . '">
  <input class="tbbutton" type="submit" name="Submit" value="L&ouml;schen &gt;&gt;">
</form>');
            }
        } else {
            // re-get $post
            $post = $HTTP_POST_VARS['post'];
            if (!($post['postid'] = intval($post['postid']))) {
                exit('nix da');
            }
            // decrease thread reply count
            thwb_query("UPDATE " . $pref . "thread SET threadreplies=threadreplies-1 WHERE threadid={$thread['threadid']}");
            // decrease board post count
            thwb_query("UPDATE " . $pref . "board SET boardposts=boardposts-1 WHERE boardid={$board['boardid']}");
            // remove post
            thwb_query("DELETE FROM " . $pref . "post WHERE postid={$post['postid']}");
            // display stuff
            updatethread($thread['threadid']);
            updateboard($board['boardid']);
            log_action('delete post');
            message("Post wurde gel&ouml;scht", "Post wurde gel&ouml;scht.<br><a href=\"" . build_link("showtopic.php?thread[threadid]={$thread['threadid']}") . "\">Zur&uuml;ck zum Thread</a>");
        }
    } else {
        message("Fehler", "Sie haben keine Erlaubnis diesen Post zu l&ouml;schen");
    }
}
开发者ID:adrianbroher,项目名称:thwboard,代码行数:31,代码来源:postops.php


注:本文中的log_action函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。