function replay_deal_hust($standtable) { global $_POST, $sttime, $edtime, $mcid, $pnum, $sfreq; $rows = $standtable->find("tr"); $unum = sizeof($rows); for ($i = 1; $i < $unum; $i++) { $crow = $rows[$i]->children(); $uname = strip_tags($crow[1]->innertext); for ($j = 0; $j < $pnum; $j++) { $value = trim($crow[$j + 4]->innertext); if ($value == "") { continue; } if (strstr($value, ":") == null) { $tnum = strstr(substr(strstr($value, '('), 1), ')', true); $tnum = -intval($tnum); //echo $uname." ".$_POST['pid'.$j]." ".$tnum." * ".date("Y-m-d H:i:s",$edtime-10)."<br />\n"; inswa($tnum, $sttime, $edtime, $_POST['pid' . $j], convert_str($uname), $mcid, $sfreq); } else { $tnum = 0; if (strstr($value, "(") == null) { $act = $value; } else { $act = strstr($value, '(', true); $tnum = strstr(substr(strstr($value, '('), 1), ')', true); } if ($tnum == "") { $tnum = 0; } else { $tnum = -intval($tnum); } //echo $uname." ".$_POST['pid'.$j]." ".date("Y-m-d H:i:s",$sttime+replay_to_second($act)-10)." * $tnum + ".date("Y-m-d H:i:s",$sttime+replay_to_second($act))."<br />\n"; insac($tnum, $sttime, replay_to_second($act), $_POST['pid' . $j], convert_str($uname), $mcid, $sfreq); } } } }
function deal_spoj($standtable) { global $_POST, $sttime, $edtime, $mcid, $pnum, $sfreq; $rows = $standtable->find("tr"); $unum = sizeof($rows); for ($i = 1; $i < $unum; $i++) { $crow = $rows[$i]->children(); $uname = strip_tags($crow[1]->innertext); //echo $uname." ---<br>"; if ($uname == "") { continue; } for ($j = 0; $j < $pnum; $j++) { $value = trim($crow[$j + 2]->innertext); if ($value == "-") { continue; } if (strstr($value, '-') !== false) { $tnum = strstr(substr(strstr($value, '('), 1), ')', true); $act = strtotime(strstr($value, '(', true)); // echo $uname." ".$_POST['pid'.$j]." ".$tnum." * ".date("Y-m-d H:i:s",$act)."<br />\n"; insac($tnum, $sttime, $act - $sttime, $_POST['pid' . $j], convert_str($uname), $mcid, $sfreq); } else { $tnum = strstr(substr(strstr($value, '('), 1), ')', true); // echo $uname." ".$_POST['pid'.$j]." ".$tnum." * ".date("Y-m-d H:i:s",$edtime-10)."<br />\n"; inswa($tnum, $sttime, $edtime, $_POST['pid' . $j], convert_str($uname), $mcid, $sfreq); } } } }