if ($from == '') { if ($to == '') { $from = get_current_day('-6 days'); $to = get_current_day(); } else { $from = date('Y-m-d', strtotime('-6 days', strtotime($to))); } } else { if ($to == '') { $to = date('Y-m-d', strtotime('+6 days', strtotime($from))); } } $days = getDatesBetween($from, $to); $days_active = 'active'; } $sales = get_sales($from, $to, $days, $month); krsort($sales); ?> <div class="row"> <div class="col-md-4"> <div class="btn-group"> <a href="?act=reports&type=sales&subtype=daily" type="button" class="btn btn-default <?php echo $days_active; ?> ">По дням</a> <a href="?act=reports&type=sales&subtype=monthly" type="button" class="btn btn-default <?php echo $month_active; ?> ">По месяцам</a> </div> </div>
break; case 'restore_link': $id = rq('id', 2); delete_offer($id, 0); cache_links_update(); exit; break; case 'delete_sale': $type = $_REQUEST['type']; $click_id = rq('click_id', 2); $conversion_id = rq('conversion_id', 2); delete_sale($click_id, $conversion_id, $type); exit; break; case 'get_sales': $sales = get_sales($_POST['sType'], $_POST['sStart'], $_POST['sEnd']); echo json_encode($sales); exit; break; case 'delete_rule': $rule_id = $_REQUEST['id']; delete_rule($rule_id); exit; break; case 'restore_rule': $rule_id = intval($_POST['id']); restore_rule($rule_id); exit; break; case 'move_link_to_category': $category_id = $_REQUEST['category_id'];
public function Addgood($a, $b) { $Tuanid = $a; $good = $b; $array = explode(',', $good); $User = M("Tuanid"); if ($User->where("Tuanpid='{$Tuanid}'")->select()) { $User->where("Tuanpid='{$Tuanid}'")->delete(); //商品列表如果存在则删除,重新循环遍历 for ($i = 0; $i < count($array); $i++) { $goodid = $array[$i]; $data["goodid"] = $goodid; $data["price"] = get_good_tuanprice($goodid); $data["view"] = get_good_view($goodid); $data["salenumber"] = get_sales($goodid); $data["tuanpid"] = $Tuanid; $data["create_time"] = time(); // 设置用户的创建时间 $User->add($data); } } else { //商品列表不存在,遍历添加 for ($i = 0; $i < count($array); $i++) { $goodid = $array[$i]; $data["goodid"] = $goodid; $data["Tuanpid"] = $Tuanid; $data["price"] = get_good_price($goodid); $data["view"] = get_good_view($goodid); $data["salenumber"] = get_sales($goodid); $data["create_time"] = time(); // 设置用户的创建时间 $User->add($data); } } }
$mysql[] = $mle_totalcount_num . ' mle.mc.total'; $db->Query("SELECT COUNT(*) FROM soloads WHERE receipt != '' AND datemailed='0000-00-00 00:00:00'"); list($mle_pending_soloads) = $db->FetchRow(); $mysql[] = $mle_pending_soloads . ' mle.soloads'; $db->SelectDB('fap'); $db->Query("SELECT COUNT(*) FROM mailqueue WHERE 1"); list($fap_queue_num) = $db->FetchRow(); $mysql[] = $fap_queue_num . ' fap.queue'; $db->SelectDB('mle'); $sales = array(); $sales[] = 'Sales'; $sales[] = '-----'; for ($i = 6; $i > -1; $i--) { $db->Query("SELECT DATE_SUB(CURDATE(), INTERVAL {$i} DAY)"); list($prev_day) = $db->FetchRow(); $sales[] = "{$prev_day} \$" . get_sales($prev_day, $db); } $hdtemp = array(); $hdtemp[] = 'Disk Temp'; $hdtemp[] = '---------'; $hdtemp[] = parse_hddtemp(popen2('/usr/sbin/hddtemp /dev/sda')); $hdtemp[] = parse_hddtemp(popen2('/usr/sbin/hddtemp /dev/sdb')); $hdtemp[] = parse_hddtemp(popen2('/usr/sbin/hddtemp /dev/sdc')); $hdtemp[] = parse_hddtemp(popen2('/usr/sbin/hddtemp /dev/sdd')); $procbounce = array(); $procbounce[] = 'Daemons'; $procbounce[] = '-------'; list(, $procbounce[]) = explode('-q ', system('ps aux | grep procbounce.php | grep -v grep')); list(, $procbounce[]) = explode('-q ', system('ps aux | grep sendqueue.php | grep -v grep')); list(, $procbounce[]) = explode('-q ', system('ps aux | grep sendsoload.php | grep -v grep')); $col_1 = array_merge($mysql, $SPACER, $postfix, $SPACER, $nginx);