MMCT TEAM
Server IP : 162.214.80.37  /  Your IP : 216.73.216.83
Web Server : Apache
System : Linux sh013.webhostingservices.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : imyrqtmy ( 2189)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home2/imyrqtmy/public_html/harishtaraagriculturaltrust/admin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/imyrqtmy/public_html/harishtaraagriculturaltrust/admin/user.php
<?php include 'comman/links.php'; ?>
<style>
  input {
border: none;
background-color: transparent;
resize: none;
outline: none;
 }
input:hover
{
  color:#fff;
}
</style>
     <!-- Layout wrapper -->
    <div class="layout-wrapper layout-content-navbar">
      <div class="layout-container">
        <!-- Menu -->
  <?php  include 'comman/sidebar.php'; ?>

        <!-- Layout container -->
        <div class="layout-page">
         <?php include 'comman/header.php';   ?>

          <!-- Content wrapper -->
          <div class="content-wrapper">
            <!-- Content -->

            <div class="container-xxl flex-grow-1 container-p-y">
              <h4 class="fw-bold py-3 mb-4"><span class="text-muted fw-light">Admin /</span> User</h4>

              <div class="row">
                <div class="col-md-12">
                  <ul class="nav nav-pills flex-column flex-md-row mb-3">
                    <!-- <li class="nav-item">
                      <a class="nav-link active" href="javascript:void(0);"><i class="bx bx-user me-1"></i> Account</a>
                    </li> -->
                    <!-- <li class="nav-item">
                      <a class="nav-link" href="pages-account-settings-notifications.html"
                        ><i class="bx bx-bell me-1"></i> Notifications</a
                      >
                    </li> -->
                    <!-- <li class="nav-item">
                      <a class="nav-link" href="pages-account-settings-connections.html"
                        ><i class="bx bx-link-alt me-1"></i> Connections</a
                      >
                    </li> -->
                  </ul>
                  <div class="card mb-4">
                    <!-- <h5 class="card-header">Profile Details</h5> -->
                    <!-- Account -->
                    <!-- <div class="card-body">
                      <div class="d-flex align-items-start align-items-sm-center gap-4">
                         <div class="button-wrapper">
                          <label for="upload" class="btn btn-primary me-2 mb-4" tabindex="0">
                            <span class="d-none d-sm-block">Upload new photo</span>
                            <i class="bx bx-upload d-block d-sm-none"></i>
                            <input
                              type="file"
                              id="upload"
                              class="account-file-input"
                              hidden
                              accept="image/png, image/jpeg"
                            />
                          </label>
                          

                          <p class="text-muted mb-0">Allowed JPG, GIF or PNG. Max size of 800K</p>
                        </div>
                      </div>
                    </div> -->
                    <!-- <hr class="my-0" /> -->
                    <!-- <div class="card-body">
                      <form id="pro" method="POST"  ">
                        <div class="row">
                          <div class="mb-3 col-md-6">
                            <label for="firstName" class="form-label">Category select</label>
                            <select id="defaultSelect" name="cat" class="form-select">
                                 <?php

                                    $result = mysqli_query($conn,"SELECT * FROM category");
                                    while($data = mysqli_fetch_array($result))
                                    {
                                    ?>
                                <option hidden >Category select</option>
                                <option value="<?php echo $data['id']; ?>"><?php echo $data['name']; ?></option>
                                <?php
                                }
                                ?>
                                 </select>
                            <input type="text" hidden name="pro" value="pro"> 
                          </div>
                          
                          <div class="mb-3 col-md-6">
                             <div class="mb-3">
                                <label for="defaultSelect" class="form-label"> Sub Category select</label>
                                 <select id="defaultSelect" name="sub" class="form-select">
                                 <?php

                                    $result = mysqli_query($conn,"SELECT * FROM sub_category");
                                    while($data = mysqli_fetch_array($result))
                                    {
                                    ?>
                                <option hidden >Category select</option>
                                <option value="<?php echo $data['id']; ?>"><?php echo $data['name']; ?></option>
                                <?php
                                }
                                ?>
                                 </select>
                          </div>
                             
                          </div>
                         </div>  
                         <div class="row">
                         <div class="mb-3 col-md-12">
                            <label for="">Upload Image</label>
                            <input
                              class="form-control"
                              type="file"
                              id="firstName"
                              name="files"
                              value=" "
                              autofocus
                            />
                          </div>
                          </div> 
                          <div class="row">
                          <div class="mb-3 col-md-6">
                            <label for="defaultSelect" class="form-label">Product Name</label>
                                <input type="text" name="name" class="form-control"  autofocus>
                           </div>
                          
                          <div class="mb-3 col-md-6">
                                 <label for="defaultSelect" class="form-label"> Price</label>
                                 <input type="text" name="price" class="form-control"  autofocus>
                          </div>
                         </div>  
                         <div class="row">
                          <div class="mb-3 col-md-6">
                            <label for="defaultSelect" class="form-label">Product Quantity:</label>
                                <input type="text" name="qty" class="form-control"  autofocus>
                           </div>
                          
                          <div class="mb-3 col-md-6">
                                 <label for="defaultSelect" class="form-label"> Discription</label>
                                 <input type="text" name="dis" class="form-control"  autofocus>
                          </div>
                         </div>  
                         <div class="mt-2">
                          <button type="submit" class="btn btn-primary me-2">Upload</button>
                          <button type="reset" class="btn btn-outline-secondary">Cancel</button>
                        </div>
                      </form>
                    </div> -->
                    <!-- /Account -->
                  </div>
                  <hr>
                  <div class="card">
                    <h5 class="card-header">View User</h5>
                    <div class="card-body">
                    <div class="table-responsive text-nowrap">
                  <table class="table">
                    <thead>
                      <tr>
                        <th>Id</th>
                        <th>Name</th>
                        <th>Email</th>
                        <th>Referr By</th>
                        <th>Referr Code</th>
                        <th>Time</th>
                         <th>Status</th>

                        <th>Actions</th>
                      </tr>
                    </thead>
                    <tbody class="table-border-bottom-0">
                        <?php

                        $result = mysqli_query($conn,"SELECT * FROM users");
                        while($data = mysqli_fetch_array($result))
                        {
                         ?>
                      <td>1</td>
                      <td><?php echo $data['name'];   ?></td>
                      <td><?php echo $data['email'];   ?></td>
                       <td> <?php echo $data['ref_by'];   ?></td>
                        <td>
                           <button  onclick="myFunction()" class="btn btn-outline-dark"><input type="text" value="<?php echo $data['ref_code'];   ?>" id="myInput"></button>
                        </td>
                        <td><?php echo $data['time'];   ?></td>
                               
                      <td>    <span class="badge bg-success">Success</span></td>
                        <td>
                               <a class="dropdown-item" href="edit_cat.php"
                                ><i class="bx bx-edit-alt  "></i> Edit</a
                              >
                              <a class="dropdown-item" href="javascript:void(0);"
                                ><i class="bx bx-trash  "></i> Delete</a
                              >
                            
                          
                        </td>
                      </tr>
                      <?php

                        }
                    ?>
                    </tbody>
                  </table>
                </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <!-- / Content -->
<?php include 'comman/footer.php'; ?>

<script>
	   $(document).ready(function(){
		   $('#pro').unbind().submit(function(e){
			   e.preventDefault();
			   var data=document.getElementById('pro');
				var formdata= new FormData(data);
  				$.ajax({
					   type: "POST",
					   url: "pro_process.php",
					   data: formdata,
					   processData: false,
					   contentType: false,
					   cache: false,
					   success: function (data) 
					   {
						   if(data==1)
						   {
                            swal({
                                position: 'top-end',
                                 title: 'Product Added',
                                 
                                timer: 1500
                                }).then(function() {
                                    window.location = "product.php";
                                });
                                                
							 
						   }
						   else
						   {
								 alert(data);
						   }
					 
					   }
				   });
		   })
	   })
    </script>
    <script>
      function myFunction() {
  /* Get the text field */
  var copyText = document.getElementById("myInput");

  /* Select the text field */
  copyText.select();
  copyText.setSelectionRange(0, 99999); /* For mobile devices */

   /* Copy the text inside the text field */
  navigator.clipboard.writeText(copyText.value);

  /* Alert the copied text */
  alert("Copied the text: " + copyText.value);
}
    </script>

MMCT - 2023