forked from physje/funda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupload_offline.php
57 lines (49 loc) · 2.3 KB
/
upload_offline.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
include_once(__DIR__.'/include/config.php');
include_once(__DIR__ .'/include/HTML_TopBottom.php');
include_once($cfgGeneralIncludeDirectory.'class.phpPushover.php');
$db = connect_db();
$minUserLevel = 3;
$cfgProgDir = 'auth/';
include($cfgProgDir. "secure.php");
if(isset($_POST['opslaan'])) {
$files = array_filter($_FILES['upload']['name']);
$total = count($_FILES['upload']['name']);
// Loop through each file
for( $i=0 ; $i < $total ; $i++ ) {
//Get the temp file path
$tmpFilePath = $_FILES['upload']['tmp_name'][$i];
//Make sure we have a file path
if ($tmpFilePath != ""){
//Setup our new file path
$newFilePath = $offlineDir.date('YmdHis').'_'.$_FILES['upload']['name'][$i];
//Upload the file into the temp dir
if(move_uploaded_file($tmpFilePath, $newFilePath)) {
$Links[] = $_FILES['upload']['name'][$i] .' is geupload<br>';
}
}
}
//$String[] = "<p> </p>";
$Rechts[] = "Ga door naar het <a href='check_offline.php'>inladen</a> in de database van deze pagina's<br>\n";
$Rechts[] = "<a href='". $_SERVER['PHP_SELF']."'>Upload</a> nog meer pagina's<br>\n";
} else {
$Links[] = "Omdat via de RSS-feed niet alle informatie op te halen is, is er ook de mogelijkheid om HTML-pagina's van funda.nl aan het script te voeden zodat deze de informatie eruit kan halen.";
$Links[] = "<p>";
$Links[] = "Er kunnen 2 soorten pagina's die ingeladen kunnen worden :<ul>";
$Links[] = "<li>Overzichtpagina van een zoekopdracht, dus overzicht van tekoopstaande of verkochte huizen.</li>";
$Links[] = "<li>Pagina van individueel huis</li>";
$Links[] = "</ul>";
$Links[] = "Het script leest vervolgens deze pagina's in en verwerkt deze informatie in de database.</ul>";
//$Rechts[] = "<p> </p>";
$Rechts[] = "<form method='post' action='". $_SERVER['PHP_SELF']."' enctype='multipart/form-data'>";
$Rechts[] = "<input name='upload[]' type='file' multiple='multiple'>";
$Rechts[] = "<input name='opslaan' type='submit' value='Uploaden'>";
}
# Laat de resultaten vam de check netjes op het scherm zien.
$tweeKolom = false;
echo $HTMLHeader;
echo "<tr>\n";
echo "<td width='50%' valign='top' align='center'>". showBlock(implode("\n", $Links)) ."</td>\n";
echo "<td width='50%' valign='top' align='center'>". showBlock(implode("\n", $Rechts)) ."</td>\n";
echo "</tr>\n";
echo $HTMLFooter;