Mini Shell

Direktori : /home2/aravindar/public_html/admin/
Upload File :
Current File : /home2/aravindar/public_html/admin/ug_course.php

<?php
/* Database connection */
include("config.php");
$conn = dbconnect();
session_start();

// login or not
if ($_SESSION['name'] == '' || $_SESSION['admin_id'] == '') {
    header('location:logout.php');
    die();
}

$name = $_SESSION['name'];
$admin_id = $_SESSION['admin_id'];
$query  = "SELECT * FROM tb1_admin WHERE name='" . $name . "' AND admin_id='" . $admin_id . "'";
$res_query = mysqli_query($conn, $query);
$fetch = mysqli_fetch_object($res_query);
$username = $fetch->user_name;
$phone = $fetch->phone;
$adminposition = $fetch->position;
if ($adminposition == 1) {
    $type = 'Main Admin';
} elseif ($adminposition == 2) {
    $type = 'Accounts';
} elseif ($adminposition == 3) {
    $type = 'Marketing';
} else {
    $type = 'Others';
}

$url_query  = "SELECT * FROM tb1_url WHERE url_title='news'";
$res_url = mysqli_query($conn, $url_query);
$fetch_url = mysqli_fetch_object($res_url);
$url_path = $fetch_url->url_path;

?>
<!DOCTYPE html>
<html lang="en">
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Admin - Sri Aravindar Arts & Science College </title>
<!-- Meta -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<!-- Favicon icon -->
<link rel="icon" href="assets/images/favicon.png" type="image/x-icon">
<!-- Google font-->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,800" rel="stylesheet">
<!-- Required Fremwork -->
<link rel="stylesheet" type="text/css" href="plugin/bootstrap/dist/css/bootstrap.min.css">
<!-- feather Awesome -->
<link rel="stylesheet" type="text/css" href="assets/icon/feather/css/feather.css">
<!-- Font Awesome -->
<link rel="stylesheet" type="text/css" href="assets/icon/font-awesome/css/font-awesome.min.css">
<!-- Style.css -->
<link rel="stylesheet" type="text/css" href="assets/css/style.css">
<link rel="stylesheet" type="text/css" href="assets/css/jquery.mCustomScrollbar.css">
<link rel="stylesheet" type="text/css" href="assets/css/component.css">
<link rel="stylesheet" href="assets/vendors/datatables.net-bs4/dataTables.bootstrap4.css">

<link rel="stylesheet" href="assets/vendors/datatables.net-fixedcolumns-bs4/fixedColumns.bootstrap4.min.css">
<style type="text/css">
    td {
        white-space: normal !important;
        word-wrap: break-word;
    }

    table {
        table-layout: fixed;
    }
</style>
</head>
<!-- Menu sidebar static layout -->

<body>

    <!-- Pre-loader start -->
    <div class="theme-loader">
        <div class="ball-scale">
            <div class='contain'>
                <div class="ring">
                    <div class="frame"></div>
                </div>
                <div class="ring">
                    <div class="frame"></div>
                </div>
                <div class="ring">
                    <div class="frame"></div>
                </div>
                <div class="ring">
                    <div class="frame"></div>
                </div>
                <div class="ring">
                    <div class="frame"></div>
                </div>
                <div class="ring">
                    <div class="frame"></div>
                </div>
                <div class="ring">
                    <div class="frame"></div>
                </div>
                <div class="ring">
                    <div class="frame"></div>
                </div>
                <div class="ring">
                    <div class="frame"></div>
                </div>
                <div class="ring">
                    <div class="frame"></div>
                </div>
            </div>
        </div>
    </div>
    <!-- Pre-loader end -->
    <div id="pcoded" class="pcoded">
        <div class="pcoded-overlay-box"></div>
        <div class="pcoded-container navbar-wrapper">

            <?php include('static-header.php') ?>

            <div class="pcoded-main-container">
                <div class="pcoded-wrapper">

                    <?php include('static-sidebar.php') ?>

                    <div class="pcoded-content">
                        <div class="pcoded-inner-content">
                            <div class="main-body">
                                <div class="page-wrapper">
                                    <!-- Page-header start -->
                                    <div class="page-header">
                                        <div class="row align-items-end">
                                            <div class="col-lg-8">
                                                <div class="page-header-title">
                                                    <div class="d-inline">
                                                        <h4>UG Course</h4>
                                                        <span>You can view The UG Course here!</span>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-lg-4">
                                                <div class="page-header-breadcrumb">
                                                    <ul class="breadcrumb-title">
                                                        <li class="breadcrumb-item" style="float: left;">
                                                            <a href="dashboard"> <i class="feather icon-home"></i> </a>
                                                        </li>
                                                        <li class="breadcrumb-item" style="float: left;"><a href="#!">Home Page</a>
                                                        </li>
                                                        <li class="breadcrumb-item" style="float: left;"><a href="#!">UG Course</a>
                                                        </li>
                                                    </ul>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!-- Page-header end -->
                                    <!-- Page body start -->
                                    <div class="page-body">
                                        <div class="col-md-12 text-right mb-3">
                                            <a href="add_ugcourse" class="btn btn-info pl-3 pr-3 mt-3">Add UG Course</a>
                                        </div>
                                        <!-- Zero config.table start -->
                                        <div class="card">

                                            <div class="card-block">
                                                <div class="table-responsive">

                                                    <table id="fixed-column" class="table table-striped table-bordered" cellspacing="0" width="100%">
                                                        <thead>
                                                            <tr>
                                                                <th>SI No</th>
                                                                <th>Course Name</th>
                                                                <th>Duration</th>
                                                                <th>Course Image</th>
                                                                <th>View</th>
                                                                <th>Action</th>
                                                                <th>Updated By</th>
                                                                <th>Last Update</th>
                                                            </tr>
                                                        </thead>
                                                        <tbody>
                                                            <?php
                                                            $url_query  = "SELECT * FROM tb1_url WHERE url_title='courses'";
                                                            $res_url = mysqli_query($conn, $url_query);
                                                            $fetch_url = mysqli_fetch_object($res_url);
                                                            $url_path = $fetch_url->url_path;
                                                            // $url_path = './dynamic_image/course/';

                                                            $content_query = "SELECT * FROM tb1_ugcourses ORDER BY updated_log DESC";
                                                            //echo $content_query;
                                                            $content_res = mysqli_query($conn, $content_query);
                                                            $counter = 0;
                                                            while ($content_row = mysqli_fetch_object($content_res)) {
                                                                $counter++;
                                                                $course_id = $content_row->course_id;
                                                                $course_name = $content_row->course_name;
                                                                $status = $content_row->status;
                                                                $course_img = $content_row->course_img;
                                                                $duration = $content_row->duration;
                                                                $duration = $content_row->duration;

                                                                $crm_id = $content_row->crm_id;
                                                                $updated_at = $content_row->updated_log;
                                                                $updated_log = date('d-m-Y h:i:s A', strtotime($updated_at));

                                                                $crm_query = "SELECT * FROM tb1_admin WHERE admin_id ='$crm_id' ";
                                                                $crm_res = mysqli_query($conn, $crm_query);
                                                                $crm_row = mysqli_fetch_object($crm_res);
                                                                $crm_name = strtolower($crm_row->name);
                                                            ?>
                                                                <tr>
                                                                    <td><?php
                                                                        if ($status == 1) {
                                                                        ?>
                                                                            <i class="fa fa-circle" aria-hidden="true" style="color:#008000" title="Course Active"></i>
                                                                        <?php
                                                                        } else {
                                                                        ?>
                                                                            <i class="fa fa-circle" aria-hidden="true" style="color:#FF0000" title="Course Deactive"></i>
                                                                        <?php
                                                                        }
                                                                        echo $counter;
                                                                        ?>
                                                                    </td>
                                                                    <td><?php echo $course_name; ?></td>
                                                                    <td><?php echo $duration; ?></td>
                                                                    <td class="text-center"><a href="<?php echo $url_path . $course_img; ?>" target="_blank"> <span class="pcoded-micon"><i class="feather icon-image" style="font-size: 18px !important;"></i></span></a></td>

                                                                    <td><button class="btn btn-info waves-effect md-trigger" data-modal="modal-10" type="button" data-id='<?php echo $course_id ?>'>View More</button></td>
                                                                    <td class="text-center"><a href="edit_ugcourse?id=<?php echo base64_encode($course_id); ?>" target="_blank"><span class="pcoded-micon"><i class="feather icon-edit" style="font-size: 18px !important;"></i></span></a></td>
                                                                    <td><?php echo ucfirst($crm_name); ?></td>
                                                                    <td><?php echo $updated_log; ?></td>
                                                                </tr>
                                                            <?php
                                                            }
                                                            ?>

                                                        </tbody>
                                                    </table>

                                                </div>
                                            </div>
                                        </div>
                                        <!-- Zero config.table end -->
                                        <div class="md-modal md-effect-10" id="modal-10">
                                            <div class="col-md-12 text-right">
                                                <button class="md-close btn" style="background: #fe5d70;    position: absolute;left: 99%;color: #fff;cursor: pointer;">X</button>
                                            </div>
                                            <div class="md-content modal-content">

                                            </div>

                                        </div>

                                        <div class="md-overlay"></div>
                                    </div>
                                    <!-- Page body end -->
                                </div>
                                <div id="styleSelector">

                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <!-- Required Jquery -->
    <script type="text/javascript" src="plugin/jquery/dist/jquery.min.js"></script>
    <script type="text/javascript" src="plugin/jquery-ui/jquery-ui.min.js"></script>
    <script type="text/javascript" src="plugin/popper.js/dist/umd/popper.min.js"></script>
    <script type="text/javascript" src="plugin/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- jquery slimscroll js -->
    <script type="text/javascript" src="plugin/jquery-slimscroll/jquery.slimscroll.js"></script>
    <!-- modernizr js -->
    <script type="text/javascript" src="plugin/modernizr/modernizr.js"></script>
    <script type="text/javascript" src="plugin/modernizr/feature-detects/css-scrollbars.js"></script>

    <!-- Plugin js for this page -->
    <script src="assets/vendors/datatables.net/jquery.dataTables.js"></script>
    <script src="assets/vendors/datatables.net-bs4/dataTables.bootstrap4.js"></script>
    <script src="assets/vendors/datatables.net-fixedcolumns/dataTables.fixedColumns.min.js"></script>
    <!-- BEGIN PAGE LEVEL CUSTOM SCRIPTS -->
    <script src="assets/vendors/table/datatable/datatables.js"></script>
    <!-- NOTE TO Use Copy CSV Excel PDF Print Options You Must Include These Files  -->
    <script src="assets/vendors/table/datatable/button-ext/dataTables.buttons.min.js"></script>
    <script src="assets/vendors/table/datatable/button-ext/jszip.min.js"></script>
    <script src="assets/vendors/table/datatable/button-ext/buttons.html5.min.js"></script>
    <script src="assets/vendors/table/datatable/button-ext/buttons.print.min.js"></script>
    <!-- End plugin js for this page -->
    <!-- modalEffects js nifty modal window effects -->
    <script type="text/javascript" src="assets/js/modalEffects.js"></script>
    <script type="text/javascript" src="assets/js/classie.js"></script>

    <script src="assets/js/pcoded.min.js"></script>
    <script src="assets/js/vartical-layout.min.js"></script>
    <script src="assets/js/sweetalert.min.js"></script>
    <script src="assets/js/jquery.mCustomScrollbar.concat.min.js"></script>
    <script type="text/javascript" src="assets/js/script.js"></script>
    <script src="assets/validation/jquery-validation/jquery.validate.min.js"></script>
    <script src="assets/js/data-table.js"></script>
    <script src="assets/css/validation/form-validation.js"></script>

    <script type="text/javascript">
        $('.md-trigger').click(function() {
            var id = $(this).attr('data-id');
            $.ajax({
                url: "ugcourseview_model.php?id=" + id,
                cache: false,
                success: function(result) {
                    $(".modal-content").html(result);
                }
            });
        });
    </script>


</body>

</html>

Zerion Mini Shell 1.0