\n"; echo "parent.window.location.href=\"../../element/bssSpecific/alarm_show.php?info=$info&backurl=$backurl\";\n"; echo "\n"; } adjust_head_frame("down"); adjust_title_head_frame("down"); adjust_title_tail_frame("down"); adjust_content_head_frame("down"); echo "
"; $DEBUG=0; $db='PPS_DB'; global $OMC_server; $ppsDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], $db); $face_value_type = 6; $moneyPara = getMoneyPara_forPpsReport(); //显示的货币单位是最小货币单位的倍数 $moneyPara=$moneyPara+0; if(!isset($moneyPara)||$moneyPara==0||trim($moneyPara)=="") { $info="The parameter (currency_decimal)
has no value,please set it!"; $backurl="../../sysDefine/pubVarDef/paramList.php"; show_alarm($info,$backurl); } $dotLen = strLen($moneyPara) - 1; //echo "
dotLen=$dotLen"; $query_year=$_REQUEST['query_year']; $query_week=$_REQUEST['query_week']; if ($DEBUG) echo "query_year = $query_year,query_week = $query_week
"; $fmtBit = "%01.".$dotLen."f"; ?> "; return ($weekNum); } if(!$query_year) { $query_year=date("Y",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); } $firstw = date("w",mktime(0,1,0,1,1,date($query_year))); $lastDayNumber = date("z",mktime(0,0,0,date("m"),date("d")-1,date("Y")))+1; $lastWeekNumber = floor(($lastDayNumber-(7-$firstw)) / 7)+1; if ($DEBUG) echo "firstw = $firstw,"; if ($DEBUG) echo "lastDayNumber=$lastDayNumber,"; if ($DEBUG) echo "lastWeekNumber=$lastWeekNumber
"; if(!$query_week) { $query_week=$lastWeekNumber; } $defaultWeek="$query_year-$query_week"; if($DEBUG) echo "defaultWeek=$defaultWeek
"; $year=date("Y")."-".date("m")."-".date("d").",".date("w"); if($DEBUG) echo "Today is $year
"; $thisFebDays=date("t",mktime(0,0,0,2,1,date("Y"))); if($DEBUG) echo "thisFebDays=$thisFebDays
"; $strWeek = array( "0" => "Sun", "1" => "Mon", "2" => "Tue", "3" => "Wed", "4" => "Thu", "5" => "Fri", "6" => "Sat", ); $monDays = array( "0" => "31", "1" => "$thisFebDays", "2" => "31", "3" => "30", "4" => "31", "5" => "30", "6" => "31", "7" => "31", "8" => "30", "9" => "31", "10" => "30", "11" => "31", ); /* $i=0; for($i=0;$i<12;$i++){ echo "$monDays[$i],"; } */ $selWeekFirstDayNumber = 7-$firstw+($query_week-2)*7+1; if($DEBUG) echo "selWeekFirstDayNumber=$selWeekFirstDayNumber,"; $i=0; while($selWeekFirstDayNumber>=$monDays[$i]){ $selWeekFirstDayNumber = $selWeekFirstDayNumber-$monDays[$i]; $i++; }; $bgnMonth = $i+1; $bgnDay = $selWeekFirstDayNumber; $bgnDay = (($bgnDay<10&&$bgnDay>0)?"0":"").$bgnDay; if($bgnDay>0) $bgnDay = $query_year."-".$bgnMonth."-".$bgnDay; elseif($bgnDay<=0){ if($bgnMonth<=1) { $bgnYear=$query_year-1; $bgnDay =31+$bgnDay; $bgnDay = $bgnYear."-12"."-".$bgnDay; } else { $bgnMonth = $bgnMonth - 1; $bgnDay =$monDays[$bgnMonth-1]; $bgnDay = $query_year."-".$bgnMonth."-".$bgnDay; } } if($DEBUG) echo "bgnMonth=$bgnMonth,"; if($DEBUG) echo "bgnDay=$bgnDay
"; $selWeekLastDayNumber = 7-$firstw+($query_week-1)*7; if($DEBUG) echo "selWeekLastDayNumber=$selWeekLastDayNumber,"; $i=0; while($selWeekLastDayNumber>=$monDays[$i]){ $selWeekLastDayNumber = $selWeekLastDayNumber-$monDays[$i]; $i++; }; $endMonth = $i+1; $endDay = $selWeekLastDayNumber; $endDay = ($endDay<10?"0":"").$endDay; $endDay = $query_year."-".$endMonth."-".$endDay; if($DEBUG) echo "endDay=$endDay
"; echo "
"; $selSQL ="SELECT * FROM daily_report WHERE date>='$bgnDay' and date<='$endDay' order by date ASC"; if($DEBUG) echo "selSQL=$selSQL
"; $selRes = mysqli_query($ppsDbConn,$selSQL); echo mysqli_error($ppsDbConn); $selRow = @mysqli_fetch_array($selRes); if(!$selRow){ echo "No record found!($query_year-$query_week)!"; exit(); } //Account summary $lastWeekBalance=0; $thisWeekRecharge=0; $thisWeekBalance=0; $thisWeekCharge=0; //Account report $thisWeekFresh=0; $thisWeekInuse=0; $thisWeekSuspended=0; $thisWeekBlacklist=0; $thisWeekReleased=0; $thisWeekOprTrial=0; $thisWeekTotal=0; //Recharge card $faceValue1=0; $thisWeekFaceValue1Used=0; $thisWeekFaceValue1Unused=0; $faceValue2=0; $thisWeekFaceValue2Used=0; $thisWeekFaceValue2Unused=0; $faceValue3=0; $thisWeekFaceValue3Used=0; $thisWeekFaceValue3Unused=0; $faceValue4=0; $thisWeekFaceValue4Used=0; $thisWeekFaceValue4Unused=0; $faceValue5=0; $thisWeekFaceValue5Used=0; $thisWeekFaceValue5Unused=0; $faceValue6=0; $thisWeekFaceValue6Used=0; $thisWeekFaceValue6Unused=0; //Call statistics $thisWeekIncomingCallNumber=0; $thisWeekIncomingCallDuration=0; $thisWeekIncomingCallCharge=0; $thisWeekLocalCallNumber=0; $thisWeekLocalCallDuration=0; $thisWeekLocalCallCharge=0; $thisWeekIDDCallNumber=0; $thisWeekIDDCallDuration=0; $thisWeekIDDCallCharge=0; $thisWeekNDDCallNumber=0; $thisWeekNDDCallDuration=0; $thisWeekNDDCallCharge=0; $thisWeekShortMessageNumber=0; $thisWeekShortMessageDuration=0; $thisWeekShortMessageCharge=0; $thisWeekShortMessageViaWebNumber=0; $thisWeekShortMessageViaWebDuration=0; $thisWeekShortMessageViaWebCharge=0; $thisWeekConferenceCallNumber=0; $thisWeekConferenceCallDuration=0; $thisWeekConferenceCallCharge=0; $thisWeekRentNumber=0; $thisWeekRentDuration=0; $thisWeekRentCharge=0; $thisWeekRechargeSuccNumber=0; $thisWeekRechargeSuccDuration=0; $thisWeekRechargeSuccCharge=0; $thisWeekRechargeFailNumber=0; $thisWeekRechargeFailDuration=0; $thisWeekRechargeFailCharge=0; $thisWeekOperatorRechargeNumber=0; $thisWeekOperatorRechargeDuration=0; $thisWeekOperatorRechargeCharge=0; $thisWeekChargeNumber=0; $thisWeekChargeDuration=0; $thisWeekChargeCharge=0; $thisWeekTotalNumber=0; $thisWeekTotalDuration=0; $thisWeekTotalCharge=0; $thisWeekTotalGPRSVolume=0; $thisWeekTotalGPRSDuration=0; $thisWeekTotalGPRSCharged=0; $thisWeekTotalSMSNumber=0; $thisWeekTotalSMSCharged=0; $thisWeekTotalMMSSendNumber=0; $thisWeekTotalMMSSendCharged=0; $thisWeekTotalMMSRetrieveNumber=0; $thisWeekTotalMMSRetrieveCharged=0; $thisWeekTotalMMSEmailNumber=0; $thisWeekTotalMMSEmailCharged=0; $allUssdCodes = []; // 用于存储所有记录的 ussd_code do{ //Account summary if($lastWeekBalance == 0){ $lastWeekBalance = $selRow[yesterday_balance]; } $thisWeekRecharge += $selRow[today_recharge]; $thisWeekBalance = $selRow[today_balance]; $thisWeekCharge += $selRow[today_charge]; $weekNum = getWeekNumFromDay("$selRow[date]"); $dayCharge[$weekNum] = $selRow[today_charge]; //Account report $thisWeekFresh = $selRow[fresh_user_num]; $thisWeekInuse = $selRow[normal_user_num]; $thisWeekSuspended = $selRow[suspend_user_num]; $thisWeekBlacklist = $selRow[blacklist_user_num]; $thisWeekReleased = $selRow[released_user_num]; $thisWeekOprTrial = $selRow[opr_trial_user_num]; $thisWeekTotal = $selRow[total_user_num]; //Recharge card $faceValue1 = ($selRow[precard_facevalue1]>0)?$selRow[precard_facevalue1]:$faceValue1; $thisWeekFaceValue1Used += $selRow[precard_used_today1]; $dayFaceValue1Used[$weekNum] = $selRow[precard_used_today1]; $thisWeekFaceValue1Unused = $selRow[precard_unused1]; $faceValue2 = ($selRow[precard_facevalue2]>0)?$selRow[precard_facevalue2]:$faceValue2; $thisWeekFaceValue2Used += $selRow[precard_used_today2]; $dayFaceValue2Used[$weekNum] = $selRow[precard_used_today2]; $thisWeekFaceValue2Unused = $selRow[precard_unused2]; $faceValue3 = ($selRow[precard_facevalue3]>0)?$selRow[precard_facevalue3]:$faceValue3; $thisWeekFaceValue3Used += $selRow[precard_used_today3]; $dayFaceValue3Used[$weekNum] = $selRow[precard_used_today3]; $thisWeekFaceValue3Unused = $selRow[precard_unused3]; $faceValue4 = ($selRow[precard_facevalue4]>0)?$selRow[precard_facevalue4]:$faceValue4; $thisWeekFaceValue4Used += $selRow[precard_used_today4]; $dayFaceValue4Used[$weekNum] = $selRow[precard_used_today4]; $thisWeekFaceValue4Unused = $selRow[precard_unused4]; $faceValue5 = ($selRow[precard_facevalue5]>0)?$selRow[precard_facevalue5]:$faceValue5; $thisWeekFaceValue5Used += $selRow[precard_used_today5]; $dayFaceValue5Used[$weekNum] = $selRow[precard_used_today5]; $thisWeekFaceValue5Unused = $selRow[precard_unused5]; $faceValue6 = ($selRow[precard_facevalue6]>0)?$selRow[precard_facevalue6]:$faceValue6; $thisWeekFaceValue6Used += $selRow[precard_used_today6]; $dayFaceValue6Used[$weekNum] = $selRow[precard_used_today6]; $thisWeekFaceValue6Unused = $selRow[precard_unused6]; //Call statistics $thisWeekIncomingCallNumber += $selRow[incoming_call_num ]; $thisWeekIncomingCallDuration += $selRow[incoming_call_duration]; $thisWeekIncomingCallCharge += $selRow[incoming_call_charge]; $thisWeekLocalCallNumber += $selRow[local_callout_num]; $thisWeekLocalCallDuration += $selRow[local_callout_duration]; $thisWeekLocalCallCharge += $selRow[local_callout_charge]; $thisWeekIDDCallNumber += $selRow[IDD_call_num]; $thisWeekIDDCallDuration += $selRow[IDD_call_duration]; $thisWeekIDDCallCharge += $selRow[IDD_call_charge]; $thisWeekNDDCallNumber += $selRow[NDD_call_num]; $thisWeekNDDCallDuration += $selRow[NDD_call_duration]; $thisWeekNDDCallCharge += $selRow[NDD_call_charge]; $thisWeekShortMessageNumber += $selRow[short_message_num]; $thisWeekShortMessageDuration += $selRow[short_message_duration]; $thisWeekShortMessageCharge += $selRow[short_message_charge]; $thisWeekShortMessageViaWebNumber += $selRow[short_message_via_web_num]; $thisWeekShortMessageViaWebDuration += $selRow[short_message_via_web_duration]; $thisWeekShortMessageViaWebCharge += $selRow[short_message_via_web_charge]; $thisWeekConferenceCallNumber += $selRow[conference_call_num]; $thisWeekConferenceCallDuration += $selRow[conference_call_duration]; $thisWeekConferenceCallCharge += $selRow[conference_call_charge]; $thisWeekRentNumber += $selRow[rent_charging_num]; $thisWeekRentDuration += $selRow[rent_charging_duration]; $thisWeekRentCharge += $selRow[rent_charge]; $thisWeekRechargeSuccNumber += $selRow[recharge_suc_num]; $thisWeekRechargeSuccDuration += $selRow[recharge_suc_duration]; $thisWeekRechargeSuccCharge += $selRow[recharge_suc]; $thisWeekRechargeFailNumber += $selRow[recharge_fail_num]; $thisWeekRechargeFailDuration += $selRow[recharge_fail_duration]; $thisWeekRechargeFailCharge += $selRow[recharge_fail]; $thisWeekOperatorRechargeNumber += $selRow[ast_recharge_num]; $thisWeekOperatorRechargeDuration += $selRow[ast_recharge_duration]; $thisWeekOperatorRechargeCharge += $selRow[ast_recharge]; $thisWeekChargeNumber += $selRow[ast_charge_num]; $thisWeekChargeDuration += $selRow[ast_charge_duration]; $thisWeekChargeCharge += $selRow[ast_charge]; $thisWeekTotalNumber += $selRow[total_call_num]; $thisWeekTotalDuration += $selRow[total_call_duration]; $thisWeekTotalCharge += $selRow[total_call_charge]; $thisWeekTotalGPRSVolume+=($selRow[gprs_volume]-0)/1024; $thisWeekTotalGPRSDuration+=($selRow[gprs_duration]-0)/3600; $thisWeekTotalGPRSCharged+=$selRow[gprs_charged]-0; $thisWeekTotalSMSNumber+=$selRow[sms_number]; $thisWeekTotalSMSCharged+=$selRow[sms_charged]; $thisWeekTotalMMSSendNumber+=$selRow[mms_send_number]; $thisWeekTotalMMSSendCharged+=$selRow[mms_send_charged]; $thisWeekTotalMMSRetrieveNumber+=$selRow[mms_retrieve_number]; $thisWeekTotalMMSRetrieveCharged+=$selRow[mms_retrieve_charged]; $thisWeekTotalMMSEmailNumber+=$selRow[mms_email_number]; $thisWeekTotalMMSEmailCharged+=$selRow[mms_email_charged]; // for ($i = 1; $i <= 8; $i++) { // //$average = $array['session_num_' . $i] ? round($array['session_duration_' . $i]/$array['session_num_' . $i], 2) : 0; // //$tps = round($array['session_num_' . $i]/(3600*24), 2); // $thisWeekTotalSessionNum[$i]+=$selRow['session_num_' . $i]; // $thisWeekTotalSessionDuration[$i]+=$selRow['session_duration_'. $i]; // $thisWeekTotalErrorTimeout[$i]+=$selRow['error_timeout_'. $i]; // $thisWeekTotalErrorSystem[$i]+=$selRow['error_system_'. $i]; // $thisWeekTotalErrorMessage[$i]+=$selRow['error_message_'. $i]; // $thisWeekTotalErrorReserve1[$i]+=$selRow['error_reserve_1_'. $i]; // $thisWeekTotalErrorReserve2[$i]+=$selRow['error_reserve_2_'. $i]; // } // if(!count($allUssdCodes)){ //代表是第一条记录 // //echo $selRow['ussd_code_1']; // for ($i = 1; $i <= 8; $i++) { // $allUssdCodes[$i] = $selRow['ussd_code_' . $i]; // $thisWeekTotalSessionNum[$i]+=$selRow['session_num_' . $i]; // $thisWeekTotalSessionDuration[$i]+=$selRow['session_duration_'. $i]; // $thisWeekTotalErrorTimeout[$i]+=$selRow['error_timeout_'. $i]; // $thisWeekTotalErrorSystem[$i]+=$selRow['error_system_'. $i]; // $thisWeekTotalErrorMessage[$i]+=$selRow['error_message_'. $i]; // } // //echo $selRow['ussd_code_2']; // }else{//剩余记录 // foreach ($allUssdCodes as $key => $value) { // if(!$value){ //空则要把现在的值补充进去 // $allUssdCodes[$key] = $selRow['ussd_code_' . $key]; // $thisWeekTotalSessionNum[$key]+=$selRow['session_num_' . $key]; // $thisWeekTotalSessionDuration[$key]+=$selRow['session_duration_'. $key]; // $thisWeekTotalErrorTimeout[$key]+=$selRow['error_timeout_'. $key]; // $thisWeekTotalErrorSystem[$key]+=$selRow['error_system_'. $key]; // $thisWeekTotalErrorMessage[$key]+=$selRow['error_message_'.$key]; // }else{//不空则开始比较 // for ($j = 1; $j <= 8; $j++) {//当前allUssdCodes[key]与当前记录全部进行比较 // if($allUssdCodes[$key] == $selRow['ussd_code_' . $j]){ // $thisWeekTotalSessionNum[$key]+=$selRow['session_num_' . $key]; // $thisWeekTotalSessionDuration[$key]+=$selRow['session_duration_'. $key]; // $thisWeekTotalErrorTimeout[$key]+=$selRow['error_timeout_'. $key]; // $thisWeekTotalErrorSystem[$key]+=$selRow['error_system_'. $key]; // $thisWeekTotalErrorMessage[$key]+=$selRow['error_message_'.$key]; // break; // } // } // } // //echo "key=$key, value=$value
"; // } // } if(!count($allUssdCodes)){ // 代表是第一条记录 // 初始化数组 for ($i = 1; $i <= 8; $i++) { $allUssdCodes[$i] = $selRow['ussd_code_' . $i]; $thisWeekTotalSessionNum[$i] = $selRow['session_num_' . $i]; $thisWeekTotalSessionDuration[$i] = $selRow['session_duration_'. $i]; $thisWeekTotalErrorTimeout[$i] = $selRow['error_timeout_'. $i]; $thisWeekTotalErrorSystem[$i] = $selRow['error_system_'. $i]; $thisWeekTotalErrorMessage[$i] = $selRow['error_message_'. $i]; } } else { // 剩余记录 // 创建USSD索引的映射 $codeToIndexMap = array_flip(array_filter($allUssdCodes)); for ($j = 1; $j <= 8; $j++) { $currentCode = $selRow['ussd_code_' . $j]; if (!$currentCode) continue; // 跳过空代码 if (isset($codeToIndexMap[$currentCode])) { // 已存在的代码,累加统计数据 $index = $codeToIndexMap[$currentCode]; $thisWeekTotalSessionNum[$index] += $selRow['session_num_' . $j]; $thisWeekTotalSessionDuration[$index] += $selRow['session_duration_'. $j]; $thisWeekTotalErrorTimeout[$index] += $selRow['error_timeout_'. $j]; $thisWeekTotalErrorSystem[$index] += $selRow['error_system_'. $j]; $thisWeekTotalErrorMessage[$index] += $selRow['error_message_'. $j]; } else { //找一个空位存放 foreach ($allUssdCodes as $key => $value) { if (!$value) { $allUssdCodes[$key] = $currentCode; $codeToIndexMap[$currentCode] = $key; $thisWeekTotalSessionNum[$key] = $selRow['session_num_' . $j]; $thisWeekTotalSessionDuration[$key] = $selRow['session_duration_'. $j]; $thisWeekTotalErrorTimeout[$key] = $selRow['error_timeout_'. $j]; $thisWeekTotalErrorSystem[$key] = $selRow['error_system_'. $j]; $thisWeekTotalErrorMessage[$key] = $selRow['error_message_'. $j]; break; } } } } } }while($selRow=mysqli_fetch_array($selRes)); $thisWeekTotalGPRSVolume=number_format($thisWeekTotalGPRSVolume,3,'.',''); $thisWeekTotalGPRSDuration=number_format($thisWeekTotalGPRSDuration,3,'.',''); if($DEBUG){ echo "lastWeekBalance=$lastWeekBalance, "; echo "thisWeekRecharge=$thisWeekRecharge, "; echo "thisWeekBalance=$thisWeekBalance, "; echo "thisWeekCharge=$thisWeekCharge, "; echo "
"; echo "thisWeekFresh=$thisWeekFresh, "; echo "thisWeekInuse=$thisWeekInuse, "; echo "thisWeekSuspended=$thisWeekSuspended, "; echo "thisWeekBlacklist=$thisWeekBlacklist, "; echo "thisWeekReleased=$thisWeekReleased, "; echo "thisWeekTotal=$thisWeekTotal, "; echo "
"; echo "faceValue1=$faceValue1, "; echo "thisWeekFaceValue1Used=$thisWeekFaceValue1Used, "; echo "thisWeekFaceValue1Unused=$thisWeekFaceValue1Unused, "; echo "
"; echo "thisWeekFaceValue2Used=$thisWeekFaceValue2Used, "; echo "thisWeekFaceValue2Unused=$thisWeekFaceValue2Unused, "; echo "thisWeekFaceValue3Used=$thisWeekFaceValue3Used, "; echo "thisWeekFaceValue3Unused=$thisWeekFaceValue3Unused, "; echo "thisWeekFaceValue4Used=$thisWeekFaceValue4Used, "; echo "thisWeekFaceValue4Unused=$thisWeekFaceValue4Unused, "; echo "
"; } /********************* 统计该月几周的收费情况及充值卡 *************************/ /* echo "bgnDay=$bgnDay, endDay=$endDay
"; $pieces = explode("-",$endDay); $query_month = $pieces[1]; $tmp = date("w",mktime(0,0,0,$query_month,1,$query_year)); echo "query_month=$query_month, tmp=$tmp
"; $week1FirstDay = date("Y",mktime(0,0,0,$query_month,1-$tmp,$query_year))."-". date("m",mktime(0,0,0,$query_month,1-$tmp,$query_year))."-". date("d",mktime(0,0,0,$query_month,1-$tmp,$query_year)); echo "week1FirstDay=$week1FirstDay
"; */ /********************* 统计该周前5周的收费情况及充值卡情况 ********************/ if($DEBUG) echo "bgnDay=$bgnDay, endDay=$endDay
"; for($i=4;$i>0;$i--){ //start day $pieces = explode("-",$bgnDay); $query_month = $pieces[1]; $query_day = $pieces[2]; $weekStart[4-$i] = date("Y",mktime(0,0,0,$pieces[1],$pieces[2]-$i*7,$pieces[0]))."-". date("m",mktime(0,0,0,$pieces[1],$pieces[2]-$i*7,$pieces[0]))."-". date("d",mktime(0,0,0,$pieces[1],$pieces[2]-$i*7,$pieces[0])); //end day $pieces = explode("-",$endDay); $query_month = $pieces[1]; $query_day = $pieces[2]; $weekEnd[4-$i] = date("Y",mktime(0,0,0,$pieces[1],$pieces[2]-$i*7,$pieces[0]))."-". date("m",mktime(0,0,0,$pieces[1],$pieces[2]-$i*7,$pieces[0]))."-". date("d",mktime(0,0,0,$pieces[1],$pieces[2]-$i*7,$pieces[0])); } $weekStart[4] = $bgnDay; $weekEnd[4] = $endDay; if($DEBUG){ echo "$weekStart[0], $weekEnd[0]
"; echo "$weekStart[1], $weekEnd[1]
"; echo "$weekStart[2], $weekEnd[2]
"; echo "$weekStart[3], $weekEnd[3]
"; echo "$weekStart[4], $weekEnd[4]
"; } for($i=0;$i<5;$i++){ $weekCharge[$i]=0; $selBgnDay = $weekStart[$i]; $selEndDay = $weekEnd[$i]; if($DEBUG) echo "selBgnDay=$selBgnDay, selEndDay=$selEndDay
"; $selSQL = "SELECT * FROM daily_report WHERE date>='$selBgnDay' and date<='$selEndDay'"; if($DEBUG) echo "selSQL=$selSQL
"; $selRes = mysqli_query($ppsDbConn,$selSQL); echo mysqli_error($ppsDbConn); $selRow = @mysqli_fetch_array($selRes); do{ $weekCharge[$i] += $selRow[today_charge]; $weekFaceValue1Used[$i] += $selRow[precard_used_today1]; $weekFaceValue2Used[$i] += $selRow[precard_used_today2]; $weekFaceValue3Used[$i] += $selRow[precard_used_today3]; $weekFaceValue4Used[$i] += $selRow[precard_used_today4]; $weekFaceValue5Used[$i] += $selRow[precard_used_today5]; $weekFaceValue6Used[$i] += $selRow[precard_used_today6]; }while($selRow = @mysqli_fetch_array($selRes)); if($DEBUG){ echo "weekCharge[$i]=$weekCharge[$i]
"; echo "weekFaceValue1Used[$i]=$weekFaceValue1Used[$i]
"; echo "weekFaceValue2Used[$i]=$weekFaceValue2Used[$i]
"; echo "weekFaceValue3Used[$i]=$weekFaceValue3Used[$i]
"; echo "weekFaceValue4Used[$i]=$weekFaceValue4Used[$i]
"; } $thisWeek = $query_week-4+$i; if($thisWeek<1) $thisWeek=$thisWeek+52; $label[$i] = "W".$thisWeek; if($DEBUG) echo "label[$i]=$label[$i]
"; if($DEBUG) echo "
"; } $firstWeek = $label[0]; $lastWeek = $label[4]; ?>
 

"; echo "PPS report W$query_week($bgnDay ~ $endDay)"; echo ""; //----------------------------------全局统计-------------------------------------------------------- ?>  "; echo " "; echo " "; ?> "; echo ""; $fresh_user_num = showComma($thisWeekFresh); echo ""; echo ""; echo ""; echo ""; $normal_user_num = showComma($thisWeekInuse); echo ""; echo ""; echo ""; echo ""; $suspend_user_num = showComma($thisWeekSuspended); echo ""; echo ""; echo ""; echo ""; $blacklist_user_num = showComma($thisWeekBlacklist); echo ""; echo ""; echo ""; echo ""; $released_user_num = showComma($thisWeekReleased); echo ""; echo ""; echo ""; echo ""; $opr_trial_user_num = showComma($thisWeekOprTrial); echo ""; echo ""; echo ""; $selRow[released_user_num]; echo ""; $total_user_num = showComma($thisWeekTotal); echo ""; echo ""; echo ""; ?>
$strDailyUserState$strDailyUserNum
$strDailyUserTitle$strDailyFresh$fresh_user_num
$strDailyUsing$normal_user_num
$strDailySuspend$suspend_user_num
$strBlackList$blacklist_user_num
$strReleased$released_user_num
OPR Trial$opr_trial_user_num
$strTotal$total_user_num

 "; echo " "; for($i=1;$i<=$face_value_type;$i++) { $ValueList="precard_facevalue".$i; $showValue=${"faceValue".$i}/$moneyPara; if($showValue == 0){ echo ""; $arr_FaceValueList[$i] = 0; }else{ echo ""; $arr_FaceValueList[$i] = 1; } } ?> "; echo ""; echo ""; for($i=1;$i<=$face_value_type;$i++) { $precard_used_today="precard_used_today".$i; $precardUsed=showComma(${"thisWeekFaceValue".$i."Used"}); if($arr_FaceValueList[$i] == 1){ echo ""; }else{ echo ""; } } echo ""; echo ""; echo ""; for($i=1;$i<$face_value_type+1;$i++) { $precard_unused="precard_unused".$i; $precardUnused=showComma(${"thisWeekFaceValue".$i."Unused"}); if($arr_FaceValueList[$i] == 1){ echo ""; }else{ echo ""; } } echo ""; ?>
$strDailyCardFace-- ($strValueCurrency"; echo "$showValue)"; echo "
$strPrepaidCardUsed$precardUsed--
$strNotCharged$precardUnused--

 "; echo " "; echo " "; echo " "; echo " "; ?> $strDailyCallIncoming"; $incoming_call_nums = showComma($thisWeekIncomingCallNumber); $incoming_call_duration = showComma($thisWeekIncomingCallDuration); $incoming_call_charge = showComma(sprintf("$fmtBit",$thisWeekIncomingCallCharge/$moneyPara)); echo ""; echo ""; echo ""; ?> $strDailyCallIDD"; $IDD_call_nums = showComma($thisWeekIDDCallNumber); $IDD_call_duration = showComma($thisWeekIDDCallDuration); $IDD_call_charge = showComma(sprintf("$fmtBit",$thisWeekIDDCallCharge/$moneyPara)); echo ""; echo ""; echo ""; ?> $strDailyCallNDD"; $NDD_call_nums = showComma($thisWeekNDDCallNumber); $NDD_call_duration = showComma($thisWeekNDDCallDuration); $NDD_call_charge = showComma(sprintf("$fmtBit",$thisWeekNDDCallCharge/$moneyPara)); echo ""; echo ""; echo ""; ?> $strDailyCallLocalOut"; $local_callout_nums = showComma($thisWeekLocalCallNumber); $local_callout_duration = showComma($thisWeekLocalCallDuration); $local_callout_charge = showComma(sprintf("$fmtBit",$thisWeekLocalCallCharge/$moneyPara)); echo ""; echo ""; echo ""; ?> $strDailyCallSMS"; $short_message_nums = showComma($thisWeekShortMessageNumber); $short_message_duration = showComma($thisWeekShortMessageDuration); $short_message_charge = showComma(sprintf("$fmtBit",$thisWeekShortMessageCharge/$moneyPara)); echo ""; echo ""; echo ""; ?> $strDailyCallSMSViaWeb"; $short_message_nums = showComma($thisWeekShortMessageViaWebNumber); $short_message_duration = showComma($thisWeekShortMessageViaWebDuration); $short_message_charge = showComma(sprintf("$fmtBit",$thisWeekShortMessageViaWebCharge/$moneyPara)); echo ""; echo ""; echo ""; ?> $strDailyCallConferenceCall"; $conference_call_nums = showComma($thisWeekConferenceCallNumber); $conference_call_duration = showComma($thisWeekConferenceCallDuration); $conference_call_charge = showComma(sprintf("$fmtBit",$thisWeekConferenceCallCharge/$moneyPara)); echo ""; echo ""; echo ""; ?> $strDailyCallRent"; $rent_charging_nums = showComma($thisWeekRentNumber); $rent_charging_duration = showComma($thisWeekRentDuration); $rent_charge = showComma(sprintf("$fmtBit",$thisWeekRentCharge/$moneyPara)); echo ""; echo ""; echo ""; ?> $strOperatorRecharge"; $ast_recharge_nums = showComma($thisWeekOperatorRechargeNumber); $ast_recharge_duration = showComma($thisWeekOperatorRechargeDuration); $ast_recharge = showComma(sprintf("$fmtBit",$thisWeekOperatorRechargeCharge/$moneyPara)); echo ""; echo ""; echo ""; ?> $strOperatorCharge"; $ast_charge_nums = showComma($thisWeekChargeNumber); $ast_charge_duration = showComma($thisWeekChargeDuration); $ast_charge = showComma(sprintf("$fmtBit",$thisWeekChargeCharge/$moneyPara)); echo ""; echo ""; echo ""; ?> $strTotal"; $total_call_num = showComma($thisWeekTotalNumber); $total_call_charge = showComma(sprintf("$fmtBit",$thisWeekTotalCharge/$moneyPara)); $total_call_duration = showComma($thisWeekTotalDuration); echo ""; echo ""; echo ""; ?>
$strDailyCallType$strDailyCallTimes$strDailyCallDuration$strDailyCallCharge
$incoming_call_nums$incoming_call_duration$incoming_call_charge
$IDD_call_nums$IDD_call_duration$IDD_call_charge
$NDD_call_nums$NDD_call_duration$NDD_call_charge
$local_callout_nums$local_callout_duration$local_callout_charge
$short_message_nums$short_message_duration$short_message_charge
$short_message_nums$short_message_duration$short_message_charge
$conference_call_nums$conference_call_duration$conference_call_charge
$rent_charging_nums$rent_charging_duration$rent_charge
$ast_recharge_nums$ast_recharge_duration$ast_recharge
$ast_charge_nums$ast_charge_duration$ast_charge
$total_call_num$total_call_duration$total_call_charge

 "; echo ""; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; ?> 1"; // $thisWeekTotalSessionNum[$i]+=$selRow['session_num_' . $i]; // $thisWeekTotalSessionDuration[$i]+=$selRow['session_duration_'. $i]; // $thisWeekTotalErrorTimeout[$i]+=$selRow['error_timeout_'. $i]; // $thisWeekTotalErrorSystem[$i]+=$selRow['error_system_'. $i]; // $thisWeekTotalErrorMessage[$i]+=$selRow['error_message_'. $i]; // $thisWeekTotalErrorReserve1[$i]+=$selRow['error_reserve_1_'. $i]; // $thisWeekTotalErrorReserve2[$i]+=$selRow['error_reserve_2_'. $i]; $average1 = $thisWeekTotalSessionNum[1] ? round($thisWeekTotalSessionDuration[1]/($thisWeekTotalSessionNum[1]), 2) : 0; $tps1 = round($thisWeekTotalSessionNum[1]/(3600*24), 2); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; // echo ""; // echo ""; // echo ""; ?> "; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } ?>
IndexUSSD CodeSession NumSession DurationError TimeoutError SystemError MessageAverage DurationTPS
$allUssdCodes[1]$thisWeekTotalSessionNum[1]$thisWeekTotalSessionDuration[1]$thisWeekTotalErrorTimeout[1]$thisWeekTotalErrorSystem[1]$thisWeekTotalErrorMessage[1]$average1$tps1$incoming_call_nums$incoming_call_duration$incoming_call_charge
$i{$allUssdCodes[$i]}{$thisWeekTotalSessionNum[$i]}{$thisWeekTotalSessionDuration[$i]}{$thisWeekTotalErrorTimeout[$i]}{$thisWeekTotalErrorSystem[$i]}{$thisWeekTotalErrorMessage[$i]}{$average}{$tps}

"; echo ""; echo " "; echo "GPRS volume(MB)"; echo "GPRS duration(H)"; echo "GPRS charged"; echo ""; echo ""; echo "GPRS statistic"; echo " $thisWeekTotalGPRSVolume"; echo " $thisWeekTotalGPRSDuration"; echo " $thisWeekTotalGPRSCharged"; echo ""; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
 SMS numberSMS chargedMMS send numberMMS send chargedMMS retrieve numberMMS retrieve chargedMMS email numberMMS email number
MMS statistic $thisWeekTotalSMSNumber $thisWeekTotalSMSCharged $thisWeekTotalMMSSendNumber $thisWeekTotalMMSSendCharged $thisWeekTotalMMSRetrieveNumber $thisWeekTotalMMSRetrieveCharged $thisWeekTotalMMSEmailNumber $thisWeekTotalMMSEmailCharged
"; ?>

 "; echo ""; echo ""; echo ""; echo ""; ?> $strAccountSummary"; $yesterday_balance = showComma(sprintf("$fmtBit",$lastWeekBalance/$moneyPara)); $today_recharge = showComma(sprintf("$fmtBit",$thisWeekRecharge/$moneyPara)); $today_balance = showComma(sprintf("$fmtBit",$thisWeekBalance/$moneyPara)); $today_charge = showComma(sprintf("$fmtBit",$thisWeekCharge/$moneyPara)); echo ""; echo ""; echo ""; echo ""; ?>
$strAccountLastWeekBalance$strAccountThisWeekRecharge$strAccountThisWeekBalance$strAccountThisWeekCharge
$yesterday_balance$today_recharge$today_balance$today_charge

"; $maxYNum = ($dayCharge[$i]>$maxYNum)?$dayCharge[$i]:$maxYNum; } $maxYNum = (ceil($maxYNum/80)+1)*80; if($DEBGU) echo "maxYNum=$maxYNum
"; $legendArr=array( array('Charge','7D0000',0) ); $title="W".$query_week." call charge statistic."; //-----图片背景和坐标,标示等基本元素,请勿修改这部分 $DEBUG=0; $sizex=550; $sizey=270; $bgcolor=F8F8F8; $fgcolor=000000; $dayStr=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$i,date("Y"))); $im = ImageCreate ($sizex, $sizey); $background_color = ImageColorAllocate ($im, hexdec(substr($bgcolor, 0, 2)), hexdec(substr($bgcolor, 2, 2)),hexdec(substr($bgcolor, 4, 2))); $text_color = ImageColorAllocate ($im, hexdec(substr($fgcolor, 0, 2)), hexdec(substr($fgcolor, 2, 2)),hexdec(substr($fgcolor, 4, 2))); //背景 ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); //边框 $xBgn=75; $yBgn=15; $xEnd=500; $yEnd=215; $unitXPix=60; ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color); ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color); ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color); ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color); //竖网格及标注 for($i=0;$i<7;$i++){ ImageDashedLine($im, $xBgn + $i*60, $yBgn, $xBgn + $i*60, $yEnd, $text_color); $strThisWeek = $strWeek[$i]; Imagestring($im, 2, $xBgn + $i*60 - 4, $yEnd, "$strThisWeek", $text_color); } //横网格及标注 for($i=0;$i<8;$i++){ ImageDashedLine($im, $xBgn, $yBgn + $i*25, $xEnd, $yBgn + $i*25, $text_color); /* $yRemark=$maxYNum / 8 * (8 - $i); Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "$yRemark", $text_color); */ $scale=$maxYNum / 8 * (8 - $i); if($scale>1000*1000){ $displayMaxData = round($scale/100000)/10; $displayMaxData = $displayMaxData."M"; }elseif($scale>1000){ $displayMaxData = round($scale/100)/10; $displayMaxData = $displayMaxData."K"; }else $displayMaxData=$scale; Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "$displayMaxData", $text_color); } //色块图标及说明 for($i=0;$ipointArr[$i]={$pointArr[$i]}"; $pointArr[$i+1] = $yEnd - round(($yEnd - $yBgn) * ($pointArr[$i+1] / $maxYNum)); if($DEBUG) echo "
pointArr[$i+1]={$pointArr[$i+1]}"; } $pointArr[$i] = $pointArr[$i-2]; if($DEBUG) echo "
pointArr[$i]={$pointArr[$i]}"; $pointArr[$i+1] = $yEnd-1; if($DEBUG) echo "
pointArr[$i+1]={$pointArr[$i+1]}"; return($pointArr); } for($i=0;$i<7;$i++){ $pointArr[$i*2] = $i; $pointArr[$i*2+1] = $dayCharge[$i]; } //-----开始画图(线或色块),需要修改 //色块 /* $pointArr=getNewXY($pointArr); $pointNum= sizeof($pointArr) / 2; $tmpColor=$legendArr[0][2]; imagefilledpolygon($im, $pointArr, $pointNum, $tmpColor); */ //线条 $pointArr=getNewXY($pointArr); $pointNum= sizeof($pointArr) / 2; $tmpColor=$legendArr[0][2]; //imagepolygon($im, $pointArr, $pointNum, $tmpColor); for($i=0;$i<6;$i++){ imageline($im,$pointArr[$i*2],$pointArr[$i*2+1],$pointArr[$i*2+2],$pointArr[$i*2+3],$tmpColor); } ?>
"; echo ""; echo ""; ?>

$maxYNum)?${"dayFaceValue".$k."Used"}[$i]:$maxYNum; } } $maxYNum = (ceil($maxYNum/8)+1)*8; if($DEBUG) echo "maxYNum=$maxYNum
"; for($i=0;$i<6;$i++){ $faceValue[$i] = "Face value(".${"faceValue".($i+1)}/$moneyPara.")"; $moneyPara; } $legendArr=array( array($faceValue[0],'0000FF',0), array($faceValue[1],'00FF00',0), array($faceValue[2],'FF0000',0), array($faceValue[3],'7D0000',0), array($faceValue[4],'FF00FF',0), array($faceValue[5],'eeaa22',0) ); /* for($i=0;$i<4;$i++){ $legendArr[$i*3] = "Face value(".${"faceValue".$i}.")"; $legendArr[$i*3+1] = "7D7D00"; $legendArr[$i*3+2] = 0; } */ $title="Week".$query_week." recharge card statistic."; //-----图片背景和坐标,标示等基本元素,请勿修改这部分 $sizex=700; $sizey=270; $bgcolor=F8F8F8; $fgcolor=000000; $dayStr=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$i,date("Y"))); $im = ImageCreate ($sizex, $sizey); $background_color = ImageColorAllocate ($im, hexdec(substr($bgcolor, 0, 2)), hexdec(substr($bgcolor, 2, 2)),hexdec(substr($bgcolor, 4, 2))); $text_color = ImageColorAllocate ($im, hexdec(substr($fgcolor, 0, 2)), hexdec(substr($fgcolor, 2, 2)),hexdec(substr($fgcolor, 4, 2))); //背景 ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); //边框 $xBgn=75; $yBgn=15; $xEnd=500; $yEnd=215; $unitXPix=60; ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color); ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color); ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color); ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color); //竖网格及标注 for($i=0;$i<7;$i++){ ImageDashedLine($im, $xBgn + $i*60, $yBgn, $xBgn + $i*60, $yEnd, $text_color); $strThisWeek = $strWeek[$i]; Imagestring($im, 2, $xBgn + $i*60 - 4, $yEnd, "$strThisWeek", $text_color); } //横网格及标注 for($i=0;$i<8;$i++){ ImageDashedLine($im, $xBgn, $yBgn + $i*25, $xEnd, $yBgn + $i*25, $text_color); /* $yRemark=$maxYNum / 8 * (8 - $i); Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "$yRemark", $text_color); */ $scale=$maxYNum / 8 * (8 - $i); if($scale>1000*1000){ $displayMaxData = round($scale/100000)/10; $displayMaxData = $displayMaxData."M"; }elseif($scale>1000){ $displayMaxData = round($scale/100)/10; $displayMaxData = $displayMaxData."K"; }else $displayMaxData=$scale; Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "$displayMaxData", $text_color); } //色块图标及说明 for($i=0;$i"; } //线条 $pointArr1=getNewXY($pointArr1); $pointNum1= sizeof($pointArr1) / 2; $tmpColor1=$legendArr[0][2]; if($DEBUG){ for($i=0;$i<14;){ echo "pointArr1[$i]=$pointArr1[$i], "; $i++; echo "pointArr1[$i]=$pointArr1[$i]
"; $i++; } } for($i=0;$i<6;$i++){ imageline($im,$pointArr1[$i*2],$pointArr1[$i*2+1],$pointArr1[$i*2+2],$pointArr1[$i*2+3],$tmpColor1); } //face value 2 for($i=0;$i<7;$i++){ $pointArr2[$i*2] = $i; $pointArr2[$i*2+1] = $dayFaceValue2Used[$i]; //echo "dayFaceValue2Used[$i]=$dayFaceValue2Used[$i]
"; } //线条 $pointArr2=getNewXY($pointArr2); $pointNum2= sizeof($pointArr2) / 2; $tmpColor2=$legendArr[1][2]; for($i=0;$i<6;$i++){ imageline($im,$pointArr2[$i*2],$pointArr2[$i*2+1],$pointArr2[$i*2+2],$pointArr2[$i*2+3],$tmpColor2); } //face value 3 for($i=0;$i<7;$i++){ $pointArr3[$i*2] = $i; $pointArr3[$i*2+1] = $dayFaceValue3Used[$i]; //echo "dayFaceValue3Used[$i]=$dayFaceValue3Used[$i]
"; } //线条 $pointArr3=getNewXY($pointArr3); $pointNum3= sizeof($pointArr3) / 2; $tmpColor3=$legendArr[2][2]; for($i=0;$i<6;$i++){ imageline($im,$pointArr3[$i*2],$pointArr3[$i*2+1],$pointArr3[$i*2+2],$pointArr3[$i*2+3],$tmpColor3); } //face value 4 for($i=0;$i<7;$i++){ $pointArr4[$i*2] = $i; $pointArr4[$i*2+1] = $dayFaceValue4Used[$i]; //echo "dayFaceValue4Used[$i]=$dayFaceValue4Used[$i]
"; } //线条 $pointArr4=getNewXY($pointArr4); $pointNum4= sizeof($pointArr4) / 2; $tmpColor4=$legendArr[3][2]; for($i=0;$i<6;$i++){ imageline($im,$pointArr4[$i*2],$pointArr4[$i*2+1],$pointArr4[$i*2+2],$pointArr4[$i*2+3],$tmpColor4); } //face value 5 for($i=0;$i<7;$i++){ $pointArr5[$i*2] = $i; $pointArr5[$i*2+1] = $dayFaceValue5Used[$i]; //echo "dayFaceValue5Used[$i]=$dayFaceValue5Used[$i]
"; } //线条 $pointArr5=getNewXY($pointArr5); $pointNum5= sizeof($pointArr5) / 2; $tmpColor5=$legendArr[4][2]; for($i=0;$i<6;$i++){ imageline($im,$pointArr5[$i*2],$pointArr5[$i*2+1],$pointArr5[$i*2+2],$pointArr5[$i*2+3],$tmpColor5); } //face value 6 for($i=0;$i<7;$i++){ $pointArr6[$i*2] = $i; $pointArr6[$i*2+1] = $dayFaceValue6Used[$i]; //echo "dayFaceValue6Used[$i]=$dayFaceValue6Used[$i]
"; } //线条 $pointArr6=getNewXY($pointArr6); $pointNum6= sizeof($pointArr6) / 2; $tmpColor6=$legendArr[5][2]; for($i=0;$i<6;$i++){ imageline($im,$pointArr6[$i*2],$pointArr6[$i*2+1],$pointArr6[$i*2+2],$pointArr6[$i*2+3],$tmpColor6); } ?>
"; echo ""; echo ""; ?>


$maxData)?$data[$i]:$maxData; if($DEBUG) echo "maxData=$maxData
"; if($DEBUG) echo "data[$i-1]=${data[$i-1]}, label[$i-1]=${label[$i-1]}
"; } $maxData = (ceil($maxData/1000)+1)*1000; $image= imagecreate ($width,$height+20); $bg=imagecolorallocate($image,0xff,0xff,0xff); #$point= imagecolorallocate($image,0xff,0xff,0xff); $line=imagecolorallocate($image,0x7d,0x00,0x00); $lineFrame=imagecolorallocate($image,0xbb,0xbb,0xbb); $text=imagecolorallocate($image,0x00,0x00,0x00); $dotcolor=imagecolorallocate($image,0x7d,0x00,0x00); imageline ($image,50,0,50,$height,$lineFrame); imageline($image,50,$height,$width,$height,$lineFrame); for ($i=1;$i<11;$i++) { imagedashedline($image,50,$height - $jc*$i*10 ,$width ,$height -$jc*$i*10 ,$lineFrame ); // imagestring ($image,$font,0,$height-$jc*$i*10,$maxData/10*$i,$text); $scale = $maxData/10*$i; if($scale>1000*1000){ $displayMaxData = round($scale/100000)/10; $displayMaxData = $displayMaxData."M"; }elseif($scale>1000){ $displayMaxData = round($scale/100)/10; $displayMaxData = $displayMaxData."K"; }else $displayMaxData=$scale; imagestring ($image,$font,0,$height-$jc*$i*10,$displayMaxData,$text); } for ($i=0;$i"; $x1=(($width-50)/count($data))*($i)+40+10; #echo $x1 ."
"; $y1=$height-$tmp*$jc; $x2=$x1; $y2=$y1+$tmp*$jc; #echo $y1."
"; // imagestring($image,$font,$x1,$y1-2*$fontheight,$tmp."%(".$data[$i].")",$text); if($data[$i]>1000*1000){ $displayData[$i] = round($data[$i]/100000)/10; $displayData[$i] = $displayData[$i]."M"; }elseif($data[$i]>1000){ $displayData[$i] = round($data[$i]/100)/10; $displayData[$i] = $displayData[$i]."K"; } else $displayData[$i] = $data[$i]; //imagestring($image,$font,$x1,$y1-2*$fontheight,$data[$i],$text); imagestring($image,$font,$x1+$dot,$y1-$dot,$displayData[$i],$text); imagearc ($image,$x1 ,$y1,$dot,$dot,0,360,$dotcolor); imagefilltoborder ($image,$x1,$y1,$dotcolor,$dotcolor); imagestring ($image,$font,$x1,$y2,$label[$i],$text); if ($i>0) { imageline($image,$tmpx1,$tmpy1,$x1,$y1,$line); } $tmpx1=$x1;$tmpy1=$y1; } $filename2=time()."2.png"; ImagePng ($image,$filename2); ImageDestroy($image); //display the picture echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; ?>


$maxData)?$data1[$i]:$maxData; $maxData = ($data2[$i]>$maxData)?$data2[$i]:$maxData; $maxData = ($data3[$i]>$maxData)?$data3[$i]:$maxData; $maxData = ($data4[$i]>$maxData)?$data4[$i]:$maxData; $maxData = ($data5[$i]>$maxData)?$data5[$i]:$maxData; $maxData = ($data6[$i]>$maxData)?$data6[$i]:$maxData; if($DEBUG) echo "maxData=$maxData
"; if($DEBUG) echo "data1[$i-1]=${data1[$i-1]}, label[$i-1]=${label[$i-1]}
"; } $maxData = (ceil($maxData/10)+1)*10; $image= imagecreate ($width,$height+20); $bg=imagecolorallocate($image,0xff,0xff,0xff); #$point= imagecolorallocate($image,0xff,0xff,0xff); $line1=imagecolorallocate($image,0x00,0x00,0xFF); $line2=imagecolorallocate($image,0x00,0xFF,0x00); $line3=imagecolorallocate($image,0xFF,0x00,0x00); $line4=imagecolorallocate($image,0x7d,0x00,0x00); $line5=imagecolorallocate($image,0xFF,0x00,0xFF); $line6=imagecolorallocate($image,0xee,0xaa,0x22); $lineFrame=imagecolorallocate($image,0xbb,0xbb,0xbb); $text=imagecolorallocate($image,0x00,0x00,0x00); $dotcolor1=imagecolorallocate($image,0x00,0x00,0xFF); $dotcolor2=imagecolorallocate($image,0x00,0xFF,0x00); $dotcolor3=imagecolorallocate($image,0xFF,0x00,0x00); $dotcolor4=imagecolorallocate($image,0x7d,0x00,0x00); $dotcolor5=imagecolorallocate($image,0xFF,0x00,0xFF); $dotcolor6=imagecolorallocate($image,0xee,0xaa,0x22); imageline ($image,50,0,50,$height,$lineFrame); imageline($image,50,$height,$width,$height,$lineFrame); for ($i=1;$i<11;$i++) { imagedashedline($image,50,$height - $jc*$i*10 ,$width ,$height -$jc*$i*10 ,$lineFrame ); // imagestring ($image,$font,0,$height-$jc*$i*10,$maxData/10*$i,$text); $scale = $maxData/10*$i; if($scale>1000*1000){ $displayMaxData = round($scale/100000)/10; $displayMaxData = $displayMaxData."M"; }elseif($scale>1000){ $displayMaxData = round($scale/100)/10; $displayMaxData = $displayMaxData."K"; }else $displayMaxData = $scale; imagestring ($image,$font,0,$height-$jc*$i*10,$displayMaxData,$text); } //face value 1 for ($i=0;$i"; $x1=(($width-50)/count($data1))*($i)+40+10; #echo $x1 ."
"; $y1=$height-$tmp*$jc; $x2=$x1; $y2=$y1+$tmp*$jc; #echo $y1."
"; if($data1[$i]>1000*1000){ $displayData1[$i] = round($data1[$i]/100000); $displayData1[$i] = $displayData1[$i]/10; $displayData1[$i] = $displayData1[$i]."M"; }elseif($data1[$i]>1000){ $displayData1[$i] = round($data1[$i]/100); $displayData1[$i] = $displayData1[$i]/10; $displayData1[$i] = $displayData1[$i]."K"; } else $displayData1[$i] = $data1[$i]; //imagestring($image,$font,$x1,$y1-2*$fontheight,$data1[$i],$text); imagestring($image,$font,$x1+$dot,$y1-$dot,$displayData1[$i],$text); imagearc ($image,$x1 ,$y1,$dot,$dot,0,360,$dotcolor1); imagefilltoborder ($image,$x1,$y1,$dotcolor1,$dotcolor1); imagestring ($image,$font,$x1,$y2,$label[$i],$text); if ($i>0) { imageline($image,$tmpx1,$tmpy1,$x1,$y1,$line1); } $tmpx1=$x1;$tmpy1=$y1; } //face value 2 for ($i=0;$i"; $x1=(($width-50)/count($data2))*($i)+40+10; #echo $x1 ."
"; $y1=$height-$tmp*$jc; $x2=$x1; $y2=$y1+$tmp*$jc; #echo $y1."
"; if($data2[$i]>1000*1000){ $displayData2[$i] = round($data2[$i]/100000); $displayData2[$i] = $displayData2[$i]/10; $displayData2[$i] = $displayData2[$i]."M"; }elseif($data2[$i]>1000){ $displayData2[$i] = round($data2[$i]/100); $displayData2[$i] = $displayData2[$i]/10; $displayData2[$i] = $displayData2[$i]."K"; } else $displayData2[$i] = $data2[$i]; //imagestring($image,$font,$x1,$y1-2*$fontheight,$data2[$i],$text); imagestring($image,$font,$x1+$dot,$y1-$dot,$displayData2[$i],$text); imagearc ($image,$x1 ,$y1,$dot,$dot,0,360,$dotcolor2); imagefilltoborder ($image,$x1,$y1,$dotcolor2,$dotcolor2); imagestring ($image,$font,$x1,$y2,$label[$i],$text); if ($i>0) { imageline($image,$tmpx1,$tmpy1,$x1,$y1,$line2); } $tmpx1=$x1;$tmpy1=$y1; } //face value 3 for ($i=0;$i"; $x1=(($width-50)/count($data3))*($i)+40+10; #echo $x1 ."
"; $y1=$height-$tmp*$jc; $x2=$x1; $y2=$y1+$tmp*$jc; #echo $y1."
"; if($data3[$i]>1000*1000){ $displayData3[$i] = round($data3[$i]/100000); $displayData3[$i] = $displayData3[$i]/10; $displayData3[$i] = $displayData3[$i]."M"; }elseif($data3[$i]>1000){ $displayData3[$i] = round($data3[$i]/100); $displayData3[$i] = $displayData3[$i]/10; $displayData3[$i] = $displayData3[$i]."K"; } else $displayData3[$i] = $data3[$i]; //imagestring($image,$font,$x1,$y1-2*$fontheight,$data3[$i],$text); imagestring($image,$font,$x1+$dot,$y1-$dot,$displayData3[$i],$text); imagearc ($image,$x1 ,$y1,$dot,$dot,0,360,$dotcolor3); imagefilltoborder ($image,$x1,$y1,$dotcolor3,$dotcolor3); imagestring ($image,$font,$x1,$y2,$label[$i],$text); if ($i>0) { imageline($image,$tmpx1,$tmpy1,$x1,$y1,$line3); } $tmpx1=$x1;$tmpy1=$y1; } //face value 4 for ($i=0;$i"; $x1=(($width-50)/count($data4))*($i)+40+10; #echo $x1 ."
"; $y1=$height-$tmp*$jc; $x2=$x1; $y2=$y1+$tmp*$jc; #echo $y1."
"; if($data4[$i]>1000*1000){ $displayData4[$i] = round($data4[$i]/100000); $displayData4[$i] = $displayData4[$i]/10; $displayData4[$i] = $displayData4[$i]."M"; }elseif($data4[$i]>1000){ $displayData4[$i] = round($data4[$i]/100); $displayData4[$i] = $displayData4[$i]/10; $displayData4[$i] = $displayData4[$i]."K"; } else $displayData4[$i] = $data4[$i]; //imagestring($image,$font,$x1,$y1-2*$fontheight,$data4[$i],$text); imagestring($image,$font,$x1+$dot,$y1-$dot,$displayData4[$i],$text); imagearc ($image,$x1 ,$y1,$dot,$dot,0,360,$dotcolor4); imagefilltoborder ($image,$x1,$y1,$dotcolor4,$dotcolor4); imagestring ($image,$font,$x1,$y2,$label[$i],$text); if ($i>0) { imageline($image,$tmpx1,$tmpy1,$x1,$y1,$line4); } $tmpx1=$x1;$tmpy1=$y1; } //face value 5 for ($i=0;$i"; $x1=(($width-50)/count($data5))*($i)+40+10; #echo $x1 ."
"; $y1=$height-$tmp*$jc; $x2=$x1; $y2=$y1+$tmp*$jc; #echo $y1."
"; if($data5[$i]>1000*1000){ $displayData5[$i] = round($data5[$i]/100000); $displayData5[$i] = $displayData5[$i]/10; $displayData5[$i] = $displayData5[$i]."M"; }elseif($data5[$i]>1000){ $displayData5[$i] = round($data5[$i]/100); $displayData5[$i] = $displayData5[$i]/10; $displayData5[$i] = $displayData5[$i]."K"; } else $displayData5[$i] = $data5[$i]; //imagestring($image,$font,$x1,$y1-2*$fontheight,$data5[$i],$text); imagestring($image,$font,$x1+$dot,$y1-$dot,$displayData5[$i],$text); imagearc ($image,$x1 ,$y1,$dot,$dot,0,360,$dotcolor5); imagefilltoborder ($image,$x1,$y1,$dotcolor5,$dotcolor5); imagestring ($image,$font,$x1,$y2,$label[$i],$text); if ($i>0) { imageline($image,$tmpx1,$tmpy1,$x1,$y1,$line5); } $tmpx1=$x1;$tmpy1=$y1; } //face value 6 for ($i=0;$i"; $x1=(($width-50)/count($data6))*($i)+40+10; #echo $x1 ."
"; $y1=$height-$tmp*$jc; $x2=$x1; $y2=$y1+$tmp*$jc; #echo $y1."
"; if($data6[$i]>1000*1000){ $displayData6[$i] = round($data6[$i]/100000); $displayData6[$i] = $displayData6[$i]/10; $displayData6[$i] = $displayData6[$i]."M"; }elseif($data6[$i]>1000){ $displayData6[$i] = round($data6[$i]/100); $displayData6[$i] = $displayData6[$i]/10; $displayData6[$i] = $displayData6[$i]."K"; } else $displayData6[$i] = $data6[$i]; //imagestring($image,$font,$x1,$y1-2*$fontheight,$data6[$i],$text); imagestring($image,$font,$x1+$dot,$y1-$dot,$displayData6[$i],$text); imagearc ($image,$x1 ,$y1,$dot,$dot,0,360,$dotcolor6); imagefilltoborder ($image,$x1,$y1,$dotcolor6,$dotcolor6); imagestring ($image,$font,$x1,$y2,$label[$i],$text); if ($i>0) { imageline($image,$tmpx1,$tmpy1,$x1,$y1,$line6); } $tmpx1=$x1;$tmpy1=$y1; } //色块图标及说明 for($i=0;$i"; echo ""; echo ""; echo ""; echo ""; echo ""; ?>

 

$strDailyOperator: "; echo "$userInfo[ID]"; echo "              "; echo "$strDailyPrintTime"; ?>