<?php
/**
 * HTML Change Password Form
 *
 * PHP version 7.3
 *
 * @package        SMS
 * @version        Release 1.0.0
 * @create_by      Mohammad aljaouni
 * @create_date    17-08-2020
 * @edited_by
 * @last_edit_date
 * @todo           Nothing
 */
ob_start();
session_start();
$chain = "AWdrh78y892Djk*^523*%$#ghgHGHia&%$*)AsfdsLJnLaad";
include("validateLogin.php");
include("includeInformation.php");
include("header.php");
?>
<!-- Start Dashboard page -->
    <!-- start main-content -->
    <div class="main-content">
        <!-- Start Page-content -->
        <div class="page-content">
        <!-- Page-Title -->
        <div class="page-title-box">
            <div class="container-fluid">
                <div class="row align-items-center">
                    <?php echo breadcrumbs(basename($_SERVER['PHP_SELF']));?>
                </div>
            </div>
        </div>
        <!-- end page title end breadcrumb -->
        <div class="page-content-wrapper">
            <div class="container-fluid">
                <div class="row justify-content-center align-items-center">
                    <div class="col-sm-12 col-lg-4 ">
                        <div class="card">
                            <div class="card-body">
                                <h5 class="mb-5 text-center"><?php echo $deleteLBL["deletePage"];?></h5>
								<form action="numberImport.php" name="delete" id="delete" method="POST" class="formAlign" enctype="multipart/form-data" onSubmit="return check();">
                                <?php
								$resCpanel=mysqli_query($conn, "SELECT `delete` FROM `cpanel`");
							$rowCpanel=mysqli_fetch_assoc($resCpanel);
							if($rowCpanel["delete"]=="0"){
								?>
                                    <div class="row">
                                        <?php
                                        if(!empty($_GET["res"]))
                                            echo result($_GET["res"]);
                                        ?>
                                        <div class="col-md-12">
                                        
                                             <div class="form-group form-group-custom mb-2">
                                            	 <span style="color:#46becf;font-weight:500;padding-bottom:10px;font-size:12px"><?php echo $deleteLBL["numbersFile"];?>: </span><br>
                                                <input type="file" name="numbers" id="numbers" class="form-control" >
                                            </div>
                                            <div class="form-group" style="margin: 0px">
                                                <label for="name" class="col-form-label myModalLabel" style="color:#FF0000;font-size:14px"> 
                                                <?php echo $numberLBL["numbersNote2"];?><br />
                                                <a href="sample.xls"><b style="font-size: 14px; color: red">sample.xls</b></a><br />
                                                <a href="sample.xlsx"><b style="font-size: 14px; color: red">sample.xlsx</b></a><br />
                                                <a href="sample.csv"><b style="font-size: 14px; color: red">sample.csv</b></a><br />
                                                <a href="sample.txt"><b style="font-size: 14px; color: red">sample.txt</b></a>
                                                </label>
                                            </div>
                                             
                                            <div class="mt-4">
                                                <button class="btn btn-success btn-block waves-effect waves-light" type="submit"><?php echo $button["upload"]?></button>
                                            </div>
                                        </div>
                                    </div>
                                    <?php
										}else{
											echo "<div class='row'> <div class='col-md-12 mb-4'  style='color:red;font-size: 12px;'><div class='col-12 mb-4 alert-div' style='height: 0px;'>
												<div class='alert alert-success alert-dismissible fade show' role='alert'>
													<button type='button' class='close' data-dismiss='alert' aria-label='Close'>
														<span aria-hidden='true'>x</span>
													</button>
													جاري حذف الأرقام ...
												</div>
											</div></div></div>";
										}
									?>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- end row -->
            </div>
            <!-- end container-fluid -->
        </div>
        <!-- end page-content-wrapper -->
    </div>
        <!-- End Page-content -->
</div>
    <!-- end main content -->
<!-- End Dashboard page -->
<script>
	function check(){
		if(!/[\S]/.test($("#numbers").val())){
			alert("<?php echo $deleteLBL["numbersFile"];?>");	 
			return false;
		}
		var fileExtension = ['xls', 'xlsx', 'csv', 'txt'];
        if ($.inArray($("#numbers").val().split('.').pop().toLowerCase(), fileExtension) == -1) {
           alert("<?php echo $deleteLBL["allowedFiles"];?>");	 
			return false;
        }
	}
</script>
<?php
include("footer.php");
ob_end_flush();
?>
