window.location='index.php?redo=1".$_SESSION["queryString"]."';"; else echo ""; die(); } } else if( isset($_GET["suppack"])) { @mysql_query("DELETE FROM download_enable WHERE ID=".$_GET["suppack"], $_SESSION["writeServer"]) or die(mysql_error()); $reqSupp = "DELETE FROM devices WHERE name='DOWNLOAD' AND ivalue=".$_GET["suppack"]; if( isset($_GET["nonnot"]) ) $reqSupp .= " AND tvalue IS NULL"; @mysql_query($reqSupp, $_SESSION["writeServer"]) or die(mysql_error()); } if( isset($_GET["systemid"])) $nbMach = 1; else $nbMach = getCount($_SESSION["saveRequest"]); if( $nbMach > 0 ) { $canAc = 1; PrintEnTete( $l->g(477)." ($nbMach ".$l->g(478).")"); } else { die($l->g(478)); } if( ! isset( $_GET["systemid"] ) ) echo "
<= ".$l->g(188)."
"; else echo "
<= ".$l->g(188)."
"; if( isset($_GET["systemid"])) $canAc = 3; //preferences.php must set systemid in query string $lbl = "pack"; $sql = "d.fileid = e.fileid"; $whereId = "d.FILEID=e.FILEID AND d.FILEID"; $linkId = "d.FILEID"; $select = array("ID"=>$l->g(460), "d.FILEID"=>$l->g(475), "NAME"=>$l->g(49), "PRIORITY"=>$l->g(440),"INFO_LOC"=>$l->g(470), "PACK_LOC"=>$l->g(471), "FRAGMENTS"=>$l->g(480), "SIZE"=>$l->g(462), "OSNAME"=>$l->g(25)); $selectPrelim = array("d.FILEID"=>"d.FILEID"); $from = "download_available d, download_enable e"; $fromPrelim = ""; $group = ""; $order = ""; $countId = "e.ID"; $requete = new Req($lbl,$whereId,$linkId,$sql,$select,$selectPrelim,$from,$fromPrelim,$group,$order,$countId,true); ShowResults($requete,true,false,false,false,false,false,$canAc); $_SESSION["storedRequest"] = $_SESSION["saveRequest"]; function setPack( $packid ) { global $_GET; if( isset($_GET["systemid"])) { $val["h.id"] = $_GET["systemid"]; if( ! @mysql_query( "INSERT INTO devices(HARDWARE_ID, NAME, IVALUE) VALUES('".$val["h.id"]."', 'DOWNLOAD', $packid )", $_SESSION["writeServer"] )) { echo "
ERROR: MySql connection problem
".mysql_error($_SESSION["writeServer"])."
"; return false; } $_SESSION["justAdded"] = true; } else { $lareq = getPrelim( $_SESSION["saveRequest"] ); if( ! $res = @mysql_query( $lareq, $_SESSION["readServer"] )) return false; while( $val = @mysql_fetch_array($res)) { if( ! @mysql_query( "INSERT INTO devices(HARDWARE_ID, NAME, IVALUE) VALUES('".$val["h.id"]."', 'DOWNLOAD', $packid)", $_SESSION["writeServer"] )) { echo "
ERROR: MySql connection problem
".mysql_error($_SESSION["writeServer"])."
"; return false; } } } return true; } function resetPack( $packid ) { global $_GET; if( isset($_GET["systemid"])) { $val["h.id"] = $_GET["systemid"]; if( ! @mysql_query( "DELETE FROM devices WHERE name='DOWNLOAD' AND IVALUE=$packid AND hardware_id='".$val["h.id"]."'", $_SESSION["writeServer"] )) { echo "
ERROR: MySql connection problem
".mysql_error($_SESSION["writeServer"])."
"; return false; } } else { $lareq = getPrelim( $_SESSION["saveRequest"] ); if( ! $res = @mysql_query( $lareq, $_SESSION["readServer"] )) return false; while( $val = @mysql_fetch_array($res)) { if( ! @mysql_query( "DELETE FROM devices WHERE name='DOWNLOAD' AND IVALUE=$packid AND hardware_id='".$val["h.id"]."'", $_SESSION["writeServer"] )) { echo "
ERROR: MySql connection problem
".mysql_error($_SESSION["writeServer"])."
"; return false; } } } return true; //TODO: comprends pas: echo "DELETE FROM devices WHERE name='FREQUENCY' AND hardware_id IN ($lareq)";flush(); } ?>