getGraph_for_sig_genan_analyst($aFrom, $aTo,$period); return $result; } function getSpellPower($from,$to){ $camdpams = new Camdpams(); $result = $camdpams->getSpellPower($from,$to); return array("SpellPowerGrid",$result[0],$result[1],"SpellPower"); // return $result; } function getSummary($from,$to){ $camdpams = new Camdpams(); $result = $camdpams->getSummary($from,$to); // return array("SummaryGrid",$result,"Summary"); return $result; } if (!isset($_GET['PeriodToDisplay'])){ $sajax_request_type = "POST"; $sajax_debug_mode = 0; sajax_init(); sajax_export("getGraph_for_sig_genan_analyst", "getSpellPower", "getSummary" ); sajax_handle_client_request(); print " [CAMDPAMS MIS] Reports: Analysts
CAMDPAMS
Analysts Activity


Please wait...


dirty_sig_gen Stats for SigsSafeinserted

Please wait...
Spell Power




Please wait...


"; } else{ $pdisplay = strtoupper($_GET['PeriodToDisplay']); $from = $_GET['StartDay']; $to = $_GET['EndDay']; if($from>$to){prn_error();return;} switch($pdisplay){ case "DAY": $r = getGraph_for_sig_genan_analyst($from,$to,'daily'); break; case "WEEK": if(date("Y",strtotime($to))>= date("Y",strtotime($from))+1){prn_error();return;} else{$r = getGraph_for_sig_genan_analyst($from,$to,'weekly');} break; case "MONTH": if(date("Y",strtotime($to))>= date("Y",strtotime($from))+1){prn_error();return;} else{$r = getGraph_for_sig_genan_analyst($from,$to,'monthly');} break; case "QUARTER": if(date("Y",strtotime($to))>= date("Y",strtotime($from))+1){prn_error();return;} else{$r = getGraph_for_sig_genan_analyst($from,$to,'quarter');} break; case "YEAR": $r = getGraph_for_sig_genan_analyst($from,$to,'year'); break; case "DAY_OF_WEEK": if(date("Y",strtotime($to))>= date("Y",strtotime($from))+1 || (strtotime($to)- strtotime($from))/(24*60*60)>6 ||(date("w",strtotime($from))!=0) ||(date("w",strtotime($to))!=6)){prn_error();return;} else{$r = getGraph_for_sig_genan_analyst($from,$to,'d_of_week');} break; /* case "HOUR_OF_DAY": if(date("Y",strtotime($to))>= date("Y",strtotime($from))+1){prn_error();return;} else{$r = getGraph_for_sig_genan_analyst($from,$to,'h_of_day');} break;*/ default: $r = getGraph_for_sig_genan_analyst($from,$to,'daily'); break; } //print $r; $tok = split("\n",$r); $ts[]=''; $element[0][]=''; for($i=0;$i"; $j=0; prn_section($ts,$element[0],"SigsSafeinserted",$pdisplay); print ""; } function prn_section($x,$y,$k,$rep){ $cnt_x=count($x); $cnt_y = count($y); print ""; for($i =1;$i<$cnt_x;$i++){ // print "".date("M d, Y",mktime(0, 0, 0, date("m",$x[$i]/1000) , date("d",$x[$i]/1000), date("Y",$x[$i]/1000)))."$y[$i]"; print "".date_format($x[$i],$rep)."$y[$i]"; } print ""; // print ""; } function date_format($d,$rep){ switch($rep){ case "DAY": $r = date("M d, Y",mktime(0, 0, 0, date("m",$d/1000) , date("d",$d/1000), date("Y",$d/1000))); break; case "WEEK": if(date("W",$d/1000)>52){$r=1;} else{$r = date("W",$d/1000)+1;} break; case "MONTH": if(date("d",$d/1000)>1){$r = date("m",$d/1000);} else{$r = date("m",$d/1000)-1;} $r = date("n",$d/1000); break; case "QUARTER": $to2 = date("n",$d/1000); if($to2>=1 && $to2<3){$r=1;} if($to2>=3 && $to2<6){$r=2;} if($to2>=6 && $to2<9){$r=3;} if($to2>=9 && $to2<=12){$r=4;} break; case "YEAR": if(date("d",$d/1000)>1 || date("m",$d/1000)>1){$r = date("Y",$d/1000);} else{$r = date("Y",$d/1000)-1;} $r = date("Y",$d/1000); break; case "DAY_OF_WEEK": $r = date("w",$d/1000)+1; break; /* case "HOUR_OF_DAY": if(date("H",$d/1000)!=00){$r = date("H",$d/1000)-1;} else{$r = 23;} break;*/ default: $r = date("M d, Y",mktime(0, 0, 0, date("m",$d/1000) , date("d",$d/1000), date("Y",$d/1000))); break; } return $r; } function prn_error(){ print "NOT CORRECT DATETIME FORMAT"; } /* ============================== Start Summary Section ============================== -->
Summary
Please wait...


*/ ?>