本文整理汇总了PHP中Sesion::get_user_id方法的典型用法代码示例。如果您正苦于以下问题:PHP Sesion::get_user_id方法的具体用法?PHP Sesion::get_user_id怎么用?PHP Sesion::get_user_id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sesion
的用法示例。
在下文中一共展示了Sesion::get_user_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Sesion
<?php
if (!isset($_REQUEST['proveedor']) || $_REQUEST['proveedor'] < 1 || !isset($_REQUEST['codigo']) || $_REQUEST['codigo'] < 1 || !isset($_REQUEST['monto']) || $_REQUEST['monto'] <= 0 || !isset($_REQUEST['fondo']) || $_REQUEST['fondo'] < 1) {
$action_message = "Debe ingresar todos los datos de la operación!";
return;
}
include_once 'include/sesion.php';
$sesion = new Sesion();
$query = "UPDATE compras SET saldo = (saldo - " . $_REQUEST['monto'] . ") WHERE codigo = " . $_REQUEST['codigo'];
if (!mysql_query($query)) {
$action_message = mysql_error();
return;
}
$query = "UPDATE fondos SET saldo = (saldo - " . $_REQUEST['monto'] . ") WHERE codigo = " . $_REQUEST['fondo'];
if (!mysql_query($query)) {
$action_message = mysql_error();
return;
}
$query = "\n UPDATE\n proveedores\n SET\n saldo = (saldo - " . $_REQUEST['monto'] . ")\n WHERE\n codigo = " . $_REQUEST['proveedor'];
if (!mysql_query($query)) {
$action_message = mysql_error();
return;
}
$query = "INSERT INTO pagos (\n fecha, \n proveedor, \n usuario, \n operacion, \n fondo, \n monto\n ) VALUES (\n NOW(),\n " . $_REQUEST['proveedor'] . ",\n " . $sesion->get_user_id() . ",\n " . $_REQUEST['codigo'] . ",\n " . $_REQUEST['fondo'] . ",\n " . $_REQUEST['monto'] . "\n )";
if (!mysql_query($query)) {
$action_message = mysql_error();
return;
}
$action_message = "Se ha registrado el pago!";