<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
   <!-- Content Header (Page header) -->
   <section class="content-header mb_10">
      <h1>Wholesalers</h1>
   </section>
   <!-- Main content -->
   <section class="content">
      <div class="row">
         <div class="col-lg-12 mb_20">
            <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#AddWholesaler" id="ItemCreateItemBtn" data-backdrop="static" data-keyboard="false"> 
            Add Wholesaler
            </button>
         </div>
      </div>
	  
	  
      <div class="modal fade" id="AddWholesaler">
         <div class="modal-dialog modal-lg">
            <div class="modal-content">
               <div class="modal-header">
                  <button type="button" class="close mfwPopUpClose" data-dismiss="modal" aria-label="Close">
                  <i class="fa fa-remove" class="remover"></i></button>
                  <h4 class="modal-title">Wholesaler Details</h4>
               </div>
               <div class="modal-body">
                     <form role="form" id="hdtestFormId" data-target="user/create_wholesaler" runat="server">
                        <div class="box-body padder0">
                           <div class="section_wrap">
                               <div class="row">
                                  <div class="col-lg-12 col-md-12 col-sm-12 cl-xs-12">
                                      <h4 class="sub_title">Personal Information</h4>
                                  </div>
                                  <div class="col-lg-6 col-md-6 col-sm-6 cl-xs-12">
                                     <div class="form-group">
                                        <label for="UserName">Wholesaler Name</label>
                                        <input type ="hidden" name="UserRole" value="3">
                                        <input type ="hidden" id="farm_action" value="user/create_wholesaler1">
                                        <input type="text" class="form-control" id="UserName" name="UserName" placeholder="User Name" required autocomplete="off">
                                     </div>
                                  </div>
                                  <div class="col-lg-6 col-md-6 col-sm-6 cl-xs-12">
                                     <div class="form-group">
                                        <label for="UserEmail">Email Address</label>
                                        <input type="text" class="form-control" id="UserEmail" name="UserEmail" required placeholder="Email" autocomplete="off">
                                     </div>
                                  </div>
                               </div>
                               <div class="row">
                                  <div class="col-lg-6 col-md-6 col-sm-6 cl-xs-12">
                                     <div class="form-group">
                                        <label for="UserMobile">Mobile Number</label>
                                        <input type="text" class="form-control" id="UserMobile" name="UserMobile" required placeholder="Mobile" autocomplete="off">
                                     </div>
                                  </div>
                                  <div class="col-lg-6 col-md-6 col-sm-6 cl-xs-12">
                                     <div class="form-group">
                                        <label for="UserPassword">Password</label>
                                        <input type="text" class="form-control" id="UserPassword" name="UserPassword" placeholder="Password" autocomplete="off">
                                     </div>
                                  </div>
                               </div>
                            </div>
							
                          <div class="section_wrap section_wh wholesalerinfo">
                               <div class="row">
                                   <div class="col-lg-12 col-md-12 col-sm-12 cl-xs-12">
                                      <h4 class="sub_title">Shop Information</h4>
                                  </div>
                                  <div class="col-lg-6 col-md-6 col-sm-6 cl-xs-12">
                                     <div class="form-group">
                                        <label for="WordNumber">Ward Number</label>
                                        <input type="text" class="form-control" id="WordNumber" name="WordNumber" required placeholder="Ward Number" autocomplete="off">
                                     </div>
                                  </div>
                                  <div class="col-lg-6 col-md-6 col-sm-6 cl-xs-12">
                                     <div class="form-group">
                                        <label for="HouseNumber">Shop Number</label>
                                        <input type="text" class="form-control" id="HouseNumber" name="HouseNumber" required placeholder="Shop Number" autocomplete="off">
                                     </div>
                                  </div>
                               </div>
                               <div class="row">
                                  <div class="col-lg-6 col-md-6 col-sm-6 cl-xs-12">
                                     <div class="form-group">
                                        <label for="Town">Town</label>
                                        <input type="text" class="form-control" id="Town" name="Town" required placeholder="Town" autocomplete="off">
                                     </div>
                                  </div>
                                  <div class="col-lg-6 col-md-6 col-sm-6 cl-xs-12">
                                     <div class="form-group">
                                        <label for="District">District</label>
                                        <input type="text" class="form-control" id="District" name="District" required placeholder="District" autocomplete="off">
                                     </div>
                                  </div>
                               </div>
                             </div>
                           <div class="section_wrap section_wh wholesalerinfo">
                               <div class="row">
                                   <div class="col-lg-12 col-md-12 col-sm-12 cl-xs-12">
                                      <h4 class="sub_title">Business Information</h4>
                                   </div>
                                  <div class="col-lg-6 col-md-6 col-sm-6 cl-xs-12">
                                     <div class="form-group">
                                        <label for="AadharNumber">Aadhar Number</label>
                                        <input type="text" class="form-control" id="AadharNumber" name="AadharNumber" required placeholder="Aadhar Number" autocomplete="off">
                                     </div>
                                  </div>
                                  <div class="col-md-6">
                                     <div class="form-group">
                                        <label for="PanNumber">Pan Number</label>
                                        <input type="text" class="form-control" id="PanNumber" name="PanNumber" required placeholder="Pan Number" autocomplete="off">
                                     </div>
                                  </div>
                               </div>
                               <div class="row">
                                  <div class="col-lg-12 col-md-12 col-sm-12 cl-xs-12">
                                     <div class="form-group">
                                        <label for="GSTNumber">GST Number</label>
                                        <input type="text" class="form-control" id="GSTNumber" name="GSTNumber" required placeholder="GST Number" autocomplete="off">
                                     </div>
                                  </div>
                               </div>
                               <div class="row">
                                   <div class="col-md-6">
                                      <label>Wholesaler Image</label>
                                      <div class="priview_thumb">
                                         <input class="form-control" type='file' id="imgInp" name="WholesalerImage" />
                                         <span>Preferred size 400px*400px.</span>
                                         <span class="priview_thumb_img">
                                            <a href="" data-toggle="modal" data-target="#wholeSaleBigImg" ><img id="blah" src="#" alt="" class="prev_thumb"/></a>
                                         </span>
                                      </div>
                                  </div>
                                  <div class="col-md-6">
                                     <label>Shop Image</label>
                                     <div class="priview_thumb">
                                         <input class="form-control" type='file' id="shopimgInp" name="ShopImage"/>
                                         <span>Preferred size 400px*400px.</span>
                                         <span class="priview_thumb_img">
                                            <a href="" data-toggle="modal" data-target="#shopBigImg" ><img id="shopblah" src="#" alt="" class="prev_thumb"/></a>
                                         </span>
                                     </div>
                                  </div>
                               </div>
                               <div class="row">
                                   <div class="col-md-6">
                                      <label>Aadhar Card Image</label>
                                     <div class="priview_thumb">
                                         <input class="form-control" type='file' id="aadharimgInp" name="AadharImage"/>
                                         <span>Preferred size 1280px*720px.</span>
                                         <span class="priview_thumb_img">
                                            <a href="" data-toggle="modal" data-target="#aadharBigImg" ><img id="aadharblah" src="#" alt="" class="prev_thumb" /></a>
                                         </span>
                                     </div>
                                  </div>
                                   <div class="col-md-6">
                                      <label>Pan Card Image</label>
                                     <div class="priview_thumb">
                                         <input class="form-control" type='file' id="panimgInp" name="PanImage"/>
                                         <span>Preferred size 1280px*720px.</span>
                                         <span class="priview_thumb_img">
                                            <a href="" data-toggle="modal" data-target="#panBigImg" ><img id="panblah" src="#" alt="" class="prev_thumb"/></a>
                                         </span>
                                     </div>
                                  </div>
                               </div>
                             </div>
                        </div>
                        <!-- /.box-body -->
                        <div class="box-footer text-center">
                           <input type="hidden" id="UserId" name="UserId">
                           <button type="submit" class="btn btn-primary" id="hdTestUser">Submit</button>
                        </div>
                     </form>
               </div>
            </div>
            <!-- /.modal-content -->
         </div>
         <!-- /.modal-dialog -->
      </div>
      <!-- /.modal -->
      
      <!---- Modal Inner Modle Img View ---->
      <!-- WHOLESALER IMAGE Popup -->
      <div class="modal fade" id="wholeSaleBigImg">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                  <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">Wholesaler Image</h4>
              </div>
              <div class="modal-body">
                  <div class="text-center">
                     <img id="blah_img" src="#" alt="" class="big_img"/>
                  </div>
              </div>
            </div>
            <!-- /.modal-content -->
          </div>
          <!-- /.modal-dialog -->
        </div>
       
       <!-- SHOP IMAGE Popup -->
      <div class="modal fade" id="shopBigImg">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                  <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">Shop Image</h4>
              </div>
              <div class="modal-body">
                  <div class="text-center">
                     <img id="blah" src="#" alt="" class="big_img"/>
                  </div>
              </div>
            </div>
            <!-- /.modal-content -->
          </div>
          <!-- /.modal-dialog -->
        </div>
        
        <!-- AADHAR CARD IMAGE Popup -->
        <div class="modal fade" id="aadharBigImg">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                  <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">Aadhar Image</h4>
              </div>
              <div class="modal-body">
                <div class="text-center">
                    <img id="blah" src="#" alt="" class="big_img"/>
                </div>
              </div>
            </div>
            <!-- /.modal-content -->
          </div>
          <!-- /.modal-dialog -->
        </div>
        
        <!-- PAN CARD IMAGE Popup -->
         <div class="modal fade" id="panBigImg">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                  <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">PAN Image</h4>
              </div>
              <div class="modal-body">
                  <div class="text-center">
                        <img id="blah" src="#" alt="" class="big_img"/>
                   </div>
              </div>
            </div>
            <!-- /.modal-content -->
          </div>
          <!-- /.modal-dialog -->
        </div>
      
      
      
      <div class="row">
         <div class="col-lg-12">
            <div class="box">
               <div class="box-body">
                  <div class="table-responsive">
                     <table id="mfw_ItemsTable" class="table table-bordered table-striped">
                        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                           <div class="row">
                              <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12 padder0">
                                 <select id="optionStatus" class="form-control mb_6">
                                    <option>Select status</option>
                                    <option <?php if($active==1){echo "selected";} ?> value="Active">Active</option>
                                    <option <?php if($active==0){echo "selected";} ?> value="Inactive">Inactive</option>
                                 </select>
                              </div>
                           </div>
                        </div>
                        <thead>
                           <tr>
                              <th>Sr No.</th>
                              <th>Image</th>
                              <th>Name</th>
                              <th>Email</th>
                              <th>Mobile No.</th>
                              <th>City</th>
                              <th>GST No.</th>
                              <th>Items</th>
                              <th>Action</th>
                              <th>Status</th>
                           </tr>
                        </thead>
                        <tbody>
                           <?php if(!empty($customer)){
                              $countItem = count($customer);
                               $i = $countItem;
                               $a=1;
                              foreach($customer as $value){ 
                              ?>
                           <tr>
                              <td><?php echo $a; ?></td>
                              <td><?php 
                                 if(isset($value['user_image']) && !empty($value['user_image'])){
                                 	$ItemImage = base_url().'assets/uploads/users/'.$value['user_image'];
                                 	echo '<img src="'.$ItemImage.'" class="img_thumb" alt="Image">';
                                 } 
                                 ?>
                              </td>
                              <td><?php echo $value['user_name']; ?></td>
                              <td><span class="cus_email"><?php if(!empty($value['user_email'])){ echo $value['user_email']; } ?></span></td>
                              <td><?php if(!empty($value['user_mobile'])){ echo $value['user_mobile']; } ?></td>
                              <td><?php if(!empty($value['address'])){  
                                 $test_str = $value['address']; 
                                                $words = explode('|', $test_str);
                                                if($words[0]){
                                                   echo $words[0];
                                                }
                                                } ?>
                              </td>
                              <td><?php if(!empty($value['GST_number'])){ echo $value['GST_number']; } ?></td>
                              <td><a class="btn-primary icon_btn" href="<?php echo base_url('dashboard/items_master')."/".$value['user_id']; ?>" target="_blank"><i class="fa fa-eye" aria-hidden="true"></i></a>
                              </td>
                              <td>
                                 <button class="btn-primary wholesaler_edit_btn icon_btn" data-id="<?php echo $value['user_id']; ?>" title="Edit"><i class="fa fa-pencil-square-o"></i></button>
                              </td>
                              <td>
                                 <label class="switch UserStatus" data-UserStatusId="<?php echo $value['user_id']; ?>" data-statusValue='<?php if($value['status']==1) {echo "0"; }else{ echo "1";}?>'>
                                 <input type="checkbox" name="u_status"<?php if($value['status']==1) {echo 'checked'; }?> >
                                 <span class="slider round"></span>
                                 </label>
                              </td>
                           </tr>
                           <?php 
                              $a++;
                              $i--;
                              }
                              } ?> 
                        </tbody>
                        <tfoot>
                           <tr>
                              <th>Sr No.</th>
                              <th>Image</th>
                              <th>Name</th>
                              <th>Email</th>
                              <th>Mobile No.</th>
                              <th>City</th>
                              <th>GST No.</th>
                              <th>Items</th>
                              <th>Action</th>
                              <th>Status</th>
                           </tr>
                        </tfoot>
                     </table>
                  </div>
               </div>
               <!-- /.box-body -->
            </div>
            <!-- /.box -->
         </div>
      </div>
   </section>
   <!-- /.content -->
</div>
<!-- /.content-wrapper -->
