SHARE
TWEET

Jawaad

a guest Aug 21st, 2008 565 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // UPLOAD CSV CUSTOM
  2. // Ver. 1.0
  3. // by Jawaad
  4. // zaibatsu@gmail.com
  5. // File: index.php
  6.  
  7. @session_start();
  8. //@ob_start();
  9. //@ob_implicit_flush(0);
  10.  
  11. @error_reporting(E_ALL ^ E_NOTICE);
  12. @ini_set('display_errors', true);
  13. @ini_set('html_errors', false);
  14. @ini_set('error_reporting', E_ALL ^ E_NOTICE);
  15.  
  16. define('jin', true);
  17.  
  18. // CONECT DATABASE
  19. @mysql_connect("localhost", "root", "") OR die ("NOT CONNECT DATABASE");
  20. @mysql_select_db("db_sms") OR die ("CONNECTED, BUT NO DATABASE");
  21.  
  22.  
  23.  
  24. ?>
  25. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  26.   "http://www.w3.org/TR/html4/strict.dtd">
  27. <html xmlns='http://www.w3.org/1999/xhtml' lang='en' xml:lang='en:us'>
  28.   <head>
  29.     <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  30.     <title>UPLOAD CSV CUSTOM</title>
  31.     <style type="text/css" media="screen">
  32.       body {
  33.         background: #fff;
  34.         color: #888;
  35.         font: 100% georgia,times,serif;
  36.       }
  37.       h1 {
  38.         font-weight: normal;
  39.         margin: 0;
  40.         padding: 0 0 .5em 0;
  41.       }
  42.       h2 {
  43.         font-weight: normal;
  44.         margin: 0;
  45.         padding: 0 0 .5em 0;
  46.       }
  47.                
  48. /*- Menu Tabs J--------------------------- */
  49.  
  50.     #tabsJ {
  51.       float:left;
  52.       width:100%;
  53.       background:#fff;
  54.       font-size:93%;
  55.       line-height:normal;
  56.           border-bottom:1px solid #24618E;
  57.       }
  58.     #tabsJ ul {
  59.         margin:0;
  60.         padding:10px 10px 0 50px;
  61.         list-style:none;
  62.       }
  63.     #tabsJ li {
  64.       display:inline;
  65.       margin:0;
  66.       padding:0;
  67.       }
  68.     #tabsJ a {
  69.       float:left;
  70.       background:url("tableftJ.gif") no-repeat left top;
  71.       margin:0;
  72.       padding:0 0 0 5px;
  73.       text-decoration:none;
  74.       }
  75.     #tabsJ a span {
  76.       float:left;
  77.       display:block;
  78.       background:url("tabrightJ.gif") no-repeat right top;
  79.       padding:5px 15px 4px 6px;
  80.       color:#24618E;
  81.       }
  82.     /* Commented Backslash Hack hides rule from IE5-Mac \*/
  83.     #tabsJ a span {float:none;}
  84.     /* End IE5-Mac hack */
  85.     #tabsJ a:hover span {
  86.       color:#FFF;
  87.       }
  88.     #tabsJ a:hover {
  89.       background-position:0% -42px;
  90.       }
  91.     #tabsJ a:hover span {
  92.       background-position:100% -42px;
  93.       }        
  94.     </style>
  95.     <script type="text/javascript">
  96. function addElement() {
  97.   var ni = document.getElementById('myDiv');
  98.   var numi = document.getElementById('theValue');
  99.   var num = (document.getElementById("theValue").value -1)+ 2;
  100.   numi.value = num;
  101.   var divIdName = "my"+num+"Div";
  102.   var newdiv = document.createElement('div');
  103.   newdiv.setAttribute("id",divIdName); //  + num +
  104.   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>";
  105.   ni.appendChild(newdiv);
  106. }
  107.  
  108. function removeElement(divNum) {
  109.   var d = document.getElementById('myDiv');
  110.   var olddiv = document.getElementById(divNum);
  111.   d.removeChild(olddiv);
  112. }
  113. </script>
  114. </head>
  115.  
  116. <body>
  117.       <h1>UPLOAD CUSTOM CSV INSERT TO MYSQL</h1>
  118. <div id="tabsJ">
  119.   <ul>
  120.     <li><a href="?do=upload_csv" title="Upload CSV"><span>Upload CSV</span></a></li>
  121.     <li><a href="?do=create_table" title="Create New Table"><span>Create New Table</span></a></li>
  122.   </ul>
  123. </div>
  124. <?php
  125. switch($_REQUEST["do"]) {
  126.         case "upload_csv":
  127.                 include ("upload_csv.php");
  128.         break;
  129.         case "create_table":
  130.                 include ("create_table.php");
  131.         break;
  132.        
  133.         default:
  134.                 include ("upload_csv.php");
  135. }
  136.  
  137. ?>
  138.  
  139.  
  140.          </body>
  141. </html>
RAW Paste Data
Want to get better at PHP?
Learn to code PHP in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top