include "..//index.php"; session_start(); date_default_timezone_set('America/Montevideo'); $ActiveUser = $_SESSION['user']; if ($_SESSION["password"] != "alm") { header("Location: ..//index.php"); exit(); } $Target = $_GET['target']; $Month = $_POST['month']; $Month = strtotime($Month); $Month = date("m-Y"); $today = date("d-m-Y"); $currMonth = substr($today, 3, 7); if ($Target == "VentasHoy") { echo "
| Fecha | Hora | Usuario | Tipo | Local | Codigo | Descripcion | "; $file = "Logs/Ventas/$currMonth/$today.txt"; $myfile = fopen($file, "r") or die("Unable to open file!"); $contents = fread($myfile, filesize($file)); //echo nl2br($pageText); $contents = nl2br(file_get_contents($file)); $contents = str_replace("][", " #* ",$contents); $contents = str_replace("]", " #* ",$contents); $items = explode('¬', $contents); foreach ($items as $item) { $items = explode('[', $contents); foreach ($items as $item) { if ($item != "") { echo "
|---|---|
| "; $Fecha = substr($item, 0, 10); $item = str_replace("$Fecha", "$Fecha #* ", $item); $Hora = substr($item, 0, 30); $item = str_replace("$Hora", "$Hora #* ", $item); $item = str_replace(" #* ", " | ",$item); echo $item; echo " |
| Hora | Usuario | Tipo | Codigo | Descripcion | "; $file = "Logs/Actualizaciones/$currMonth/$today.txt"; $myfile = fopen($file, "r") or die("Unable to open file!"); $contents = fread($myfile, filesize($file)); //echo nl2br($pageText); $contents = nl2br(file_get_contents($file)); $contents = str_replace("] - [", " #* ",$contents); $contents = str_replace("][", " #* ",$contents); $contents = str_replace("]", " #* ",$contents); $items = explode('¬', $contents); foreach ($items as $item) { $items = explode('[', $contents); foreach ($items as $item) { if ($item != "") { echo "
|---|---|
| "; $Fecha = substr($item, 0, 10); $item = str_replace("$Fecha", "$Fecha #* ", $item); $Hora = substr($item, 0, 30); $item = str_replace("$Hora", "$Hora #* ", $item); $item = str_replace(": Nueva Informacion", " #* Nueva Info", $item); $item = str_replace(" #* ", " | ",$item); echo $item; echo " |
| Fecha | Hora | Usuario | Tipo | Local | Codigo | Descripcion | "; $directory = "Logs/Ventas/$Month/"; $dir = opendir($directory); while (($file = readdir($dir)) !== false) { $filename = $directory . $file; $type = filetype($filename); if ($type == 'file') { $contents = nl2br(file_get_contents($filename)); $contents = str_replace("][", " #* ",$contents); $contents = str_replace("]", " #* ",$contents); $items = explode('¬', $contents); foreach ($items as $item) { $items = explode('[', $contents); foreach ($items as $item) { if ($item != "") { echo "
|---|---|
| "; $Fecha = substr($item, 0, 10); $item = str_replace("$Fecha", "$Fecha #* ", $item); $Hora = substr($item, 0, 30); $item = str_replace("$Hora", "$Hora #* ", $item); $item = str_replace(" #* ", " | ",$item); echo $item; echo " |
| Fecha | Hora | Usuario | Tipo | Codigo | Descripcion | "; $directory = "Logs/Actualizaciones/$Month/"; $dir = opendir($directory); while (($file = readdir($dir)) !== false) { $filename = $directory . $file; $type = filetype($filename); if ($type == 'file') { $contents = nl2br(file_get_contents($filename)); $contents = str_replace("] - [", " #* ",$contents); $contents = str_replace("][", " #* ",$contents); $contents = str_replace("]", " #* ",$contents); $items = explode('¬', $contents); foreach ($items as $item) { $items = explode('[', $contents); foreach ($items as $item) { $items = explode('[', $contents); foreach ($items as $item) { if ($item != "") { echo "
|---|---|
| "; $Fecha = substr($item, 0, 10); $item = str_replace("$Fecha", "$Fecha #* ", $item); $Hora = substr($item, 0, 30); $item = str_replace("$Hora", "$Hora #* ", $item); $item = str_replace(": Nueva Informacion", " #* Nueva Info", $item); $item = str_replace(" #* ", " | ",$item); echo $item; echo " |