本文整理汇总了PHP中db_log函数的典型用法代码示例。如果您正苦于以下问题:PHP db_log函数的具体用法?PHP db_log怎么用?PHP db_log使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了db_log函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleSubscribe
function handleSubscribe($postObj)
{
$uid = 0;
$params = array(array("" . $postObj->FromUserName, SQLSRV_PARAM_IN), array("" . $postObj->ToUserName, SQLSRV_PARAM_IN), array($uid, SQLSRV_PARAM_INOUT));
$sp = "{call app_subscrible(?,?,?)}";
sp_execute($sp, $params);
//
//关注时通过微信号获取用户基本信息
if ($user = get_unionid_userinfo(db_get_token_ticket(CFG_APPID, CFG_SECRET)["token"], $postObj->FromUserName)) {
$params = array(array("" . $user["openid"], SQLSRV_PARAM_IN), array("" . $user["nickname"], SQLSRV_PARAM_IN), array("" . $user["province"], SQLSRV_PARAM_IN), array("" . $user["city"], SQLSRV_PARAM_IN), array("" . $user["country"], SQLSRV_PARAM_IN), array(intval($user["sex"]), SQLSRV_PARAM_IN), array("" . $user["headimgurl"], SQLSRV_PARAM_IN));
sp_execute("{call app_set_userinfo(?,?,?,?,?,?,?)}", $params);
} else {
db_log("获取用户信息失败!");
}
//用户扫描带场景值二维码
$cids = "";
if (strstr($postObj->EventKey, "qrscene_")) {
$cids = substr($postObj->EventKey, strlen("qrscene_"));
$cid = str2num(canteenid_content, $cids);
} else {
$cid = 0;
}
//
$sp = "{call app_user_add_canteen(?,?)}";
$params = array(array($uid, SQLSRV_PARAM_IN), array($cid, SQLSRV_PARAM_IN));
$rs = sp_execute($sp, $params);
//
response_canteen_welcome($postObj, $cids, $rs[0]["cname"], $rs[0]["picurl"], $rs[0]["newsid"]);
}
示例2: delete
/**
* @return true on success false on failure
*/
public function delete()
{
if (!$this->view()) {
$this->errormsg[] = Config::lang($this->msg['error_does_not_exist']);
return false;
}
db_delete($this->db_table, $this->id_field, $this->id);
db_log($this->id, 'delete_fetchmail', $this->result['id']);
$this->infomsg[] = Config::Lang_f('pDelete_delete_success', $this->result['src_user'] . ' -> ' . $this->result['mailbox']);
return true;
}
示例3: db_get_all
function db_get_all($sql, $fetchmode = MDB2_FETCHMODE_ORDERED, $_db = NULL)
{
global $db, $db_error_message;
if ($_db == NULL) {
$_db = $db;
}
db_log(5, "Query: {$sql}");
$db_error_message = NULL;
$result = $_db->queryAll($sql, NULL, $fetchmode);
if (PEAR::isError($result)) {
$db_error_message = $result->message;
db_log(1, "Query Error: {$db_error_message} {$sql}");
return NULL;
} else {
db_log(5, "Query results: " . count($result));
return $result;
}
}
示例4: exists
if (trim($sSchema) != '') {
$sSqlConsultaSchema = " select exists ( select 1 ";
$sSqlConsultaSchema .= " from information_schema.schemata ";
$sSqlConsultaSchema .= " where information_schema.schemata.schema_name = '{$sSchema}' ) ";
$aDadosSchema = DB::query($sSqlConsultaSchema);
if (is_bool($aDadosSchema)) {
throw new Exception("Falha ao consultar schemas SQL : {$sSqlConsultaSchema}");
}
if (!$aDadosSchema->fetchColumn()) {
if (is_bool(DB::exec("CREATE SCHEMA {$sSchema} "))) {
throw new Exception("Falha ao criar schema {$sSchema} !");
}
if (is_bool(DB::exec("ALTER DATABASE " . DB::getInstance()->getDataBase() . " SET search_path TO {$sSchema} "))) {
throw new Exception("Falha ao alterar schema atual para {$sSchema} !");
}
}
if (is_bool(DB::exec("SET search_path TO {$sSchema} "))) {
throw new Exception("Falha ao definir schema atual para {$sSchema} !");
}
}
$oDataBaseVersioning = new DatabaseVersioning($sSchema);
$oDataBaseVersioning->setFileLog($sFileLog);
$oDataBaseVersioning->upgradeDatabase();
} catch (Exception $eException) {
DB::rollBack();
db_log($eException->getMessage() . "\n", $sFileLog);
exit;
}
DB::commit();
db_log("Processo Finalizado com Sucesso!\n", $sFileLog);
示例5: telegram_bot
}
return $response;
}
// instantiating a new bot
$bot = new telegram_bot($token);
// instantiating a new triggers set
$ts = new telegram_trigger_set($botname, $singletrigger);
// registering the triggers
$ts->register_trigger_command("trigger_welcome", ["/start", "/welcome", "/hi"], 0);
$ts->register_trigger_command("trigger_help", ["/help"], 0);
$ts->register_trigger_command("trigger_photo", ["/getphoto", "/photo", "/picture"], -1);
// parameters count is ignore
// error trigger
$ts->register_trigger_error("trigger_err");
// receiving data sent from the user
$message = $bot->read_post_message();
$date = $message->message->date;
$chatid = $message->message->chat->id;
$text = $message->message->text;
// running triggers management
$response = $ts->run($bot, $chatid, $text);
// returns an array of triggered events
// log messages exchange on the database
db_log($botname, 'recv', $chatid, 'text', $text, $date);
if (count($response) > 0) {
foreach ($response as $r) {
db_log($botname, 'sent', $chatid, $r['type'], $r['content'], $date);
}
} else {
db_log($botname, 'error', $chatid, 'Error', $date);
}
示例6: escape_string
if ($result['rows'] == 1) {
$error = 1;
$tAddress = escape_string($_POST['fAddress']);
$tGoto = $fGoto;
$tDomain = $fDomain;
$pCreate_alias_address_text = $PALANG['pCreate_alias_address_text_error2'];
}
if ($fActive == "on") {
$sqlActive = db_get_boolean(True);
} else {
$sqlActive = db_get_boolean(False);
}
if ($error != 1) {
if (preg_match('/^\\*@(.*)$/', $fGoto, $match)) {
$fGoto = "@" . $match[1];
}
$result = db_query("INSERT INTO {$table_alias} (address,goto,domain,created,modified,active) VALUES ('{$fAddress}','{$fGoto}','{$fDomain}',NOW(),NOW(),'{$sqlActive}')");
if ($result['rows'] != 1) {
$tDomain = $fDomain;
$tMessage = $PALANG['pCreate_alias_result_error'] . "<br />({$fAddress} -> {$fGoto})<br />\n";
} else {
db_log($SESSID_USERNAME, $fDomain, 'create_alias', "{$fAddress} -> {$fGoto}");
$tDomain = $fDomain;
$tMessage = $PALANG['pCreate_alias_result_success'] . "<br />({$fAddress} -> {$fGoto})<br />\n";
}
}
}
include "templates/header.php";
include "templates/menu.php";
include "templates/create-alias.php";
include "templates/footer.php";
示例7: add_first_user
function add_first_user()
{
global $input;
// Add the first user in database
$first_user = file_get_contents("../first_user");
$first_user = explode(" , ", $first_user);
$user_ID = $first_user[0];
$surname = $first_user[3];
$forename = $first_user[2];
$passwd = $first_user[1];
$permissions = 1;
// try {
if (!db_ready()) {
db_prepare();
}
db_user_create($user_ID, $surname, $forename, $passwd, $permissions);
add_admin_to_file($user_ID);
push_users_to_ezmanager();
db_log(db_gettable('users'), 'Created user ' . $user_ID, $_SESSION['user_login']);
db_close();
// } catch (PDOException $e) {
// $errors['db_error'] = $e->getMessage();
// require template_getpath('install.php');
// die;
// }
session_destroy();
unlink("../first_user");
require template_getpath('install_success.php');
}
示例8: db_log
//
echo '<div class="item" style="height:40px;">';
echo '<div class="item-txtname">电话</div>';
echo '<div class="item-txtval">';
echo '<input type="tel" id="canteenTel" name="canteenTel" placeholder="请输入餐厅电话" value="" class="txt-input" maxlength="30">';
echo '</div>';
echo '</div>';
}
?>
<div class="ui-btn-wrap">
<?php
if ($_REQUEST["action"] == "finish") {
db_log("user_canteen_create:9");
echo '<button id="register" onclick="location.href=\'mycanteen.php\'" class="ui-btn-lg ui-btn-green">点击进入</button>';
} else {
db_log("user_canteen_create:10");
echo '<button id="register" onclick="toRegister()" class="ui-btn-lg ui-btn-primary">立即注册</button>';
}
?>
</div>
</div>
</div>
</div>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
<?php
//通过access_token获取jsapi_ticket
$ticket = db_get_token_ticket(CFG_APPID, CFG_SECRET)["ticket"];
$signPackage = get_sign_package(CFG_APPID, $ticket);
?>
示例9: store
/**
* store $this->values in the database
*
* converts values based on $this->struct[*][type] (boolean, password encryption)
*
* calls $this->storemore() where additional things can be done
* @return bool - true if all values were stored in the database, otherwise false
* error messages (if any) are stored in $this->errormsg
*/
public function store()
{
if ($this->values_valid == false) {
$this->errormsg[] = "one or more values are invalid!";
return false;
}
if (!$this->beforestore()) {
return false;
}
$db_values = $this->values;
foreach (array_keys($db_values) as $key) {
switch ($this->struct[$key]['type']) {
# modify field content for some types
case 'bool':
$db_values[$key] = db_get_boolean($db_values[$key]);
break;
case 'pass':
$db_values[$key] = pacrypt($db_values[$key]);
break;
case 'b64p':
$db_values[$key] = base64_encode($db_values[$key]);
break;
case 'quot':
case 'vnum':
case 'vtxt':
unset($db_values[$key]);
# virtual field, never write it
break;
}
if ($this->struct[$key]['not_in_db'] == 1) {
unset($db_values[$key]);
}
# remove 'not in db' columns
if ($this->struct[$key]['dont_write_to_db'] == 1) {
unset($db_values[$key]);
}
# remove 'dont_write_to_db' columns
}
if ($this->new) {
$result = db_insert($this->db_table, $db_values);
} else {
$result = db_update($this->db_table, $this->id_field, $this->id, $db_values);
}
if ($result != 1) {
$this->errormsg[] = Config::lang_f($this->msg['store_error'], $this->label);
return false;
}
$result = $this->storemore();
# db_log() even if storemore() failed
db_log($this->domain, $this->msg['logname'], $this->id);
if ($result) {
# return success message
# TODO: add option to override the success message (for example to include autogenerated passwords)
$this->infomsg['success'] = Config::lang_f($this->msg['successmessage'], $this->label);
}
return $result;
}
示例10: urlencode
$redirect_uri = urlencode(CFG_HTTP . "mobile/sales_scan.php?cids=" . $_REQUEST["cids"] . "&winids=" . $_REQUEST["winids"] . "&action=setcookie");
weixin_require_auth($redirect_uri);
}
exit;
}
$tipMsg = "";
$wid = $_COOKIE["wxp_user_openid"];
$cids = $_REQUEST["cids"];
$winids = $_REQUEST["winids"];
$cid = str2num(canteenid_content, $cids);
$winid = str2num(saleswin_content, $winids);
//debug:1
$mode = 0;
$ret = " ";
$params = array(array("" . $wid, SQLSRV_PARAM_IN), array($cid, SQLSRV_PARAM_IN), array($winid, SQLSRV_PARAM_IN), array($mode, SQLSRV_PARAM_IN), array($ret, SQLSRV_PARAM_OUT));
db_log("sales_scan:wid:{$wid}, cid:{$cid}, winid:{$winid}");
$rs = sp_execute("{call app_sales_scan(?,?,?,?,?)}", $params);
if ($ret == "ok_master") {
$tipMsg = '您已经成为【' . $rs[0]["cname"] . '】[' . $rs[0]["winname"] . ']的管理员';
} else {
if ($ret == "ok_sales") {
//send message
altermsg_for_sales($cids, $rs[0]["oid"], $rs[0]["uname"], $rs[0]["cname"], $rs[0]["winname"], $rs[0]["pay_sta"], $rs[0]["uid"], $rs[0]["amount"], $rs[0]["total"], $rs[0]["wid_m"]);
$tipMsg = '已将您的订餐信息通知给【' . $rs[0]["cname"] . '】管理员';
} else {
$tipMsg = $ret;
}
}
?>
<!DOCTYPE html>
<html>
示例11: delete
/**
* @return true on success false on failure
*/
public function delete()
{
if (!$this->view()) {
$this->errormsg[] = Config::Lang($this->msg['error_does_not_exist']);
return false;
}
db_delete('domain_admins', $this->id_field, $this->id);
db_delete($this->db_table, $this->id_field, $this->id);
db_log('admin', 'delete_admin', $this->id);
# TODO delete_admin is not a valid db_log keyword yet, and 'admin' is not displayed in viewlog.php
$this->infomsg[] = Config::Lang_f('pDelete_delete_success', $this->id);
return true;
}
示例12: time
//设置有效期7天
$time = time() + 3600 * 24 * 7;
weixin_auth_openid_set_cookie($user, $time);
echo '<script>location.href="http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . '"</script>';
exit;
}
} else {
db_log("check_cookie:5");
//处理需要重定向的URL中是否带有参数
$qstr = $_SERVER["QUERY_STRING"];
$t = "?";
if (strlen($qstr) > 0) {
$t = "&";
}
$redirect_uri = urlencode('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . $t . "act_sc=setcookie");
weixin_require_auth($redirect_uri);
exit;
}
}
db_log("check_cookie:6");
//通过用户微信号获取用户ID
$params = array(array(0, SQLSRV_PARAM_IN), array("" . $_COOKIE["wxp_user_openid"], SQLSRV_PARAM_IN));
$rs = sp_execute("{call app_get_userinfo(?,?)}", $params);
if (count($rs) > 0) {
$_SESSION["uid"] = $rs[0]["uid"];
db_log("check_cookie:7");
} else {
db_log("check_cookie:8");
//db_log("用户不存在,wid=".$_COOKIE["wxp_user_openid"]);
}
}
示例13: unset
// close connection
//=== Archive compressed databases using 7z
unset($output);
// Clear output error buffer
exec("7za.exe a -t7z {$DEST}/{$BACKUP_NAME}.7z {$TEMP}/*.7z 2>&1", $output, $res);
if ($res > 0) {
// Was compression OK
db_log("Archived Failed: {$BACKUP_NAME}.7z");
// No: Log failed
db_log(".............................................................\n");
die(" Archived Failed: \n {$BACKUP_NAME}.7z");
// No: Failed
} else {
db_log("Archived OK: {$BACKUP_NAME}.7z");
//Yes: Log pass
db_log(".............................................................\n");
print " Archived OK: {$BACKUP_NAME}.7z \n";
}
//=== Remove files in temp folder
if ($dir = @opendir($TEMP)) {
while (($file = readdir($dir)) !== false) {
if (!is_dir($file)) {
unlink($TEMP . '/' . $file);
}
}
}
closedir($dir);
//=== Delete temp folder
rmdir($TEMP);
//=== Log =====================================================================
// Logs Database actions to a log file
示例14: db_log
<script src="plugins/sweetalert/sweetalert.min.js?v=2"></script>
<!--sweet-alert plugin end-->
</head>
<body>
<div class="body">
<div style="height:2px;"></div>
<!--topsearch-->
<div class="container">
<?php
$closeord = 0;
if ($oid > 0) {
echo '<div class="headerCnameTips">' . $_SESSION["cname"] . '</div>';
//处理消息链接带oids进来
$closeord = 1;
}
db_log($cid);
$sp = "{call app_get_canteen_ords(?)}";
$params = array(array($cid, SQLSRV_PARAM_IN));
$rs = sp_execute($sp, $params);
$haveOK = false;
//当前有订单
if (count($rs) > 0) {
foreach ($rs as $row) {
if ($oid != 0 && $row["oid"] != $oid) {
continue;
}
$haveOK = true;
$oids = num2str_x(orderid_content_x, $row["oid"]);
$stateColor = $row["state"] == 1 ? "chengse1" : ($row["state"] == 11 ? "statecolor1" : ($row["state"] == 18 ? "statecolor2" : "statecolor2"));
?>
<div class="ordertitletime" id="Time_Index_<?php
示例15: str2num
} else {
if ($action == "user_set_sales_win") {
$winids = $_REQUEST["winids"];
$winid = str2num(saleswin_content, $winids);
$winname = $_POST["winname"];
//生成二维码
$path = dirname(__FILE__) . "/upload/qrcode/";
$name = md5(time()) . '.png';
$filename = $path . $name;
//ready param
$cids = num2str(canteenid_content, $_SESSION["cid"]);
$codeText = CFG_HTTP . "mobile/sales_scan.php?cids={$cids}&winids={$winids}";
QRcode::png($codeText, $filename, L, 12, 2);
$winver = "qrcode/{$name}";
$windesc = $_POST["windesc"];
db_log("winid:{$winid}, winname:{$winname}, verurl:{$winver}, desc:{$windesc}, cid:" . $_SESSION["cid"]);
$params = array(array(intval($_SESSION["cid"]), SQLSRV_PARAM_IN), array($winid, SQLSRV_PARAM_IN), array("" . $winname, SQLSRV_PARAM_IN), array("" . $winver, SQLSRV_PARAM_IN), array("" . $windesc, SQLSRV_PARAM_IN));
sp_execute("{call web_set_sales_win(?,?,?,?,?)}", $params);
$status = "ok";
$info = $name;
} else {
if ($action == "set_canteen_allow_order") {
$params = array(array(intval($_SESSION["cid"]), SQLSRV_PARAM_IN), array(intval($_REQUEST["orden"]), SQLSRV_PARAM_IN));
sp_execute("{call web_set_canteen_sale_state(?,?)}", $params);
$status = "ok";
$info = "成功";
}
}
}
}
}