d2tools/index.php

45 lines
740 B
PHP
Raw Normal View History

2021-03-21 03:10:59 +00:00
<?php
ini_set('display_errors', 1);
2021-03-21 19:47:29 +00:00
ini_set('log_errors', 1);
require_once "./config.php";
2021-03-21 19:47:29 +00:00
//$path = $d2_dir."data\\global\\excel\\";
$path = $d2_dir;
2021-03-21 19:47:29 +00:00
2021-03-21 03:10:59 +00:00
$post = $_POST;
2021-03-21 19:47:29 +00:00
if (!empty($post['code'])) {
array_filter($post['code']);
if(!empty($post['code'][0])) {
$post['code'] = $post['code'][0];
} else {
$post['code'] = $post['code'][1];
}
}
2021-03-21 03:10:59 +00:00
require_once 'uniqueitems.php';
$fp = fopen($u, 'a+');
echo "<pre>";
print_r($post);
foreach ($post as $p){
echo "$p\t";
}
echo "</pre>";
if (!empty($_POST)) {
fputcsv($fp, $post, "\t");
// write for .tbl
$str = '"'.$post["index"].'" "'. $post["index"] .'"';
file_put_contents("UniqueItemsTblEntries.txt", $str, FILE_APPEND | LOCK_EX);
}
2021-03-21 19:47:29 +00:00
2021-03-21 03:10:59 +00:00