Ejemplo n.º 1
0
        $bez = substr($bez, 1);
        $av_p = round($dat['points'] / $dat['members'], 2);
        $av_pcs = round($dat['pcs'] / $dat['members'], 2);
        // SUCCESS RATE CALCULATION START
        $cluster = getcluster($bez);
        $total = $cluster['srate_total_cnt'];
        $scnt = $cluster['srate_success_cnt'];
        $ncnt = $cluster['srate_noticed_cnt'];
        if ($total > 0) {
            $psucceeded = $scnt * 100 / $total;
            $pnoticed = $ncnt * 100 / $total;
            // Erfolg ist gut und zählt 75%
            // Bemerkt ist schlecht (deshalb 100-$pnoticed) und zählt 25%
            $srate = $psucceeded * 0.75 + (100 - $pnoticed) * 0.25;
        } else {
            $srate = 0;
        }
        // SUCCESS RATE CALCULATION END
        if ($bez != $no_ranking_clusters) {
            db_query('INSERT INTO rank_clusters VALUES(0,\'' . mysql_escape_string($bez) . '\',\'' . mysql_escape_string($dat['members']) . '\',\'' . mysql_escape_string($dat['points']) . '\',\'' . mysql_escape_string($av_p) . '\',\'' . mysql_escape_string($dat['pcs']) . '\',\'' . mysql_escape_string($av_pcs) . '\',\'' . mysql_escape_string($srate) . '\');');
        }
        db_query('UPDATE clusters SET points=\'' . mysql_escape_string($dat['points']) . '\',rank=\'' . mysql_insert_id() . '\' WHERE id=\'' . mysql_escape_string($bez) . '\' LIMIT 1;');
    }
    file_put('data/calc-stat.dat', 'Gleich fertig!!!');
    cleardir('data/_server' . $server . '/usrimgs');
}
server_update_points(1);
unlink('data/calc-running.dat');
unlink('data/calc-stat.dat');
echo '<br /><br /><br />ZEIT: ' . calc_time($starttime);
Ejemplo n.º 2
0
 // 条件选项
 $tag_list = array(1 => '超过1个月', 2 => '超过2个月', 3 => '超过3个月', 6 => '超过半年', 12 => '超过1年', 24 => '超过2年');
 $tmp = array_keys($tag_list);
 if (!empty($_REQUEST['tag'])) {
     $start = calc_time($_REQUEST['tag']);
     $_REQUEST['start_time'] = $start['year'] . '-' . $start['month'] . '-01 00:00:00';
     $_REQUEST['end_time'] = date('Y-m-t 23:59:59');
     if (end($tag_list) != $tag_list[$_REQUEST['tag']]) {
         $key = array_search($_REQUEST['tag'], $tmp);
         $limit = calc_time($tmp[$key + 1]);
         $_REQUEST['time_limit'] = $limit['year'] . '-' . $limit['month'] . '-01 00:00:00';
     }
     $res['tag'] = $_REQUEST['tag'];
     $condition = '&tag=' . $_REQUEST['tag'];
 } else {
     $limit = calc_time(next($tmp));
     $_REQUEST['time_limit'] = $limit['year'] . '-' . $limit['month'] . '-01 00:00:00';
 }
 if (admin_priv('outflow_list_all', '', false)) {
     $platform = get_role_list(1);
     $platform_list = array();
     foreach ($platform as $val) {
         $platform_list[$val['role_id']] = $val['role_name'];
     }
     $smarty->assign('platform', $platform_list);
     $admin_list = get_admin_tmp_list();
 } elseif (admin_priv('outflow_list_part', '', false)) {
     $admin_list = get_admin_tmp_list($_SESSION['role_id']);
 } else {
     $_REQUEST['admin_id'] = $_SESSION['admin_id'];
 }
Ejemplo n.º 3
0
 public function get_order_time()
 {
     ci()->load->model('admin/stores_model');
     $options['store_id'] = ci()->input->get('store_id');
     $date = ci()->input->get('date');
     ci()->session->set_userdata('date', $date);
     $week_day = ci()->input->get('week_day');
     $selected = ci()->input->get('selected');
     $dt = ci()->input->get('delivery_type');
     $zip = ci()->input->get('zip');
     if (!$date) {
         $stamp = strtotime('+1 Day');
         $cleanses_date[][$stamp] = $stamp;
     } else {
         $stamp = strtotime($date . ' 23:59:59');
         $cleanses_date[][$stamp] = $stamp;
     }
     if ($dt == 'deliver') {
         $opt = array('custom' => "delivery_zip like '%{$zip}%'");
         $store_data = ci()->stores_model->get_row($opt);
         $store_data['open_days'] = $store_data['delivery_days'];
     } else {
         $store_data = ci()->stores_model->get_row($options);
     }
     $lead_time = 0;
     foreach (ci()->cart->contents() as $k => $v) {
         $options['where']['product_id'] = $v['option']['product_id'];
         $product = ci()->products_model->get_row($options);
         if ((int) $product['lead_time'] > $lead_time) {
             $lead_time = (int) $product['lead_time'];
         }
     }
     if ($dt == 'deliver') {
         $store_data['open_days'] = serialize(array_values(unserialize($store_data['delivery_days'])));
         if ($cleanses_time = calc_delivery_time($store_data['lead_time'], $store_data, $cleanses_date, $selected)) {
             echo '<label class="delivery-label">What time would you like it by?</label>' . $cleanses_time . '<br><sup style="color:red; ">note: <br>for 1, 2 & 3 day cleanses you will have 1 pickup day<br> for 4, 5 & 6+ day cleanses you will have 2(+) pickup days</sup>';
         }
     } elseif ($dt == 'shipping') {
         echo '';
     } else {
         if ($cleanses_time = calc_time($lead_time, $store_data, $dt, $cleanses_date, $selected)) {
             echo '<label class="delivery-label">What time would you like it ready by?</label>' . $cleanses_time . '<br><sup style="color:red; ">note: <br>for 1, 2 & 3 day cleanses you will have 1 pickup day<br> for 4, 5 & 6+ day cleanses you will have 2(+) pickup days</sup>';
         }
     }
     exit;
 }
Ejemplo n.º 4
0
function createlayout_bottom()
{
    global $starttime;
    if ($starttime > 0) {
        $time = (double) calc_time($starttime, 0, 10);
        if ($t < 1) {
            $time = number_format($time * 1000, 1, '.', ',') . ' ms';
        } else {
            $time = number_format($time, 2, ',', '.') . ' s';
        }
    }
    $time2 = nicetime3(0, '');
    echo '
<div id="generation-time">' . $time . '</div>
<div id="server-time">' . $time2 . '</div>
';
    basicfooter();
}
Ejemplo n.º 5
0
 * note ID rejected from SECTION by EDITOR
 * note ID modified in SECTION by EDITOR
 * note ID moved from SECTION to SECTION by EDITOR (not matched yet)
 */
$reg = '/^note (\\d*) (.*) (?:from|in) (\\S*) by (\\w*)/';
reset($inputs);
while (list(, $inp) = each($inputs)) {
    list($odate, $subj) = $inp;
    if (preg_match($reg, $subj, $d)) {
        if ($d[2] == 'rejected and deleted') {
            $d[2] = 'rejected';
        }
        if ($d[2] == 'approved') {
            continue;
        }
        if (calc_time($odate)) {
            // 'new' before $after
            @$team['n'][$d[4]]['total']++;
            @$team['n'][$d[4]][$d[2]]++;
            @$tmp['n'][$d[4]]++;
            @$files['n'][$d[3]]++;
        } else {
            // 'old' after $after
            @$team['o'][$d[4]][$d[2]]++;
            @$tmp['o'][$d[4]]++;
            @$team['o'][$d[4]]['total']++;
            @$files['o'][$d[3]]++;
        }
        // the normal arrays
        @$team[$d[4]]['total']++;
        @$team[$d[4]][$d[2]]++;