Jayanthkumar

Jayanthkumar

Member Since 2 Years Ago

Experience Points 4,190
Experience Level 1

810 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 5
Lessons
Completed
Best Reply Awards 1
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

09 Mar
2 years ago

Jayanthkumar left a reply on Show Array Count In Blade

{{ count(explode(",",$cust->device_id)) }}

Jayanthkumar started a new conversation Show Array Count In Blade

Hi i am getting values in below mentioned format with the coloumn name device_id from invoice table

[377,379,314,306,380,317,378,367,381,369,366,382,384,383,387]
[303,318,311]
[319] 

i need to sow the count in front end insteard of showing all id i.e

15 3 1

controller code

   public function show()
    {

        $cust = DB::table('invoice')->join('customer', 'invoice.customer_id', '=', 'customer.id')->join('cities', 'customer.cities_id', '=', 'cities.id')->join('states', 'cities.state_id', '=', 'states.id')->join('districts', 'customer.districts_id', '=', 'districts.id')->select('invoice.*', 'customer.customer_name','customer.phone','customer.street','customer.locality','customer.PIN_code','customer.email','states.state','cities.city','districts.district')->get();

        return view('pages.viewinvoice', ['custom' => $cust]);    
    }

invoice table itself is having device_id coloumn 

blade.php code

                   @foreach($custom as $cust )
                        
                       <tr>
                   
                        
                      
                        <td>{{ $cust->device_id }}</td>

                        {{--<td><a href="{{ url('invoice') }}">Show invoice</a></td>--}}
                        <td><a href="<?php echo 'invoice/' .$cust-> id  ?>">print invoice</a></td>
                        
                      
                        </tr>
                        @endforeach 

output is 
[377,379,314,306,380,317,378,367,381,369,366,382,384,383,387]
[303,318,311]
[319] 

i need 
15
3
1

if i use

<td>{{ count($cust->device_id) }}</td>

i am getting
1
1
1
07 Mar
2 years ago

Jayanthkumar started a new conversation How To Navigate To Different Page Based On If-else Condition Of Table Id

Hi laracast,

this is the print method used in invoice controller

   public function print($id)
    {
        $row = DB::table('invoice')->where('invoice.id',$id)->join('customer', 'invoice.customer_id', '=', 'customer.id')->join('cities', 'customer.cities_id', '=', 'cities.id')->join('states', 'cities.state_id', '=', 'states.id')->join('districts', 'customer.districts_id', '=', 'districts.id')->first();

        $row1 = DB::table('device')->where('invoice_id',$id)->get();
        $row2 = DB::table('device')->where('invoice_id',$id)->first();
        $count = count($row1);
        return view('pages.invoice', ['row' => $row, 'row1' => $row1, 'row2' => $row2 ,'count' => $count]);
    }

i am joining state to $row,

now i need to use if else condition

ex if ($row states.id =1) then return view('pages.invoice', ['row' => $row, 'row1' => $row1, 'row2' => $row2 ,'count' => $count]);

else if($row->state.id = 2)
 return view('pages.invoicestate2', ['row' => $row, 'row1' => $row1, 'row2' => $row2 ,'count' => $count]);

else
 return view('pages.invoicedefault', ['row' => $row, 'row1' => $row1, 'row2' => $row2 ,'count' => $count]);

how to do this

30 Dec
2 years ago

Jayanthkumar left a reply on How Structure Javascript Code For Real Multiple Page Application?

Use all the Js link in main page and call that link where ever you need and add the JS code for specific function @lavidaenbroma

example of main page

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    
    <!-- Bootstrap -->
    <link href="{{ asset('/vendors/bootstrap/dist/css/bootstrap.min.css') }}" rel="stylesheet">
    <link href="{{ asset('/css/uii/jquery-ui.theme.min.css') }}" rel="stylesheet">
  </head>

  <body class="nav-md">
    <link href="{{ asset('/css/bootstrap-editable.css') }}" rel="stylesheet">
    <link href="{{ asset('/css/bootstrap-filterable.css') }}" rel="stylesheet">
     <!-- filter code-->
   <script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>

   <script src="{{ asset('js/bootstrap-editable.min.js') }}"></script>
   <script src="{{ asset('js/filter/filterable-utils.js') }}"></script>
  <script src="{{ asset('js/filter/filterable-cell.js') }}"></script>
  <script src="{{ asset('js/filter/filterable-row.js') }}"></script>
  <script src="{{ asset('js/filter/filterable.js') }}"></script>
  
    @yield('page-script')
    <script type="text/javascript">
    $('table').filterable();
  </script>


//this script will be applied in all page



    

  </body>
</html>

in which ever page you need script call it like below

 @section('page-script')
<script>  

// your script
</script>
@endsection
26 Dec
2 years ago

Jayanthkumar left a reply on WhereBetween Is Not Working For Me

$from and $to are not null they have date i tried dd($from) @dubbeltje

Jayanthkumar left a reply on WhereBetween Is Not Working For Me

@dubbeltje i tried that also it is returning null value

Jayanthkumar started a new conversation WhereBetween Is Not Working For Me

i am trying get the data from DB i am using filter to get the date between two dates but i am getting null value

here is my controller code

public function filterdate(){

    $from = Input::get('from');
    $to = Input::get('to');
    $cust = DB::table('invoice')->whereBetween('invoice_date', array($from,$to) )->get();
    dd($cust);
    return view('pages.viewinvoice', ['custom' => $cust]);
}

Jayanthkumar started a new conversation How To Use Filters For Date In Data Tables

I need to use filters for Data table based on the date selected range... how to do this

24 Dec
2 years ago

Jayanthkumar started a new conversation How To Filter Data Between The Date And View Content

Hi i am getting all the Data from DB and i am able to show in table format but now i need to make better by adding filter of 2 date selector and one button

by on click i need to show the contents entered with in that range how to do this

here is my view

<table id="datatable-responsive" class="table table-striped table-bordered dt-responsive nowrap" cellspacing="0" width="100%">
                      <thead>
                        <tr>
                          <th>Customer name</th>
                          <th>Phone Number</th>
                          <th>State</th>
                          <th>District</th>
                          <th>City/Taluk/Mandal</th>
                          <th>Payment</th>  
                          <th>Payment Status</th>
                          <th>Sales person</th> 
                          <th>Invoice Number</th>
                          <th>Invoice Date</th>
                          
                          
                          <th>More Options</th>
                        </tr>
                      </thead>
                      <tbody>
                        
                        @foreach($custom as $cust )
                        
                       <tr>
                        <td>{{ $cust->customer_name}}</td>
                        <td>{{ $cust->phone}}</td>
                        <td>{{ $cust->state}}</td>
                        <td>{{ $cust->district}}</td>
                        <td>{{ "$cust->city"}}</td>
                        
                        
                        
                        <td>@if($cust->mode_of_payment == 1)
                              Cash   
                              @elseif ($cust->mode_of_payment == 2)
                              NEFT
                              @elseif ($cust->mode_of_payment == 3)
                              Payumoney
                              @elseif ($cust->mode_of_payment == 4)
                              Amazon
                              @elseif ($cust->mode_of_payment == 5)
                              Ebay
                              @elseif ($cust->mode_of_payment == 6)
                              Cash on delivery
                              @elseif ($cust->mode_of_payment == 7)
                              Others
                              @endif </td>
                        <td><a>@if($cust->payment_status == 1)
                              <p1 style="color:red">NOT PAID</p1>
                              <a href="<?php echo 'payment/' .$cust-> id  ?>">Make it Paid</a>
                            @elseif ($cust->payment_status == 2)
                              <p1 style="color:green">RECEIVED<p1> 
                            @elseif ($cust->payment_status == 3)
                              <p1>NOT APPLICABLE<p1>  
                              @endif</a></td>       
                        <td>{{ $cust->salesperson}}</td>      
                        <td>{{ $cust->invoice_number}}</td>
                        <td>{{ $cust->invoice_date}}</td>
                        {{--<td>{{ $cust->device_id}}</td>--}}
                        
                        {{--<td><a href="{{ url('invoice') }}">Show invoice</a></td>--}}
                        <td><a href="<?php echo 'invoice/' .$cust-> id  ?>">print invoice</a></td>
                        
                      
                        </tr>
                        @endforeach

                        
                        
                      </tbody>
                    </table>

in this table i am getting date in one coloumn so that i need a filter to show data present between that dates

need help....plz give some suggestions and tips

23 Dec
2 years ago

Jayanthkumar left a reply on Laravel Passport For Mobile App

thanks @zachleigh i started reading the Doc...

22 Dec
2 years ago

Jayanthkumar started a new conversation Laravel Passport For Mobile App

Hi i need to develop mobile app for that i need to learn passport authentication can any one suggest me the tutorials

20 Dec
2 years ago

Jayanthkumar started a new conversation Increment Coloumn Value By Input Field Value

hi team,

i have coloumn in enquiry table named finish

i have a input field in invoice form count after sumbit, I need to increment the finished buy count value prexent in input field,

till now i was incrementing by 1 but now i need to increment based on input field...

input field in blade

<input id="quan" name="quantity" type="quantity" class="form-control" readonly placeholder="" value="{{$count}}">

this is my controller code invoice

$inveri = new Invoice;
        $inveri->customer_id = $request->idnumber;
        $inveri->quatation_num = $request->quatationnum;
        $inveri->purchase_order = $request->purchaseorder;
        $inveri->invoice_number = $request->invoicenumber;
        $inveri->invoice_date = $request->invoicedate;
        $inveri->net_amount = $request->netamount;
        $inveri->vat = $request->vat;
        $inveri->vatamt = $request->vatamt;
        $inveri->gross_amount = $request->gross;
        $inveri->salesperson = $request->dispatchedby;
        $inveri->dispatched_through = $request->dispatchedthrough;
        $inveri->dispatched_date = $request->dispatcheddate;
        $inveri->mode_of_payment = $request->modeofpayment;
        $inveri->tin_number = $request->purchaseorder; 
        $inveri->payment_date = $request->paymentreceiveddate;
        $inveri->payment_received_bank = $request->paymentreceivedbank;
        $inveri->payment_status = $request->paidrnot;

        $inveri->deviceone = $request->select1;

        $inveri->tin_number = $request->tin; 
       
        $inveri->device_id = $request->deviceid;
        $inveri->user = Auth::user()->id;


        $inveri->save();

in this table i need to increment finished by the count value

DB::table('Enquiry')
            ->where('id', Input::get('enquiry_id'))
            ->increment('finished', 1);

pls need answers soon

19 Dec
2 years ago

Jayanthkumar started a new conversation How To Pass Primary Key To Another Table As Foreign Key For On Update

i need to pass primary key of invoice table and need to store the same in the device table as a foreign key

here is my controller code

public function store(Request $request,$id)
    {
        

            DB::table('customer')
            ->where('phone', Input::get('phone'))
            ->update(['enquiry_r_invoice' => 1]);

            

            DB::table('Enquiry')
            ->where('id', Input::get('enquiry_id'))
            ->update(['order_status' => '3']);

            $man=explode(',', $id);
            DB::table('device')
            ->whereIn('id',$man)
            ->update(['status' => '4', 'customer_id' => Input::get('idnumber') ,'invoice_id' => Input::get()]);
            
            
            $enquiry->customer_id = $item->id;
       
            
        $inveri = new Invoice;
        
        $inveri->customer_id = $request->idnumber;
        $inveri->quatation_num = $request->quatationnum;
        $inveri->purchase_order = $request->purchaseorder;
        $inveri->invoice_number = $request->invoicenumber;
        $inveri->invoice_date = $request->invoicedate;
        $inveri->net_amount = $request->netamount;
        $inveri->vat = $request->vat;
        $inveri->vatamt = $request->vatamt;
        $inveri->gross_amount = $request->gross;
        $inveri->salesperson = $request->dispatchedby;
        $inveri->dispatched_through = $request->dispatchedthrough;
        $inveri->dispatched_date = $request->dispatcheddate;
        $inveri->mode_of_payment = $request->modeofpayment;
        $inveri->tin_number = $request->purchaseorder; 
        $inveri->payment_date = $request->paymentreceiveddate;
        $inveri->payment_received_bank = $request->paymentreceivedbank;
        $inveri->payment_status = $request->paidrnot;

        $inveri->deviceone = $request->select1;
       
       

        $inveri->tin_number = $request->tin; 
       
        $inveri->device_id = $request->deviceid;
        $inveri->user = Auth::user()->id;


        $inveri->save();

        // $inveri2 = DB::table('Enquiry')
        //     ->where('customer_id', Input::get('customer_id'))
        //     ->update(['device_id' => Input::get('deviceid')]);
        Alert::success('Data successfully stored');
        return redirect('viewinvoice');

       

    }

Jayanthkumar started a new conversation How Get Coloumn And Match With Another Table From Array

HI I am using two table one is invoice,device and customer,,,,

i have invoice table where customer is single and device is an array.,,,

now i need to get the device serial number based on ID from the device array,,,,and need to match with customer,,,

my issue is i have customer id in device table but devices is an array... i am able to get sl no from array not able match with customer

here is my code controller code

public function show()
    {

        //getting device IDs from invoice table 
        $deviceview = DB::table('invoice')->pluck('device_id');
    //output =[1,2,3]

    //separate each device from array   
        $man=explode(',', $deviceview);
    //output of =[1,2,3]
    //array:3 [▼
    //0 => "["[1"
    //1 => "2"
    // 2 => "3"]"]"]
    
    //this just to get array count in number
        $count = count($man);
    //output = 3;

    //variable to pluck device serial number form device for each exploded $man
        $row = DB::table('device')->whereIn('id',$man)->pluck('slno');
    //output = 0 => "101602000055"
        //        1 => "101602000051"
    //        2 => "101602000053"

    //  now issue arise i have list of serial number but dont know which serial number belongs 
    //  to which customer based on invoice generated
        


        //$cust = DB::table('customer')->where('enquiry_r_invoice', 1)->get();
        $cust = DB::table('invoice')->join('customer', 'invoice.customer_id', '=', 'customer.id')->join('device','invoice.device_id', '=', 'device.id')->where('invoice.device_id', '='  ,'device.id')->join('cities', 'customer.cities_id', '=', 'cities.id')->join('states', 'cities.state_id', '=', 'states.id')->join('districts', 'customer.districts_id', '=', 'districts.id')->select('invoice.*', 'customer.customer_name','customer.phone','customer.street','customer.locality','customer.PIN_code','customer.email','device.slno', 'device.device', 'device.maharajsl', 'device.samanthsl','states.state','cities.city','districts.district')->get();

        

        return view('pages.viewinvoice', ['custom' => $cust, 'row' => $row ]);
       
    }

how to fix this issue

17 Dec
2 years ago

Jayanthkumar started a new conversation How To Get Array Count

i am passing the array from one view to another, there i am retriving data also but i need the array count how to get that count

 public function pass_device_array(Request $request,$id, $enqid){
       
       $man=explode(',', $id);
       
        $row = DB::table('device')->whereIn('id',$man)->pluck('id');
        $row1 = DB::table('Enquiry')->where('id',$enqid)->first();
        
        return view('pages.newinvoice', ['row' => $row, 'row1' => $row1]);

    }

$man is having the list of array....

i need one more variable to hold the count of $id

how to do this

16 Dec
2 years ago

Jayanthkumar left a reply on Not Able To Pass This Array To Controller Through Route

thanks @lucassimines and @TerrePorter

Route::get('/sendarray/send/{id}/{enqid}',"[email protected]_device_array");

this worked for me....

but now am not able to pass array from controller to View

 public function pass_device_array(Request $request,$id, $enqid){
       
        $row = DB::table('device')->whereIn('id',$id)->first();
        $row1 = DB::table('Enquiry')->where('id',$enqid)->first();
        dd($id);
        
        return view('pages.newinvoice', ['row' => $row, 'row1' => $row1]);

    }

whereIn is also not working for me\

Jayanthkumar started a new conversation Not Able To Pass This Array To Controller Through Route

i am passing array to controller using route i am able to get array but i am not able to route it properly can any help me in routing this

this is my script which is working correctly

   <script>  
      $(document).ready(function(){  
            $('#btn-invoice').click(function(){  
                if(confirm("Are you sure you want to Generate invoice...?"))  
                {     
                      
                      var enqid = parseInt($('#enqvalue').val());
                      var id = [];  
                      $(':checkbox:checked').each(function(i){  
                          id[i] = $(this).val();  
                      });  
                      
                      if(id.length === 0)  
                      {  
                          alert("Please Select atleast one checkbox");  
                      }  
                      else  
                      {  
                        window.location.href = '/sendarray/send?id='+id+'&enqid='+enqid;
                      }  
                }  
                else  
                {  
                      return false;  
                }  
            });  
      });  
      </script>

this is my route which is not routing to controller

Route::get('/sendarray/send?{id}&enq{id}',"[email protected]_device_array");
15 Dec
2 years ago

Jayanthkumar left a reply on Need To Pass Array Value To The Controller

hi @phpMick

i am using check box to get array of ID and i need to pass the same to the controller and from there i need to pass array to another view...

 <td><input type="checkbox" name="checkbox" id="checkbox" value="{{$device->id}}"/></td>

this is the check box code

Jayanthkumar started a new conversation Need To Pass Array Value To The Controller

Hi it is getting value in data id but it is not passing to the controller

this is my script



      @section('page-script')
      <script>  
      $(document).ready(function(){  
            $('#btn-invoice').click(function(){  
                if(confirm("Are you sure you want to Generate invoice...?"))  
                {     
                      
                      var enqid = parseInt($('#enqvalue').val());
                      var id = [];  
                      $(':checkbox:checked').each(function(i){  
                          id[i] = $(this).val();  
                      });  
                      
                      if(id.length === 0) //tell you if the array is empty  
                      {  
                          alert("Please Select atleast one checkbox");  
                      }  
                      else  
                      {  
                          $.ajax({  
                                url:'sendarray',  
                                method:'GET',  
                                data:{id:id},  
                                success : function(data){
                          return data;
                      }
                          });  
                      }  
                }  
                else  
                {  
                      return false;  
                }  
            });  
      });  
      </script>  
      @endsection

this is my route

Route::get('/sendarray',"[email protected]_device_array");

this is my controller code

 public function pass_device_array(Request $request){
        $row = $request->input('id');
        dd($row);
        // $enqid = $request->input('enqid');
        // $row1 = DB::table('Enquiry')->where('id',$enqid)->first();
        
        
    }

i am not able to dd the row

14 Dec
2 years ago

Jayanthkumar left a reply on Hi How To Push Array Value To Text Field

hi @ejdelmonico this is also not working

var array_id = [];  
                     $(':checkbox:checked').each(function(i){  
                     array_id[i].push($('#textfield').val());
                     });
12 Dec
2 years ago

Jayanthkumar left a reply on Hi How To Push Array Value To Text Field

Hi @DmytroOlefyrenko i have changing the script as u mentioned but still i am not able to get that value in textfield

<script>  
 $(document).ready(function(){  
      $('#btn-mail').click(function(){  
           if(confirm("Are you sure you want to Proceed?"))  
           {  
                var array_id = [];  

                $(':checkbox:checked').each(function(i){  
                     array_id[i] = $(this).val(); 
                     array_id.push($('#textfield').val());
                     
                     
                });  
                console.log(array_id);
                
                 
                
                // if(id.length === 0) //tell you if the array is empty  
                // {  
                //      alert("Please Select atleast one checkbox");  
                // }  
                // else  
                // {  
                //      $.ajax({  
                //           url:'sendmail',  
                //           method:'POST',  
                //           data:{id:id},  
                //           success:function()  
                //           {  
                //                for(var i=0; i<id.length; i++)  
                //                {  
                //                     $('tr#'+id[i]+'').css('background-color', '#ccc');  
                //                     $('tr#'+id[i]+'').fadeOut('slow');  
                //                }  
                //           }  
                //      });  
                // }  
           }  
           else  
           {  
                return false;  
           }  
      });  
 });  
 </script>  

Jayanthkumar started a new conversation Hi How To Push Array Value To Text Field

hi i am using check box to get the value of that table...i need to send that array based on check box so here is my script...i am able to get that array in variable "array_id" but not able put the same in text box

<p1 type="text" id="textfield"></p1>
<script>  
 $(document).ready(function(){  
      $('#btn-mail').click(function(){  
           if(confirm("Are you sure you want to Proceed?"))  
           {  
                var array_id = [];  

                $(':checkbox:checked').each(function(i){  
                     array_id[i] = $(this).val(); 
                     array_id.push($(this).find(('#textfield').val());
                     
                });  
                console.log(array_id);
                 
                
                // if(id.length === 0) //tell you if the array is empty  
                // {  
                //      alert("Please Select atleast one checkbox");  
                // }  
                // else  
                // {  
                //      $.ajax({  
                //           url:'sendmail',  
                //           method:'POST',  
                //           data:{id:id},  
                //           success:function()  
                //           {  
                //                for(var i=0; i<id.length; i++)  
                //                {  
                //                     $('tr#'+id[i]+'').css('background-color', '#ccc');  
                //                     $('tr#'+id[i]+'').fadeOut('slow');  
                //                }  
                //           }  
                //      });  
                // }  
           }  
           else  
           {  
                return false;  
           }  
      });  
 });  
 </script>  
09 Dec
2 years ago

Jayanthkumar left a reply on How To Pass IDs Of Checked Box

Can any one suggest me the solution...

08 Dec
2 years ago

Jayanthkumar started a new conversation How To Pass IDs Of Checked Box

Hi i need to pass the IDs of the row which all r checked

How pass that Multiple Ids

 <table id="datatable-responsive" class="table table-striped table-bordered dt-responsive nowrap" cellspacing="0" width="100%">
                      <thead>
                        <tr>
                          <p><label><input type="checkbox" id="checkAll"/> Check all</label></p>
                         
here is the a "tag" which need to pass the IDs of the checked rows
 <a href="completed}}" class="btn btn-success">Generate Invoice</a>
                          

                          

                          <th>Check Box</th>
                          <th>Serial No</th>
                          <th>Device</th>
                          <th>Language</th>
                          <th>enquiry id</th>
                         
                        </tr>
                      </thead>
                      <tbody>
                         @foreach($devices as $device)
                         @foreach($rows as $row)
                         
                         
                        <tr>
                        
                        <td><input type="checkbox" name="checkbox[]" data-id="checkbox"class="cb" value="{{$device->id}}" /></td> 
                        
                        <td>{{ $device->slno}}</td>
                        <td>@if($device->maharajsl == 0 && $device->device == 'SAMRAT')
                          SAMRAT
                          @elseif($device->maharajsl == 0 && $device->device == 'YUVARAJ')
                          YUVARAJ
                          @elseif($device->samanthsl!= 0)
                          SAMANTH
                          @elseif($device->maharajsl !=0)
                          MAHARAJ
                          @endif
                        </td>
                       <td>@if($device->device == 'SAMRAT')
                                {{ $device->language}}
                              @elseif ($device->device =='YUVARAJ')
                                -----
                              @endif</td>
                               <td> {{ $row->enquiry_id}}</td>
                        

                       
                              


                        </tr>
                        @endforeach
                        @endforeach
                      </tbody>
                      </tbody>
                    </table>
07 Dec
2 years ago
01 Dec
2 years ago

Jayanthkumar left a reply on Make Text Visible And Not Based On Conditions

issue solved

<td><a>@if($cust->payment_status == 1)
                              NOT PAID
                              <a href="<?php echo 'payment/' .$cust-> id  ?>">Make it Paid</a>
                            @elseif ($cust->payment_status == 2)
                              RECEIVED 
                              @endif</a> </td>

Jayanthkumar started a new conversation Make Text Visible And Not Based On Conditions

i need a javascript to show "Make it Paid" visible only if $cust is Not paid or else make "make it paid" text invisible

HOw to do this

@if($cust->payment_status == 1) NOT PAID @elseif ($cust->payment_status == 2) RECEIVED @endif
29 Nov
2 years ago

Jayanthkumar left a reply on Trying To Get Property Of Non-object (View:

hi @snapey and @KhaledSMQ

this is my controller code

 public function passenquiry($id){

        $row = DB::table('customer')->where('id',$id)->first();
        return view('pages.updateenquiry')->with('row',$row);
    dd($row);
      
    }

It is showing null, but that Id is having the value

 public function passenquiry($id){

        $row = DB::table('customer')->where('id',$id)->first();
    dd($row);
      
    }
28 Nov
2 years ago

Jayanthkumar left a reply on Trying To Get Property Of Non-object (View:

From other view the passing value is shown successfully

Jayanthkumar left a reply on Trying To Get Property Of Non-object (View:

@khaledSMQ i am getting the same error...

Jayanthkumar started a new conversation Trying To Get Property Of Non-object (View:

Hi i am passing the values from one view to another view,, my issue is i pass same content from page1 to page3 its working fine if i pass content from page2 to page 3 it is showing this error

ErrorException in 3cfff9bd5709f795b300dbef00c49d4109391b80.php line 24: Trying to get property of non-object (View: /home/jayanthkumar/vinfinet/projects/stock/resources/views/pages/updateenquiry.blade.php)

here is update enquiry code

@extends('layouts.template')
@section('content')


<!-- page content -->
        <div class="right_col" role="main">
            <div class="clearfix"></div>
            <div class="row">              
              <div class="col-md-6 col-sm-6 col-xs-12">
        <h3 style="text-align: center">Enquiry Form</h3>
        <div class="Enquiry-new">
            <form id="enq_validate" action="update_enquiry" method="POST">          
                
                            <div class="form-group">
                            <label for="sel2">Customer type</label>
                                <select name="costumer_type" class="form-control" id="sel2" >
                                  <option value="">--Select--</option>
                                  <option value="1">Farmer</option>
                                  <option value="2">Dealer</option>
                                  <option value="3">Others</option>
                                </select>
                            </div>          
                            <div class="form-group">
                              <label>Customer Name</label>
                              <input name="cusname" type="text"  class="form-control" id="enquirename" placeholder="" value="{{ old('name', $row->name) }}">
                            </div>
                            <div class="form-group">
                              <label>Customer phone number</label>
                              <input name="phone" type="tel" class="form-control" id="enquirenum" placeholder="" value="{{ old('phone', $row->phone) }}">
                            </div>
                           <div class="form-group">
                              <label>Address line1</label>
                              <input name="address1" type="text" class="form-control" id="enquireaddress" placeholder="" value="{{ old('address1', $row->address1) }}">
                            </div>
                            <div class="form-group">
                              <label>Address line2</label>
                              <input name="address2" type="text" class="form-control" id="enquireaddress" placeholder="" value="{{ old('address2', $row->address2) }}"> 
                            </div>
                            <div class="form-group">
                              <label>Pin code</label>
                              <input name="pincode" type="number" class="form-control" id="enquirepin" placeholder="" value="{{ old('PIN_code', $row->PIN_code) }}">
                            </div>
                            <div class="form-group">
                              <label>District</label>
                              <input name="city" type="text" class="form-control" id="enquirecity" placeholder="City" value="{{ old('city', $row->city) }}">
                            </div>
                            <div class="form-group">
                              <label>State</label>
                              <input name="state" type="text" class="form-control" id="enquirestate" placeholder="State" value="{{ old('customerstate', $row->customerstate) }}">
                            </div>
                            <div class="form-group">
                            <label>Email</label>
                            <input name="email" type="email" class="form-control" id="invoiceemail" placeholder="" value="{{ old('email', $row->email) }}">
                            </div>
                            
                            <div class="form-group">
                            <label for="sel1">Enquiry For</label>
                                <select name="seldevice" class="form-control" id="sel1">
                                  <option value="">--Select--</option>
                                  <option value="1">SAMRAT</option>
                                  <option value="2">YUVARAJ</option>
                                  <option value="3">MAHARAJ</option>
                                  <option value="4">SAMANTH</option>
                                  <option value="5">BHEEMA</option>
                                  <option value="6">Dealership</option>
                                </select>
                            </div> 
                            <div class="form-group">
                              <label>Quantity</label>
                              <input name="quantity" type="tel" class="form-control" id="enquirequantity" placeholder="" >
                            </div>
                            <div class="form-group">
                            <label for="sel3">Language</label>
                                <select name="language" class="form-control" id="sel3">
                                  <option value="">--Select--</option>
                                  <option value="1">English</option>
                                  <option value="2">Telugu</option>
                                  <option value="3">Kannada</option>
                                  <option value="4">Tamil</option>
                                  <option value="5">Hindi</option>
                                  <option value="6">Marathi</option>
                                </select>
                            </div> 
                            <div class="form-group">
                            <label for="sel4">Enquired Through:</label>
                                <select name="enquired_through" class="form-control" id="sel4">
                                  <option value="">--Select--</option>
                                  <option value="1">Kisanraja Website</option>
                                  <option value="2">Vinfinet Website</option>
                                  <option value="3">Customer Care</option>
                                  <option value="4">Toll free number</option>
                                  <option value="5">Facebook</option>
                                  <option value="6">You Tube</option>
                                  <option value="7">Amazon</option>
                                  <option value="8">Others</option>
                                </select>
                            </div>
                            <div class="form-group">
                            <label for="sel5">Enquiry Result</label>
                                <select name="result" class="form-control" id="sel5" onchange="showresult(this.value)">
                                  <option value="" disabled selected>--Select--</option>
                                  <option value="1">Follow Up Required</option>
                                  <option value="2">Active Order</option>
                                  <option value="3">Suspened</option>
                                  <option value="9">Error</option>
                                  <option value="5">Cancelled</option>
                                </select>
                            </div>

                            
                            <div class="form-group">
                                  <input name="fallow_up_date" class="form-control" id="fallowupdate" placeholder="MM/DD/YYYY" type="date" />
                            </div> 
                            <div class="form-group">
                                <label for="comment">Comment:</label>
                                <textarea name="comments" class="form-control" rows="5" id="comment"></textarea>
                            </div>

                 <input type="hidden" name="_token" value="{{csrf_token()}}">           
                <button type="submit" class="btn btn-primary">Save</button>

</form>
        </div>
              </div>
            </div>
          </div>
        </div>
        <!-- /page content -->
        @endsection

        <!-- form validation -->

        @section('page-script')
         <script src="../js/formValidation.min.js"></script>
    <script src="../js/form.bootstrap.min.js"></script>
<script type="text/javascript">
    $(document).ready(function() {
        //Form Validation Starts
        $('#enq_validate')
            .formValidation({
                framework: 'bootstrap',
                fields: {
                        costumer_type: {
                      validators: {
                          notEmpty: {
                              message: 'The selection is required'
                          }
                      }
                  },
                    cusname: {
                        validators: {
                            notEmpty: {
                                message: 'The name is required'
                            }
                        }
                    },
                address1: {
                    validators: {
                        notEmpty: {
                            message: 'The address is required'
                        },
                        stringLength: {
                            max: 50,
                            message: 'maximum length is 50 Enter in Next line'
                        }
                    }
                },
                address2: {
                    validators: {
                        stringLength: {
                            max: 50,
                            message: 'maximum length is 50'
                        }
                    }
                },
                pincode: {
                    validators: {
                        notEmpty: {
                            message: 'The pincode is required'
                    },
                        stringLength: {
                            max: 6,
                            message: 'maximum length is 6'
                        }
                }
            },
                city: {
                    validators: {
                        notEmpty: {
                            message: 'The city is required'
                        },
                        stringLength: {
                            max: 100,
                            message: 'maximum length is 100'
                        }
                    }
                },
                state: {
                    validators: {
                        notEmpty: {
                            message: 'The state is required'
                        },
                        stringLength: {
                            max: 100,
                            message: 'maximum length is 100'
                        }
                    }
                },
                phone: {
                    validators: {
                        notEmpty: {
                            message: 'The mobile number is required'
                        },
                        regexp: {
                            message: 'The mobile number can only contain the digits, spaces, -, (, ), + and .',
                            regexp: /^[0-9\s\-()+\.]+$/
                        }
                    }
                },
                email: {
                    validators: {
                        emailAddress: {
                            message: 'Enter valid Email'
                        }
                    }
                },
                   seldevice: {
                      validators: {
                          notEmpty: {
                              message: 'The selection is required'
                          }
                      }
                  },
                quantity: {
                    validators: {
                        notEmpty: {
                            message: 'The quantity is required'
                        },
                        integer: {
                            message: 'The quantity must be a number'
                        }
                    }
                },
                language: {
                      validators: {
                          notEmpty: {
                              message: 'The selection is required'
                          }
                      }
                  },
                  enquired_through: {
                      validators: {
                          notEmpty: {
                              message: 'The selection is required'
                          }
                      }
                  },
                  result: {
                      validators: {
                          notEmpty: {
                              message: 'The selection is required'
                          }
                      }
                  },
                  comments: {
                    validators: {
                        stringLength: {
                            max: 500,
                            message: 'maximum length is 500'
                        }
                    }
                }
                
                  
                 
                }
            })
        //End Form validation
    });


    function showresult(str) {
  if (str == "1") {
    $("#fallowupdate").css('display', 'block');
    return;
  }else{
    $("#fallowupdate").css('display', 'none'); 

  } 
}

</script>
@stopassola 

controller code

   public function passenquiry($id){

        $row = DB::table('customer')->where('id',$id)->first();
        return view('pages.updateenquiry')->with('row',$row);
    }
21 Nov
2 years ago

Jayanthkumar left a reply on Show City Based On State Selected Through The Dropdown

google api is available itseems but i am noth getting how to get it done

Jayanthkumar started a new conversation Show City Based On State Selected Through The Dropdown

i need give select option for selecting state based on the state selected, i need to show city of the state in another select field...how to do this can any one help me for this

09 Nov
2 years ago

Jayanthkumar started a new conversation Pass Value To Input Field

Hi i am doing the convertion from number to word but i am able to alert the value but i need to pass that value to one input field

function numToString(x)
{
var r=0;
var txter=x;
var sizer=txter.length;
var numStr="";
if(isNaN(txter))
{
alert(" Invalid number");
exit();
}
var n=parseInt(x);
var places=0;
var str="";
var entry=0;
while(n>=1)
{
r=parseInt(n%10);

if(places<3 && entry==0)
{
numStr=txter.substring(txter.length-0,txter.length-3) // Checks for 1 to 999.
str=onlyDigit(numStr); //Calls function for last 3 digits of the value.
entry=1;
}

if(places==3)
{
 numStr=txter.substring(txter.length-5,txter.length-3) 
 if(numStr!="")
 {
  str=onlyDigit(numStr)+ " Thousand "+str;
 }
}

if(places==5)
{
 numStr=txter.substring(txter.length-7,txter.length-5) //Substring for 5 place to 7 place of the string
 if(numStr!="")
 {
  str=onlyDigit(numStr)+ " Lakhs "+str; //Appends the word lakhs to it
 }
}

if(places==6)
{
 numStr=txter.substring(txter.length-9,txter.length-7)  //Substring for 7 place to 8 place of the string
 if(numStr!="")
 {
  str=onlyDigit(numStr)+ " Crores "+str;        //Appends the word Crores
 }
}

n=parseInt(n/10);
places++;
}
alert(str);
}

insterd of alert(str);

i need to pass that str to input field which is below

<input type="text" class="form-control" id="amtinword">
07 Nov
2 years ago

Jayanthkumar left a reply on How To Generate Tracking Id And View Status

@tisuchi buy using that number i need to view the page till i delete that order,

Actions should happen in view or page

  1. page1-> enter the tracking no
  2. page2->show his order status and log out option 3.page3->enter the tracking no again this should happen untill that order got successfully delivered, once delivered, delete that tracking number 4.page4->enter the tracking no...if tracking id not present in DB display Invalid Tracking ID...

this is wat my project,,,

Jayanthkumar started a new conversation How To Generate Tracking Id And View Status

In my project i need to generate Tracking Id (Random number) for each order is confirmed, and by that Id customer need to know the staus of order.

In my state i can able place order but not able generate random number or Id, and to give access for based on that id

05 Nov
2 years ago

Jayanthkumar left a reply on Increment Colomn Content By One

DB::table('Enquiry')
            ->where('customer_id', Input::get('customer_id'))
            ->increment('finished', 1);

this worked @InaniELHoussain we need specify count for increment

Jayanthkumar left a reply on Increment Colomn Content By One

@InaniELHoussain this is not working i tried this before....

no changes in DB,program is running successfully but no changes

 $item = DB::table('Enquiry')
            ->where('customer_id', Input::get('customer_id'))->increment('finished');

Jayanthkumar started a new conversation Increment Colomn Content By One

hi i need to increment the value by 1 for this colomn how to do this

$item = DB::table('Enquiry')
            ->where('customer_id', Input::get('customer_id'))
            ->update(['finished' => Input::get('finished + 1']);

finished is the colomn name in the DB i need that to be incremented by one

Jayanthkumar left a reply on Laravel Eloquent

@madala except space it will support both the cases

in your case try to use same format in controller while passing value

ex in the below code i am passing value to DB customer_id & CUSTOMER_NUM is name in DB instered of space i used underscore...

$inveri = new Invoice;
        
        $inveri->customer_id = $request->idnumber;
        $inveri->CUSTOMER_NUM = $request->quatationnum;

Jayanthkumar left a reply on How To Print Project_name Regarding To Project_id

@Amalmax

in that script i am passing the content present in $proj to the view that is where you want to show i.e in view.blade.

EX:

 return view('jayanth', ['custom' => $proj]); 

this code will carry the value with the help of $proj and this will route me to jayanth.blade.php

there i vl use $proj to show the content

this is jayanth.blade.php

<td>{{ $proj->projectname}}</td>

now i vl get projectname displayed in td

Jayanthkumar left a reply on How To Print Project_name Regarding To Project_id

@Amalmax yeah you can use both eloquent and join to make relationship between tables

i gave the example of JOIN

Jayanthkumar left a reply on How To Print Project_name Regarding To Project_id

@Amalmax in route u need to point to some method to the controller ex in route

Route::get("project", "[email protected]");

In controller u have to Join collaborators and project in the show method and need to use ->for selecting which are fields required for you from project table ex: project name,number etc

  public function show()
    {
        $proj = DB::table('collaborators')->join('project', 'collaborators.project_id', '=', 'project.id')->select('collaborators.*', 'project.projectname','project.projectnumber' etc)->get();

        return view('pages.myview', ['custom' => $proj]);  return to your blade view
    }

this code will work for u

03 Nov
2 years ago

Jayanthkumar started a new conversation Combine Two Colomn And Show In One View

i want this address1 and address2 should be shown in one td,, i am new to laravel can i get any solution

<td>{{ "$enq->address1"}}</td
<td>{{ "$enq->address2"}}</td

Jayanthkumar left a reply on Jquery To Concate 2 Fields And Display In Another Field

server side not working @bobbybouwmann

 public function store(Request $request)
    {

        $item = customer::firstOrNew(array('phone' => Input::get('phone')));
        $item->name = Input::get('cusname');
        //$item->address = Input::get('address');
        $item->city = Input::get('city');
        $item->customerstate = Input::get('state');
        $item->email = Input::get('email');
        $item->PIN_code = Input::get('pincode');
        $item->enquiry_r_invoice = '2';

        $request->merge([
        'address' => $request->get('address1') . ' ' . $request->get('address2'),
        ]);

        Model::create($request->all());


        $item->save();

this is my controller code