• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP now函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: store

 public function store()
 {
     $vals = array('sales_username' => trim($this->input->post('sales_username')), 'sales_pwd' => md5($this->input->post('sales_pwd')), 'sales_email' => $this->input->post('sales_email'), 'sales_fname' => trim($this->input->post('sales_fname')), 'sales_lname' => trim($this->input->post('sales_lname')), 'sales_phone' => trim($this->input->post('sales_phone')), 'sales_gender' => $this->input->post('sales_gender'), 'sales_address' => trim($this->input->post('sales_address')), 'sales_city' => trim($this->input->post('sales_city')), 'sales_reg' => $this->input->post('sales_reg'), 'sales_about' => trim($this->input->post('sales_about')), 'visibility' => 1, 'created_at' => now(true));
     $this->sales->create($vals);
     $this->session->set_flashdata('message', '<div class="alert alert-success">A new sales successfully added.</div>');
     redirect('sales');
 }
开发者ID:aldiunanto,项目名称:sia,代码行数:7,代码来源:sales.php


示例2: getNow

 public function getNow()
 {
     if (!$this->_now) {
         return now();
     }
     return $this->_now;
 }
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:7,代码来源:Rule.php


示例3: _initSelect

 public function _initSelect()
 {
     //die("<PRE>".$this->getSelect()->__toString(). "</PRE>");
     parent::_initSelect();
     $this->getSelect()->distinct(true)->joinInner(array('product_table' => $this->getTable('catalogrule/rule_product')), 'main_table.rule_id = product_table.rule_id', array())->where('from_time=0 or from_time<=? or to_time=0 or to_time>=?', now())->group('main_table.rule_id');
     //die("<PRE>".$this->getSelect()->__toString()."</PRE>");
 }
开发者ID:rajarshc,项目名称:Rooja,代码行数:7,代码来源:Collection.php


示例4: ajax_update

 public function ajax_update()
 {
     $this->_validate();
     $data = array('title' => $this->input->post('title'), 'edited_on' => date('Y-m-d H:i:s', now()), 'edited_by' => GetUserID());
     $this->empl_status_model->update(array('id' => $this->input->post('id')), $data);
     echo json_encode(array("status" => TRUE));
 }
开发者ID:abdulghanni,项目名称:_zohobiz_,代码行数:7,代码来源:empl_status.php


示例5: index

 public function index()
 {
     //        $this->user_manager->authenticate();
     $this->load->model('contact_model', 'contact');
     $contact = $this->contact->getContactPages(3);
     $dataContact = array('content' => $contact['content'], 'title' => $contact['title']);
     $posts = $this->input->post();
     if ($posts) {
         $this->load->library('setting_manager');
         $this->load->helper('date');
         $this->load->model('contact_model', 'contact');
         $this->load->library('mail');
         $this->config->load('email', TRUE);
         $data = $posts;
         $validate = $this->setting_manager->contactValidate($data);
         if (empty($validate)) {
             $reply = 0;
             $to_add = array("name" => $data['name'], "email" => $data['email'], "phone" => $data['phone'], "message" => $data['content'], "date_add" => date('Y-m-d H:i:s', now()), "reply" => $reply);
             $insert = $this->contact->insert($to_add);
             $mailTo['name'] = $data['name'];
             $mailTo['email'] = $this->config->item('email_contact_from', 'email');
             $dataEmail['email'] = $data['email'];
             $dataEmail['name'] = $data['name'];
             $dataEmail['phone'] = $data['phone'];
             $dataEmail['content'] = $data['content'];
             sentMailTemp($mailTo, 'contact', $dataEmail);
             $this->data['success'] = 'Your Mail has been sent successfully';
             redirect('contact/index');
         } else {
             $this->data['data_error'] = $validate;
         }
     }
     $this->data['contact'] = $dataContact;
     $this->load('front_layout', 'contact');
 }
开发者ID:manhhung86it,项目名称:cyafun,代码行数:35,代码来源:contact.php


示例6: saveUser

 public function saveUser($user)
 {
     $exist = $this->exist($user->screen_name);
     if (!$exist) {
         $this->helper("time");
         $date = now(4);
         $imageProfile = str_replace("normal", "bigger", $user->profile_image_url);
         if (!$user->url) {
             $website = "http://twitter.com/" . $user->screen_name;
         } else {
             $website = $user->url;
         }
         $fields = "Username, Website, Avatar, Rank, Start_Date, Type";
         $values = "'{$user->screen_name}', '{$website}', '{$imageProfile}', 'Beginner', '{$date}', 'Twitter'";
         $this->Db->table("users", $fields);
         $this->Db->values($values);
         $insertID = $this->Db->save();
         $fields = "ID_User, Name, Twitter";
         $values = "'{$insertID}', '{$user->name}', '{$user->screen_name}'";
         $this->Db->table("users_information", $fields);
         $this->Db->values($values);
         $this->Db->save();
         $this->Twitter_Api->welcome();
         return $this->exist($user->screen_name);
     } else {
         return $exist;
     }
 }
开发者ID:no2key,项目名称:MuuCMS,代码行数:28,代码来源:twitter.php


示例7: saveAnswerAction

 public function saveAnswerAction()
 {
     if (!Mage::getSingleton('customer/session')->authenticate($this)) {
         Mage::getSingleton('core/session')->addError(Mage::helper('askit')->__('Sorry, only logined customer can add self answer.'));
         $this->_redirectReferer();
         return;
     }
     $customerName = (string) $this->getRequest()->getParam('askitCustomer');
     $email = (string) $this->getRequest()->getParam('askitEmail');
     if (!$customerName || !$email || !Mage::getStoreConfig('askit/general/allowedCustomerAnswer')) {
         $this->_redirectReferer();
         return;
     }
     $answer = (string) $this->getRequest()->getParam('askitAnswer');
     $questionId = (string) $this->getRequest()->getParam('question');
     $productId = (int) $this->getRequest()->getParam('product');
     $customerId = (int) Mage::getSingleton('customer/session')->getCustomerId();
     $model = Mage::getModel('askit/askIt');
     $storeId = Mage::getModel('askit/askIt')->load($questionId)->getStoreId();
     $defaultAnswerStatus = Mage::getStoreConfig('askit/general/defaultAnswerStatus');
     //pending
     $model->setText(strip_tags($answer))->setStoreId($storeId)->setProductId($productId)->setCustomerId($customerId)->setHint(0)->setParentId($questionId)->setCustomerName($customerName)->setEmail($email)->setCreatedTime(now())->setUpdateTime(now())->setStatus($defaultAnswerStatus)->save();
     Mage::getSingleton('core/session')->addSuccess(Mage::helper('askit')->__('Your answer has been accepted'));
     $this->_redirectReferer();
 }
开发者ID:praxigento,项目名称:mage_app_prxgt_store,代码行数:25,代码来源:IndexController.php


示例8: saveAction

 public function saveAction()
 {
     if ($data = $this->getRequest()->getPost()) {
         $model = Mage::getModel('testimonials/testimonials');
         $model->setData($data)->setId($this->getRequest()->getParam('id'));
         try {
             if (!$model->getId()) {
                 $model->setCreatedTime(now());
             }
             $model->setUpdateTime(now());
             $url = $data['url'];
             $model->save();
             Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('testimonials')->__('Testimonial was successfully saved'));
             Mage::getSingleton('adminhtml/session')->setFormData(false);
             if ($this->getRequest()->getParam('back')) {
                 $this->_redirect('*/*/edit', array('id' => $model->getId()));
                 return;
             }
             $this->_redirect('*/*/');
             return;
         } catch (Exception $e) {
             Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
             Mage::getSingleton('adminhtml/session')->setFormData($data);
             $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
             return;
         }
     }
     Mage::getSingleton('adminhtml/session')->addError(Mage::helper('testimonials')->__('Unable to find item to save'));
     $this->_redirect('*/*/');
 }
开发者ID:jokusafet,项目名称:MagentoSource,代码行数:30,代码来源:TestimonialsController.php


示例9: apontar_componente

 public function apontar_componente()
 {
     $of = trim($this->input->post('of'));
     $produto = trim($this->input->post('produto'));
     $componente = trim($this->input->post('componente'));
     $quantidade = (int) trim($this->input->post('quantidade'));
     $motivo = trim($this->input->post('motivo'));
     //se o motivo for igual a "D" (desabastecer), altera o valor para negativo
     if ($motivo == "D") {
         $quantidade = (int) $quantidade * -1;
     }
     if ((int) $quantidade != 0) {
         $session_data = $this->session->userdata('logged_in');
         $dados = array('cd_of' => $of, 'cd_produto' => $produto, 'cd_componente' => $componente, 'qt_apontada' => $quantidade, 'dt_apontamento' => date('YmdHis', now()), 'username' => $session_data['username'], 'cd_motivo' => $motivo);
         if ($this->apontamento_model->do_insert($dados) == TRUE) {
             echo '<div class="alert alert-success">' . ' Arquivo apontado com sucesso.</div>';
         } else {
             echo '<div class="alert alert-danger" role="alert">
                  <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
                  <span class="sr-only">Error:</span>FAvor verificar dados inseridos</div>';
         }
     }
     $dados = array('dados_of' => $this->ordem_producao_model->get_dados_of($of, $produto)->row(), 'cd_componente' => $componente, 'tela' => 'apontar', 'pasta' => 'apontamento', 'status' => $this->apontamento_model->get_hist_apon($of, $produto, $componente)->result());
     $this->load->view('conteudo', $dados);
 }
开发者ID:BruceFonseca,项目名称:Logistics-System,代码行数:25,代码来源:apontamento.php


示例10: saveAction

 public function saveAction()
 {
     if ($data = $this->getRequest()->getPost()) {
         if (isset($_FILES['content_bg_img']['name']) && $_FILES['content_bg_img']['name'] != null) {
             $result['file'] = '';
             try {
                 /* Starting upload */
                 $uploader = new Varien_File_Uploader('content_bg_img');
                 // Any extention would work
                 $uploader->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png'));
                 $uploader->setAllowRenameFiles(true);
                 // Set the file upload mode
                 // false -> get the file directly in the specified folder
                 // true -> get the file in the product like folders
                 //	(file.jpg will go in something like /media/f/i/file.jpg)
                 $uploader->setFilesDispersion(false);
                 // We set media as the upload dir
                 $path = Mage::getBaseDir('media') . DS . 'queldorei/shopper' . DS;
                 $result = $uploader->save($path, $_FILES['content_bg_img']['name']);
             } catch (Exception $e) {
                 Mage::getSingleton('adminhtml/session')->addError($e->getMessage() . '  ' . $path);
                 Mage::getSingleton('adminhtml/session')->setFormData($data);
                 $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
                 return;
             }
             $data['content_bg_img'] = 'queldorei/shopper/' . $result['file'];
         } else {
             if (isset($data['content_bg_img']['delete']) && $data['content_bg_img']['delete'] == 1) {
                 $data['content_bg_img'] = '';
             } else {
                 unset($data['content_bg_img']);
             }
         }
         $model = Mage::getModel('shoppercategories/shoppercategories');
         $model->setData($data)->setId($this->getRequest()->getParam('id'));
         try {
             if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
                 $model->setCreatedTime(now())->setUpdateTime(now());
             } else {
                 $model->setUpdateTime(now());
             }
             $model->save();
             Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('shoppercategories')->__('Color Scheme was successfully saved'));
             Mage::getSingleton('adminhtml/session')->setFormData(false);
             if ($this->getRequest()->getParam('back')) {
                 $this->_redirect('*/*/edit', array('id' => $model->getId()));
                 return;
             }
             $this->_redirect('*/*/');
             return;
         } catch (Exception $e) {
             Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
             Mage::getSingleton('adminhtml/session')->setFormData($data);
             $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
             return;
         }
     }
     Mage::getSingleton('adminhtml/session')->addError(Mage::helper('shoppercategories')->__('Unable to find item to save'));
     $this->_redirect('*/*/');
 }
开发者ID:par-orillonsoft,项目名称:wildfalcon,代码行数:60,代码来源:ShoppercategoriesController.php


示例11: _sendEmail

 protected function _sendEmail()
 {
     $data = $this->getRequest()->getParams();
     $senderInfo = $data['sender'];
     $recipients = $data['recipients'];
     $recipientEmail = $recipients['email'];
     $recipientName = $recipients['name'];
     $offer = Mage::getModel('customerreward/offer')->load($this->getRequest()->getParam('offer_id'));
     $offer->setCurrentDate(Mage::helper('core')->formatDate(now(), 'long'));
     $description = Mage::getBlockSingleton('customerreward/offer_view')->setOffer($offer)->getTitleDescriptionHtml();
     $offer->setTitleHtml($description['title']);
     $offer->setDescription($description['description']);
     $offer->setImageUrl(Mage::getBaseUrl('media') . $offer->getImage());
     if (Mage::helper('customerreward')->getReferConfig('coupon')) {
         $offer->setCoupon($data['coupon']);
     }
     //send email
     $translate = Mage::getSingleton('core/translate');
     $translate->setTranslateInline(false);
     $mailTemplate = Mage::getModel('core/email_template');
     $message = nl2br(htmlspecialchars($senderInfo['message']));
     $sender = array('name' => Mage::helper('customerreward')->htmlEscape($senderInfo['name']), 'email' => Mage::helper('customerreward')->htmlEscape($senderInfo['email']));
     $mailTemplate->setDesignConfig(array('area' => 'frontend', 'store' => Mage::app()->getStore()->getId()));
     $template = Mage::helper('customerreward')->getEmailConfig('sendfriend');
     foreach ($recipientEmail as $k => $email) {
         $name = $recipientName[$k];
         $mailTemplate->sendTransactional($template, 'sales', $email, $name, array('store' => Mage::app()->getStore(), 'name' => $name, 'email' => $email, 'message' => $message, 'sender_name' => $sender['name'], 'sender_email' => $sender['email'], 'title' => $data['title'], 'url' => $data['url'], 'offer' => $offer));
     }
     $translate->setTranslateInline(true);
     return $this;
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:31,代码来源:OfferController.php


示例12: saveAction

 public function saveAction()
 {
     $model = Mage::getModel('contest/participant');
     if ($data = $this->getRequest()->getPost()) {
         $model->setData($data)->setId($this->getRequest()->getParam('id'));
         try {
             if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
                 $model->setCreatedTime(now())->setUpdateTime(now());
             } else {
                 $model->setUpdateTime(now());
             }
             $model->save();
             if (!empty($data["contest_participant_send_mail"]) && $data["contest_participant_send_mail"] == 1) {
                 // SEND EMAIL TO PARTICPANT
                 $this->_sendEmailToParticipant($this->getRequest()->getParam('id'));
             }
             Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('contest')->__('Participant was successfully saved'));
             Mage::getSingleton('adminhtml/session')->setFormData(false);
             if ($this->getRequest()->getParam('back')) {
                 $this->_redirect('*/*/edit', array('id' => $model->getId()));
                 return;
             }
             $this->_redirect('*/*/');
             return;
         } catch (Exception $e) {
             Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
             Mage::getSingleton('adminhtml/session')->setFormData($data);
             $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
             return;
         }
     }
     Mage::getSingleton('adminhtml/session')->addError(Mage::helper('contest')->__('Unable to find item to save'));
     $this->_redirect('*/*/');
 }
开发者ID:par-orillonsoft,项目名称:magento-contests,代码行数:34,代码来源:ParticipantController.php


示例13: validate

 public function validate()
 {
     $hlp = Mage::helper('umicrosite');
     $dhlp = Mage::helper('udropship');
     extract($this->getData());
     $hasPasswordField = false;
     foreach ($this->getRegFields() as $rf) {
         $rfName = str_replace('[]', '', $rf['name']);
         if (!empty($rf['required']) && !$this->getData($rfName) && !in_array($rf['type'], array('image', 'file')) && !in_array($rfName, array('payout_paypal_email'))) {
             Mage::throwException($hlp->__('Incomplete form data'));
         }
         $hasPasswordField = $hasPasswordField || in_array($rfName, array('password_confirm', 'password'));
         if ($rfName == 'password_confirm' && $this->getData('password') != $this->getData('password_confirm')) {
             Mage::throwException($hlp->__('Passwords do not match'));
         }
     }
     $this->setStreet(@$street1 . "\n" . @$street2);
     $this->initPassword(@$password);
     $this->initUrlKey(@$url_key);
     $this->setRemoteIp($_SERVER['REMOTE_ADDR']);
     $this->setRegisteredAt(now());
     $this->setStoreId(Mage::app()->getStore()->getId());
     $dhlp->processCustomVars($this);
     $this->attachLabelVars();
     return $this;
 }
开发者ID:xiaoguizhidao,项目名称:magento,代码行数:26,代码来源:Registration.php


示例14: saveAction

 public function saveAction()
 {
     $session = Mage::getSingleton('adminhtml/session');
     if ($data = $this->getRequest()->getPost()) {
         $model = Mage::getModel('prodfaqs/prodfaqs');
         $model->setData($data)->setId($this->getRequest()->getParam('id'));
         try {
             if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
                 $model->setCreatedTime(now())->setUpdateTime(now());
             } else {
                 $model->setUpdateTime(now());
             }
             $model->save();
             if ($data['customer_email'] != '' && $data['send_mail_to'] == 1) {
                 Mage::helper('prodfaqs')->sendEmailToClient($data);
             }
             Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('prodfaqs')->__('Faq was successfully saved'));
             Mage::getSingleton('adminhtml/session')->setFormData(false);
             if ($this->getRequest()->getParam('back')) {
                 $this->_redirect('*/*/edit', array('id' => $model->getId()));
                 return;
             }
             $this->_redirect('*/*/');
             return;
         } catch (Exception $e) {
             Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
             Mage::getSingleton('adminhtml/session')->setFormData($data);
             $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
             return;
         }
     }
     Mage::getSingleton('adminhtml/session')->addError(Mage::helper('prodfaqs')->__('Unable to find Faq to save'));
     $this->_redirect('*/*/');
 }
开发者ID:ashfaqphplhr,项目名称:artificiallawnsforturf,代码行数:34,代码来源:ProdfaqsController.php


示例15: saveAction

 public function saveAction()
 {
     //$accomplish_want = $this->getRequest()->getParam('accomplish_want');
     //$recommend = $this->getRequest()->getParam('recommend');
     //$about_concern = $this->getRequest()->getParam('about_concern');
     $name = $this->getRequest()->getParam('name');
     $email = $this->getRequest()->getParam('email');
     $phone = $this->getRequest()->getParam('phone');
     $help = $this->getRequest()->getParam('help');
     $comment = $this->getRequest()->getParam('comment');
     //$best_time = $this->getRequest()->getParam('best_time');
     // $concern_number = $this->getRequest()->getParam('concern_number');
     /* Mail Function */
     $to = "[email protected]";
     $subject = 'Customer Feedback';
     $msg = '<html><head>';
     $msg .= '<title>Feedback Details</title>';
     $msg .= '</head>';
     $msg .= '<table border="1" cellspacing="1">';
     $msg .= "<tr><td>Name</td><td>" . $name . "</td></tr>";
     $msg .= "<tr><td>Email Address</td><td>" . $email . "</td></tr>";
     $msg .= "<tr><td>Mobile Number</td><td>" . $phone . "</td></tr>";
     $msg .= "<tr><td>Category</td><td>" . $help . "</td></tr>";
     $msg .= "<tr><td>Tell us more about your feedback or inquiry</td><td>" . $comment . "</td></tr>";
     $msg .= "</table>";
     $msg .= "</html>";
     // To send HTML mail, the Content-type header must be set
     $headers = 'MIME-Version: 1.0' . "\r\n";
     $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
     mail($to, $subject, $msg, $headers);
     /* End Mail function */
     $model = Mage::getModel('feedback/feedback');
     $model->setData($data)->setId($this->getRequest()->getParam('id'));
     $model->setHelp($help);
     $model->setComment($comment);
     $model->setPhone($phone);
     $model->setName($name);
     $model->setEmail($email);
     try {
         if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
             $model->setCreatedTime(now())->setUpdateTime(now());
         } else {
             $model->setUpdateTime(now());
         }
         $model->save();
         Mage::getSingleton('core/session')->addSuccess(Mage::helper('feedback')->__('Thank you for your feedback. Your opinion is important to us.'));
         Mage::getSingleton('core/session')->setFormData(false);
         if ($this->getRequest()->getParam('back')) {
             $this->_redirect('*/*/edit', array('id' => $model->getId()));
             return;
         }
         $this->_redirect('*/*/');
         return;
     } catch (Exception $e) {
         Mage::getSingleton('core/session')->addError($e->getMessage());
         Mage::getSingleton('core/session')->setFormData($data);
         $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
         return;
     }
 }
开发者ID:mSupply,项目名称:runnable_test_repo,代码行数:60,代码来源:IndexController.php


示例16: update

 function update($id)
 {
     $data = array('id' => $this->input->post('id', TRUE), 'faktur' => $this->input->post('faktur', TRUE), 'tgl' => $this->input->post('tgl', TRUE), 'tgl_kedaluarsa' => $this->input->post('tgl_kedaluarsa', TRUE), 'tgl_terima' => $this->input->post('tgl_terima', TRUE), 'id_customer' => $this->input->post('id_customer', TRUE), 'id_sales' => $this->input->post('id_sales', TRUE), 'keterangan' => $this->input->post('keterangan', TRUE), 'ref' => $this->input->post('ref', TRUE), 'id_bayar' => $this->input->post('id_bayar', TRUE), 'totalbayar' => $this->input->post('total', TRUE), 'pajak' => $this->input->post('pajak', TRUE), 'total_pajak' => $this->input->post('total_pajak', TRUE), 'grandtotal' => $this->input->post('grandtotal', TRUE), 'uangmuka' => $this->input->post('uangmuka', TRUE), 'sisa' => $this->input->post('sisa', TRUE), 'biaya_lain' => $this->input->post('biayakirim', TRUE), 'status' => $this->input->post('status', TRUE), 'id_user' => userid(), 'datetime' => now());
     $this->db->where('id', $id);
     $this->db->update('sales_order', $data);
     /*'datetime' => date('Y-m-d H:i:s'),*/
 }
开发者ID:roniwahyu,项目名称:Sistem-Informasi-Peternakan,代码行数:7,代码来源:sales_order_model.php


示例17: log

 /**
  * Log the data for the given observer model.
  *
  * @param Varien_Event_Observer $observer Observer Instance
  */
 public function log(Varien_Event_Observer $observer)
 {
     /* @var $history FireGento_AdminMonitoring_Model_History */
     $history = Mage::getModel('firegento_adminmonitoring/history');
     $history->setData(array('object_id' => $observer->getObjectId(), 'object_type' => $observer->getObjectType(), 'content' => $observer->getContent(), 'content_diff' => $observer->getContentDiff(), 'user_agent' => $this->getUserAgent(), 'ip' => $this->getRemoteAddr(), 'user_id' => $this->getUserId(), 'user_name' => $this->getUserName(), 'action' => $observer->getAction(), 'created_at' => now()));
     $history->save();
 }
开发者ID:giuseppemorelli,项目名称:firegento-adminmonitoring,代码行数:12,代码来源:Log.php


示例18: insert

 /**
  * 商户提交入驻申请
  * @method insert
  */
 public function insert()
 {
     $model = D('Merchant');
     if (!$model->create()) {
         $this->error($model->getError());
     }
     $model->authorization_start_time = now();
     $model->authorization_end_time = date('Y-m-d H:i:s', strtotime('+1 month', time()));
     $imgData = I('post.imgData');
     if (empty($imgData)) {
         $this->error('请上传商户图片');
     }
     $imgData = explode('|', $imgData);
     $imgData = array_filter($imgData);
     $model->startTrans();
     $merchant_id = $model->add();
     $insert_img = D('MerchantImg')->insert($imgData, $merchant_id);
     if ($merchant_id !== false && $insert_img !== false) {
         $model->commit();
         $this->success('新增成功', U('Index/index'));
     } else {
         $model->rollback();
         $this->error('新增失败');
     }
 }
开发者ID:a3147972,项目名称:wswl,代码行数:29,代码来源:MerchantController.class.php


示例19: insert_instance

 public function insert_instance($input)
 {
     $this->load->helper('date');
     $last_widget = $this->db->select('`order`')->order_by('`order`', 'desc')->limit(1)->get_where('widget_instances', array('widget_area_id' => $input['widget_area_id']))->row();
     $order = isset($last_widget->order) ? $last_widget->order + 1 : 1;
     return $this->db->insert('widget_instances', array('title' => $input['title'], 'widget_id' => $input['widget_id'], 'widget_area_id' => $input['widget_area_id'], 'options' => $input['options'], '`order`' => $order, 'created_on' => now(), 'updated_on' => now()));
 }
开发者ID:baltag,项目名称:pyrocms,代码行数:7,代码来源:widgets_m.php


示例20: getIndex

 public function getIndex(Request $request, $param1 = null, $param2 = null, $param3 = null, $param4 = null)
 {
     if (strtolower($param1) === 'generate') {
         return $this->getGenerate($request);
     } else {
         if (is_year($param1) && is_null($param2) && is_null($param3) && is_null($param4)) {
             return $this->makeMonthsView($request, $param1);
         } else {
             if (is_year($param1) && is_month($param2) && is_null($param3) && is_null($param4)) {
                 return $this->makeListView($request, $param1, $param2, $param3);
             } else {
                 if (is_year($param1) && is_month($param2) && !is_null($param3) && is_null($param4)) {
                     if (is_day($param3)) {
                         return $this->makeDayView($request, $param1, $param2, $param3);
                     } else {
                         if (is_uuid($param3)) {
                             return $this->makeMonthEmployeeView($request, $param1, $param2, $param3);
                         } else {
                             return redirect('/dtr/' . now('year'));
                         }
                     }
                 } else {
                     if (is_year($param1) && is_month($param2) && is_day($param3)) {
                         return $this->makeDayEmployeeView($request, $param1, $param2, $param3, $param4);
                     } else {
                         return redirect('/dtr/' . now('year'));
                     }
                 }
             }
         }
     }
     //.'/'.now('month'));//return $this->makeListView($request, $param1, $param2, $param3);
 }
开发者ID:jrsalunga,项目名称:gi-manager,代码行数:33,代码来源:DtrController.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP nr_query函数代码示例发布时间:2022-05-15
下一篇:
PHP notify_user函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap