include('../../../things.php'); $HTTP_HOST = $_SERVER['HTTP_HOST']; $cat = ''; $act = ''; //$nr = ''; $langv = ''; $nr = ''; include('../fixes.php'); //ini_set('display_errors', 1); //ini_set('display_startup_errors', 1); //error_reporting(E_ALL); mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header ("Pragma: no-cache"); // HTTP/1.0 //header ("Content-Type: text/html; charset=UTF-8"); $asterpos = ''; $asterpos2 = ''; $catstring = ''; $numrows = ''; $rows = ''; $catsting = ''; $butt1 = ''; $onlynamed = ''; $toload = ''; $toload0 = ''; $where = ''; $sort = ''; $nr2 = ''; $NatalKook = ''; $PHP_SELF = ''; $klass2 = ''; $klass3 = ''; $klass4 = ''; $klass5 = ''; $klass6 = ''; $find = ''; $start = ''; $avastamine = ''; $sun = ''; $prevnext = ''; $transitsarray = ''; $transitsarray2 = ''; $tra=($trah = mysqli_connect("localhost", "megadel_abhi", "Trustn02!!!", "megadel_horoskoop")); //mysqli_set_charset($trah, "utf8mb4"); mysqli_set_charset($tra, "latin1"); if (($langv <> 'eng') && ($langv <> 'est')) { $langv = 'eng'; //30 jan 2022 } if (($nr == '') AND ($name == '')){$nr=1;} $sort = $_GET['sort'] ?? null; if ($sort == '') {$sort='nr';} else {$sort = $_GET['sort'];} //echo $sort; if ($act == '') {$act='cat';} $start = $_GET['start'] ?? 0; //echo 'kusi '.$start; if ($start < 0) {$start = 0; //echo 'kusi '.$start; } //$onlynamed = $_GET['onlynamed'] ?? null; if (isset($array['onlynamed'])) { $onlynamed = $array['onlynamed']; } else { $onlynamed = 'y'; } /* if ($_GET['start'] ?? null < 0) {$start = 0;} if ($start == '') {$start='0';} //lisasin need 2.2.2021 sest parameetriteta annab browse.php errori mysqlis. else $start = $_GET['start']; if ($start < 0) {$start = 0;}; if ($_GET['start'] < 0) {$_GET['start'] = 0;} */ if ($_GET['rows'] ?? null == '') {$rows='25';} else $rows = $_GET['rows']; /* if (($_SERVER['HTTP_HOST'] == 'horoskoop.ee') OR ($_SERVER['HTTP_HOST'] == 'www.horoskoop.ee') AND $langv != 'eng' OR $langv == 'est' ) { include('../lang_ee2.php'); include('../funcs2.php'); if ($langv == '') {$langv='est';} } else { include('../lang_en.php'); include('../funcs2eng.php'); if ($langv == '') {$langv='eng';} } */ include('../lang_en.php'); include('../funcs2eng.php'); //include('../header.php'); echo'
'; if (($HTTP_HOST == 'horoskoop.ee') OR ($HTTP_HOST == 'www.horoskoop.ee')) { include('../inc-bann-est.php'); } else { //include('../inc-bann-eng.php'); } //echo ''; include ('browse.php'); include ('brows.php'); //exit; echo' '; if ($_GET['onlynamed'] ?? null == 'y') { $where = "WHERE named='y'"; } if (($act == 'cat') AND ($cat == '')) { echo '
download list of asteroids in this group in Zet act format.'; } //select asteroids.nr, asteroids.name from asteroids, astermap, astercat where astercat.est = 'Eesti' and astercat.id = astermap.id and astermap.nr = asteroids.nr /* Otsime namesrce järgi märksõna */ if (($act == 'desc') and ($cat != '')) { $sqlmy = "select astorb_disc2.nr, astorb_disc2.name, astorb_disc2_2019.namesrc2 FROM astorb_disc2, astorb_disc2_2019, astermap, astercat WHERE astermap.id <> 'sittt' and astorb_disc2_2019.namesrc2 LIKE '%".$cat."%' and astercat.id = astermap.id and astermap.nr = astorb_disc2.nr and astermap.nr = astorb_disc2_2019.nr order by ".$sort." "; $sqlmy = "select astorb_disc2.nr, astorb_disc2.name, astorb_disc2_2019.namesrc2 FROM astorb_disc2, astorb_disc2_2019 WHERE astorb_disc2_2019.namesrc2 LIKE '%".$cat."%' and astorb_disc2.nr = astorb_disc2_2019.nr"; // ettevaatust sellega. lingib index69b.php printTable3($sqlmy); } exit; /* Otsingu from */ if ($act == 'find') { echo'
'; } //print_r($_POST); //print_r($_GET); /* Otsingu tulemus */ if (($_GET['act'] ?? null == 'find') and ($_POST['find'] ?? null != '')) //if (($_POST['act'] == 'find') and ($_POST['find'] != '')) //if ($_GET['act'] == 'find') { //echo 'mida'; // here was a trick before! space before each name field!!! //printTable("select nr, name from asteroids where name like '".$find."%' "); // vahetasin ära 26 feb 2023 //mysqli_set_charset($trah, "utf8mb4"); //printTable("select nr, name from astorb_disc2 where name like '".$find."%' "); //printTable("select nr, name from asteroids_namesrc5 where name like '".$find."%' "); //echo 'noh'; printTable("select nr, name from asteroids_namesrc5 where name like '".$_POST['find']."%' "); //selle panin 14 jan 2026 //printTable("select nr, name from asteroids_namesrc2 where name like 'jun%' "); //selle panin 14 jan 2026 } //+------------------------------------------------------------------+ //| Asteroidi info leht koos kaardiga | //+------------------------------------------------------------------+ if ($act == 'info') { if (!$nr) { $result = mysqli_query($trah, "select nr from asteroids where ltrim(name) = '".$name."'"); while ($data = mysqli_fetch_row($result)) { $nr = $data[0]; } } if ($nr == '') { $nr = 666; } $command="../cgi-bin/swetest -ps -xs".$nr." -b".date("d").".".date("m").".".date("Y")." -ut".date("H").":".date("i")." -g -fpPZl -edir/var/www/vhosts/megadelfi.com/astrolog/ephe -head -roundmin > ../temp/_aster_$NatalKook"; exec($command); //echo $command; $datafile = "../temp/_aster_$NatalKook"; $INFO = fopen($datafile,"r"); if ( filesize($datafile) > 0) { $filesisu = fread($INFO, filesize($datafile)); fclose($INFO); $transitsarray=explode("\n",$filesisu); } //echo ' ';
//print_r($transitsarray);
if (is_array($transitsarray) && isset($transitsarray[0])) {
$asterpos = substr($transitsarray[0],22,8);
//echo $asterpos;
}
//if (count($transitsarray) > 0) {
//if (strlen($transitsarray) > 0) {
if (!empty($transitsarray)) {
$uuendus = explode("\t", $transitsarray[0]);
}
//print_r($uuendus);
if (isset($uuendus[2])){
$asterpos = $uuendus[2];
}
$asterpos = str_replace(' ar ',' ARI ',$asterpos);
$asterpos = str_replace(' ta ',' TAU ',$asterpos);
$asterpos = str_replace(' ge ',' GEM ',$asterpos);
$asterpos = str_replace(' cn ',' CAN ',$asterpos);
$asterpos = str_replace(' le ',' LEO ',$asterpos);
$asterpos = str_replace(' vi ',' VIR ',$asterpos);
$asterpos = str_replace(' li ',' LIB ',$asterpos);
$asterpos = str_replace(' sc ',' SCO ',$asterpos);
$asterpos = str_replace(' sa ',' SAG ',$asterpos);
$asterpos = str_replace(' cp ',' CAP ',$asterpos);
$asterpos = str_replace(' aq ',' AQU ',$asterpos);
$asterpos = str_replace(' pi ',' PIS ',$asterpos);
if ($nr < 90000)
{
if (substr($asterpos,2,1) != ' ')
{
$asterpos = 'NOT CALCULATED!';
}
}
//mysqli_set_charset($trah, "utf8mb4");
//mysqli_set_charset($trah, "latin1");
//mysqli_set_charset($trah, "latin1");
$disco = mysqli_query($trah, "select day, month, year, site, disc, name, incl, eccent, daily, au, type, des from astorb_disc2 where nr = '".$nr."'"); // 13 jan 2023
$kuups = mysqli_fetch_row($disco);
//print_r($kuups);
if (is_array($kuups)) {
$kuup = $kuups[0];
$kuu = $kuups[1];
$aasta = $kuups[2];
$alist = $nr;
$place = $kuups[3];
$astname = $kuups[5];
$designation = $kuups[11];
}
//mysqli_set_charset($trah, "latin1");
//$disco7 = mysqli_query($trah, "select name from asteroids_namesrc2 where nr = '".$nr."'"); // 13 jan 2023
//$disco7 = mysqli_query($trah, "select name from asteroids_namesrc2 where nr = 13390"); // 13 siin oli vist src5 enne
$disco7 = mysqli_query($trah, "select name from astorb_disc2 where nr = '".$nr."'"); // 26 jan 2026
$kuups7 = mysqli_fetch_row($disco7);
if (isset($kuups7[0])){
//if (isset($kuups7[9])){
$astname = $kuups7[0];
}
$command="../cgi-bin/swetest -ps -xs".$nr." -b".$kuups[0].".".$kuups[1].".".$kuups[2]." -ut".date("H").":".date("i")." -g -fpPZl -edir/var/www/vhosts/megadelfi.com/astrolog/ephe -head -roundmin > ../temp/_aster2_$NatalKook";
exec($command);
//echo $command;
$datafile2 = "../temp/_aster2_$NatalKook";
$INFO2 = fopen($datafile2,"r");
if ( filesize($datafile2) > 0) {
$filesisu2 = fread($INFO2, filesize($datafile2));
fclose($INFO2);
$transitsarray2=explode("\n",$filesisu2);
}
if (is_array($transitsarray2) && isset($transitsarray2[0])) {
$asterpos2 = substr($transitsarray2[0],22,8);
}
//if (count($transitsarray2) > 0) {
if (is_array($transitsarray2) && isset($transitsarray2[0])) {
$uuendus = explode("\t", $transitsarray2[0]);
}
if (isset($uuendus2)) {
$asterpos2 = $uuendus[2];
}
$asterpos2 = str_replace(' ar ',' ARI ',$asterpos2);
$asterpos2 = str_replace(' ta ',' TAU ',$asterpos2);
$asterpos2 = str_replace(' ge ',' GEM ',$asterpos2);
$asterpos2 = str_replace(' cn ',' CAN ',$asterpos2);
$asterpos2 = str_replace(' le ',' LEO ',$asterpos2);
$asterpos2 = str_replace(' vi ',' VIR ',$asterpos2);
$asterpos2 = str_replace(' li ',' LIB ',$asterpos2);
$asterpos2 = str_replace(' sc ',' SCO ',$asterpos2);
$asterpos2 = str_replace(' sa ',' SAG ',$asterpos2);
$asterpos2 = str_replace(' cp ',' CAP ',$asterpos2);
$asterpos2 = str_replace(' aq ',' AQU ',$asterpos2);
$asterpos2 = str_replace(' pi ',' PIS ',$asterpos2);
if ($nr < 90000) {
if (substr($asterpos2,2,1) != ' ') {
$asterpos2 = 'NOT CALCULATED!';
}
}
echo '
';
echo '';
echo ''.$astname.'
';
echo '('.$designation.')
';
echo '';
echo'NOW @ '.$asterpos.'
';
if ($kuups)
if($nr2)
{
/*echo str_replace(" ", "%20",trim($kuups[3])).'&kuup='.$kuups[0].'&kuu='.$kuups[1].'&aasta='.$kuups[2].'&alist='.$nr.','.$nr2[0].'\',\'\',\'width=470,height=750\')" >';
//'onMouseDown="MM_openBrWindow(\'../astdate.php?place='.$kuups[3].'&alist='.$nr.','.$nr2[0].'\',\'\',\'width=470,height=750\')" >'.
echo 'puuuuFOUND @ '.' '.$asterpos2.'';
//° */
}
//if ($nr2[0] == '') {$nr2[0] = 'söök';}
//echo '&kuup='.$kuups[0].'&kuu='.$kuups[1].'&aasta='.$kuups[2].'&alist='.$nr.','.$nr2[0].'\',\'\',\'width=470,';
echo '';
echo 'onMouseDown="MM_openBrWindow(\'../astdate.php?place=';
echo str_replace(" ", "%20",trim($kuups[3])).'&kuup='.$kuups[0].'&kuu='.$kuups[1].'&aasta='.$kuups[2].'&alist='.$nr.','.$nr.'\',\'\',\'width=470,height=750\')" >';
//echo str_replace(" ", "%20",trim($kuups[3])).'&kuup='.$kuups[0].'&kuu='.$kuups[1].'&aasta='.$kuups[2].'&alist='.$nr.','.$nr2[0].'\',\'\',\'width=470,height=750\')" >';
echo 'DISCOVERY POS:';
if ($kuups[8] == '') // 13 jan 2023
{
$kuups[8] = 1;
}
echo '';
$fornextcat = "Eesti";
$result2 = mysqli_query($trah, "select astercat.".$langv." from astercat, astermap where astermap.nr = '".$nr."' AND astermap.id = astercat.id ");
while ($data2 = mysqli_fetch_row($result2))
{
$fornextcat = $data2[0];
//}
$result2020 = mysqli_query($trah, "select astercat.id from astercat where astercat.".$langv." = '".$fornextcat."'");
while ($data2020 = mysqli_fetch_row($result2020))
{
$catnr2020 = $data2020[0];
}
$sql2020 = "select nr from astermap where id = '".$catnr2020."' and nr < '".$nr."' order by nr desc limit 1";
$result2020b = mysqli_query($trah, $sql2020);
while ($data2020b = mysqli_fetch_row($result2020b))
{
$prevnext = ' << prev in category - '.$fornextcat.' - ';
}
$sql2020 = "select nr from astermap where id = '".$catnr2020."' and nr > '".$nr."' order by nr limit 1";
$result2020b = mysqli_query($trah, $sql2020);
while ($data2020b = mysqli_fetch_row($result2020b))
{
$prevnext.= 'next in category >> ';
}
echo $prevnext.'
';
}
/*
$mysqli = new mysqli("localhost", "megadel_abhi", "Trustn02!!", "megadel_horoskoop");
//mysqli_set_charset($mysqli,'utf8');
if ($mysqli->connect_errno) {
echo "Failed to connect to mysql: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}
//$mysqli->real_query("select title from blogposts where id = '1'");
$mysqli->real_query("select namesrc, namesrc0 from astorb_disc2_2019 where nr = '".$nr."'");
$kass = $mysqli->use_result();
while ($yrow = $kass->fetch_assoc()) {
$tata2[1] = $yrow['namesrc0'];
}
$rezult = mysqli_query($trah, "select namesrc, namesrc0 from astorb_disc2_2019 where nr = '".$nr."'");
$tata = mysqli_fetch_row($rezult);
//printf("Initial character set: %s\n", $mysqli->character_set_name());
mysqli_set_charset($trah, "latin1"); //äkki tuleb see peale querit ära muuta endiseks?
$rezult = mysqli_query($trah, "select src from asteroids_namesrc2 where nr = '".$nr."'");
$tata3 = mysqli_fetch_row($rezult);
mysqli_set_charset($trah, "utf8mb4");
echo '
'; //preg_replace('/{*\((\d+)\)/','$0' //echo '
'.preg_replace('/{*\((\d+)\)/','$0',str_replace("\t",'
',$tata2[1])).''.iconv('UTF-8', 'UTF-8', $tata3[0]).'
'.preg_replace('/{*\((\d+)\)/','$0',str_replace("\t",' ',$tata2[1])).'
'; //aga kui src3 on tühi siis väljastame src2 VÄLJAST src2 if ($allikad[0] == ''){ //echo $allikad[2].' _ _'; echo preg_replace('/{*\((\d+)\)/','$0',str_replace("\t",'
',$allikad[2])).' _ _'; } else { // a kui src3 ikkagi ei ole tühi siis juhul kui src2 on pikem kui src3, väljastame src2 VÄLJAST src2 if (strlen($allikad[2]) > strlen($allikad[0]) ) { echo preg_replace('/{*\((\d+)\)/','$0',str_replace("\t",'
',$allikad[2])).' _ _.'; } else { // kui src3 ei ole tühi ja kui ta ei ole lühem kui src2 siis väljastame src3 VÄLJAST src3 echo $allikad[0]; } } echo '
',$allikad[2])).' _ _.'; } else { echo $allikad[0]; } } echo'
';
//include('astrocartobann4.htm');
echo '
';
echo '';
echo '
',$allikad[2])).'
'; // see on vist see kui tuleb oma sisestatud asteroidi info lisaks // siin hakatakse vaatama kuhu kategooriatesse asteroid kuulub $result2 = mysqli_query($trah, "select astercat.".$langv." from astercat, astermap where astermap.nr = '".$nr."' AND astermap.id = astercat.id "); while ($data2 = mysqli_fetch_row($result2)) { // jäetakse need kategooriad meelde $catstring .= ''.$data2[0].', '; if (($data2[0] == 'Mütoloogia') OR ($data2[0] == 'Mythology')) { $butt1 = 'true'; } $fornextcat = $data2[0]; } if ($nr < 100) { $butt1 = 'true'; } echo '
'.$lang['discovered'].$kuups[0].'-'.$kuups[1].'-'.$kuups[2].' '.$lang['in'].$lang['inplace'].' '.$kuups[3].''.$lang['by'].''.$kuups[4].' | ||
| '; echo ' ORBITS | '; //echo ' ORBITS | '; echo ' AstDys | '; echo ' Wikipedia | '; echo ' Dictionary | '; echo ' UrbanDictionary | '; echo ' Bartleby | '; echo ' Webster | '; echo ' Name Source | '; if ($butt1) { echo 'Mythica'; } echo ' | ||
| '.$lang['categories'].': ';
if ($REMOTE_ADDR == $myip)
{
// echo 'e d i t ';
echo 'e d i t ';
}
// nüüd väljastatakse need kategooriad
echo $catstring;
echo ' |
| '.makekuup($data[0]).' | '.makelink($data[1]).' Asteroid '.$data[2].' '.strtolower(eng2estTR(ucfirst($data[3]))); // echo ' |
| '.makekuup($data[0]).' | '.makelink($data[1]).' Asteroid '.$data[2].' '.strtolower(eng2estTR(ucfirst($data[3]))); if (($data[4] != 'Sun') AND ($data[4] != 'Moo') AND ($data[4] != 'Mer') AND ($data[4] != 'Ven') AND ($data[4] != 'Mar') AND ($data[4] != 'Jup') AND ($data[4] != 'Sat') AND ($data[4] != 'Ura') AND ($data[4] != 'Nep') AND ($data[4] != 'Plu')) { echo ' asteroid'.$lang['with_asteroid']; //echo ' '.makelink('#'.$data[4]); echo ' '.$data[4].''; } else { echo ' '.eng2estTR($data[4]); } echo '. |
| '.makekuup($data[0]).' | '.makelink($data[1]).' Asteroid '.$data[4].' '.strtolower(eng2estTR(ucfirst($data[3]))); if (($data[4] != 'Sun') AND ($data[4] != 'Moo') AND ($data[4] != 'Mer') AND ($data[4] != 'Ven') AND ($data[4] != 'Mar') AND ($data[4] != 'Jup') AND ($data[4] != 'Sat') AND ($data[4] != 'Ura') AND ($data[4] != 'Nep') AND ($data[4] != 'Plu')) { echo ' asteroid'.$lang['with_asteroid']; //echo ' '.makelink('#'.$data[2]); //echo ' '.makelink('#'.$data[2]); echo ' '.$data[2].''; } else { echo ' '.eng2estTR($data[2]); } echo '. |
'; echo '
'; printTable("select asteroids.nr, asteroids.name from asteroidinfo, asteroids where asteroidinfo.nr = asteroids.nr order by asteroidinfo.id desc"); echo '
Latest events
'; printTable("select distinct asteroids.nr, asteroids.name from asteroidevents, asteroids where asteroidevents.planet1 = ltrim(asteroids.name) OR asteroidevents.planet2 = ltrim(asteroids.name) order by asteroidevents.id desc"); echo '
Latest comments
'; printTable("select distinct asteroids.nr, asteroids.name from astcomm, asteroids where astcomm.id = asteroids.nr AND astcomm.".$langv." <> '' order by astcomm.date desc"); } /* Mitteavalik toimetamine */ if ($act == 'edit2') { //echo 'blaah '.$nr; echo '
'; } /* Mitteavalik lisamine */ if ($act == 'lisa') { // echo 'blaah2 '.$nr; //$result = mysql_db_query("megadel_horoskoop", "INSERT INTO `mylinks` (`id`, `link`, `title`, `description`, `date`) VALUES ('', '".$link."', '".$asi2[0]."', '".$description."', '".date(Y)."-".date(m)."-".date(d)." ".date(H).":".date(i).":".date(s)."')"); //$result = mysql_db_query("megadel_horoskoop", "SELECT id FROM mylinks WHERE link = '".$link."'"); //while ($data = mysql_fetch_row($result)) { //$linkid = $data[0]; } // echo "