<?php

include "main.php";

isconnected();

if(isset($_REQUEST['action']))
{
	$action = $_REQUEST['action'];
	if($action == 1)
	{
		$nom = AntiInjectionSQL($_REQUEST['nom']);
		
		$SQL = "INSERT INTO groupe (nom) VALUES ('$nom')";
		$pdo->query($SQL);
		
		header("Location: groupe.php");
		exit;
	}
}

?>

<!doctype html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="description" content="">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- The above 4 meta tags *must* come first in the head; any other head content must come *after* these tags -->

    <!-- Title -->
    <title>SMS Sender</title>

    <!-- Favicon -->
    <link rel="icon" href="img/core-img/favicon.png">

    <!-- Master Stylesheet [If you remove this CSS file, your file will be broken undoubtedly.] -->
    <link rel="stylesheet" href="style.css">

</head>

<body>
    <!-- Preloader Start -->
    <div id="preloader">
        <div class="preload-content">
            <div id="hasro-load"></div>
        </div>
    </div>
    <!-- Preloader End -->

    <!-- ======================================
    ******* Page Wrapper Area Start **********
    ======================================= -->
    <div class="ecaps-page-wrapper">
        <!-- Sidemenu Area -->
        <?php
		
		include "menu.php";
		
		?>

            <!-- Main Content Area -->
            <div class="main-content">
                <div class="container-fluid">
                    <div class="row justify-content-center">
                        <div class="col-sm-12 col-lg-12">
							<div class="card box-margin">
								<div class="card-body">
									<h3><i class="bx bx-user-circle"></i> Ajouter un groupe</h3>
									<div style="margin-bottom:20px;">
									<a href="groupe.php" class="btn btn-primary mr-2"><i class="pe-7s-angle-left-circle"></i> Retour</a>
									</div>
									<form method="POST">
										<div class="form-group">
											<label for="exampleInputEmail111">Nom du groupe :</label>
											<input type="text" name="nom" value="" placeholder="Entrer le nom du groupe" class="form-control">
										</div>
										<input type="hidden" name="action" value="1">
										<button type="submit" class="btn btn-primary mr-2"><i class="zmdi zmdi-collection-plus"></i> Ajouter</button>
									</form>
								</div>
							</div>
                        </div>
                        
                    </div>

                    <div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-modal="false">
                        <div class="modal-dialog modal-lg">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <h5 class="modal-title mt-0 font-16" id="myLargeModalLabel">Add New Customer</h5><button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                </div>
                                <div class="modal-body">
                                    <form>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group"><label for="LeadName">Name</label> <input type="text" class="form-control" id="LeadName" required=""></div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group"><label for="LeadEmail">Email</label> <input type="email" class="form-control" id="LeadEmail" required=""></div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <div class="form-group"><label for="PhoneNo">Phone No</label> <input type="text" class="form-control" id="PhoneNo" required=""></div>
                                            </div>
                                            <div class="col-md-6">
                                                <div class="form-group"><label for="status-select" class="mr-2">Country</label> <select class="custom-select" id="status-select">
                                                        <option selected="">Select</option>
                                                        <option value="1">India</option>
                                                        <option value="2">USA</option>
                                                        <option value="3">Japan</option>
                                                        <option value="4">China</option>
                                                        <option value="5">Germany</option>
                                                    </select></div>
                                            </div>
                                        </div><button type="button" class="btn btn-sm btn-primary">Save</button> <button type="button" class="btn btn-sm btn-danger">Delete</button>
                                    </form>
                                </div>
                            </div><!-- /.modal-content -->
                        </div><!-- /.modal-dialog -->
                    </div>

                </div>

                <!-- Footer Area -->
            </div>
        </div>
    </div>

    <!-- ======================================
    ********* Page Wrapper Area End ***********
    ======================================= -->

    <!-- Must needed plugins to the run this Template -->
    <script src="js/jquery.min.js"></script>
    <script src="js/popper.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/bundle.js"></script>
    <script src="js/default-assets/setting.js"></script>

    <!-- Active JS -->
    <script src="js/default-assets/active.js"></script>

    <script src="js/default-assets/ammap.min.js"></script>
    <script src="js/default-assets/radar.js"></script>
    <script src="js/default-assets/widget-page-chart-active.js"></script>

    <script src="js/default-assets/apexchart.min.js"></script>
    <script src="js/default-assets/dashboard-active.js"></script>


</body>

</html>