HEX
Server: Apache
System: Linux iad1-shared-e1-19 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User: austral3d (14892361)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: /home/austral3d/fourdplan.com/cotizario/welcome.php
<!DOCTYPE html>
<html>
    <head>
        <title>Product Finder</title>
        <?php include "files/functions.php" ?>
        <?php $conn = connect_sql() ?>
        <?php include "files/functionsJS.php" ?>
    </head>
    <body>
        <?php $origName = $_GET["companyName"]; ?>
        <?php 
            $companyName = format_companyName($origName);
            if (!in_array($companyName, get_dbs($conn))) {
                create_db($conn, $companyName);
            }
            mysqli_select_db($conn, $companyName);
        ?>

        <h3>Welcome <?php echo $origName; ?>!</h3>

        <br />
        <br />
        <div id='listSelect' style='display:block'>
            <h4>Select master list</h4>
            <form action='search.php' method='GET'>
                <select name='masterList'>
                    <option value='' selected>Select product list ...</option>
                    <?php foreach(get_table_names($conn, $companyName) as $table): ?>
                        <?php echo $companyName; ?>
                        <option value=<?php echo $companyName.'-'.$table.'>'.$table ?></option>
                    <?php endforeach; ?>
                    <input type='submit' value='Select'/>
                </select>
            </form>
            <br />
            <input type='button' value='Upload new file' 
                onclick='showItem("listUpload");hideItem("listSelect")' />
        </div>
        <div id='listUpload' style='display:none'>
            <h4>Upload new list</h4>
            
            <form action="" method="POST" enctype="multipart/form-data">
                <input type="file" name="productList" id="productList" required>
			    <?php
                    
                    list_upload_info('productList');
                    upload_file('productList');
                    $file_name = $_FILES['productList']['name'];
                    create_table_from_file($conn, $file_name, "uploads/".$file_name);
                    
			    ?>
                <input type='submit' value='Upload File' />
            </form>

            <br />
            <input type='button' value='Choose from list'
                onclick='showItem("listSelect");hideItem("listUpload")' />
        </div>
        



    </body>
</html>