本文整理汇总了PHP中curdatetime函数的典型用法代码示例。如果您正苦于以下问题:PHP curdatetime函数的具体用法?PHP curdatetime怎么用?PHP curdatetime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了curdatetime函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: zbs_CreditLogPush
/**
* logs succeful self credit fact into database
*
* @param string $login existing users login
*
* @return void
*/
function zbs_CreditLogPush($login)
{
$login = mysql_real_escape_string($login);
$date = curdatetime();
$query = "INSERT INTO `zbssclog` (`id` , `date` , `login` ) VALUES ( NULL , '" . $date . "', '" . $login . "');";
nr_query($query);
}
示例2: zb_CardCreate
/**
* Creates card in database with some serial and price
*
* @param int $serial
* @param float $cash
*
* @return void
*/
function zb_CardCreate($serial, $cash)
{
$admin = whoami();
$date = curdatetime();
$query = "INSERT INTO `cardbank` (`id` ,`serial` , `cash` , `admin` , `date` , `active` , `used` , `usedate` , `usedlogin` , `usedip`) " . "VALUES (NULL , '" . $serial . "', '" . $cash . "', '" . $admin . "', '" . $date . "', '1', '0', NULL , '', NULL);";
nr_query($query);
}
示例3: setOptions
/**
* Sets default options
*
* @return void
*/
protected function setOptions()
{
$this->curdate = curdatetime();
$this->dayLimit = vf($this->altCfg['CAP_DAYLIMIT'], 3);
$this->penalty = vf($this->altCfg['CAP_PENALTY'], 3);
$this->payId = vf($this->altCfg['CAP_PAYID'], 3);
$this->ignoreFrozen = $this->altCfg['CAP_IGNOREFROZEN'] ? true : false;
$this->logPath = DATA_PATH . 'documents/crimeandpunishment.log';
}
示例4: op_TransactionAdd
/**
* Registers new non processed transaction
*
* @param string $hash
* @param float $summ
* @param int $customerid
* @param string $paysys
* @param string $note
*
* @return void
*/
function op_TransactionAdd($hash, $summ, $customerid, $paysys, $note)
{
$date = curdatetime();
$summ = vf($summ);
$customerid = mysql_real_escape_string($customerid);
$paysys = mysql_real_escape_string($paysys);
$note = mysql_real_escape_string($note);
$hash = mysql_real_escape_string($hash);
$query = "INSERT INTO `op_transactions` (`id`,`hash`, `date` , `summ` , `customerid` ,`paysys` , `processed` ,`note`)\n VALUES (NULL ,'" . $hash . "' , '" . $date . "', '" . $summ . "', '" . $customerid . "', '" . $paysys . "', '0', '" . $note . "');";
nr_query($query);
}
示例5: ms_TicketCreate
function ms_TicketCreate($from, $to, $text, $replyto = 'NULL', $admin = '')
{
$from = mysql_real_escape_string($from);
$to = mysql_real_escape_string($to);
$admin = mysql_real_escape_string($admin);
$text = mysql_real_escape_string(strip_tags($text));
$date = curdatetime();
$replyto = vf($replyto);
$query = "\n INSERT INTO `ticketing` (\n `id` ,\n `date` ,\n `replyid` ,\n `status` ,\n `from` ,\n `to` ,\n `text`,\n `admin`\n )\n VALUES (\n NULL ,\n '" . $date . "',\n " . $replyto . ",\n '0',\n '" . $from . "',\n '" . $to . "',\n '" . $text . "',\n '" . $admin . "'\n );\n ";
nr_query($query);
}
示例6: setOptions
/**
* Sets default options
*
* @return void
*/
protected function setOptions()
{
$this->curdate = curdatetime();
$this->discountPullDays = vf($this->altCfg['CUD_PULLDAYS'], 3);
$this->fillPercent = vf($this->altCfg['CUD_PERCENT'], 3);
$this->discountPayId = vf($this->altCfg['CUD_PAYID'], 3);
$this->discountLimit = vf($this->altCfg['CUD_PERCENTLIMIT'], 3);
$this->customDiscountCfId = vf($this->altCfg['CUD_CFID'], 3);
$this->logPath = DATA_PATH . 'documents/cudiscounts.log';
$this->setDebug($this->altCfg['CUD_ENABLED']);
$this->customDiscountCfId = vf($this->altCfg['CUD_CFID'], 3);
}
示例7: im_CreateMessage
/**
* Creates message for some admin user
*
* @param string $to admin login
* @param string $text message text
*
* @return void
*/
function im_CreateMessage($to, $text)
{
$to = mysql_real_escape_string($to);
$text = mysql_real_escape_string($text);
$text = strip_tags($text);
$from = whoami();
$date = curdatetime();
$read = 0;
$query = "INSERT INTO `ub_im` (\n `id` ,\n `date` ,\n `from` ,\n `to` ,\n `text` ,\n `read`\n )\n VALUES (\n NULL , '" . $date . "', '" . $from . "', '" . $to . "', '" . $text . "', '" . $read . "'\n );\n ";
nr_query($query);
log_register("UBIM SEND FROM {" . $from . "} TO {" . $to . "}");
}
示例8: zb_CashAdd
/**
* Add some cash to user login in stargazer, and creates payment record in registry
*
* @global object $billing Pre-initialized low-level stargazer handlers
* @param string $login Existing users login
* @param float $cash Amount of money to put/set on user login
* @param string $operation Operation type: add, correct,set,mock
* @param int $cashtype Existing cashtype ID for payment registry
* @param string $note Payment notes
*
* @return void
*/
function zb_CashAdd($login, $cash, $operation, $cashtype, $note)
{
global $billing;
$login = mysql_real_escape_string($login);
$cash = mysql_real_escape_string($cash);
$cash = preg_replace("#[^0-9\\-\\.]#Uis", '', $cash);
$cash = trim($cash);
$cashtype = vf($cashtype);
$note = mysql_real_escape_string($note);
$date = curdatetime();
$balance = zb_CashGetUserBalance($login);
$admin = whoami();
$noteprefix = '';
/**
* They wanna fuck you for free and explode ya
* I gonna waiting no time let me show ya
* You gonna be kidding Couse nothing is happening
* You wanna be happy So follow me
*/
switch ($operation) {
case 'add':
$targettable = 'payments';
$billing->addcash($login, $cash);
log_register('BALANCEADD (' . $login . ') ON ' . $cash);
break;
case 'correct':
$targettable = 'paymentscorr';
$billing->addcash($login, $cash);
log_register('BALANCECORRECT (' . $login . ') ON ' . $cash);
break;
case 'set':
$targettable = 'payments';
$billing->setcash($login, $cash);
log_register("BALANCESET (" . $login . ') ON ' . $cash);
$noteprefix = 'BALANCESET:';
break;
case 'mock':
$targettable = 'payments';
log_register("BALANCEMOCK (" . $login . ') ON ' . $cash);
$noteprefix = 'MOCK:';
break;
}
//push dat payment to payments registry
$query = "INSERT INTO `" . $targettable . "` (\n `id` ,\n `login` ,\n `date` ,\n `admin` ,\n `balance` ,\n `summ` ,\n `cashtypeid` ,\n `note`\n )\n VALUES (\n NULL , '" . $login . "', '" . $date . "', '" . $admin . "', '" . $balance . "', '" . $cash . "', '" . $cashtype . "', '" . ($noteprefix . $note) . "'\n );";
nr_query($query);
}
示例9: 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 . "]");
}
}
示例10: vf
if (isset($_POST['changetask'])) {
if (wf_CheckPost(array('editenddate', 'editemployeedone'))) {
if (zb_checkDate($_POST['editenddate'])) {
//editing task sub
$editid = vf($_POST['changetask']);
simple_update_field('taskman', 'enddate', $_POST['editenddate'], "WHERE `id`='" . $editid . "'");
simple_update_field('taskman', 'employeedone', $_POST['editemployeedone'], "WHERE `id`='" . $editid . "'");
simple_update_field('taskman', 'donenote', $_POST['editdonenote'], "WHERE `id`='" . $editid . "'");
simple_update_field('taskman', 'status', '1', "WHERE `id`='" . $editid . "'");
//flushing darkvoid after changing task
$darkVoid = new DarkVoid();
$darkVoid->flushCache();
log_register('TASKMAN DONE [' . $editid . ']');
//generate job for some user
if (wf_CheckPost(array('generatejob', 'generatelogin', 'generatejobid'))) {
stg_add_new_job($_POST['generatelogin'], curdatetime(), $_POST['editemployeedone'], $_POST['generatejobid'], 'TASKID:[' . $_POST['changetask'] . ']');
log_register("TASKMAN GENJOB (" . $_POST['generatelogin'] . ') VIA [' . $_POST['changetask'] . ']');
}
} else {
show_error(__('Wrong date format'));
}
} else {
show_error(__('All fields marked with an asterisk are mandatory'));
}
}
//setting task undone
if (isset($_GET['setundone'])) {
$undid = vf($_GET['setundone'], 3);
simple_update_field('taskman', 'status', '0', "WHERE `id`='" . $undid . "'");
simple_update_field('taskman', 'enddate', 'NULL', "WHERE `id`='" . $undid . "'");
log_register("TASKMAN UNDONE [" . $undid . ']');
示例11: zb_TicketCreate
/**
* Creates new ticket into database
*
* @param string $from
* @param string $to
* @param string $text
* @param int $replyto
* @param string $admin
*
* @return void
*/
function zb_TicketCreate($from, $to, $text, $replyto = 'NULL', $admin = '')
{
$from = mysql_real_escape_string($from);
$to = mysql_real_escape_string($to);
$admin = mysql_real_escape_string($admin);
$text = mysql_real_escape_string(strip_tags($text));
$date = curdatetime();
$replyto = vf($replyto);
$query = "INSERT INTO `ticketing` (`id` , `date` , `replyid` , `status` ,`from` , `to` , `text`, `admin`) " . "VALUES (NULL , '" . $date . "', " . $replyto . ", '0', '" . $from . "', '" . $to . "', '" . $text . "', '" . $admin . "');";
nr_query($query);
log_register("TICKET CREATE (" . $to . ")");
}
示例12: registerTemplateDB
/**
* register uploaded template into database
*
* @param $path string path to template file
* @param $displayname string template display name
* @param $public int is template accesible from userstats
*
* @return void
*/
protected function registerTemplateDB($path, $displayname, $public)
{
$path = mysql_real_escape_string($path);
$displayname = mysql_real_escape_string($displayname);
$public = vf($public, 3);
$admin = whoami();
$date = curdatetime();
$query = "INSERT INTO `docxtemplates` (`id`, `date`, `admin`, `public`, `name`, `path`) \n VALUES (NULL, '" . $date . "', '" . $admin . "', '" . $public . "', '" . $displayname . "', '" . $path . "');";
nr_query($query);
log_register("PLDOCS ADD TEMPLATE `" . $displayname . "`");
}
示例13: zb_BillingStats
/**
* Collects billing stats
*
* @param bool $quiet
*/
function zb_BillingStats($quiet = false)
{
$ubstatsurl = 'http://stats.ubilling.net.ua/';
$statsflag = 'exports/NOTRACK';
//detect host id
$hostid_q = "SELECT * from `ubstats` WHERE `key`='ubid'";
$hostid = simple_query($hostid_q);
if (empty($hostid)) {
//register new ubilling
$randomid = 'UB' . md5(curdatetime() . zb_rand_string(8));
$newhostid_q = "INSERT INTO `ubstats` (`id` ,`key` ,`value`) VALUES (NULL , 'ubid', '" . $randomid . "');";
nr_query($newhostid_q);
$thisubid = $randomid;
} else {
$thisubid = $hostid['value'];
}
//detect stats collection feature
$thiscollect = file_exists($statsflag) ? 0 : 1;
//disabling collect subroutine
if (isset($_POST['editcollect'])) {
if (!isset($_POST['collectflag'])) {
file_put_contents($statsflag, 'Im greedy bastard');
} else {
if (file_exists($statsflag)) {
unlink($statsflag);
}
}
rcms_redirect("?module=report_sysload");
}
//detect total user count
$usercount_q = "SELECT COUNT(`login`) from `users`";
$usercount = simple_query($usercount_q);
$usercount = $usercount['COUNT(`login`)'];
//detect tariffs count
$tariffcount_q = "SELECT COUNT(`name`) from `tariffs`";
$tariffcount = simple_query($tariffcount_q);
$tariffcount = $tariffcount['COUNT(`name`)'];
//detect nas count
$nascount_q = "SELECT COUNT(`id`) from `nas`";
$nascount = simple_query($nascount_q);
$nascount = $nascount['COUNT(`id`)'];
//detect payments count
$paycount_q = "SELECT COUNT(`id`) from `payments`";
$paycount = simple_query($paycount_q);
$paycount = $paycount['COUNT(`id`)'];
$paycount = $paycount / 100;
$paycount = round($paycount);
//detect ubilling actions count
$eventcount_q = "SELECT COUNT(`id`) from `weblogs`";
$eventcount = simple_query($eventcount_q);
$eventcount = $eventcount['COUNT(`id`)'];
$eventcount = $eventcount / 100;
$eventcount = round($eventcount);
//detect ubilling version
$releaseinfo = file_get_contents("RELEASE");
$ubversion = explode(' ', $releaseinfo);
$ubversion = vf($ubversion[0], 3);
$releasebox = wf_tag('span', false, '', 'id="lastrelease"');
$releasebox .= wf_tag('span', true) . wf_tag('br');
$updatechecker = wf_AjaxLink('?module=report_sysload&checkupdates=true', $releaseinfo . ' (' . __('Check updates') . '?)', 'lastrelease', false, '');
$ubstatsinputs = zb_AjaxLoader();
$ubstatsinputs .= wf_tag('b') . __('Serial key') . ': ' . wf_tag('b', true) . $thisubid . wf_tag('br');
$ubstatsinputs .= wf_tag('b') . __('Use this to request technical support') . ': ' . wf_tag('b', true) . wf_tag('font', false, '', 'color="#076800"') . substr($thisubid, -4) . wf_tag('font', true) . wf_tag('br');
$ubstatsinputs .= wf_tag('b') . __('Ubilling version') . ': ' . wf_tag('b', true) . $updatechecker . wf_tag('br');
$ubstatsinputs .= $releasebox;
$ubstatsinputs .= wf_HiddenInput('editcollect', 'true');
$ubstatsinputs .= wf_CheckInput('collectflag', 'I want to help make Ubilling better', false, $thiscollect);
$ubstatsinputs .= ' ' . wf_Submit('Save');
$ubstatsform = wf_Form("", 'POST', $ubstatsinputs, 'glamour');
$ubstatsform .= wf_CleanDiv();
$statsurl = $ubstatsurl . '?u=' . $thisubid . 'x' . $usercount . 'x' . $tariffcount . 'x' . $nascount . 'x' . $paycount . 'x' . $eventcount . 'x' . $ubversion;
$tracking_code = wf_tag('div', false, '', 'style="display:none;"') . wf_tag('iframe', false, '', 'src="' . $statsurl . '" width="1" height="1" frameborder="0"') . wf_tag('iframe', true) . wf_tag('div', true);
if ($quiet == false) {
show_window(__('Billing info'), $ubstatsform);
}
if ($thiscollect) {
show_window('', $tracking_code);
}
}
示例14: ts_CreateTask
/**
* Creates new task in database
*
* @param string $startdate
* @param string $starttime
* @param string $address
* @param string $login
* @param string $phone
* @param int $jobtypeid
* @param int $employeeid
* @param string $jobnote
*
* @return void
*/
function ts_CreateTask($startdate, $starttime, $address, $login, $phone, $jobtypeid, $employeeid, $jobnote)
{
$altercfg = rcms_parse_ini_file(CONFIG_PATH . "alter.ini");
$curdate = curdatetime();
$admin = whoami();
$address = str_replace('\'', '`', $address);
$address = mysql_real_escape_string($address);
$login = mysql_real_escape_string($login);
$phone = mysql_real_escape_string($phone);
$startdate = mysql_real_escape_string($startdate);
$jobSendTime = !empty($starttime) ? ' ' . date("H:i", strtotime($starttime)) : '';
if (!empty($starttime)) {
$starttime = "'" . mysql_real_escape_string($starttime) . "'";
} else {
$starttime = 'NULL';
}
$jobtypeid = vf($jobtypeid, 3);
$employeeid = vf($employeeid, 3);
$jobnote = mysql_real_escape_string($jobnote);
$smsData = 'NULL';
//store sms for backround processing via watchdog
if ($altercfg['WATCHDOG_ENABLED']) {
if (isset($_POST['newtasksendsms'])) {
$newSmsText = $address . ' ' . $phone . ' ' . $jobnote . $jobSendTime;
$smsDataRaw = ts_SendSMS($employeeid, $newSmsText);
if (!empty($smsDataRaw)) {
$smsData = serialize($smsDataRaw);
$smsData = "'" . base64_encode($smsData) . "'";
}
}
}
$query = "INSERT INTO `taskman` (`id` , `date` , `address` , `login` , `jobtype` , `jobnote` , `phone` , `employee` , `employeedone` ,`donenote` , `startdate` ,`starttime`, `enddate` , `admin` , `status`,`smsdata`)\n VALUES (NULL , '" . $curdate . "', '" . $address . "', '" . $login . "', '" . $jobtypeid . "', '" . $jobnote . "', '" . $phone . "', '" . $employeeid . "',NULL, NULL , '" . $startdate . "'," . $starttime . ",NULL , '" . $admin . "', '0'," . $smsData . ");";
nr_query($query);
//flushing darkvoid
$darkVoid = new DarkVoid();
$darkVoid->flushCache();
log_register("TASKMAN CREATE `" . $address . "`");
}
示例15: zbs_CashAdd
/**
* Adds some money to user account
*
* @param string $login
* @param float $cash
* @param string $note
*
* @return void
*/
function zbs_CashAdd($login, $cash, $note)
{
$login = vf($login);
$cash = mysql_real_escape_string($cash);
$cashtype = 0;
$note = mysql_real_escape_string($note);
$date = curdatetime();
$balance = zb_CashGetUserBalance($login);
billing_addcash($login, $cash);
$query = "INSERT INTO `payments` ( `id` , `login` , `date` , `balance` , `summ` , `cashtypeid` , `note` )\n VALUES (NULL , '" . $login . "', '" . $date . "', '" . $balance . "', '" . $cash . "', '" . $cashtype . "', '" . $note . ");";
nr_query($query);
log_register("BALANCECHANGE (" . $login . ') ON ' . $cash);
}