<a href="#" class="btn btn-danger"> <span class="bigger-150"> <?php echo $ungenerated; ?> </span> <br> Ungenerated Tickets </a> </div> </div> </div> </div> <?php $report = import_csv_data($pdo, $csv_data); if (isset($report)) { ?> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Report</h3> </div> <div class="panel-body"> <div class="col-md-6"> <h2>Imported</h2> <?php echo $report['success']; ?> </div>
/** * Import functions */ include "../functions/functions.import.php"; xhtml_head(T_("Import data file")); if (isset($_POST['import_file'])) { //file has been submitted $datafname = tempnam("/tmp", "FOO"); move_uploaded_file($_FILES['datafile']['tmp_name'], $datafname); $data_id = new_data($_POST['description']); if ($data_id) { print "<p>" . T_("Created new data entry: ") . "{$data_id}</p>"; $ds = import_csv_columns($datafname, $data_id); if ($ds) { print "<p>" . T_("Created column strucure") . "</p>"; $is = import_csv_data($datafname, $data_id); if ($is) { print "<p>" . T_("Data imported successfully") . "</p>"; } } } } else { ?> <form enctype="multipart/form-data" action="" method="post"> <p><input type="hidden" name="MAX_FILE_SIZE" value="1000000000" /></p> <p><?php echo T_("Choose the headered CSV data file to upload:"); ?> <input name="datafile" type="file" /></p> <p><?php echo T_("Description for file:");
/** * XHTML functions */ include "../functions/functions.xhtml.php"; /** * Import functions */ include "../functions/functions.import.php"; xhtml_head(T_("Import data file"), true, false, array('../js/display.js')); if (isset($_POST['import_file']) && isset($_GET['data_id']) && isset($_GET['column_id'])) { //file has been submitted $datafname = tempnam("/tmp", "FOO"); move_uploaded_file($_FILES['datafile']['tmp_name'], $datafname); $data_id = intval($_GET['data_id']); $column_id = intval($_GET['column_id']); $is = import_csv_data($datafname, $data_id, $column_id); if ($is != false) { $rows = count($is); print "<p>" . T_("Data imported successfully") . " " . T_("Rows:") . " {$rows}</p>"; if ($rows > 0) { include "../functions/functions.work.php"; if (run_auto_processes(get_auto_processes($data_id), $is)) { p(T_("Successfully ran automatic processes"), "p"); } else { p(T_("Failed to run automatic processes"), "p"); } } } else { p(T_("Failed to import data"), "p"); } } else {