本文整理汇总了PHP中simple_get_lastid函数的典型用法代码示例。如果您正苦于以下问题:PHP simple_get_lastid函数的具体用法?PHP simple_get_lastid怎么用?PHP simple_get_lastid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了simple_get_lastid函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bs_FilePush
function bs_FilePush($filename, $rawdata)
{
$filename = vf($filename);
$rawdata = mysql_real_escape_string($rawdata);
$query = "INSERT INTO `bankstaraw` (\n `id` ,\n `filename` ,\n `rawdata`\n )\n VALUES (\n NULL , '" . $filename . "', '" . $rawdata . "'\n );\n ";
nr_query($query);
$lastid = simple_get_lastid('bankstaraw');
return $lastid;
}
示例2: stg_add_tagtype
/**
* Creates new tag type in database
*
* @return void
*/
function stg_add_tagtype()
{
$color = mysql_real_escape_string($_POST['newcolor']);
$size = vf($_POST['newpriority'], 3);
$text = mysql_real_escape_string($_POST['newtext']);
$query = "INSERT INTO `tagtypes` (`id` ,`tagcolor` ,`tagsize` ,`tagname`) VALUES (NULL , '" . $color . "', '" . $size . "', '" . $text . "');";
nr_query($query);
$newId = simple_get_lastid('tagtypes');
log_register('TAGTYPE ADD `' . $text . '` [' . $newId . ']');
}
示例3: create
public function create($public, $type, $title, $text)
{
$public = vf($public, 3);
$type = vf($type);
$title = mysql_real_escape_string($title);
$text = mysql_real_escape_string($text);
$query = "INSERT INTO `zbsannouncements` (`id`,`public`,`type`,`title`,`text`) VALUES\n (NULL, '" . $public . "', '" . $type . "', '" . $title . "', '" . $text . "'); ";
nr_query($query);
$newId = simple_get_lastid('zbsannouncements');
log_register("ANNOUNCEMENT CREATE [" . $newId . "]");
return $newId;
}
示例4: ms_MassSendMessage
function ms_MassSendMessage($users_arr, $message)
{
global $alter_conf;
if (!empty($users_arr)) {
foreach ($users_arr as $eachuser) {
if (!$alter_conf['MASSSEND_SAFE']) {
ms_SendMessage($eachuser, $message);
} else {
ms_TicketCreate('NULL', $eachuser, $message, 'NULL', whoami());
$newid = simple_get_lastid('ticketing');
ms_TicketSetDone($newid);
}
}
log_register("MASSEND (" . sizeof($users_arr) . ")");
}
}
示例5: ts_CreateTask
$altCfg = $ubillingConfig->getAlter();
//if someone creates new task
if (isset($_POST['createtask'])) {
if (wf_CheckPost(array('newstartdate', 'newtaskaddress', 'newtaskphone'))) {
if (wf_CheckPost(array('typicalnote'))) {
$newjobnote = $_POST['typicalnote'] . ' ' . $_POST['newjobnote'];
} else {
$newjobnote = $_POST['newjobnote'];
}
//date validyty check
if (zb_checkDate($_POST['newstartdate'])) {
ts_CreateTask($_POST['newstartdate'], @$_POST['newstarttime'], $_POST['newtaskaddress'], @$_POST['newtasklogin'], $_POST['newtaskphone'], $_POST['newtaskjobtype'], $_POST['newtaskemployee'], $newjobnote);
if (!isset($_GET['gotolastid'])) {
rcms_redirect("?module=taskman");
} else {
$lasttaskid = simple_get_lastid('taskman');
rcms_redirect("?module=taskman&edittask=" . $lasttaskid);
}
} else {
show_error(__('Wrong date format'));
}
} else {
show_error(__('All fields marked with an asterisk are mandatory'));
}
}
//modify task sub
if (isset($_POST['modifytask'])) {
if (wf_CheckPost(array('modifystartdate', 'modifytaskaddress', 'modifytaskphone'))) {
if (zb_checkDate($_POST['modifystartdate'])) {
$taskid = $_POST['modifytask'];
ts_ModifyTask($taskid, $_POST['modifystartdate'], $_POST['modifystarttime'], $_POST['modifytaskaddress'], @$_POST['modifytasklogin'], $_POST['modifytaskphone'], $_POST['modifytaskjobtype'], $_POST['modifytaskemployee'], $_POST['modifytaskjobnote']);
示例6: poolCreate
/**
* Creates new address pool in database
*
* @param ...
*
*
* @return void
*/
public function poolCreate($netid, $pool, $netmask, $vlan)
{
$netid = vf($netid, 3);
$pool = mysql_real_escape_string($pool);
$netmask = vf($netmask);
$vlan = vf($vlan, 3);
$query = "INSERT INTO `netextpools` (`id`, `netid`, `pool`, `netmask`, `gw`, `clientip`, `broadcast`, `vlan`, `login`) " . "VALUES (NULL, '" . $netid . "', '" . $pool . "', '" . $netmask . "', NULL, NULL, NULL, '" . $vlan . "', NULL);";
nr_query($query);
$newPoolId = simple_get_lastid('netextpools');
log_register("POOL CREATE [" . $newPoolId . "] `" . $pool . "/" . $netmask . "`");
$newGw = int2ip(ip2int($pool) + 1);
$newBroadcast = int2ip(ip2int($pool) + ($this->cidrOffsets[$netmask] - 1));
simple_update_field('netextpools', 'gw', $newGw, "WHERE `id`='" . $newPoolId . "';");
simple_update_field('netextpools', 'broadcast', $newBroadcast, "WHERE `id`='" . $newPoolId . "';");
//creating ips list for pool
$newIpsStart = int2ip(ip2int($newGw) + 1);
$newIpsEnd = int2ip(ip2int($newBroadcast) - 1);
$this->ipsCreate($newPoolId, $newIpsStart, $newIpsEnd);
}
示例7: onuCreate
/**
* Creates new ONU in database and returns it Id or 0 if action fails
*
* @param int $onumodelid
* @param int $oltid
* @param string $ip
* @param string $mac
* @param string $serial
* @param string $login
*
* @return int
*/
public function onuCreate($onumodelid, $oltid, $ip, $mac, $serial, $login)
{
$mac = strtolower($mac);
$mac = trim($mac);
$onumodelid = vf($onumodelid, 3);
$oltid = vf($oltid, 3);
$ip = mysql_real_escape_string($ip);
$macRaw = $mac;
$mac = mysql_real_escape_string($mac);
$serial = mysql_real_escape_string($serial);
$login = mysql_real_escape_string($login);
$login = trim($login);
$result = 0;
if (!empty($mac)) {
if (check_mac_format($mac)) {
if ($this->checkMacUnique($mac)) {
$query = "INSERT INTO `pononu` (`id`, `onumodelid`, `oltid`, `ip`, `mac`, `serial`, `login`) " . "VALUES (NULL, '" . $onumodelid . "', '" . $oltid . "', '" . $ip . "', '" . $mac . "', '" . $serial . "', '" . $login . "');";
nr_query($query);
$result = simple_get_lastid('pononu');
log_register('PON CREATE ONU [' . $result . '] MAC `' . $macRaw . '`');
} else {
log_register('PON MACDUPLICATE TRY `' . $macRaw . '`');
}
} else {
log_register('PON MACINVALID TRY `' . $macRaw . '`');
}
}
return $result;
}
示例8: outcomingCreate
/**
* Creates new outcoming operation record in database
*
* @param string $date
* @param string $desttype
* @param string $destparam
* @param int $storageid
* @param int $itemtypeid
* @param float $count
* @param float $price
* @param string $notes
*
* @return string not emplty if something went wrong
*/
public function outcomingCreate($date, $desttype, $destparam, $storageid, $itemtypeid, $count, $price = '', $notes = '')
{
$result = '';
$date = mysql_real_escape_string($date);
$desttype = mysql_real_escape_string($desttype);
$destparam = mysql_real_escape_string($destparam);
$storageid = vf($storageid, 3);
$itemtypeid = vf($itemtypeid, 3);
$countF = mysql_real_escape_string($count);
$countF = str_replace('-', '', $countF);
$countF = str_replace(',', '.', $countF);
$priceF = mysql_real_escape_string($price);
$priceF = str_replace(',', '.', $priceF);
$notes = mysql_real_escape_string($notes);
if (isset($this->allStorages[$storageid])) {
if (isset($this->allItemTypes[$itemtypeid])) {
$allItemRemains = $this->remainsOnStorage($storageid);
@($itemRemains = $allItemRemains[$itemtypeid]);
$itemsReserved = $this->reserveGet($storageid, $itemtypeid);
$realRemains = $itemRemains - $itemsReserved;
if ($countF <= $realRemains) {
$query = "INSERT INTO `wh_out` (`id`,`date`,`desttype`,`destparam`,`storageid`,`itemtypeid`,`count`,`price`,`notes`) VALUES " . "(NULL,'" . $date . "','" . $desttype . "','" . $destparam . "','" . $storageid . "','" . $itemtypeid . "','" . $countF . "','" . $priceF . "','" . $notes . "')";
nr_query($query);
$newId = simple_get_lastid('wh_out');
log_register('WAREHOUSE OUTCOME CREATE [' . $newId . '] ITEM [' . $itemtypeid . '] COUNT `' . $count . '` PRICE `' . $price . '`');
if ($desttype == 'storage') {
$this->incomingCreate($date, $itemtypeid, 0, $destparam, $count, $price, '', __('from') . ' ' . __('Warehouse storage') . ' `' . $this->allStorages[$storageid] . '`');
}
} else {
$result = $this->messages->getStyledMessage(__('The balance of goods and materials in stock is less than the amount') . ' (' . $countF . ' > ' . $itemRemains . '-' . $itemsReserved . ')', 'error');
}
} else {
$result = $this->messages->getStyledMessage(__('Strange exeption') . ' EX_WRONG_ITEMTYPE_ID', 'error');
}
} else {
$result = $this->messages->getStyledMessage(__('Strange exeption') . ' EX_WRONG_STORAGE_ID', 'error');
}
return $result;
}
示例9: logResult
private function logResult()
{
$resultStatus = $this->getResult('result');
$resultStatusCode = $this->getResult('resultCode');
$resultComment = $this->getResult('resultComment');
switch ($resultStatusCode) {
case 1:
$resultComment = 'запрос обработан успешно';
break;
case 0:
$resultComment = 'запрос обрабатывается';
break;
case -1:
$resultComment = 'неверный алгоритм ЭП';
break;
case -2:
$resultComment = 'неверный формат ЭП';
break;
case -3:
$resultComment = 'недействительный сертификат ЭП';
break;
case -4:
$resultComment = 'некорректное значение ЭП';
break;
case -5:
$resultComment = 'ошибка проверки сертификата ЭП';
break;
case -6:
$resultComment = 'у заявителя отсутствует лицензия';
break;
case -7:
$resultComment = 'отсутствует идентификатор запроса';
break;
case -8:
$resultComment = 'неверный формат ID запроса';
break;
case -9:
$resultComment = 'не найден запрос по указанному ID';
break;
case -10:
$resultComment = 'повторите запрос позднее';
break;
}
$query = "\r\n INSERT INTO `rbs_results` (`requestID`, `resultStatus`, `resultStatusCode`, `resultComment`, `resultTime`)\r\n VALUES('{$this->_requestPK}', '{$resultStatus}', '{$resultStatusCode}', '{$resultComment}', NOW())\r\n ON DUPLICATE KEY UPDATE `resultStatus` = '{$resultStatus}', `resultStatusCode` = '{$resultStatusCode}', `resultComment` = '{$resultComment}', `resultTime` = NOW()\r\n ";
nr_query($query);
return simple_get_lastid('rbs_results');
}
示例10: __
<td>' . __('Text') . '</td>
</tr>
';
if (!empty($allmessages)) {
foreach ($allmessages as $io => $eachmessage) {
$result .= '
<tr class="row3">
<td>' . $eachmessage['date'] . '</td>
<td>' . $eachmessage['text'] . '</td>
</tr>
';
}
}
$result .= '</table>';
show_window(__('Previous messages'), $result);
}
if (isset($_GET['username'])) {
$login = $_GET['username'];
web_MessagesShowPrevious($login);
if (isset($_POST['messagetext'])) {
zb_TicketCreate('NULL', $login, $_POST['messagetext'], 'NULL', whoami());
$newid = simple_get_lastid('ticketing');
zb_TicketSetDone($newid);
rcms_redirect("?module=pl_sendmessage&username=" . $login);
}
web_MessageSendForm();
show_window('', web_UserControls($login));
}
} else {
show_error(__('You cant control this module'));
}
示例11: tariffCreate
/**
* Creates new tariff in database
*
* @return void/string on error
*/
public function tariffCreate()
{
$result = '';
if (wf_CheckPost(array('newtariffname', 'newtarifffee', 'newtariffserviceid'))) {
$nameF = mysql_real_escape_string($_POST['newtariffname']);
$feeF = mysql_real_escape_string($_POST['newtarifffee']);
$serviceidF = mysql_real_escape_string($_POST['newtariffserviceid']);
$primary = wf_CheckPost(array('newtariffprimary')) ? 1 : 0;
$freePeriod = wf_CheckPost(array('newtarifffreeperiod')) ? 1 : 0;
if (zb_checkMoney($feeF)) {
$query = "INSERT INTO `mg_tariffs` (`id`,`name`,`fee`,`serviceid`,`primary`,`freeperiod`) VALUES ";
$query .= "(NULL,'" . $nameF . "','" . $feeF . "','" . $serviceidF . "','" . $primary . "','" . $freePeriod . "')";
nr_query($query);
$newId = simple_get_lastid('mg_tariffs');
log_register('MEGOGO TARIFF CREATE [' . $newId . '] `' . $_POST['newtariffname'] . '` FEE `' . $_POST['newtarifffee'] . '`');
} else {
$result = $this->messages->getStyledMessage(__('Wrong format of a sum of money to pay'), 'error');
}
} else {
$result = $this->messages->getStyledMessage(__('No all of required fields is filled'), 'error');
}
return $result;
}
示例12: addMyNote
/**
* Creates new personal note in database
*
* @return void
*/
public function addMyNote()
{
if (wf_CheckPost(array('newtext'))) {
$owner = $this->myLogin;
$createDate = curdatetime();
$remindDate = !empty($_POST['newreminddate']) ? $_POST['newreminddate'] : '';
$activity = isset($_POST['newactive']) ? 1 : 0;
$text = $_POST['newtext'];
$this->createNote($owner, $createDate, $remindDate, $activity, $text);
$newId = simple_get_lastid('stickynotes');
log_register("STICKY CREATE [" . $newId . "]");
}
}
示例13: createContact
/**
* Creates new DB contact record
*
* @param string $phone
* @param string $name
*
* @return void
*/
public function createContact($phone, $name)
{
$phoneF = mysql_real_escape_string($phone);
$nameF = mysql_real_escape_string($name);
$query = "INSERT INTO `contacts` (`id`,`phone`,`name`) VALUES (NULL, '" . $phoneF . "','" . $nameF . "');";
nr_query($query);
$newId = simple_get_lastid('contacts');
log_register('PHONEBOOK CREATE [' . $newId . '] NAME `' . $name . '` PHONE `' . $phone . '`');
}
示例14: createNetwork
/**
* Creates new DHCP network
*
* @param int $netid
* @param string $dhcpconfname
*
* @return void
*/
public function createNetwork($netid, $dhcpconfname)
{
$netid = vf($netid, 3);
$dhcpconfname = vf($dhcpconfname);
$dhcpconfname = trim($dhcpconfname);
$query = "INSERT INTO `dhcp` (`id` ,`netid` , `dhcpconfig` , `confname`)\n VALUES (NULL , '" . $netid . "', '', '" . $dhcpconfname . "');";
nr_query($query);
$newID = simple_get_lastid('dhcp');
log_register('CREATE DHCPNet [' . $newID . '] NETWORK [' . $netid . ']');
}
示例15: addCapability
/**
* creates new capability in database
*
* @param $address - users address
* @param $phone - users phone
* @param $notes - text notes to task
*
* @return integer
*/
public function addCapability($address, $phone, $notes)
{
$date = curdatetime();
$address = mysql_real_escape_string($address);
$phone = mysql_real_escape_string($phone);
$notes = mysql_real_escape_string($notes);
$query = "INSERT INTO `capab` (`id` , `date` , `address` , `phone` ,`stateid` ,`notes` ,`price` ,`employeeid` ,`donedate`) \n VALUES ( NULL , '" . $date . "', '" . $address . "', '" . $phone . "', '0', '" . $notes . "', NULL , NULL , NULL);";
nr_query($query);
$lastId = simple_get_lastid('capab');
log_register("CAPABILITY ADD [" . $lastId . "] `" . $address . "`");
}