????????????????????
??????????????????
ÿØÿà
 JFIF      ÿÛ C      


!"$"$ÿÛ C    
ÿÂ p 
" ÿÄ     
         ÿÄ             ÿÚ 
   ÕÔË®

(%	aA*‚XYD¡(J„¡E¢RE,P€XYae )(E¤²€B¤R¥	BQ¤¢ X«)X…€¤   @  

adadasdasdasasdasdas


.....................................................................................................................................????????????????????
??????????????????
ÿØÿà
 JFIF      ÿÛ C      


!"$"$ÿÛ C    
ÿÂ p 
" ÿÄ     
         ÿÄ             ÿÚ 
   ÕÔË®

(%	aA*‚XYD¡(J„¡E¢RE,P€XYae )(E¤²€B¤R¥	BQ¤¢ X«)X…€¤   @  

adadasdasdasasdasdas


.....................................................................................................................................<?php
   include('session.php');
?>

<?php

include 'connection.php';

if(isset($_GET['idk']))
{
     $delsql = "DELETE FROM customers WHERE id=".$_GET['idk'];
     $conn->query($delsql);
      exit;
}

?>

<?php
// Username is root
$user = 'xceljsr_db';
$password = 'xcel@123#$';
$database = 'anilpzp6_account';
$servername = 'localhost';
$mysqli = new mysqli($servername, $user, 
                $password, $database);
  
// Checking for connections
if ($mysqli->connect_error) {
    die('Connect Error (' . 
    $mysqli->connect_errno . ') '. 
    $mysqli->connect_error);
}
  


$userId = $_SESSION['uid'];
$sql10 = "SELECT * FROM customers WHERE addedby = '$userId'";
$result10 = $mysqli->query($sql10);


// $mysqli->close(); 
$a=0;
?>



<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Add Customers | Xcel Training Institute</title>
    <!-- Favicon icon -->
    <link rel="icon" type="image/png" href="../images/logo-wide.png">
    <!-- Base Styling  -->
    <link rel="stylesheet" href="assets/main/css/fonts.css">
    <link rel="stylesheet" href="assets/main/css/style.css">
    <script src="https://code.jquery.com/jquery-3.6.4.min.js" integrity="sha256-oP6HI9z1XaZNBrJURtCoUT5SUnxFr8s3BzRl+cbzUq8=" crossorigin="anonymous"></script>
    <style>
    .btn{
            background-color: red;
            border: none;
            color: white;
            padding: 5px 5px;
            text-align: center;
            text-decoration: none;
            display: inline-block;
            font-size: 20px;
            margin: 4px 2px;
            cursor: pointer;
            border-radius: 20px;
        }
        .green{
            background-color: #199319;
        }
        .red{
            background-color: red;
        }
        </style>
</head>

<body>
    <div id="main-wrapper" class="show">


      <?php
         include "sidebar.php";
         ?>


         <?php
         include "header.php";
         ?>


          <div class="content-body">
            <div class="warper container-fluid">
                <div class="new-patients main_container">
                    
       <div class="row">
                        <div class="col-lg-12">
                            <div class="card">
                                <div class="card-header">
                                    <h4 class="card-title">Add Customers</h4>
                                </div>
                                <div class="card-body">
                                    <div class="basic-form">
                                        <form action="insert_customer.php" method="post" enctype="multipart/form-data">

                                            <div class="row">
                                                                      
                                                <div class="col-xl-4">
                                                    <div class="form-group">
                                                        <label class="form-label">Name</label>
                                                        <input type="text" class="form-control" placeholder="Name" name="name">
                                                    </div>
                                                </div>
                                                <div class="col-xl-4">
                                                    <div class="form-group">
                                                        <label class="form-label">Company</label>
                                                        <input type="text" class="form-control" placeholder="Company" name="company">
                                                    </div>
                                                </div>
                                                <div class="col-xl-4">
                                                    <div class="form-group">
                                                        <label class="form-label">Mobile No</label>
                                                        <div class="input-group">
                                                            <select class="form-select" name="country_code" style="max-width: 100px;">
                                                                <option value="+91" selected>+91 (IN)</option>
                                                                <option value="+1">+1 (US)</option>
                                                                <option value="+44">+44 (UK)</option>
                                                                <option value="+971">+971 (UAE)</option>
                                                                <option value="+61">+61 (AUS)</option>
                                                                <option value="+880">+880 (BD)</option>
                                                                <option value="+977">+977 (NP)</option>
                                                                <!-- Add more as needed -->
                                                            </select>
                                                            <input type="text" class="form-control" placeholder="Mobile No" name="mno">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="col-xl-4">
                                                    <div class="form-group">
                                                        <label class="form-label">Email</label>
                                                        <input type="text" class="form-control" placeholder="Email" name="email">
                                                    </div>
                                                </div>
                                                
                                                <div class="col-xl-4">
                                                    <div class="form-group">
                                                        <label class="form-label">GSTIN No</label>
                                                        <input type="text"  class="form-control gstin" placeholder="GSTIN No" name="gstno">
                                                           <span class="gstin-error" style="color: red; font-size: 14px;"></span>
                                                    </div>
                                                </div>
                                                <div class="col-xl-4">
                                                    <div class="form-group">
                                                        <label class="form-label">Address</label>
                                                        <input type="text" class="form-control" placeholder="Address" name="address">
                                                    </div>
                                                </div>
                                                
                                            </div>
                                            <div class="form-group text-right">
                                                <button type="submit" class="float-end "><img src="assets/save1.png" title="Save" style="height: 30px; width: 30px;"></button>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>


                      

                         <div class="col-md-12">
                            <div class="card shadow">
                                <div class="card-header">
                                    <h4 class="card-title">Customers </h4>
                                </div>
                                <div class="card-body">
                                    <div class="table-responsive">
                                        <table id="example1" class="display nowrap">
                                            <thead>
                                                <tr>
													<th>SL No</th>
                                                    <th>Name</th>
                                                    <th>Company</th>
                                                    <th>Mobile No</th>
                                                    <th>Email</th>
                                                    <th>Gst No</th>
                                                    <th>Address</th>
                                                    <th>Action</th>
													
                                                </tr>
                                            </thead>
                                            <tbody>

                                            <?php   // LOOP TILL END OF DATA 
                while($rows10=$result10->fetch_assoc())
                { 
             ?>
                                                <tr id="<?php echo $rows10['id'];?>">
                                                <td><?php echo ++$a ?></td>
													<td><?php echo $rows10['name'];?></td>
													<td><?php echo $rows10['company'];?></td>
													<td><?php echo $rows10['mno'];?></td>
                                                    <td><?php echo $rows10['email'];?></td>
												    <td><?php echo $rows10['gstno'];?></td>
                                                    <td><?php echo $rows10['address'];?></td>
                                                    <td>
                                                            <a class="mr-4 check" href="update-customer.php?idk=<?php echo $rows10['id'];?>" title="UPDATE">
                                                         <span class="fas fa-edit"></span>
                                                       </a>
                                                       
                                                        <a class='remove'>
                                                            <span class='fas fa-trash-alt'></span>
                                                        </a>
                                                    </td>
                                                </tr>

                                                 <?php }?>

                                               
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>




                    </div>
                    
                </div>
            </div>
        </div>
        <!-- End section content -->

        <?php
   include('footer.php');
?>


    </div>
  

    <script type="text/javascript">
    $(".remove").click(function(){
        var idk = $(this).parents("tr").attr("id");
        console.log(idk);

        if(confirm('Are you sure to remove this record ?'))
        {
            $.get("add-customer.php?idk="+idk, function(data, status){
               $("#"+idk).remove();
                    alert("Record removed successfully");  
        });
            
        }
    });


</script>

    <!-- popper js -->
    <script src="assets/plugins/popper/popper.min.js"></script>

    <!-- Bootstrap -->
    <script src="assets/plugins/bootstrap/js/bootstrap.js"></script>

    <!-- Moment -->
    <script src="assets/plugins/moment/moment.min.js"></script>

    <!-- Date Range Picker -->
    <script src="assets/plugins/daterangepicker/daterangepicker.min.js"></script>

    <!-- Datatable -->
    <script src="assets/plugins/datatables/jquery.dataTables.min.js"></script>
    <script src="assets/js/init-tdatatable.js"></script>

    <!-- Chart js -->
    <script src="assets/plugins/chart/chart/Chart.min.js"></script>
    <script src="assets/js/charts-custom.js"></script>

    <!-- Main Custom JQuery -->
    <script src="assets/js/toggleFullScreen.js"></script>
    <script src="assets/js/main.js"></script>

</body>
</html>