/**
 * Echo the img tag translation of the TRL argument
 *
 * @param String $param -- String to Translate
 * @param Array $parans -- Array of Img Tag.
 */
function teimg($str, $parans = array())
{
    $parans = " ";
    foreach ($parans as $key => $value) {
        $parans .= " {$key}='{$value}' ";
    }
    $img = ti($str);
    echo "<img src='{$img}' {$parans} />";
}
예제 #2
0
            foreach ($array as $key => $useless) {
                $query .= "`" . mysql_real_escape_string($key) . "`, ";
            }
            $query = substr($query, 0, -2) . ") values ";
            $rows = "";
            if (is_array(${$table}) && sizeof(${$table}) > 0) {
                foreach (${$table} as $key => $value) {
                    foreach ($value as $key2 => $value2) {
                        # $key = isbn
                        # $value2 = array with data to be inserted
                        $rows .= "(";
                        foreach ($array as $k => $v) {
                            $rows .= "'" . ($k == 'id' ? mysql_real_escape_string($key) : (isset($value2[$k]) ? mysql_real_escape_string(utf8_decode($value2[$k])) : '')) . "', ";
                        }
                        $rows = substr($rows, 0, -2) . "), ";
                    }
                }
            }
            $rows = substr($rows, 0, -2);
            mysql_query($query . $rows);
        }
    }
    if ($end + $start - ($deleted + 1) < $size) {
        header("Location: " . $uri . "?start=" . ($end + $start - ($deleted + 1)) . "&st=" . $st . "&totaal=" . $totaal);
        // continue with the next chunk of xml
    } else {
        // finished and show total number of inserted records and processing time
        echo date("Y-m-d H:i:s") . " records: " . $totaal . " time: " . number_format(ti() - $st, 2, '.', ',') . " seconds";
    }
    mysql_close($conn);
}