mercredi 11 avril 2018

How to pass dynamic data inside model dialogue box in laravel

Find below the code in blade file :

 @foreach($value['products']['product'] as $key)


    <tr role="row">
      <td  class="sorting_desc" tabindex="0" aria- 
      controls="DataTables_Table_0" rowspan="1" colspan="1" aria- 
      label="Rendering engine: activate to sort column ascending" aria- 
      sort="descending"></td>
      <td  class="sorting" tabindex="0" aria-controls="DataTables_Table_0" 
      rowspan="1" colspan="1"
       aria-label="Browser: activate to sort column ascending">


       <a href="" style="color:#23b7e5" data-toggle="modal"
        data-target="#myModal"> - </a>
       </td>
      <td  class="sorting" tabindex="0" aria-controls="DataTables_Table_0" 
      rowspan="1" colspan="1" aria-label="Platform(s): activate to sort 
      column ascending"> - </td>
      <td  class="sorting" tabindex="0" aria-controls="DataTables_Table_0" 
      rowspan="1" colspan="1" aria-label="Platform(s): activate to sort 
      column ascending"> </td>
      <td class="sorting" tabindex="0" aria-controls="DataTables_Table_0" 
       rowspan="1" colspan="1" aria-label="Engine version: activate to sort 
       column ascending"></td>
      <td  class="sorting" tabindex="0" aria-controls="DataTables_Table_0" 
       rowspan="1" colspan="1" aria-label="Engine version: activate to sort 
       column ascending">
      <label class="checkbox-inline">
      <input type="checkbox" checked data-toggle="toggle">Auto Renew
      </label>
      </td>

     </tr>
     <!-- Modal -->
     <div class="modal fade" id="myModal" role="dialog">
     <div class="modal-dialog-lg">

     <!-- Modal content-->
     <div class="modal-content">
     <div class="modal-header">

      <button type="button" class="close" data-dismiss="modal">&times; 
      </button>
      <h4 class="modal-title"><b> -  
      </b></h4>
    </div>
    <div class="modal-body modal-header">
      <p>Domain Name - </p>
    </div>

    <div class="row" style="padding-top:20px;">
  <div class="col-lg-6">
          <a href="" class="block panel padder-v bg-primary item" >
            <span class="text-white font-thin h1 block text-center"></span>
            <p class="text-center text-muted customFont" >Email Accounts</p>

          </a>
        </div>
       <div class="col-lg-6"  style="padding-left:20px;"><a href="" 
       class="block panel padder-v bg-info item">
            <span class="text-white font-thin h1 block text-center"></span>
            <p class="text-muted text-center customFont">Addon Domain</p>

          </a>
        </div>
  </div>


    <div class="row">
  <div class="col-lg-6">
          <a href="" class="block panel padder-v bg-info item" >
            <span class="text-white font-thin h1 block text-center"></span>
            <p class="text-center text-muted customFont" >Add Sub Domain</p>

          </a>
        </div>
     <div class="col-lg-6"  style="padding-left:20px;"><a href="" 
     class="block panel padder-v bg-primary item">
            <span class="text-white font-thin h1 block text-center"></span>
            <p class="text-muted text-center customFont">change Primary 
      Domain</p>

          </a>
        </div>
  </div>

  </div>

</div>

         <!-- my modal closed -->
         @endforeach

In the blade file in the below mentioned code I'm getting the data displayed correctly but inside the modal dailogue I'm getting the same name for different groupname. Suggest me a solution to rectify this issue.

        <a href="" style="color:#23b7e5" data-toggle="modal"
        data-target="#myModal"> - </a>

For modal dailogue I have used the below code:

     <div class="modal-header">

      <button type="button" class="close" data-dismiss="modal">&times; 
      </button>
      <h4 class="modal-title"><b> -  
      </b></h4>
      </div>

Find below the route code:

Route::get('clientlayout.main.myservices','MyServicesController@show');

Controller Code is given below:

class MyServicesController extends Controller
{

public function show(){
    $value = Whmcs::GetClientsProducts([]);

    return view('clientlayout.main.myservices',compact('value'));
}

}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire