本文整理汇总了PHP中last_id函数的典型用法代码示例。如果您正苦于以下问题:PHP last_id函数的具体用法?PHP last_id怎么用?PHP last_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了last_id函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
function create($inner = false)
{
$data = array();
$pass = s(t(v('password')));
$pri = s(t(v('prifold')));
$stat = get_var("select 1 from users where username='" . $this->name . "'");
if (!$stat && $this->name) {
if ($pri == 'open') {
include_once AROOT . 'controller' . DS . 'api_admin_folder.class.php';
$folder = new api_admin_folderController($this->name);
$rs = $folder->create(true, 'private');
}
$digest = md5($this->name . ':' . 'SabreDAV' . ':' . $pass);
$sql = "insert into users (username,password,digesta1) values ('" . $this->name . "','" . $pass . "','" . $digest . "')";
$db = run_sql($sql);
if ($db) {
$data['code'] = 0;
$data['data'][] = array('id' => last_id(), 'username' => $this->name, 'password' => $pass);
}
} else {
$data['code'] = 301;
$data['message'] = 'user exesit';
}
if ($inner) {
return json_encode($data);
} else {
render($data, 'rest');
}
}
示例2: process_transaction
function process_transaction()
{
if (isset($_GET['tx'])) {
$amount = $_GET['amt'];
$currency = $_GET['cc'];
$transaction = $_GET['tx'];
$status = $_GET['st'];
$total = 0;
$item_quantity = 0;
$send_order = query("INSERT INTO orders (order_amount, order_transaction, order_currency, order_status,order_user_id ) VALUES('{$amount}', '{$transaction}','{$currency}','{$status}','{$_SESSION['user_id']}')");
$last_id = last_id();
confirm($send_order);
foreach ($_SESSION as $name => $value) {
if ($value > 0) {
if (substr($name, 0, 8) == "product_") {
$length = strlen($name - 8);
$id = sanitize(substr($name, 8, $length));
$query = query("SELECT * FROM products WHERE p_id = {$id}");
confirm($query);
while ($row = fetch_array($query)) {
$pprice = $row['pprice'];
$sub = $row['pprice'] * $value;
$pprice = $row['pprice'];
$item_quantity += $value;
$srt = strtoupper(str_replace("_", " ", "{$row['pname']}"));
$new_quant = $row['pquant'] - $value;
$update_product_quant = query("UPDATE products SET pquant = '{$new_quant}' WHERE p_id = {$id} ");
confirm($update_product_quant);
$insert_report = query("INSERT INTO reports (p_id,order_id,pname, pprice, pquant,report_user_id) VALUES('{$id}','{$last_id}','{$srt}','{$pprice}','{$value}','{$_SESSION['user_id']}')");
confirm($insert_report);
}
$total += $sub;
$item_quantity;
}
}
}
} else {
//redirectjava('/');
}
}
示例3: teilnahme_einzugsverfahren_eingeben
function teilnahme_einzugsverfahren_eingeben($mv_id, $konto_inh, $konto_nr, $blz, $bankname, $art, $ja_nein)
{
// echo "<h1>JA NEIN $ja_nein</h1>";
/* Einzugsermächtigung */
$last_id = last_id('DETAIL');
$last_id = $last_id + 1;
$db_abfrage = "INSERT INTO DETAIL VALUES (NULL, '{$last_id}', 'Einzugsermächtigung', '{$ja_nein}', '', '1', 'MIETVERTRAG', '{$mv_id}')";
$resultat = mysql_query($db_abfrage) or die(mysql_error());
$last_dat = mysql_insert_id();
protokollieren('DETAIL', $last_dat, '0');
/* Einzugsart */
$last_id = last_id('DETAIL');
$last_id = $last_id + 1;
$db_abfrage = "INSERT INTO DETAIL VALUES (NULL, '{$last_id}', 'Autoeinzugsart', '{$art}', '', '1', 'MIETVERTRAG', '{$mv_id}')";
$resultat = mysql_query($db_abfrage) or die(mysql_error());
$last_dat = mysql_insert_id();
protokollieren('DETAIL', $last_dat, '0');
/* Kontoinhaber-AutoEinzug */
$last_id = last_id('DETAIL');
$last_id = $last_id + 1;
$db_abfrage = "INSERT INTO DETAIL VALUES (NULL, '{$last_id}', 'Kontoinhaber-AutoEinzug', '{$konto_inh}', '', '1', 'MIETVERTRAG', '{$mv_id}')";
$resultat = mysql_query($db_abfrage) or die(mysql_error());
$last_dat = mysql_insert_id();
protokollieren('DETAIL', $last_dat, '0');
/* Kontonummer-AutoEinzug */
$last_id = last_id('DETAIL');
$last_id = $last_id + 1;
$db_abfrage = "INSERT INTO DETAIL VALUES (NULL, '{$last_id}', 'Kontonummer-AutoEinzug', '{$konto_nr}', '', '1', 'MIETVERTRAG', '{$mv_id}')";
$resultat = mysql_query($db_abfrage) or die(mysql_error());
$last_dat = mysql_insert_id();
protokollieren('DETAIL', $last_dat, '0');
/* BLZ-AutoEinzug */
$last_id = last_id('DETAIL');
$last_id = $last_id + 1;
$db_abfrage = "INSERT INTO DETAIL VALUES (NULL, '{$last_id}', 'BLZ-AutoEinzug', '{$blz}', '', '1', 'MIETVERTRAG', '{$mv_id}')";
$resultat = mysql_query($db_abfrage) or die(mysql_error());
$last_dat = mysql_insert_id();
protokollieren('DETAIL', $last_dat, '0');
/* Bankname-AutoEinzug */
$last_id = last_id('DETAIL');
$last_id = $last_id + 1;
$db_abfrage = "INSERT INTO DETAIL VALUES (NULL, '{$last_id}', 'Bankname-AutoEinzug', '{$bankname}', '', '1', 'MIETVERTRAG', '{$mv_id}')";
$resultat = mysql_query($db_abfrage) or die(mysql_error());
$last_dat = mysql_insert_id();
protokollieren('DETAIL', $last_dat, '0');
echo "Teilnahme am Lastschriftverfahren wurde vermerkt";
}
示例4: add_products
function add_products()
{
if (isset($_POST['publish'])) {
global $upload_directory;
$product_title = escape_string($_POST['product_title']);
$product_category_id = escape_string($_POST['product_category_id']);
$product_price = escape_string($_POST['product_price']);
$product_description = escape_string($_POST['product_description']);
$short_desc = escape_string($_POST['short_desc']);
$product_quantity = escape_string($_POST['product_quantity']);
$product_image = escape_string($_FILES['file']['name']);
$image_temp_location = stripslashes(escape_string($_FILES['file']['tmp_name']));
/*if (!move_uploaded_file($image_temp_location, UPLOAD_DIRECTORY . DS . $product_image)){
echo "エラー:".$_FILES['file']['error']."<br>";
exit;
}else{
echo "ファイル".$_FILES['file']['name']."アップロードされました.";
}*/
move_uploaded_file($image_temp_location, UPLOAD_DIRECTORY . DS . $product_image);
$query = query("INSERT INTO products(\n\t\t\t\t\t\t\t\t\t\tproduct_title,\n\t\t\t\t\t\t\t\t\t\tproduct_category_id, \n\t\t\t\t\t\t\t\t\t\tproduct_price, \n\t\t\t\t\t\t\t\t\t\tproduct_description, \n\t\t\t\t\t\t\t\t\t\tshort_desc, \n\t\t\t\t\t\t\t\t\t\tproduct_quantity, \n\t\t\t\t\t\t\t\t\t\tproduct_image\n\t\t\t\t\t\t\t\t\t) \n\t\t\t\t\t\t\t VALUES(\n\t\t\t\t\t\t\t\t\t\t'{$product_title}',\n\t\t\t\t\t\t\t\t\t\t'{$product_category_id}', \n\t\t\t\t\t\t\t\t\t\t'{$product_price}', \n\t\t\t\t\t\t\t\t\t\t'{$product_description}', \n\t\t\t\t\t\t\t\t\t\t'{$short_desc}', \n\t\t\t\t\t\t\t\t\t\t'{$product_quantity}', \n\t\t\t\t\t\t\t\t\t\t'{$product_image}'\n\t\t\t\t\t\t\t\t\t)");
$last_id = last_id();
confirm($query);
set_message("{$last_id} 番の新商品 {$product_title} を追加しました!");
redirect("index.php?products&p=0");
}
/*print_r($_FILES);*/
}
示例5: insert_geldbuchung
function insert_geldbuchung($geldkonto_id, $buchungskonto, $auszugsnr, $rechnungsnr, $v_zweck, $datum, $kostentraeger_typ, $kostentraeger_id, $betrag, $mwst_anteil = '0.00')
{
$last_id = last_id('GELD_KONTO_BUCHUNGEN');
$last_id = $last_id + 1;
/* neu */
$datum_arr = explode('-', $datum);
$jahr = $datum_arr['0'];
$b = new buchen();
$g_buchungsnummer = $b->get_last_buchungsnummer_konto($geldkonto_id, $jahr);
$g_buchungsnummer = $g_buchungsnummer + 1;
mysql_query("INSERT INTO GELD_KONTO_BUCHUNGEN VALUES(NULL, '{$last_id}', '{$g_buchungsnummer}', '{$auszugsnr}', '{$rechnungsnr}', '{$betrag}', '{$mwst_anteil}', '{$v_zweck}', '{$geldkonto_id}', '{$buchungskonto}', '{$datum}', '{$kostentraeger_typ}', '{$kostentraeger_id}', '1')");
/* Protokollieren */
$last_dat = mysql_insert_id();
protokollieren('GELD_KONTO_BUCHUNGEN', $last_dat, '0');
}
示例6: mietdefinition_zu_details
function mietdefinition_zu_details()
{
// $daten_arr = $this->alle_letzten_kaltmieten_arr();
// print_r($daten_arr);
// $daten_arr = $this->alle_letzten_nebenkosten_arr();
// $daten_arr = $this->alle_letzten_heizkosten_arr();
for ($a = 0; $a < count($daten_arr); $a++) {
$anfang = $daten_arr[$a]['ANFANG'];
$ende = $daten_arr[$a]['ENDE'];
$einheit_id = $daten_arr[$a]['EINHEIT_ID'];
$einheit_kurzname = $daten_arr[$a]['EINHEIT_KURZNAME'];
$kosten_kat = $daten_arr[$a]['KOSTENKATEGORIE'];
$einheit_betrag = $daten_arr[$a]['BETRAG'];
$last_detail_id = last_id('DETAIL');
$last_detail_id = $last_detail_id + 1;
$sql = "INSERT INTO DETAIL VALUES(NULL, '{$last_detail_id}', '{$kosten_kat}', '{$einheit_betrag}', '{$einheit_kurzname} {$anfang} bis {$ende}', '1', 'EINHEIT','{$einheit_id}')";
echo " '{$last_detail_id}', '{$kosten_kat}', '{$einheit_betrag}', '{$einheit_kurzname} {$anfang} bis {$ende}', '1', 'EINHEIT','{$einheit_id}'<br>";
// $resultat = mysql_query($sql) or
die(mysql_error());
/* Zugewiesene MIETBUCHUNG_DAT auslesen */
$last_dat = mysql_insert_id();
protokollieren('DETAIL', $last_dat, '0');
}
}
示例7: publish_feed
function publish_feed($content, $uid, $type = 0, $tid = 0)
{
if (is_mobile_request()) {
$device = 'mobile';
} else {
$device = 'web';
}
$tid = intval($tid);
if ($type == 2 && $tid > 0) {
$comment_count = get_var("SELECT COUNT(*) FROM `todo_history` WHERE `tid` = '" . intval($tid) . "' AND `type` = 2 ", db());
} else {
$comment_count = 0;
}
$sql = "INSERT INTO `feed` ( `content` , `tid` , `uid` , `type` ,`timeline` , `device` , `comment_count` ) VALUES ( '" . s($content) . "' , '" . intval($tid) . "', '" . intval($uid) . "' , '" . intval($type) . "' , NOW() , '" . s($device) . "' , '" . intval($comment_count) . "' )";
run_sql($sql);
$lid = last_id();
if (db_errno() != 0) {
return false;
} else {
if ($comment_count > 0 && $type == 2 && $tid > 0) {
$sql = "UPDATE `feed` SET `comment_count` = '" . intval($comment_count) . "' WHERE `tid` = '" . intval($tid) . "' AND `comment_count` != '" . intval($comment_count) . "' ";
run_sql($sql);
}
return $lid;
}
}
示例8: feed_add_comment
/**
* 为Feed添加评论
*
*
* @param string token , 必填
* @param string fid - 必填
* @param string text - 必填
* @return feed array
* @author EasyChen
*/
public function feed_add_comment($text = false, $fid = false)
{
if (!$text) {
$content = $text = z(t(v('text')));
}
if (!not_empty($content)) {
return self::send_error(LR_API_ARGS_ERROR, __('INPUT_CHECK_BAD_ARGS', 'TEXT'));
}
if (!$fid) {
$fid = intval(v('fid'));
}
if (intval($fid) < 1) {
return self::send_error(LR_API_ARGS_ERROR, __('INPUT_CHECK_BAD_ARGS', 'FID'));
}
$finfo = get_line("SELECT * FROM `feed` WHERE `id` = '" . intval($fid) . "' LIMIT 1");
if (is_mobile_request()) {
$device = 'mobile';
} else {
$device = 'web';
}
$sql = "INSERT INTO `comment` ( `fid` , `uid` , `content` , `timeline` , `device` ) \n\t\tVALUES ( '" . intval($fid) . "' , '" . intval($_SESSION['uid']) . "' , '" . s($content) . "' , NOW() , '" . s($device) . "' ) ";
run_sql($sql);
if (db_errno() != 0) {
return self::send_error(LR_API_DB_ERROR, __('API_MESSAGE_DATABASE_ERROR') . mysql_error());
} else {
$lid = last_id();
// feed表comment_count计数增加
$count = get_var("SELECT COUNT(*) FROM `comment` WHERE `fid` = '" . intval($fid) . "' ", db());
$sql = "UPDATE `feed` SET `comment_count` = '" . intval($count) . "' WHERE `id` = '" . intval($fid) . "' LIMIT 1";
run_sql($sql);
// 向Feed作者发通知
if ($finfo['uid'] != uid()) {
send_notice($finfo['uid'], __('API_TEXT_COMMENT_FEED_OWNED', array(uname(), $finfo['content'], $content)), 2, array('fid' => intval($fid), 'count' => $count));
}
// 向参与了该Feed讨论的同学发送通知
$sql = "SELECT `uid` FROM `comment` WHERE `fid`= '" . intval($fid) . "' ";
if ($uitems = get_data($sql)) {
foreach ($uitems as $uitem) {
if ($uitem['uid'] != uid() && $uitem['uid'] != $finfo['uid']) {
$myuids[] = $uitem['uid'];
}
}
}
if (isset($myuids)) {
$myuids = array_unique($myuids);
foreach ($myuids as $muid) {
send_notice($muid, __('API_TEXT_COMMENT_FEED_IN', array(uname(), $finfo['content'], $content)), 2, array('fid' => intval($fid), 'count' => $count));
}
}
// 向被@的同学,发送通知
if ($ats = find_at($content)) {
$sql = "SELECT `id` FROM `user` WHERE ";
foreach ($ats as $at) {
$at = z(t($at));
if ($gname = get_group_names()) {
if (in_array(strtoupper($at), $gname)) {
if ($ndata = get_group_unames($at)) {
foreach ($ndata as $nname) {
$names[] = $nname;
}
}
} else {
$names[] = $at;
}
} else {
$names[] = $at;
}
}
foreach ($names as $at) {
$at = z(t($at));
if (mb_strlen($at, 'UTF-8') < 2) {
continue;
}
$wsql[] = " `name` = '" . s(t($at)) . "' ";
if (c('at_short_name')) {
if (mb_strlen($at, 'UTF-8') == 2) {
$wsql[] = " `name` LIKE '_" . s($at) . "' ";
}
}
}
if (isset($wsql) && is_array($wsql)) {
$sql = $sql . join(' OR ', $wsql);
if ($udata = get_data($sql)) {
foreach ($udata as $uitem) {
$myuids[] = $uitem['id'];
}
if (isset($myuids) && is_array($myuids)) {
$myuids = array_unique($myuids);
foreach ($myuids as $muid) {
if ($muid != uid() && $muid != $finfo['uid']) {
//.........这里部分代码省略.........
示例9: index
public function index()
{
//print_r( $_REQUEST );
$table = z(t(v('_table')));
$action = z(t(v('_interface')));
if (strlen($table) < 1 || strlen($action) < 1) {
return $this->send_error(LR_API_ARGS_ERROR, 'BAD ARGS');
}
// user define code
if ($my_code = get_var("SELECT `code` FROM `__meta_code` WHERE `table` = '" . s($table) . "' AND `action` = '" . s($action) . "' LIMIT 1")) {
return eval($my_code);
exit;
}
// check table
$tables = get_table_list(db());
if (!in_array($table, $tables)) {
return $this->send_error(LR_API_ARGS_ERROR, 'TABLE NOT EXISTS');
}
if ($table == c('token_table_name') && $action == 'get_token') {
return $this->get_token();
}
$fields = get_fields($table);
$kv = new SaeKV();
$kv->init();
$ainfo = unserialize($kv->get('msetting_' . $table . '_' . $action));
$in_code = $kv->get('iosetting_input_' . $table . '_' . $action);
$out_code = $kv->get('iosetting_output_' . $table . '_' . $action);
// run user defined input fliter
if (strlen($in_code) > 0) {
eval($in_code);
}
if ($ainfo['on'] != 1) {
return $this->send_error(LR_API_ARGS_ERROR, 'API NOT AVAILABLE');
}
if ($ainfo['public'] != 1) {
$this->check_token();
}
$requires = array();
$inputs = array();
$outs = array();
$likes = array();
$equal = array();
foreach ($fields as $field) {
$finfo = unserialize($kv->get('msetting_' . $table . '_' . $action . '_' . $field));
if ($finfo['required'] == 1) {
$requires[] = $field;
}
if ($finfo['input'] == 1) {
$inputs[] = $field;
}
if ($finfo['output'] == 1) {
$outputs[] = $field;
}
if ($finfo['like'] == 1) {
$likes[] = $field;
}
if ($finfo['equal'] == 1) {
$equals[] = $field;
}
}
// check require
if (count($requires) > 0) {
foreach ($requires as $require) {
if (strlen(v($require)) < 1) {
return $this->send_error(LR_API_ARGS_ERROR, z(t($require)) . ' FIELD REQUIRED');
}
}
}
// build sql
switch ($action) {
case 'insert':
if (count($inputs) < 1) {
$this->send_error(LR_API_ARGS_ERROR, 'INPUT MUST HAS 1 FIELD AT LEAST');
}
if (count($outputs) < 1) {
$this->send_error(LR_API_ARGS_ERROR, 'OUTPUT MUST HAS 1 FIELD AT LEAST');
}
foreach ($inputs as $input) {
$dsql[] = "'" . s(v($input)) . "'";
}
$sql = "INSERT INTO `" . s($table) . "` ( " . rjoin(' , ', '`', $inputs) . " ) VALUES ( " . join(' , ', $dsql) . " )";
//echo $sql;
run_sql($sql);
if (mysql_errno() != 0) {
$this->send_error(LR_API_DB_ERROR, 'DATABASE ERROR ' . mysql_error());
}
$lid = last_id();
if ($lid < 1) {
$this->send_error(LR_API_DB_ERROR, 'DATABASE ERROR ' . mysql_error());
}
if (!($data = get_data("SELECT " . rjoin(' , ', '`', $outputs) . " FROM `" . s($table) . "` WHERE `id` = '" . intval($lid) . "'", db()))) {
$this->send_error(LR_API_DB_ERROR, 'DATABASE ERROR ' . mysql_error());
} else {
if (strlen($out_code) > 0) {
eval($out_code);
}
$this->send_result($data);
}
break;
case 'update':
//.........这里部分代码省略.........
示例10: insert_geldbuchung
function insert_geldbuchung($geldkonto_id, $buchungskonto, $auszugsnr, $rechnungsnr, $v_zweck, $datum, $kostentraeger_typ, $kostentraeger_id, $betrag)
{
$last_id = last_id('GELD_KONTO_BUCHUNGEN');
$last_id = $last_id + 1;
mysql_query("INSERT INTO GELD_KONTO_BUCHUNGEN VALUES(NULL, '{$last_id}', '{$auszugsnr}', '{$rechnungsnr}', '{$betrag}', '{$v_zweck}', '{$geldkonto_id}', '{$buchungskonto}', '{$datum}', '{$kostentraeger_typ}', '{$kostentraeger_id}', '1')");
// echo "'$last_id', '$auszugsnr', '$betrag', '$v_zweck', '$geldkonto_id', '$buchungskonto', '$datum', '$kostentraeger_typ', '$kostentraeger_id' <b>1</b><br>";
}
示例11: add_product
function add_product()
{
if (isset($_POST['publish']) && empty($_POST['publish']) === false) {
$product_title = escape_string($_POST['product_title']);
$srt = str_replace(" ", "_", "{$product_title}");
$product_category_id = escape_string($_POST['product_category_id']);
$product_price = escape_string($_POST['product_price']);
$product_description = escape_string($_POST['product_description']);
$product_quantity = escape_string($_POST['product_quantity']);
$product_image = escape_string($_FILES['file']['name']);
$image_temp_location = $_FILES['file']['tmp_name'];
$uploads_dir = uploads_dir($product_category_id);
$uploads_dirs = $uploads_dir . $product_image;
move_uploaded_file($image_temp_location, $uploads_dirs);
$query = query("INSERT INTO products(pname, product_cat_id, pprice, pdesc, pquant, pimage) VALUES('{$srt}', '{$product_category_id}', '{$product_price}', '{$product_description}', '{$product_quantity}', '{$uploads_dirs}')");
$last_id = last_id();
confirm($query);
set_message("New Product was Added <a href=" . $product_title . " target=\"_blank\">View Product</a>");
}
}
示例12: board_list_add
function board_list_add()
{
$board_id = intval(v('board_id'));
$name = s(z(t(v('name'))));
if (!has_board_permission_by_id($board_id)) {
return apiController::send_error(6007, 'no permission');
}
if (!run_sql("insert into board_list(name,board_id) values('{$name}','{$board_id}')")) {
return apiController::send_error(6008, 'add list failed');
} else {
return apiController::send_result(last_id());
}
}
示例13: process_transaction
function process_transaction()
{
global $conn;
if (isset($_GET['tx'])) {
$amount = $_GET['amt'];
$currency = $_GET['cc'];
$transaction = $_GET['tx'];
$status = $_GET['st'];
$order_date = date("Y-m-d");
$order_time = date("H:i:s");
$report_date = date("Y-m-d");
$report_time = date("H:i:s");
$total = 0;
$item_quantity = 0;
$price = 0;
foreach ($_SESSION as $name => $value) {
if ($value > 0) {
if (substr($name, 0, 8) == "product_") {
$length = strlen($name - 8);
$id = substr($name, 8, $length);
$send_order = query("INSERT INTO orders (order_amount, order_transaction, order_status, order_currency, order_date, order_time) \n\t\t\t\t\t\t\t\t\t\tVALUES ('{$amount}','{$transaction}','{$status}','{$currency}','{$order_date}','{$order_time}')");
$last_id = last_id();
confirm($send_order);
$query = query("SELECT * FROM products WHERE product_id=" . escape_string($id) . " ");
confirm($query);
while ($row = fetch_array($query)) {
$product_title = $row['product_title'];
$product_price = $row['product_price'];
$price = number_format($product_price);
$product_sub = $row['product_price'] * $value;
$sub = number_format($product_sub);
$item_quantity += $value;
$insert_report = query("INSERT INTO reports (product_id, order_id, product_title, product_price, product_quantity, report_date, report_time) \n\t\t\t\t\t\t\t\t\t\t\t\tVALUES ('{$id}','{$last_id}','{$product_title}','{$product_price}','{$value}','{$report_date}','{$report_time}')");
confirm($insert_report);
/*111111*/
$new_quantity = $row['product_quantity'] - $value;
$product_query = query("UPDATE products SET product_quantity = '{$new_quantity}' WHERE product_id=" . $row['product_id'] . " ");
confirm($product_query);
/*1111111*/
}
number_format($total += $product_sub);
/*echo $item_quantity;*/
}
}
}
session_destroy();
} else {
redirect("../index.php");
}
}
示例14: top
<?php
include_once "util/top_foot_inc.php";
//include ("includes/caching.php");
//include ("includes/versetto.php");
top();
$data = <<<EOD
<br><br><br><br>
<div class="testo_18" style="position:static;margin:auto;width:450px;" >
EOD;
echo $data;
$data = addslashes(trim($_POST['omg']));
$ip = $_SERVER["REMOTE_ADDR"];
$sql = "INSERT INTO `聖書`.`request` (`testo`,`ip`) VALUES ('{$data}','{$ip}');";
mysql_queryconerror($sql, $db);
$rif = last_id();
echo "Richiesta inserita con riferimento {$rif} <br> Grazie della collaborazione </div> <br><br><br><br>";
foot();
示例15: api_checklist_add
function api_checklist_add()
{
$content = z(t(v('text')));
if (!not_empty($content)) {
return apiController::send_error(LR_API_ARGS_ERROR, 'TEXT CAN\'T EMPTY');
}
$tid = intval(v('tid'));
if (intval($tid) < 1) {
return apiController::send_error(LR_API_ARGS_ERROR, 'TID NOT EXISTS');
}
// check user
$tinfo = get_todo_info_by_id($tid);
if (intval($tinfo['details']['is_public']) == 0 && uid() != $tinfo['owner_uid']) {
return apiController::send_error(LR_API_FORBIDDEN, 'ONLY PUBLIC TODO CAN ADD CHECKLIST BY OTHERS');
}
$sql = "INSERT INTO `checklist` ( `tid` , `title` , `content` , `timeline` , `uid` ) VALUES ( '" . intval($tid) . "' , '" . s($content) . "' , '" . s($content) . "' , NOW() , '" . intval(uid()) . "' ) ";
run_sql($sql);
if (db_errno() != 0) {
return apiController::send_error(LR_API_DB_ERROR, 'DATABASE ERROR ' . mysql_error());
} else {
return apiController::send_result(get_line("SELECT * FROM `checklist` WHERE `id` = '" . intval(last_id()) . "' LIMIT 1", db()));
}
}