当前位置: 首页>>代码示例>>PHP>>正文


PHP NOW函数代码示例

本文整理汇总了PHP中NOW函数的典型用法代码示例。如果您正苦于以下问题:PHP NOW函数的具体用法?PHP NOW怎么用?PHP NOW使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了NOW函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: isEnded

 public function isEnded()
 {
     if ($this->getHidden() == TRUE || $this->getStartDate() < NOW() || $this->getEndDate() > NOW()) {
         return true;
     }
     return false;
 }
开发者ID:felixonline,项目名称:core,代码行数:7,代码来源:Notice.php

示例2: Store

 public function Store($pUserId, $pIdentifier, $pTitle, $pBody)
 {
     $New = false;
     if (!$pIdentifier) {
         $pIdentifier = $this->CreateUniqueIdentifier();
         $this->Set('Created', NOW());
         $New = true;
     } else {
         $this->Retrieve(array('Owner_FK' => $pUserId, 'Identifier' => $pIdentifier));
         if ($this->Get('Total') > 0) {
             $this->Fetch();
         } else {
             $this->Set('Created', NOW());
             $New = true;
         }
     }
     if (!$pUserId) {
         return false;
     }
     $this->Set('Owner_FK', $pUserId);
     $this->Set('Identifier', $pIdentifier);
     $this->Set('Title', $pTitle);
     $this->Set('Body', $pBody);
     $this->Set('Updated', NOW());
     $this->Save();
     return $this->Get('Identifier');
 }
开发者ID:nguyennamtien,项目名称:appleseed,代码行数:27,代码来源:journal.php

示例3: addstaffajax

 public function addstaffajax()
 {
     $config['upload_path'] = "uploads/staffs/";
     $config['allowed_types'] = "gif|jpg|jpeg|png";
     $config['max_size'] = "5000";
     $config['max_width'] = "1907";
     $config['max_height'] = "1280";
     //$this->load->library('upload', $config);
     $this->upload->initialize($config);
     if (!$this->upload->do_upload('photo')) {
         echo $this->upload->display_errors();
     } else {
         $data = $this->upload->data();
         $this->records = array('staffid' => $this->input->post('staffid', true), 'staffuserid' => $this->input->post('staffuserid', true), 'firstname' => $this->input->post('firstname', true), 'middlename' => $this->input->post('middlename', true), 'lastname' => $this->input->post('lastname', true), 'sphone' => $this->input->post('sphone', true), 'mailingaddress' => $this->input->post('mailingaddress', true), 'birthdate' => $this->input->post('birthdate', true), 'email' => $this->input->post('email', true), 'joindate' => NOW(), 'photo' => $data['file_name'], 'birthdate' => $this->input->post('birthdate', true), 'enrollmentstatus' => $this->input->post('enrollmentstatus', true), 'isActive' => 1);
         $this->urecords = array('username' => $this->input->post('staffuserid', true), 'created_on' => NOW(), 'first_name' => $this->input->post('firstname', true), 'phone' => $this->input->post('sphone', true), 'last_name' => $this->input->post('lastname', true));
         $this->ugrpuprecords = array('user_id' => $this->input->post('id', true), 'group_id' => 5);
         $this->results = $this->common_model->insertRecords($this->common_model->_staffs, $this->records);
         $this->results = $this->common_model->insertRecords($this->common_model->_usersTable, $this->urecords);
         $this->results = $this->common_model->insertRecords($this->common_model->_users_groups, $this->ugrpuprecords);
         if ($this->results) {
             $this->status['status'] = 1;
             $this->status['msg'] = "Staff";
         } else {
             $this->status['status'] = 0;
             $this->status['msg'] = "Something went wrong when saving the file, please try again.";
         }
         echo jsonEncode($this->status);
     }
 }
开发者ID:skydotint,项目名称:smartcampus,代码行数:29,代码来源:Staffs.php

示例4: insertRecord

 function insertRecord()
 {
     //print_r($this->input->post()); exit();
     $data = array();
     $data['first_name'] = $this->input->post('first_name', TRUE);
     $data['last_name'] = $this->input->post('last_name', TRUE);
     $data['email_addr'] = strtolower($this->input->post('email_addr', TRUE));
     $data['tel_number'] = $this->input->post('tel_number', TRUE);
     $data['post_code'] = $this->input->post('post_code', TRUE);
     $data['enq_reason'] = $this->input->post('enq_reason', TRUE);
     $data['receive_update_news'] = $this->input->post('receive_update_news', TRUE);
     $data['how_reach'] = $this->input->post('how_reach', TRUE);
     $data['enquiry'] = $this->input->post('enquiry', TRUE);
     $data['souceSiteUser'] = '2';
     $data['enq_creator_id'] = $this->loggId;
     $data['next_follow_up'] = date('Y-m-d');
     /**
      * If any index is has false then empty string assign
      */
     foreach ($data as $key => $val) {
         if (!$data[$key]) {
             $data[$key] = '0';
         }
     }
     $data['insert_time'] = date('Y-m-d', NOW());
     $data['next_follow_up'] = $data['insert_time'];
     $status = $this->db->insert($this->tbl, $data);
     if (!$status) {
         return FALSE;
     }
     $enquiry_id = $this->db->insert_id();
     //fetch email details
     $email_dtls = $this->Emailsmodel->fetchDetails('enquiry_registration');
     //Send Confirmation email
     $emailData = array();
     $emailData['DATE'] = date("jS F, Y");
     $emailData['NAME'] = $data['first_name'] . $data['last_name'];
     $emailData['EMAILADDR'] = $data['email_addr'];
     $search = array();
     $replace = array();
     $search[] = '{DATE}';
     $replace[] = $emailData['DATE'];
     $search[] = '{NAME}';
     $replace[] = $emailData['NAME'];
     $search[] = '{EMAILADDR}';
     $replace[] = $emailData['EMAILADDR'];
     $emailBody = str_ireplace($search, $replace, $email_dtls['email_content']);
     //print_r($emailBody); exit();
     $this->email->initialize($this->config->item('EMAIL_CONFIG'));
     $this->email->from(DWS_EMAIL_NOREPLY, DWS_EMAIL_FROM);
     $this->email->to($data['email_addr']);
     $this->email->subject($email_dtls['email_subject']);
     $this->email->message($emailBody);
     $status = $this->email->send();
     $data['enquiry_id'] = $enquiry_id;
     return $data;
 }
开发者ID:ravinderphp,项目名称:revitalise,代码行数:57,代码来源:enquirymodel.php

示例5: a10

function a10(&$db)
{
    //project
    $close = NOW();
    $close->sub(new DateInterval('P1M'));
    $sql = "UPDATE " . $db->prefix . "a10_project\n\t\t\tSET close_date='" . $close->format('Y-m-d') . "', accounting_idref=1;";
    $db->exec($sql);
    return true;
}
开发者ID:bbogin,项目名称:sr2s,代码行数:9,代码来源:loadMDB_csv.php

示例6: Create

 public function Create($pType, $pIdentifier, $pUserId)
 {
     $this->Protect('Reference_FK', null);
     $this->Set('User_FK', $pUserId);
     $this->Set('Type', $pType);
     $this->Set('Identifier', $pIdentifier);
     $this->Set('Stamp', NOW());
     $this->Save();
     return true;
 }
开发者ID:nguyennamtien,项目名称:appleseed,代码行数:10,代码来源:references.php

示例7: startCouponSaving

 public static function startCouponSaving($coupon, $customerId)
 {
     $instance = new self();
     $instance->couponId = $coupon->getCouponId();
     $instance->requiredNumberOfProducts = $coupon->getRequiredNumberOfProducts();
     $validUntil = Date('Y:m:d', strtotime($coupon->getValidity()));
     $instance->customerId = $customerId;
     $instance->creationDate = NOW();
     $instance->validUntil = $validUntil;
     $instance->state = CouponState::OPEN;
     return $instance;
 }
开发者ID:rabersabir,项目名称:coupon-module,代码行数:12,代码来源:CouponSaving.php

示例8: onSalesOrderInvoicePay

 public function onSalesOrderInvoicePay($observer)
 {
     Mage::log(" : onSalesOrderInvoicePay stap 1   ", null, 'custom.log');
     try {
         $couponDao = new CouponDao();
         $invoice = $observer->getEvent()->getInvoice();
         $order = $invoice->getOrder();
         // Method 1
         unset($this->usedDiscountCoupons);
         // Unset $array.
         $this->usedDiscountCoupons = array();
         // Reset $array to an empty array.
         foreach ($order->getAllItems() as $item) {
             // Do something with $item here...
             $name = $item->getName();
             $price = $item->getPrice();
             $_product = Mage::getModel('catalog/product')->load($item->getProductId());
             $manufacturerName = $_product->getAttributeText('manufacturer');
             $coupon = $couponDao->loadCouponByBrand($manufacturerName);
             if ($coupon != null) {
                 for ($i = 1; $i <= $item->getQtyOrdered(); $i++) {
                     $couponSaving = $couponDao->loadInInVoiceCouponSaving($coupon->getCouponId(), $order->getCustomerId());
                     if ($couponSaving != null) {
                         $couponDao->setCouponSavingToUsed($couponSaving);
                     } else {
                         if ($price >= $coupon->getMinPrice() && !$this->discountCouponUsed($order, $manufacturerName)) {
                             $couponSaving = $couponDao->loadCouponSaving($coupon->getCouponId(), $order->getCustomerId(), CouponState::OPEN);
                             if ($couponSaving == null) {
                                 $couponSavingNew = CouponSaving::startCouponSaving($coupon, $order->getCustomerId());
                                 $couponSaving = $couponDao->createCouponSaving($couponSavingNew);
                             }
                             $couponSavingId = $couponSaving->getCouponSavingId();
                             if (NOW() >= $couponSaving->getValidUntil()) {
                                 $couponDao->updateCouponSaving($couponSaving);
                                 $couponSavingNew = CouponSaving::startCouponSaving($coupon, $order->getCustomerId());
                                 $couponSavingNew = $couponDao->createCouponSaving($couponSavingNew);
                                 $couponSavingIdNew = $couponSavingNew->getCouponSavingId();
                                 $couponDao->createStamp($couponSavingIdNew, $name, $price, $order->getIncrementId());
                             } else {
                                 $couponDao->createStamp($couponSavingId, $name, $price, $order->getIncrementId());
                                 $couponDao->updateCouponSaving($couponSaving);
                             }
                         }
                     }
                 }
             }
         }
     } catch (Exception $e) {
         Mage::log("exception " + $e, null);
     }
     return $this;
 }
开发者ID:rabersabir,项目名称:coupon-module,代码行数:52,代码来源:Observer.php

示例9: _IsPast

 private function _IsPast($pTime, $pDistance)
 {
     if (!$pTime) {
         return false;
     }
     $now = strtotime(NOW());
     $diff = $now - $pTime;
     $diffMinutes = $diff / 60;
     if ($diffMinutes < $pDistance) {
         return false;
     }
     return true;
 }
开发者ID:nguyennamtien,项目名称:appleseed,代码行数:13,代码来源:janitor.php

示例10: Store

 public function Store($pContext, $pId, $pBody, $pParent, $pOwner)
 {
     $this->Protect('Entry_PK');
     $this->Set('Body', $pBody);
     $this->Set('Parent_ID', $pParent);
     $this->Set('Owner', $pOwner);
     $this->Set('Created', NOW());
     $this->Set('Context', $pContext);
     $this->Set('Context_FK', $pId);
     $this->Set('Status', 1);
     $this->Set('Address', $_SERVER['REMOTE_ADDR']);
     $this->Save();
     return true;
 }
开发者ID:nguyennamtien,项目名称:appleseed,代码行数:14,代码来源:comments.php

示例11: Index

 public function Index($pContext, $pContext_FK, $pKeywords)
 {
     $this->Retrieve(array('Context' => $pContext, 'Context_FK' => $pContext_FK));
     if ($this->Get('Total') > 0) {
         $this->Fetch();
     } else {
         $this->Set('Created', NOW());
     }
     $this->Set('Context', $pContext);
     $this->Set('Context_FK', $pContext_FK);
     $this->Set('Keywords', $pKeywords);
     $this->Set('Updated', NOW());
     $this->Save();
     return true;
 }
开发者ID:nguyennamtien,项目名称:appleseed,代码行数:15,代码来源:search.php

示例12: Send

 public function Send($pData = array())
 {
     if ($this->_Source != 'Component') {
         return false;
     }
     include_once ASD_PATH . 'components/postal/controllers/postal.php';
     $Controller = new cPostalPostalController();
     $Type = strtolower($pData['Type']);
     $SenderFullname = $pData['SenderFullname'];
     $SenderAccount = $pData['SenderAccount'];
     $RecipientEmail = $pData['RecipientEmail'];
     $MailSubject = $pData['MailSubject'];
     $Byline = $pData['Byline'];
     $Subject = $pData['Subject'];
     $Body = str_replace("\n", "<br />", $pData['Body']);
     $LinkDescription = $pData['LinkDescription'];
     $Link = $pData['Link'];
     $Stamp = $this->GetSys('Date')->Format(NOW(), true);
     $data = array('account' => $SenderAccount, 'source' => ASD_DOMAIN);
     $AccountLink = $this->GetSys('Event')->Trigger('Create', 'User', 'Link', $data);
     $View = $Controller->GetView($Type);
     list($username, $domain) = explode('@', $SenderAccount);
     $IconData = array('username' => $username, 'domain' => $domain, 'width' => 64, 'height' => 64);
     $View->Find('.icon', 0)->src = $this->GetSys('Event')->Trigger('On', 'User', 'Icon', $IconData);
     $View->Find('.fullname', 0)->innertext = $SenderFullname;
     $View->Find('.fullname', 0)->href = $AccountLink;
     $View->Find('.account', 0)->innertext = $SenderAccount;
     $View->Find('.account', 0)->href = $AccountLink;
     $View->Find('.byline-description', 0)->innertext = $Byline;
     $View->Find('.subject', 0)->innertext = $Subject;
     $View->Find('.body', 0)->innertext = $Body;
     $View->Find('.stamp', 0)->innertext = $Stamp;
     $View->Find('.link-description', 0)->innertext = $LinkDescription;
     $View->Find('.link', 0)->src = $Link;
     $View->Find('.link', 0)->innertext = $Link;
     $View->Find('.link', 0)->href = $Link;
     $from = "no-reply@" . ASD_DOMAIN;
     $fromName = "Appleseed";
     $to = $RecipientEmail;
     $toName = $RecipientEmail;
     $subject = $MailSubject;
     $body = $View->Buffer();
     $Mailer = $this->GetSys("Mailer");
     if (!$Mailer->Send($from, $fromName, $to, $toName, $subject, $body)) {
         return false;
     }
     return true;
 }
开发者ID:nguyennamtien,项目名称:appleseed,代码行数:48,代码来源:postal.php

示例13: EndFooterDisplay

 public function EndFooterDisplay($pData = null)
 {
     $Model = new cModel('Janitor');
     $Model->Retrieve(array('Task' => 'Janitorial'));
     $Model->Fetch();
     $lastUpdated = strtotime($Model->Get('Updated'));
     $now = strtotime(NOW());
     $diff = $now - $lastUpdated;
     $diffMinutes = $diff / 60;
     // If we've recently updated, don't ping the Janitor.
     if ($diffMinutes < 1) {
         return true;
     }
     $this->_Janitorial();
     return true;
 }
开发者ID:nguyennamtien,项目名称:appleseed,代码行数:16,代码来源:janitor.php

示例14: InviteCode

 public function InviteCode($pAddress, $pUserId)
 {
     $this->Retrieve(array('Account_FK' => $pUserId, 'Active' => 1));
     if ($this->Get('Total') == 0) {
         return false;
     }
     $this->Fetch();
     $this->Protect('Invite_PK');
     $this->Set('Recipient', $pAddress);
     $this->Set('Active', 2);
     // Pending
     $this->Set('Stamp', NOW());
     if ($this->Save(array('Invite_PK' => $this->Get('Invite_PK')))) {
         return $this->Get('Value');
     }
     return false;
 }
开发者ID:nguyennamtien,项目名称:appleseed,代码行数:17,代码来源:invites.php

示例15: returnConsignment

 public function returnConsignment($shipment_id, $consignment_number, $transfer_id)
 {
     try {
         $shipment = Mage::getModel("sales/order_shipment")->loadByIncrementId($shipment_id);
         $consignment = Mage::getModel('dpd/consignment');
         $consignment->setTransferId($transfer_id);
         if (Mage::getStoreConfig('dpd/misc/emailcustomer') == TRUE) {
             $customer = array();
             $customer['name'] = $shipment->getOrder()->getCustomerFirstname() . ' ' . $shipment->getOrder()->getCustomerLastname();
             $customer['email'] = $shipment->getOrder()->getCustomerEmail();
             $consignment->setEmail($customer['email']);
         }
         $consignment->setConsignment($consignment_number);
         $consignment->setReturned(NOW());
         $consignment->setStatus(3);
         $consignment->save();
         if (Mage::getStoreConfig('dpd/advanced/activity') == 1) {
             Mage::log('Shipment #' . $shipment_id . '(' . $transfer_id . ') returned (' . $consignment_number . ')', null, 'madcapsule_system.log');
         }
     } catch (Exception $e) {
         Mage::log('Unable to update tracking for shipment #' . $shipment_id . ' (' . $consignment_number . ')', null, 'madcapsule_system.log');
         return;
     }
     $track = Mage::getModel('sales/order_shipment_track')->setShipment($shipment)->setData('title', 'DPD')->setData('number', $consignment_number)->setData('carrier_code', 'custom')->setData('order_id', $shipment->getData('order_id'))->save();
     /*
     $tracking_add = Mage::getModel('sales/order_shipment_api')->addTrack($shipment_id, 'custom', 'DPD', $consignment_number);
     */
     if ($tracking_add && Mage::getStoreConfig('dpd/advanced/activity') == 1) {
         Mage::log('Tracking added: ' . $consignment_number . ' for shipment #' . $shipment_id . '', null, 'madcapsule_system.log');
     }
     if (Mage::getStoreConfig('dpd/misc/emailcustomer') == TRUE) {
         $emailTemplate = Mage::getModel('core/email_template')->loadDefault('madcapsule_dpd_tracking_template');
         $emailTemplateVariables = array();
         $emailTemplateVariables['consignment'] = $consignment_number;
         $emailTemplate->setTemplateSubject('Your order has been dispatched');
         $storeEmail = Mage::getStoreConfig('trans_email/ident_general/email');
         $storeContact = Mage::getStoreConfig('trans_email/ident_general/name');
         $emailTemplate->setSenderEmail($storeEmail);
         $emailTemplate->setSenderName($storeContact);
         $emailTemplate->send($customer['email'], $customer['name'], $emailTemplateVariables);
         if (Mage::getStoreConfig('dpd/advanced/activity') == 1) {
             Mage::log('DPD tracking email sent to ' . $customer['email'] . '', null, 'madcapsule_system.log');
         }
     }
 }
开发者ID:CherylMuniz,项目名称:fashion,代码行数:45,代码来源:Api.php


注:本文中的NOW函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。