コード例 #1
0
ファイル: admin_import.php プロジェクト: notzen/e107
     $msg = LAN_CONVERT_32;
 }
 if ($import_delete_existing_data) {
     $usr->emptyTargetDB();
 }
 // Delete existing users - reasonably safe now
 $line_counter = 0;
 $error_counter = 0;
 $write_counter = 0;
 foreach ($source_data as $line) {
     $line_counter++;
     $line_error = FALSE;
     if ($line = trim($line)) {
         $usr_data = $usr->getDefaults();
         // Reset user data
         $line_data = csv_split($line, $separator, $enveloper);
         $field_data = current($line_data);
         foreach ($field_list as $f) {
             if ($field_data === FALSE) {
                 $line_error = TRUE;
             }
             if ($f != 'dummy') {
                 $usr_data[$f] = $field_data;
             }
             $field_data = next($line_data);
         }
         if ($line_error) {
             if ($msg) {
                 $msg .= "<br />";
             }
             $msg .= LAN_CONVERT_33 . $line_counter;
コード例 #2
0
ファイル: loadfromcsv.php プロジェクト: vladisslav2011/nb
if ($decimaldot == ',') {
    print " selected";
}
print ">,</option><option value='.'";
if ($decimaldot == '.') {
    print " selected";
}
print ">.</option></select></td>";
print "</form></tr></table>";
print "<table>";
$file = fopen($csv_file, 'r');
print "<tr><form action='' method='post'><input type=hidden name='table' value='{$table}'><input type=hidden name='file' value='{$csv_file}'>";
$first_l = 0;
$ck = 0;
while ($str = fgets($file)) {
    $values = csv_split(trim(iconv($csvencoding, 'UTF-8', $str)));
    if ($first_l == 0) {
        foreach ($values as $each) {
            print "<td><select name='c{$ck}'>";
            $ck++;
            print "<option value='--'></option>";
            foreach ($tablecolumns as $col) {
                print "<option value='{$col}'>" . htmlspecialchars($friendlycolnames[$col]) . "</option>";
            }
            reset($tablecolumns);
            print "</select></td>";
        }
        reset($values);
        print "</tr>";
        $first_l++;
    }