Einchecken des Online-Codes
This commit is contained in:
81
admin/inhalte/portale/immop.php
Normal file
81
admin/inhalte/portale/immop.php
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
if (('wmiete' == $_POST['table']) OR ('wkauf' == $_POST['table'])) {
|
||||
include "inhalte/portale/immop/wohn.php";
|
||||
}
|
||||
if (('gmiete' == $_POST['table']) OR ('gkauf' == $_POST['table'])) {
|
||||
include "inhalte/portale/immop/gewerb.php";
|
||||
}
|
||||
|
||||
// Zipdatei erstellen
|
||||
$zip = new ZipArchive();
|
||||
chdir('temp');
|
||||
$zipname = $_POST['WID'].'_st_Z9B_imt.zip';
|
||||
|
||||
if ($zip->open($zipname, ZIPARCHIVE::CREATE)!==TRUE) {
|
||||
exit("Zipdatei <$zipname> kann nicht erstellt werden\n");
|
||||
}
|
||||
|
||||
$nodes = glob($_POST['WID'].'*');
|
||||
foreach ($nodes as $node) {
|
||||
if (is_file($node)) {
|
||||
$zip->addFile($node);
|
||||
}
|
||||
}
|
||||
$zip->close();
|
||||
echo "<p>Zip Archiv erstellt!</p>";
|
||||
|
||||
//FTP Upload
|
||||
$ftp_id = ftp_connect('www.lagler.de');
|
||||
$ftp_user = IMMOP_ID;
|
||||
$ftp_pass = IMMOP_PASS;
|
||||
if (!$ftp_id) {
|
||||
exit("FTP-Verbindung fehlgeschlagen");
|
||||
}
|
||||
$ftp_login_result = ftp_login($ftp_id, $ftp_user, $ftp_pass);
|
||||
if (!$ftp_login_result) {
|
||||
exit("Login zum FTP-Server fehlgeschlagen");
|
||||
}
|
||||
echo "<p>FTP-Verbindung wurde hergestellt!</p>";
|
||||
|
||||
$ftp_upload = ftp_put($ftp_id, $zipname, $zipname, FTP_BINARY);
|
||||
if (!$ftp_upload) {
|
||||
exit("Upload von ".$zipname." fehlgeschlagen");
|
||||
}
|
||||
echo "<p>Die Datei wurde hochgeladen</p>";
|
||||
ftp_close($ftp_id);
|
||||
|
||||
//Dateien löschen
|
||||
$nodes = glob($_POST['WID'].'*');
|
||||
foreach ($nodes as $node) {
|
||||
if (is_file($node)) {
|
||||
unlink($node);
|
||||
}
|
||||
}
|
||||
echo "<p>Temporäre Dateien gelöscht!</p>";
|
||||
|
||||
//Datenbank aktualisieren
|
||||
if ('importieren' == $_POST['Modus']) {
|
||||
$sql3 = 'UPDATE '.$_POST['table'].' SET ip = 1 WHERE WID = "'.$_POST['WID'].'"';
|
||||
} elseif ('loeschen' == $_POST['Modus']) {
|
||||
$sql3 = 'UPDATE '.$_POST['table'].' SET ip = 0 WHERE WID = "'.$_POST['WID'].'"';
|
||||
}
|
||||
if ('aktualisieren' != $_POST['Modus']) {
|
||||
$stmt = $db->prepare($sql3);
|
||||
if (!$stmt) {
|
||||
die ('Es konnte kein SQL-Query vorbereitet werden: '.$db->error);
|
||||
}
|
||||
if (!$stmt->execute()) {
|
||||
die ('Query konnte nicht ausgeführt werden: '.$stmt->error);
|
||||
}
|
||||
}
|
||||
echo "<p>Datenbank wurde aktualisiert!</p>";
|
||||
|
||||
?>
|
||||
<form action="index.php?section=portal" method="post">
|
||||
<label style="display:none">WID</label><input style="display:none" type="text" name="WID" <?php echo 'value="'.$nt1[WID].'"'; ?>/>
|
||||
<?php
|
||||
$table=$_POST['table'];
|
||||
?>
|
||||
<label style="display:none"></label><input style="display:none" type="text" name="table" <?php echo 'value="'.$table.'"'; ?> />
|
||||
<input type="submit" name="formaction" value="Zu den Portalen" />
|
||||
</form>
|
||||
Reference in New Issue
Block a user