示例#1
0
 public function saveLog($logID, $gatewayID, $status = 0, $error = '')
 {
     // Is this a new log?
     if (!$logID) {
         $log = array('gateway_id' => $gatewayID, 'data' => '', 'status' => $status ? 1 : 0, 'error' => $error ? substr($error, 0, 255) : '', 'post_date' => date_helper::now());
         $log['data'] .= $_GET ? trim("GET data\n" . array_helper::implodeArray(' = ', "\n", $_GET)) . "\n" : '';
         $log['data'] .= $_POST ? trim("POST data\n" . array_helper::implodeArray(' = ', "\n", $_POST)) : '';
         $logID = $this->db->insert('billing_logs', $log);
     } else {
         $log = array('status' => $status ? 1 : 0, 'error' => $error ? substr($error, 0, 255) : '');
         $this->db->update('billing_logs', $log, array('log_id' => $logID), 1);
     }
     return $logID;
 }
示例#2
0
 public function usersSettingsAccountOptions($settings, $user = array())
 {
     if (input::isCP()) {
         if (uri::segment(3) == 'edit') {
             loader::helper('array');
             $expiration = array('name' => __('expire_date', 'users_account'), 'keyword' => 'expire_date', 'type' => 'date', 'value' => $user ? $user['expire_date'] : 0, 'rules' => array('valid_date'), 'select' => true);
             $credits = array('name' => __('credits_current', 'users_account'), 'keyword' => 'total_credits', 'type' => 'number', 'value' => $user ? $user['total_credits'] : 0, 'rules' => array('required' => 1, 'min_value' => 0));
             $settings = array_helper::spliceArray($settings, 'group_id', $credits, 'total_credits');
             $settings = array_helper::spliceArray($settings, 'group_id', $expiration, 'expire_date');
         }
     } else {
         if (config::item('subscriptions_active', 'billing')) {
             $settings['subscription'] = array('name' => __('plan_current', 'users_account'), 'keyword' => 'subscription', 'type' => 'static', 'value' => config::item('usergroups', 'core', session::item('group_id')) . (session::item('expire_date') ? ' (' . __('expire_date', 'users_account') . ': ' . date_helper::formatDate(session::item('expire_date'), 'date') . ')' : '') . (session::permission('plans_purchase', 'billing') ? ' - ' . html_helper::anchor('billing/plans', __('plan_change', 'users_account')) : ''));
         }
         if (config::item('credits_active', 'billing')) {
             $settings['credits'] = array('name' => __('credits_current', 'users_account'), 'keyword' => 'subscription', 'type' => 'static', 'value' => session::item('total_credits') . (session::permission('credits_purchase', 'billing') ? ' - ' . html_helper::anchor('billing/credits', __('credits_purchase', 'users_account')) : ''));
         }
     }
     return $settings;
 }
示例#3
0
        ?>

		<?php 
        break;
        ?>

	<?php 
    case 'birthday':
        ?>

		<?php 
        echo form_helper::select($name . '__from', array('' => __('range_from', 'system')) + array_helper::buildArray(isset($field['config']['min_age']) ? $field['config']['min_age'] : 18, isset($field['config']['max_age']) ? $field['config']['max_age'] : 99), form_helper::setSelect($name . '__from', isset($value[$name . '__from']) ? $value[$name . '__from'] : ''), array('class' => 'select ' . (isset($field['class']) && $field['class'] ? $field['class'] : ''), 'style' => isset($field['style']) && $field['style'] ? $field['style'] : '', 'id' => $id . '__from'));
        ?>
		-
		<?php 
        echo form_helper::select($name . '__to', array('' => __('range_to', 'system')) + array_helper::buildArray(isset($field['config']['min_age']) ? $field['config']['min_age'] : 18, isset($field['config']['max_age']) ? $field['config']['max_age'] : 99), form_helper::setSelect($name . '__to', isset($value[$name . '__to']) ? $value[$name . '__to'] : ''), array('class' => 'select ' . (isset($field['class']) && $field['class'] ? $field['class'] : ''), 'style' => isset($field['style']) && $field['style'] ? $field['style'] : '', 'id' => $id . '__to'));
        ?>
		<?php 
        break;
        ?>

	<?php 
    case 'select':
        ?>

		<?php 
        if (isset($field['config']['search_options']) && $field['config']['search_options'] == 'multiple') {
            ?>
			<div class="checkbox <?php 
            echo isset($field['config']['columns_number']) && $field['config']['columns_number'] ? 'inline' . $field['config']['columns_number'] : 'inline1';
            ?>