


<?php $__env->startSection('content'); ?>

<div class="main-mobile-header doc-mobile-header">
      <a id="menuLink" href="#" class="menu-link"><i class="ri-menu-line"></i></a>
    </div>

   

    



     <div class="main main-app p-3 p-lg-4">
     	

        <div class="mb-4">
          <ol class="breadcrumb fs-sm mb-1">
            <li class="breadcrumb-item"><a href="#">Dashboard</a></li>
            <li class="breadcrumb-item active" aria-current="page">Users History</li>
          </ol>
        </div>



      <div class="">
        <div class="row">

          <div class="col-lg-8">
            <h2 class="main-title">Users History</h2>
            
          </div>
          <div style="text-align: right;" class="col-lg-4 text-right">
           <!--  <button type="button" class="btn btn-primary">Add Employee</button> -->
            <!-- <button  class="btn btn-primary" id="add_todo">Create Users</button> -->
            <!--<a href="#modal5" class="btn btn-primary" data-bs-toggle="modal" oncLick="show2()">-->
            <!--  Create Users</a>-->
          </div>

        </div>

        <hr class="main-separator">        
    



        <div class="card card-example">
          <div class="card-body" style="background-color:white;">
            <div class="table-responsive ">
            <table id="tableGrid1" class="table">
          
            <thead>
            <tr>
              <th>No</th>
              <th>Date</th>
              <th>User</th>
              <th>Module</th>
              <th>Action Type</th>
              <th>Item ID</th>
            </tr>
          </thead>
          <tbody>
            <?php
            $val=true;
            if($val==true)
            {
            ?>
            <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <tr>
              <td><?php echo e($key+1); ?></td>
              <td><?php echo e($user->date); ?></td>
              <td><?php echo e($user->user_id); ?></td>
              <td><?php echo e($user->module); ?></td>
              <td><?php echo e($user->action_type); ?></td>
              <td><?php echo e($user->item_id); ?></td>
              
              
            </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php
            }
            ?>
          </tbody>
        </table>
            </div><!-- table-responsive -->
          </div><!-- card-body -->
          
        </div><!-- card -->

        <br><br><br>

        

      </div><!-- container -->
      <div class="modal fade" id="modal5" tabindex="-1" aria-hidden="true">
      <div class="modal-dialog modal-dialog-centered modal-lg">
        <div class="modal-content">
          <div class="modal-header">
            <h5 class="modal-title">Add New User</h5>
            <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
          </div><!-- modal-header -->
          <form action="users-new" method="post" id="formId">
              <?php echo csrf_field(); ?>
              
          <div class="modal-body">
           

          <div class=" ">
          <div class="card-body" style="background-color:white;">
         

            <div class="row g-3 mb-3">
              <div class="row">
                
                            <h5 class="heading">User Details</h3> 
                            <div class="col-sm-4">
                            
                                
                                <div class="mb-3">

                                    <label class="form-label">User Name
                                        <span class="required-field">*</span>
                                    </label>
                                    <input type="text" name="employee_name_modal" id="employee_name_modal" required placeholder="User Name" class="form-control">
                                </div>
                            </div><!-- Col -->
                            <div class="col-sm-4">
                                <div class="mb-3">
                                    <label class="form-label">Email
                                        <span class="required-field">*</span>
                                    </label>
                                    <input type="email" name="employee_email_modal" id="employee_email_modal" required placeholder="Email" class="form-control">
                                </div>
                            </div>
                            <div class="col-sm-4">
                                <div class="mb-3">
                                    <label class="form-label">Password
                                        <span class="required-field">*</span>
                                    </label>
                                    <input type="password" name="password" id="password" required placeholder="Password" class="form-control">
                                </div>
                            </div>
                            <!-- Col -->
                            <div class="col-sm-4">
                                <div class="mb-3">
                                    <label class="form-label">Choose User Type
                                        <span class="required-field">*</span>
                                    </label>
                                    <select name="employee_user_type_modal" id="employee_user_type_modal" class="js-example-basic-single form-select select" data-width="100%">
                                        <option value="" selected>Select</option>
                                        <option value="Admin" selected>Admin</option>
                                        <option value="Team Members">Team Members</option>
                                    </select>
                                    <div class="mb-3">

                                        <!-- <label class="form-label">User Name
                                            <span class="required-field">*</span>
                                        </label> -->
                                        <input type="hidden" name="id" id="id" required value="null" class="form-control">
                                    </div>
                                </div>
                            </div>
                        </div><!-- Row -->
                        
                        <br>
                        
                        
                         <div class="row">
                
                             <h5 class="heading">Dashboard Permission</h3> 
                             
                            <div class="col-sm-4">
                                <div class="mb-3">
                                    <label class="form-label">Sales Data
                                    </label>
                                    <select name="sales_data" class="form-select select">
                                        <option value="0" selected>Select</option>
                                        <option value="1">Access</option>
                                        <option value="0">Restrict</option>
                                    </select>
                                </div>
                            </div><!-- Col -->
                            
                            <div class="col-sm-4">
                                <div class="mb-3">
                                    <label class="form-label">Approval
                                    </label>
                                    <select name="approval" class="form-select select">
                                        <option value="0" selected>Select</option>
                                        <option value="1">Access</option>
                                        <option value="0">Restrict</option>
                                    </select>
                                </div>
                            </div><!-- Col -->
                            
                            <div class="col-sm-4">
                                <div class="mb-3">
                                    <label class="form-label">Customers
                                    </label>
                                    <select name="customer" class="form-select select">
                                        <option value="0" selected>Select</option>
                                        <option value="1">Access</option>
                                        <option value="0">Restrict</option>
                                    </select>
                                </div>
                            </div><!-- Col -->
                            
                            <div class="col-sm-4">
                                <div class="mb-3">
                                    <label class="form-label">Sales
                                    </label>
                                    <select name="sales" class="form-select select">
                                        <option value="0" selected>Select</option>
                                        <option value="1">Access</option>
                                        <option value="0">Restrict</option>
                                    </select>
                                </div>
                            </div><!-- Col -->
                            
                            <div class="col-sm-4">
                                <div class="mb-3">
                                    <label class="form-label">Purchases
                                    </label>
                                    <select name="purchases" class="form-select select">
                                        <option value="0" selected>Select</option>
                                        <option value="1">Access</option>
                                        <option value="0">Restrict</option>
                                    </select>
                                </div>
                            </div><!-- Col -->
                            
                            <div class="col-sm-4">
                                <div class="mb-3">
                                    <label class="form-label">Grn
                                    </label>
                                    <select name="grn" class="form-select select">
                                        <option value="0" selected>Select</option>
                                        <option value="1">Access</option>
                                        <option value="0">Restrict</option>
                                    </select>
                                </div>
                            </div><!-- Col -->
                            
                            <div class="col-sm-4">
                                <div class="mb-3">
                                    <label class="form-label">Products & Services
                                    </label>
                                    <select name="products_services" class="form-select select">
                                        <option value="0" selected>Select</option>
                                        <option value="1">Access</option>
                                        <option value="0">Restrict</option>
                                    </select>
                                </div>
                            </div><!-- Col -->
                            
                            <div class="col-sm-4">
                                <div class="mb-3">
                                    <label class="form-label">Accounts
                                    </label>
                                    <select name="accounts" class="form-select select">
                                        <option value="0" selected>Select</option>
                                        <option value="1">Access</option>
                                        <option value="0">Restrict</option>
                                    </select>
                                </div>
                            </div><!-- Col -->
                            
                            <div class="col-sm-4">
                                <div class="mb-3">
                                    <label class="form-label">Employee
                                    </label>
                                    <select name="sales_data" class="form-select select">
                                        <option value="0" selected>Select</option>
                                        <option value="1">Access</option>
                                        <option value="0">Restrict</option>
                                    </select>
                                </div>
                            </div><!-- Col -->
                            
                            
                            
                        </div><!-- Row -->
          
            </div>  
            
            
          </div><!-- card-body -->
          
          <div class="card-footer">
            </div><!-- card-footer -->
        </div>


          <div class="modal-footer">
            <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
            <button type="submit" id="savechangesbutton" class="btn btn-primary" >Save changes</button>
          </div><!-- modal-footer -->
          </form>
        </div><!-- modal-content -->
      </div><!-- modal-content -->
    </div><!-- modal -->

     
    <style>
    tbody tr:hover {background-color: #F5F5F5;}
    .card-example>.card-body::before {
    content: ""
    }
    </style>

    <!-- <script type="text/javascript">
      // 
      public function show2(){
        console.log("here is data");
      }
      // var action="Edit";
      // 
      











    </script> -->
    <script>
      $("#tableGrid1").Grid({
        className: {
          table: 'table table-bordered mb-0'
        },
        search: true
      });
      function show2(){
        // showingmodal();
        $(".modal-title").html('Add New User');
        $('#formId').attr('action', 'users-new');
        document.getElementById("employee_email_modal").value="";
        document.getElementById("id").value="";
        document.getElementById("employee_name_modal").value="";
        document.getElementById("password").value="";
        document.getElementById("employee_user_type_modal").value="";
        
      }
      var url="users-new";
      
      function showingmodal(id,name,email,password,role){
        // console.log(id);
        // console.log(name);
        // console.log(email);
        // console.log(role);
        $('#formId').attr('action', 'users-update');
        document.getElementById("employee_email_modal").value=email;
        document.getElementById("id").value=id;
        document.getElementById("employee_name_modal").value=name;
        document.getElementById("password").value=password;
        document.getElementById("employee_user_type_modal").value=role;
        
        // $("#employee_email_modal").val=email;
        $('select').val('the_value');
        console.log("here we are selecting the add user ");
        // action=showmodalfor;
        // if(showmodalfor=="New"){
         
          
          $(".modal-title").html('Edit User');
        // }
        // else{
        //   $(".modal-title").html('Edit User');
        // }
      }

      // function verifymodal(){
      //   // console.log($("#employee_name_modal").val());
      //   // console.log($("#employee_email_modal").val());
      //   var email_valid= ValidateEmail($("#employee_email_modal").val());
      //   var name_valid= ValidateName($("#employee_name_modal").val());
      //   $.get("users-new",
      //     data: {
      //         name: "John",
      //         email: "ans@gmail.com" ,
      //         password:"1224224",
      //         role:"Admin"
      //       },
      //     function(data, status){
      //       alert("Data: " + data + "\nStatus: " + status);
      //     });
        
      // }
      $("#savechangesbutton").click(function(){
        print("here button is clicked");
      });
      function ValidateName(name){
        var format = /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]+/;

        if(format.test(name)){
          return true;
        } else {
          return false;
        }
      }
      function ValidateEmail(mail) 
      {
        if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(mail))
        {
          return (true);
        }
          alert("You have entered an invalid email address!");
          return (false);
      }

    </script>

<?php $__env->stopSection(); ?> 



        
<?php echo $__env->make('layout.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/vokks/public_html/tms/resources/views/users/history.blade.php ENDPATH**/ ?>