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


PHP input_date函数代码示例

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


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

示例1: sort_ajax_alert

function sort_ajax_alert($a, $b)
{
    if (isset($a['time']) && isset($b['time'])) {
        return $a['time'] > $b['time'];
    }
    return strtotime(input_date($a['date'])) > strtotime(input_date($b['date']));
}
开发者ID:sgh1986915,项目名称:php-crm,代码行数:7,代码来源:dashboard.php

示例2: input_datetime

function input_datetime($field, $value)
{
    $seg = $field . '_seg';
    $min = $field . '_min';
    $hour = $field . '_hour';
    $sel_seg = substr($value, 17, 2) ? substr($value, 17, 2) : date('s');
    $sel_min = substr($value, 14, 2) ? substr($value, 14, 2) : date('i');
    $sel_hour = substr($value, 11, 2) ? substr($value, 11, 2) : date('h');
    $ret = input_date($field, $value) . ' @ ';
    $ret .= select_range($hour, $sel_hour, 0, 23) . ':';
    $ret .= select_range($min, $sel_min, 0, 59, 5) . ':';
    $ret .= select_range($seg, $sel_seg, 0, 59, 5);
    return $ret;
}
开发者ID:atiarda,项目名称:phpscaffold,代码行数:14,代码来源:inc.functions.php

示例3: caller_interface

 /** Specifies the content for the caller interface view. */
 public function caller_interface($user_id)
 {
     if (!correct_user($user_id)) {
         return;
     }
     $user = $this->userModel->get_user_by_id($user_id);
     $experiments = $this->callerModel->get_experiments_by_caller($user_id);
     $nr_experiments = count($experiments);
     // Count total number of participants (and especially for longitudinal experiments)
     $longitudinal = array();
     $nr_participants = 0;
     foreach ($experiments as $e) {
         $n = count($this->participantModel->find_participants($e));
         $nr_participants += $n;
         $prereqs = $this->relationModel->get_relation_ids_by_experiment($e->id, RelationType::Prerequisite, TRUE);
         if ($prereqs && $n > 0) {
             $longitudinal[$e->name] = $n;
         }
     }
     // Check if there are participants that need to be called back today
     $callback_count = $this->participationModel->count_to_be_called_back(input_date());
     $callback_msg = '';
     if ($callback_count) {
         $callback_msg = '<p class="warning">' . sprintf(lang('call_back_warn'), $callback_count) . '</p>';
     }
     // Count testinvites that need to be reminded manually
     $testinvite_count = $this->testInviteModel->count_to_be_reminded_testinvites();
     $testinvite_url = array('url' => 'testinvite/index/1', 'title' => sprintf(lang('testinvite_action'), $testinvite_count));
     create_experiment_table();
     $data['ajax_source'] = 'experiment/table/0/' . $user_id;
     $data['page_title'] = sprintf(lang('welcome'), $user->username);
     $data['page_info'] = sprintf(lang('info_caller'), $nr_experiments, $nr_participants) . $callback_msg . $this->construct_longitudinal_message($longitudinal);
     $data['action_urls'] = array($testinvite_url);
     $this->load->view('templates/header', $data);
     $this->authenticate->authenticate_redirect('templates/list_view', $data, UserRole::Caller);
     $this->load->view('templates/footer');
 }
开发者ID:UiL-OTS-labs,项目名称:babylab-admin,代码行数:38,代码来源:welcome.php

示例4: process

 function process()
 {
     if ('save_note' == $_REQUEST['_process']) {
         $note_id = $_REQUEST['note_id'];
         $options = unserialize(base64_decode($_REQUEST['options']));
         if (!$options) {
             return;
         }
         if (!$note_id || $note_id == 'new') {
             $note_data = array('note_id' => $note_id, 'owner_id' => $options['owner_id'], 'owner_table' => $options['owner_table'], 'note_time' => strtotime(input_date(urldecode($_REQUEST['note_time']), true)), 'note' => urldecode($_REQUEST['note']), 'rel_data' => isset($_REQUEST['rel_data']) ? $_REQUEST['rel_data'] : '', 'reminder' => isset($_REQUEST['reminder']) ? $_REQUEST['reminder'] : 0, 'user_id' => isset($_REQUEST['user_id']) ? $_REQUEST['user_id'] : 0);
         } else {
             // some fields we dont want to overwrite on existing notes:
             $note_data = array('note_id' => $note_id, 'note_time' => strtotime(input_date(urldecode($_REQUEST['note_time']), true)), 'note' => urldecode($_REQUEST['note']), 'reminder' => isset($_REQUEST['reminder']) ? $_REQUEST['reminder'] : 0, 'user_id' => isset($_REQUEST['user_id']) ? $_REQUEST['user_id'] : 0);
         }
         if (isset($_REQUEST['public_chk']) && $_REQUEST['public_chk']) {
             $note_data['public'] = isset($_REQUEST['public']) ? $_REQUEST['public'] : 0;
         }
         // TODO - sanatise this note data with security module.
         // make sure we're saving a note we have access too.
         //module_security::sanatise_data('note',$note_data);
         // sanatise broke our update code.
         $note_id = update_insert('note_id', $note_id, 'note', $note_data);
         if (isset($_REQUEST['from_normal'])) {
             set_message('Note saved successfully');
             redirect_browser($this->link_open($note_id, false, $options));
         }
         echo $this->print_note($note_id, false, isset($options['display_summary']) && $options['display_summary'], false, false, $options);
         exit;
     }
 }
开发者ID:sgh1986915,项目名称:php-crm,代码行数:30,代码来源:note.php

示例5: save_invoice


//.........这里部分代码省略.........
                             if ($invoice_payment_data['payment_type'] == _INVOICE_PAYMENT_TYPE_REFUND) {
                                 $invoice_payment_data['payment_type'] = _INVOICE_PAYMENT_TYPE_NORMAL;
                             }
                         }
                     }
                 }
                 // check this invoice payment actually matches this invoice.
                 $invoice_payment_data_existing = false;
                 if ($invoice_payment_id > 0) {
                     $invoice_payment_data_existing = get_single('invoice_payment', array('invoice_payment_id', 'invoice_id'), array($invoice_payment_id, $invoice_id));
                     if (!$invoice_payment_data_existing || $invoice_payment_data_existing['invoice_payment_id'] != $invoice_payment_id || $invoice_payment_data_existing['invoice_id'] != $invoice_id) {
                         $invoice_payment_id = 0;
                         $invoice_payment_data_existing = false;
                     }
                 }
                 if (!isset($invoice_payment_data['amount']) || $invoice_payment_data['amount'] == '' || $invoice_payment_data['amount'] == 0) {
                     // || $invoice_payment_data['amount'] <= 0
                     if ($invoice_payment_id > 0) {
                         // if this is a customer credit payment, return that back to the customer account.
                         if ($invoice_payment_data_existing && $invoice_data['customer_id']) {
                             switch ($invoice_payment_data_existing['payment_type']) {
                                 case _INVOICE_PAYMENT_TYPE_CREDIT:
                                     module_customer::add_credit($invoice_data['customer_id'], $invoice_payment_data_existing['amount'], 'Refunded credit from invoice payment');
                                     break;
                             }
                         }
                         // remove invoice_payment.
                         $sql = "DELETE FROM `" . _DB_PREFIX . "invoice_payment` WHERE invoice_payment_id = '{$invoice_payment_id}' AND invoice_id = {$invoice_id} LIMIT 1";
                         query($sql);
                         // delete any existing transactions from the system as well.
                         hook_handle_callback('invoice_payment_deleted', $invoice_payment_id, $invoice_id);
                     }
                     continue;
                 }
                 if (!$invoice_payment_id && (!isset($_REQUEST['add_payment']) || $_REQUEST['add_payment'] != 'go')) {
                     continue;
                     // not saving a new one.
                 }
                 // add / save this invoice_payment.
                 $invoice_payment_data['invoice_id'] = $invoice_id;
                 // $invoice_payment_data['currency_id'] = $invoice_data['currency_id'];
                 $last_payment_time = max($last_payment_time, strtotime(input_date($invoice_payment_data['date_paid'])));
                 if (isset($invoice_payment_data['custom_notes'])) {
                     $details = @unserialize($invoice_payment_data['data']);
                     if (!is_array($details)) {
                         $details = array();
                     }
                     $details['custom_notes'] = $invoice_payment_data['custom_notes'];
                     $invoice_payment_data['data'] = serialize($details);
                 }
                 $invoice_payment_data['amount'] = number_out($invoice_payment_data['amount']);
                 update_insert('invoice_payment_id', $invoice_payment_id, 'invoice_payment', $invoice_payment_data);
             }
         }
         if (!$last_payment_time) {
             $last_payment_time = strtotime(date('Y-m-d'));
         }
         // check if the invoice has been paid
         module_cache::clear('invoice');
         //module_cache::clear_cache(); // this helps fix the bug where part payments are not caulcated a correct paid date.
         $invoice_data = self::get_invoice($invoice_id);
         if (!$invoice_data) {
             set_error('No permissions to access invoice.');
             return $invoice_id;
         }
         if ((!$invoice_data['date_paid'] || $invoice_data['date_paid'] == '0000-00-00') && $invoice_data['total_amount_due'] <= 0 && ($invoice_data['total_amount_paid'] > 0 || $invoice_data['discount_amount'] > 0) && (!$invoice_data['date_cancel'] || $invoice_data['date_cancel'] == '0000-00-00')) {
             // find the date of the last payment history.
             // if the sent date is null also update that.
             $date_sent = $invoice_data['date_sent'];
             if (!$date_sent || $date_sent == '0000-00-00') {
                 $date_sent = date('Y-m-d', $last_payment_time);
             }
             update_insert("invoice_id", $invoice_id, "invoice", array('date_paid' => date('Y-m-d', $last_payment_time), 'date_sent' => $date_sent, 'status' => _l('Paid')));
             // hook for our ticketing plugin to mark a priority support ticket as paid.
             // or anything else down the track.
             module_cache::clear('invoice');
             handle_hook('invoice_paid', $invoice_id);
             if (module_config::c('invoice_automatic_receipt', 1)) {
                 // send receipt to customer.
                 self::email_invoice_to_customer($invoice_id);
             }
         }
         if ($invoice_data['total_amount_due'] > 0) {
             // update the status to unpaid.
             update_insert("invoice_id", $invoice_id, "invoice", array('date_paid' => '', 'status' => $invoice_data['status'] == _l('Paid') ? module_config::s('invoice_status_default', 'New') : $invoice_data['status']));
         }
         if (class_exists('module_extra', false) && module_extra::is_plugin_enabled()) {
             module_extra::save_extras('invoice', 'invoice_id', $invoice_id);
         }
         if ($invoice_data['customer_id']) {
             //module_cache::clear_cache();
             module_cache::clear('invoice');
             module_customer::update_customer_status($invoice_data['customer_id']);
         }
         hook_handle_callback('invoice_saved', $invoice_id, $invoice_data);
     }
     module_cache::clear('invoice');
     module_cache::clear('job');
     return $invoice_id;
 }
开发者ID:sgh1986915,项目名称:php-crm,代码行数:101,代码来源:invoice.php

示例6: uasort

}
uasort($upcoming_finances, 'sort_recurring_finance');
// we have to search in PHP because our filters return results from all over the place
if (isset($search) && is_array($search)) {
    foreach ($upcoming_finances as $recurring_id => $recurring) {
        if ($recurring['next_due_date'] && $recurring['next_due_date'] != '0000-00-00') {
            $recurring_date = strtotime($recurring['next_due_date']);
            if (isset($search['date_from']) && strlen($search['date_from'])) {
                $search_from = strtotime(input_date($search['date_from']));
                if ($recurring_date < $search_from) {
                    unset($upcoming_finances[$recurring_id]);
                    continue;
                }
            }
            if (isset($search['date_to']) && strlen($search['date_to'])) {
                $search_to = strtotime(input_date($search['date_to']));
                if ($recurring_date > $search_to) {
                    unset($upcoming_finances[$recurring_id]);
                    continue;
                }
            }
        }
        if (isset($search['generic']) && strlen($search['generic']) > 0) {
            $name = strip_tags(isset($recurring['url']) && $recurring['url'] ? $recurring['url'] : module_finance::link_open_recurring($recurring['finance_recurring_id'], true, $recurring));
            if (stripos($name, $search['generic']) === false) {
                unset($upcoming_finances[$recurring_id]);
                continue;
            }
        }
        if (isset($search['amount_from']) && strlen($search['amount_from'])) {
            $amount = number_in($search['amount_from']);
开发者ID:sgh1986915,项目名称:php-crm,代码行数:31,代码来源:recurring_list.php

示例7: get_future_impediments_by_participant

 /** Returns all future impediments for a participant */
 public function get_future_impediments_by_participant($participant_id)
 {
     $this->db->where('participant_id', $participant_id);
     $this->db->where('to >=', input_date());
     return $this->db->get('impediment')->result();
 }
开发者ID:UiL-OTS-labs,项目名称:babylab-admin,代码行数:7,代码来源:impedimentmodel.php

示例8: replace_content


//.........这里部分代码省略.........
                                 echo "No match this time \n";
                             }
                         }
                     } else {
                         // we're just checking if this value exists or not.
                         if (strlen($template_tag_value) > 0 && $template_tag_value != '0000-00-00' && $template_tag_value != _l('N/A')) {
                             // it's a match!
                             $new_content = $bits[$elseif_key];
                             break;
                         } else {
                             // no match, move onto next bit.
                         }
                     }
                 }
             }
             if ($debug) {
                 echo "Final content to use will be: \n" . $new_content;
             }
             $content = str_replace($matches[0][$key], $new_content, $content);
         }
     }
     foreach ($this->values as $key => $val) {
         if (is_array($val)) {
             continue;
         }
         // if this isn't a html field we add newlines.
         if (!preg_match('#<[^>]+>#', $val)) {
             // raw text. nl2br
             $val = nl2br($val);
         }
         $content = str_replace('{' . strtoupper($key) . '}', $val, $content);
         // we perform some basic arithmetic on some replace fields.
         if (preg_match_all('#\\{(currency:)?' . preg_quote(strtoupper($key), '#') . '([*+-])([\\d\\.]+)\\}#', $content, $matches)) {
             // pull the "number" portion out of this string for math processing.
             // string could look like this: "$150.10 USD"
             $mathval = $originalval = $val;
             if (preg_match('#([\\d.,]+)#', $val, $mathvalmatches)) {
                 $mathval = $originalval = $mathvalmatches[1];
             }
             foreach ($matches[0] as $i => $v) {
                 $mathval = $originalval;
                 if ($matches[2][$i] == '-') {
                     $mathval = $mathval - $matches[3][$i];
                 } else {
                     if ($matches[2][$i] == '+') {
                         $mathval = $mathval + $matches[3][$i];
                     } else {
                         if ($matches[2][$i] == '*') {
                             $mathval = $mathval * $matches[3][$i];
                         }
                     }
                 }
                 if (strtolower($matches[1][$i]) == 'currency:') {
                     $mathval = dollar($mathval, true, isset($this->values['currency_id']) ? $this->values['currency_id'] : false);
                 }
                 $newval = str_replace($originalval, $mathval, $val);
                 $content = str_replace($v, $newval, $content);
             }
         }
         if (preg_match_all('#\\{currency:(' . preg_quote(strtoupper($key), '#') . ')\\}#', $content, $matches)) {
             foreach ($matches[0] as $i => $v) {
                 $content = str_replace($v, dollar($val, true, isset($this->values['currency_id']) ? $this->values['currency_id'] : false), $content);
             }
         }
         // we perform some arithmetic on date fields.
         $matches = false;
         if (stripos($key, 'date') !== false && $val && strlen($val) > 6 && preg_match_all('#' . preg_quote('{' . strtoupper($key), '#') . '((?>[+-]\\d+[ymd])*)\\}#', $content, $matches)) {
             //$processed_date = (input_date($val)); $processed_date_timeo =
             $processed_date_time = strtotime(input_date($val));
             foreach ($matches[0] as $i => $v) {
                 if (preg_match_all('#([+-])(\\d+)([ymd])#', $matches[1][$i], $date_math)) {
                     foreach ($date_math[1] as $di => $dv) {
                         $period = $date_math[3][$di];
                         $period = $period == 'd' ? 'day' : ($period == 'm' ? 'month' : ($period == 'y' ? 'year' : 'days'));
                         //echo $dv.$date_math[2][$di]." ".$period."\n";
                         $processed_date_time = strtotime($dv . $date_math[2][$di] . " " . $period, $processed_date_time);
                     }
                     $content = str_replace($v, print_date($processed_date_time), $content);
                     //echo "Processing date: $val - $processed_date (time: $processed_date_timeo / ".print_date($processed_date_timeo).") with result of: ".print_date($processed_date_time); exit;
                 }
             }
         }
         // we perform some date splitting
         $matches = false;
         if (stripos($key, 'date') !== false && $val && strlen($val) > 6 && preg_match_all('#' . preg_quote('{' . strtoupper($key), '#') . '-([ymdYMDjlSWFn])\\}#', $content, $matches)) {
             $processed_date_time = strtotime(input_date($val));
             foreach ($matches[0] as $i => $v) {
                 $content = str_replace($v, date($matches[1][$i], $processed_date_time), $content);
             }
         }
         //$val = str_replace(array('\\', '$'), array('\\\\', '\$'), $val);
         //$content = preg_replace('/\{'.strtoupper(preg_quote($key,'/')).'\}/',$val,$content);
     }
     if (preg_match_all('#\\{l:([^\\}]+)\\}#', $content, $matches)) {
         foreach ($matches[1] as $key => $label) {
             $content = str_replace($matches[0][$key], _l($label), $content);
         }
     }
     return $content;
 }
开发者ID:sgh1986915,项目名称:php-crm,代码行数:101,代码来源:template.php

示例9: process

    public function process()
    {
        if ("save_facebook" == $_REQUEST['_process']) {
            $social_facebook_id = isset($_REQUEST['social_facebook_id']) ? (int) $_REQUEST['social_facebook_id'] : 0;
            $facebook = new ucm_facebook_account($social_facebook_id);
            if (isset($_POST['butt_del']) && module_social::can_i('delete', 'Facebook', 'Social', 'social')) {
                if (module_form::confirm_delete('social_facebook_id', "Really delete this Facebook account from the system? All messages will be lost.", self::link_open($_REQUEST['social_facebook_id']))) {
                    $facebook->delete();
                    set_message("Facebook account deleted successfully");
                    redirect_browser(self::link_open(false));
                }
            }
            $facebook->save_data($_POST);
            $social_facebook_id = $facebook->get('social_facebook_id');
            if (isset($_POST['butt_save_connect'])) {
                $redirect = $this->link_open($social_facebook_id, false, false, 'facebook_account_connect');
            } else {
                set_message('Facebook account saved successfully');
                $redirect = $this->link_open($social_facebook_id);
            }
            redirect_browser($redirect);
            exit;
        } else {
            if ("send_facebook_message" == $_REQUEST['_process']) {
                if (module_form::check_secure_key()) {
                    $social_facebook_id = isset($_REQUEST['social_facebook_id']) ? (int) $_REQUEST['social_facebook_id'] : 0;
                    $facebook = new ucm_facebook_account($social_facebook_id);
                    if ($social_facebook_id && $facebook->get('social_facebook_id') == $social_facebook_id) {
                        // queue the message into the facebook_message table
                        // if there's a scheduled date in the past we send it in the past, no date we send straight away, date in the future we leave it in the db table for the cron job to pick up.
                        //print_r($_POST);exit;
                        $send_time = false;
                        // default: now
                        if (isset($_POST['schedule_date']) && isset($_POST['schedule_time']) && !empty($_POST['schedule_date']) && !empty($_POST['schedule_time'])) {
                            $date = $_POST['schedule_date'];
                            $time_hack = $_POST['schedule_time'];
                            $time_hack = str_ireplace('am', '', $time_hack);
                            $time_hack = str_ireplace('pm', '', $time_hack);
                            $bits = explode(':', $time_hack);
                            if (strpos($_POST['schedule_time'], 'pm')) {
                                $bits[0] += 12;
                            }
                            // add the time if it exists
                            $date .= ' ' . implode(':', $bits) . ':00';
                            $send_time = strtotime(input_date($date, true));
                        } else {
                            if (isset($_POST['schedule_date']) && !empty($_POST['schedule_date'])) {
                                $send_time = strtotime(input_date($_POST['schedule_date'], true));
                            }
                        }
                        //echo print_date($send_time,true);
                        //echo '<br>';
                        //echo date('c',$send_time);
                        //exit;
                        /* @var $available_pages ucm_facebook_page[] */
                        $available_pages = $facebook->get('pages');
                        $send_pages = isset($_POST['compose_page_id']) && is_array($_POST['compose_page_id']) ? $_POST['compose_page_id'] : array();
                        $page_count = 0;
                        if ($send_pages) {
                            foreach ($send_pages as $facebook_page_id => $tf) {
                                if (!$tf) {
                                    continue;
                                }
                                // see if this is an available page.
                                if (isset($available_pages[$facebook_page_id])) {
                                    // push to db! then send.
                                    $facebook_message = new ucm_facebook_message($facebook, $available_pages[$facebook_page_id], false);
                                    $facebook_message->create_new();
                                    $facebook_message->update('social_facebook_page_id', $available_pages[$facebook_page_id]->get('social_facebook_page_id'));
                                    $facebook_message->update('social_facebook_id', $facebook->get('social_facebook_id'));
                                    $facebook_message->update('summary', isset($_POST['message']) ? $_POST['message'] : '');
                                    $facebook_message->update('type', 'pending');
                                    $facebook_message->update('link', isset($_POST['link']) ? $_POST['link'] : '');
                                    $facebook_message->update('data', json_encode($_POST));
                                    $facebook_message->update('user_id', module_security::get_loggedin_id());
                                    // do we send this one now? or schedule it later.
                                    $facebook_message->update('status', _SOCIAL_MESSAGE_STATUS_PENDINGSEND);
                                    if ($send_time) {
                                        // schedule for sending at a different time (now or in the past)
                                        $facebook_message->update('last_active', $send_time);
                                    } else {
                                        // send it now.
                                        $facebook_message->update('last_active', 0);
                                    }
                                    if (isset($_FILES['picture']['tmp_name']) && is_uploaded_file($_FILES['picture']['tmp_name'])) {
                                        $facebook_message->add_attachment($_FILES['picture']['tmp_name']);
                                    }
                                    $facebook_message->send_queued(isset($_POST['debug']));
                                    $page_count++;
                                } else {
                                    // log error?
                                }
                            }
                        }
                        set_message(_l('Message delivered successfully to %s Facebook pages', $page_count));
                        $redirect = $this->link_open_message_view($social_facebook_id);
                        redirect_browser($redirect);
                    }
                }
            } else {
//.........这里部分代码省略.........
开发者ID:sgh1986915,项目名称:php-crm,代码行数:101,代码来源:social_facebook.php

示例10: unset

     if (input_date($data_field_value) != input_date($data['date_created'])) {
         unset($datas[$data_id]);
         continue;
     }
     break;
 case 'created_time':
     echo 'Searching by time not supported yet.';
     break;
 case 'updated_date_time':
     if (input_date($data_field_value, true) != input_date($data['date_updated'], true)) {
         unset($datas[$data_id]);
         continue;
     }
     break;
 case 'updated_date':
     if (input_date($data_field_value) != input_date($data['date_updated'])) {
         unset($datas[$data_id]);
         continue;
     }
     break;
 case 'updated_time':
     echo 'Searching by time not supported yet.';
     break;
 case 'created_by':
     if ($data_field_value != $data['create_user_id']) {
         unset($datas[$data_id]);
         continue;
     }
     break;
 case 'updated_by':
     if ($data_field_value != $data['update_user_id']) {
开发者ID:sgh1986915,项目名称:php-crm,代码行数:31,代码来源:admin_data_search.php

示例11: foreach

         // remove cancelled invoices
         foreach ($invoices as $invoice_id => $invoice) {
             if ($invoice['date_cancel'] != '0000-00-00') {
                 unset($invoices[$invoice_id]);
             }
         }
         if (count($invoices)) {
             $fieldset_data = array('heading' => array('type' => 'h3', 'title' => _l('Invoices Paid Between %s and %s', print_date($date_from), print_date($date_to))));
             $fieldset_data['elements_before'] = customer_admin_email_generate_invoice_list($invoices, $customer_id);
             $email_details .= module_form::generate_fieldset($fieldset_data);
         }
     }
     if (isset($_REQUEST['email']['invoice_unpaid'])) {
         // find all unpaid invoices
         $date_from = input_date($_REQUEST['email']['invoice_paid_date_from']);
         $date_to = input_date($_REQUEST['email']['invoice_paid_date_to']);
         $invoices = module_invoice::get_invoices(array('customer_id' => $customer['customer_id'], 'date_paid' => '0000-00-00'));
         // remove cancelled invoices
         foreach ($invoices as $invoice_id => $invoice) {
             if ($invoice['date_cancel'] != '0000-00-00') {
                 unset($invoices[$invoice_id]);
             }
         }
         if (count($invoices)) {
             $fieldset_data = array('heading' => array('type' => 'h3', 'title' => _l('Unpaid Invoices')));
             $fieldset_data['elements_before'] = customer_admin_email_generate_invoice_list($invoices, $customer_id);
             $email_details .= module_form::generate_fieldset($fieldset_data);
         }
     }
 }
 $template->assign_values(array('email_details' => $email_details));
开发者ID:sgh1986915,项目名称:php-crm,代码行数:31,代码来源:customer_admin_email.php

示例12: post_experiment

 /** Posts the data for an experiment */
 private function post_experiment()
 {
     $date_start = $this->input->post('date_start');
     $date_end = $this->input->post('date_end');
     $exp = array('location_id' => $this->input->post('location'), 'name' => $this->input->post('name'), 'type' => $this->input->post('type'), 'description' => $this->input->post('description'), 'duration' => $this->input->post('duration'), 'wbs_number' => $this->input->post('wbs_number'), 'experiment_color' => $this->input->post('experiment_color'), 'date_start' => $date_start ? input_date($date_start) : NULL, 'date_end' => $date_end ? input_date($date_end) : NULL, 'dyslexic' => $this->input->post('dyslexic') === '1', 'multilingual' => $this->input->post('multilingual') === '1', 'agefrommonths' => $this->input->post('agefrommonths'), 'agefromdays' => $this->input->post('agefromdays'), 'agetomonths' => $this->input->post('agetomonths'), 'agetodays' => $this->input->post('agetodays'), 'target_nr_participants' => $this->input->post('target_nr_participants'));
     if ($this->attachment) {
         $exp['attachment'] = $this->attachment;
     }
     if ($this->informedconsent) {
         $exp['informedconsent'] = $this->informedconsent;
     }
     return $exp;
 }
开发者ID:UiL-OTS-labs,项目名称:babylab-admin,代码行数:14,代码来源:experiment.php

示例13: explode

/** 
 * Copyright: dtbaker 2012
 * Licence: Please check CodeCanyon.net for licence details. 
 * More licence clarification available here:  http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ 
 * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4
 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca
 * Package Date: 2015-11-25 02:55:20 
 * IP Address: 67.79.165.254
 */
// this is shown in a lightbox, editing a particular payment by payment id
$type = $_REQUEST['w'];
$date = explode('|', $_REQUEST['date']);
$start_date = input_date($date[0]);
if (isset($date[1])) {
    $end_date = input_date($date[1]);
    $end_date_str = ' to ' . print_date($end_date);
} else {
    $end_date = $start_date;
    $end_date_str = '';
}
switch ($type) {
    case 'amount_spent':
        // pass this off to it's own file because it's getting a bit messy in here.
        include 'dashboard_popup_amount_spent.php';
        return false;
    case 'amount_paid':
        // pass this off to it's own file because it's getting a bit messy in here.
        include 'dashboard_popup_amount_paid.php';
        return false;
        // find all payments made this week.
开发者ID:sgh1986915,项目名称:php-crm,代码行数:30,代码来源:dashboard_popup.php

示例14: get_multiple

function get_multiple($table, $search = false, $id = false, $search_type = "exact", $order = false)
{
    $sql = "SELECT *";
    if ($id) {
        $sql .= ",`{$id}` AS id";
    }
    $sql .= " FROM `" . _DB_PREFIX . "{$table}`";
    $fields = get_fields($table, array(), array(), true);
    // we force the system id searching if it exists.
    if (isset($fields['system_id']) && defined('_SYSTEM_ID')) {
        $search['system_id'] = _SYSTEM_ID;
    }
    if (is_array($search)) {
        $sql .= " WHERE 1";
        foreach ($search as $key => $val) {
            $this_search_type = $search_type;
            $spesh = false;
            if (trim($val) == '' || $val === false) {
                continue;
            }
            // switch types if searching on numbers..
            // this allows easy fuzzy and exact matches
            // when we have forms that allow user input and drop down id input.
            if (isset($fields[$key]) && $fields[$key]['type'] == 'number') {
                $this_search_type = 'exact';
            }
            if (isset($fields[$key]) && $fields[$key]['type'] == 'date') {
                // we need to format the user input to the database friendly date
                $val = input_date($val);
            }
            // check the operator type
            $operator = "=";
            switch ($key[0]) {
                case "<":
                    $operator = "<=";
                    $spesh = true;
                    $key = substr($key, 1);
                    break;
                case ">":
                    $operator = ">=";
                    $spesh = true;
                    $key = substr($key, 1);
                    break;
            }
            $foo = explode("|", $key);
            $sql .= " AND (";
            foreach ($foo as $k) {
                if (!isset($fields[$k])) {
                    continue;
                }
                if ($spesh) {
                    $sql .= " `{$k}` {$operator} '" . mysql_real_escape_string($val) . "'";
                } else {
                    if ($this_search_type == "fuzzy") {
                        $sql .= " `{$k}` LIKE '%" . mysql_real_escape_string($val) . "%'";
                    } else {
                        if ($this_search_type == "exact") {
                            $sql .= " `{$k}` = '" . mysql_real_escape_string($val) . "'";
                        }
                    }
                }
                $sql .= " OR ";
            }
            $sql = rtrim($sql, " OR ");
            $sql .= ") ";
            $sql = str_replace(' AND () ', '', $sql);
            // incase any of them have incorrect fields.
        }
    }
    if ($order) {
        if (strpos($order, ' ') === false && strpos($order, '`') === false) {
            $order = '`' . $order . '`';
        }
        $sql .= " ORDER BY " . mysql_real_escape_string($order) . "";
    }
    $result = qa($sql);
    //module_security::filter_data_set($table,$result);
    return $result;
}
开发者ID:sgh1986915,项目名称:php-crm,代码行数:79,代码来源:database.php

示例15: table

 public function table($include_past = FALSE)
 {
     $id = $this->session->userdata('user_id');
     $this->datatables->select('from, comment, id');
     $this->datatables->from('availability');
     $this->datatables->where("`user_id` = '" . $this->session->userdata('user_id') . "'");
     if (!$include_past) {
         $this->db->where('to >=', input_date());
     }
     $this->datatables->edit_column('from', '$1', 'availability_dates_by_id(id)');
     $this->datatables->edit_column('id', '$1', 'availability_actions(id)');
     $this->datatables->unset_column('user_id');
     echo $this->datatables->generate();
 }
开发者ID:UiL-OTS-labs,项目名称:babylab-admin,代码行数:14,代码来源:availability.php


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