Posted by Jawaad on Thu 21 Aug 17:44
report abuse | download | new post
- // UPLOAD CSV CUSTOM
- // Ver. 1.0
- // by Jawaad
- // zaibatsu@gmail.com
- // File: index.php
- //@ob_start();
- //@ob_implicit_flush(0);
- // CONECT DATABASE
- ?>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
- <html xmlns='http://www.w3.org/1999/xhtml' lang='en' xml:lang='en:us'>
- <head>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8">
- <title>UPLOAD CSV CUSTOM</title>
- <style type="text/css" media="screen">
- body {
- background: #fff;
- color: #888;
- font: 100% georgia,times,serif;
- }
- h1 {
- font-weight: normal;
- margin: 0;
- padding: 0 0 .5em 0;
- }
- h2 {
- font-weight: normal;
- margin: 0;
- padding: 0 0 .5em 0;
- }
- /*- Menu Tabs J--------------------------- */
- #tabsJ {
- float:left;
- width:100%;
- background:#fff;
- font-size:93%;
- line-height:normal;
- border-bottom:1px solid #24618E;
- }
- #tabsJ ul {
- margin:0;
- padding:10px 10px 0 50px;
- list-style:none;
- }
- #tabsJ li {
- display:inline;
- margin:0;
- padding:0;
- }
- #tabsJ a {
- float:left;
- background:url("tableftJ.gif") no-repeat left top;
- margin:0;
- padding:0 0 0 5px;
- text-decoration:none;
- }
- #tabsJ a span {
- float:left;
- display:block;
- background:url("tabrightJ.gif") no-repeat right top;
- padding:5px 15px 4px 6px;
- color:#24618E;
- }
- /* Commented Backslash Hack hides rule from IE5-Mac \*/
- #tabsJ a span {float:none;}
- /* End IE5-Mac hack */
- #tabsJ a:hover span {
- color:#FFF;
- }
- #tabsJ a:hover {
- background-position:0% -42px;
- }
- #tabsJ a:hover span {
- background-position:100% -42px;
- }
- </style>
- <script type="text/javascript">
- function addElement() {
- var ni = document.getElementById('myDiv');
- var numi = document.getElementById('theValue');
- var num = (document.getElementById("theValue").value -1)+ 2;
- numi.value = num;
- var divIdName = "my"+num+"Div";
- var newdiv = document.createElement('div');
- newdiv.setAttribute("id",divIdName); // + num +
- newdiv.innerHTML = "<input type=hidden name=\"kode[" + num + "]\" value=\"" + num + "\"><input type=text name=\"field" + num + "\"> <select name=\"tipe" + num + "\"><option>TEXT</option><option>LONG-TEXT</option><option>NUMERIC</option><option>NUMERIC-2-DECIMAL</option><option>DATE</option><option>DATE-TIME</option></select> <a href=\"javascript:;\" onclick=\"removeElement(\'"+divIdName+"\')\">[- del]</a><p>";
- ni.appendChild(newdiv);
- }
- function removeElement(divNum) {
- var d = document.getElementById('myDiv');
- var olddiv = document.getElementById(divNum);
- d.removeChild(olddiv);
- }
- </script>
- </head>
- <body>
- <h1>UPLOAD CUSTOM CSV INSERT TO MYSQL</h1>
- <div id="tabsJ">
- <ul>
- <li><a href="?do=upload_csv" title="Upload CSV"><span>Upload CSV</span></a></li>
- <li><a href="?do=create_table" title="Create New Table"><span>Create New Table</span></a></li>
- </ul>
- </div>
- <?php
- switch($_REQUEST["do"]) {
- case "upload_csv":
- include ("upload_csv.php");
- break;
- case "create_table":
- include ("create_table.php");
- break;
- default:
- include ("upload_csv.php");
- }
- ?>
- </body>
- </html>
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.