nuna

nuna

Member Since 5 Months Ago

Experience Points
2,930
Total
Experience

2,070 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
0
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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.

Level 1
2,930 XP
Oct
17
1 week ago
Activity icon

Replied to How To Solve Call To A Member Function Get() On Null Error?

$prod = Product::on('tenant')->with('sub_products')->where('product.id', $val->product_id)->where('product.quantity','<', 1)->get()->toArray();

After I cahnged to this..I am getting the response.Thanks for the help.

Activity icon

Started a new Conversation How To Solve Call To A Member Function Get() On Null Error?

How to solve this error?When I dd prod I get null. But it should have data cuz previous it did.Now suddenky this is happening.DO i need to change anything in the query?

  public function getCartDetails(Request $request)
    {   
        $cart = Cart::where('is_shopped', 0)->where('store_id',config('store-data.main_store.id'))->where('customer_id', auth()->user()->id)->orderBy('id','desc')->first();
        $cart_s =  json_decode($cart['cart_items']);  
      
        if($cart_s){
        
         
        foreach($cart_s  as $key=>$val){  
            if(isset($cart_s->$key->color)){
                $valu = $cart_s->$key->color;
                $prod = SubProduct::on('tenant')->where('is_deleted',0)->where('color_name', $valu)->where('product_id', $val->product_id)->where('quantity','<', 1)->get()->toArray();  
            } else{
                $prod = Product::on('tenant')->with('sub_products')->where('product.id', $val->product_id)->where('product.quantity','<', 1)->first()->get()->toArray(); //Having error at this line
            } 
            if( !empty($prod)  ){ 
              $cart_s->$key->qte = '0'; 
              $cart_s->$key->type = 'oof';  
            }else{ 
              $cart_s->$key->qte = '1'; 
              $cart_s->$key->type = 'false';  
            }
        }
        
        foreach($cart_s  as $key=>$val){  
            if(isset($cart_s->$key->color)){
                $valu = $cart_s->$key->color;
                $prod = SubProduct::on('tenant')->where('color_name', $valu)->where('is_deleted',0)->where('product_id', $val->product_id)->get()->toArray();  
                $prodname = Product::on('tenant')->where('id', $val->product_id)->pluck('name')->first(); 
                //  dd($prod, $prodname); 
                if(!empty($prod)  )
                $prod[0]['name'] = $prodname;
            } else{
                $prod = Product::on('tenant')->where('id', $val->product_id)->where('quantity','>', 1)->get()->toArray();  
            }
           
            if( !empty($prod) ){ 
                if($prod[0]['quantity'] == null){
                    $cart['exceed'] = true;
                    $cart['prod_name'] = $prod[0]['name'] ?? $prodname ;
                    $cart['qte_avail'] = 0; 
                    $cart_s->$key->quantity = 0;  
                    if(isset($cart_s->$key->color)){
                        $cart['coleur'] = $cart_s->$key->color;
                    }
                }else{
                    $cart_s->$key->max_qte = $prod[0]['quantity']; 
                    if($prod[0]['quantity'] < $cart_s->$key->quantity ){ 
                        $cart['exceed'] = true;
                        $cart['prod_name'] = $prod[0]['name'] ?? $prodname ;
                        $cart['qte_avail'] = $prod[0]['quantity']; 
                        $cart_s->$key->quantity = $prod[0]['quantity']; 
                        if(isset($cart_s->$key->color)){
                            $cart['coleur'] = $cart_s->$key->color;
                        }
                        Cart::where('is_shopped', 0)->where('store_id',config('store-data.main_store.id'))->where('customer_id', auth()->user()->id)->orderBy('id','desc')->update(['cart_items' => json_encode($cart_s)]);
                    }
                } 
              }else{ 
                $cart_s->$key->max_qte = '0'; 
              }
        } 
        
        foreach($cart_s  as $key=>$val){ 
            $prod = Product::on('tenant')->where('id', $val->product_id)->where('is_deleted',1)->get()->toArray();
            if(!empty($prod) ){  
                $cart_s->$key->is_deleted = '1';
              }else{ 
                $cart_s->$key->is_deleted = '0';
              } 
              
              if(isset($request->from_product_dt_page)){ 
                  if( $cart_s->$key->type == 'oof'){
                     unset($cart_s->$key);
                     $cart['exceed'] = true;
                     Cart::where('is_shopped', 0)->where('store_id',config('store-data.main_store.id'))->where('customer_id', auth()->user()->id)->orderBy('id','desc')->update(['cart_items' => json_encode($cart_s)]);
                  }
              } 
              
        }
        foreach($cart_s  as $key=>$val){  
            $prod = Product::on('tenant')->where('id', $val->product_id)->where('out_of_stock', 1)->get()->toArray();  
              if( !empty($prod)  ){ 
                $cart_s->$key->type = 'oof'; 
              }
              
        }   
        }
        foreach($cart_s  as $key=>$val){  
            $prod = Product::on('tenant')->where('id', $val->product_id)->where('out_of_stock', 1)->first();  
              if( !empty($prod) ){
                $cart_s->$key->type = 'oof';
              }
              else{  
                $cart_s->$key->type = 'false';
              }
        } 
        
        $cart['cart_items'] = json_encode($cart_s);   
        
        return json_encode($cart);
        
    }
Oct
16
1 week ago
Activity icon

Started a new Conversation Why The Validation Does Not Return Form With Input Value

I am trying to return back the form with the value of by use. But it is not working .Please help


        $rules = [
            'name' => 'required',
            'subject' => 'required',
            'purpose' => 'required',
            'sender_email' => 'required|email',
            'sender_name' => 'required',
           
        ];
        $messages = [
            'name.required' => 'The Name field is required',
     
        ];
        $validator = Validator::make($request->all(), $rules, $messages);
        if ($validator->fails()) {
            return redirect()->back()->withErrors($validator)->withInput();
        }
Activity icon

Started a new Conversation How To Add Ck Editor In Modal

this is a system using modal.One is edit and another is create.When I replace the textarea with ckeditor,it appears only on create but not in the edit.Please help form blade

<div class="form-group">
    <label for="tnc">Terms & Conditions</label>
    <textarea name="tnc" id="tnc" class="form-control">{{ isset($voucher) ? $voucher['tnc'] : '' }}</textarea>
</div>

Model for create and edit

 <div class="modal fade" id="addVoucher" tabindex="-1" role="dialog" aria-labelledby="voucherModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
            <form id="voucherAdd" enctype="multipart/form-data">
              <input type="hidden" name="_token" value="{{ csrf_token() }}">
            <div class="modal-header">
                <h5 class="modal-title" id="voucherModalLabel">Add Voucher</h5>
                <button class="close" type="button" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">×</span>
                </button>
            </div>
            <div class="modal-body">
                @include('voucher.form._form')
            </div>
            <div class="modal-footer">
                <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
                <button class="btn btn-primary" type="submit">Save</button>
            </div>
            </form>
            </div>
        </div>
    </div>

    <div class="modal fade" id="editVoucher" tabindex="-1" role="dialog" aria-labelledby="voucherModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
            <form id="voucherEdit" enctype="multipart/form-data">
              <input type="hidden" name="_token" value="{{ csrf_token() }}">
              <input name="_method" type="hidden" value="PUT">
            <div class="modal-header">
                <h5 class="modal-title" id="voucherModalLabel">Edit Voucher</h5>
                <button class="close" type="button" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">×</span>
                </button>
            </div>
            <div class="modal-body">
                @include('voucher.form._form')
            </div>
            <div class="modal-footer">
                <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
                <button class="btn btn-primary" type="submit">Update</button>
            </div>
            </form>
            </div>
        </div>
    </div>
 CKEDITOR.replace( 'tnc' );     
 
  function editVoucher(id, ele) {
    var voucher_for = $(ele).data('db');
    
    $.ajax({
      method: 'GET',
      url: '{{ url("admin/voucher") }}/'+id+'/edit',
      data: 'voucher_for='+voucher_for
    }).done(function(response) {
      $('#editVoucher').modal('show'); 
      $('#editVoucher .modal-body').html(response);
      CKEDITOR.replace( 'tnc' );     
      $('.v-datepicker').datepicker().bind({
        keydown: function(e) {
            if (e.shiftKey === true ) {
                if (e.which == 9) {
                    return true;
                }
                return false;
            }
            if (e.which==191) {
                return true;
            }
            if (e.which > 57) {
                return false;
            }
            if (e.which==32) {
                return false;
            }
            return true;
        }
      });
    });
  }
Oct
14
1 week ago
Activity icon

Replied to Trying To Get Property 'sub_products' Of Non-object

$productExists = Product::on('tenant')->with(['brand'])->with('sub_products')->where('id', '=', $id)->first(); 

This is the query for productExist


App\Product {#1198 ▼
  #table: "product"
  +timestamps: false
  #connection: "tenant"
  #primaryKey: "id"
  #keyType: "int"
  +incrementing: true
  #with: []
  #withCount: []
  #perPage: 15
  +exists: true
  +wasRecentlyCreated: false
  #attributes: array:44 [▶]
  #original: array:44 [▼
    "id" => 4021
    "code" => null
    "name" => "Foundation"
    "model" => "fg5668"
    "brand_id" => 15
    "category_id" => 53
    "on_sale" => "1"
    "ean13" => null
    "upc" => null
    "fcc_id" => null
    "imei_no" => null
    "serial_no" => null
    "tax_perc" => "3.00"
    "quantity" => 230
    "total_sold" => 0
    "price" => "7000.00"
    "product_description" => null
    "wholesale_price" => "6000.00"
    "selling_price" => "5000.00"
    "discount_amount" => "0.00"
    "location" => null
    "color" => "{"#e3d4bb":"ivory","#ffa100":"oyeb"}"
    "sku" => "[null,null]"
    "width" => "0.00"
    "width_unit" => "0"
    "height" => "0.00"
    "height_unit" => "0"
    "depth" => "0.00"
    "depth_unit" => "0"
    "weight" => "0.00"
    "weight_unit" => "0"
    "scan_serial_no" => "0"
    "scan_imei_no" => "0"
    "out_of_stock" => "0"
    "active" => "1"
    "available_date" => "2020-09-08"
    "expiry_date" => "2021-09-17"
    "is_deleted" => 0
    "img_position" => null
    "created_on" => "2020-09-22 22:01:06"
    "created_by" => 1
    "updated_on" => "2020-09-22 22:01:06"
    "updated_by" => 40760
    "top_seller_status" => "1"
  ]
  #changes: []
  #casts: []
  #dates: []
  #dateFormat: null
  #appends: []
  #dispatchesEvents: []
  #observables: []
  #relations: array:2 [▼
    "brand" => App\ProductBrand {#1113 ▼
      #table: "product_brand"
      #connection: "tenant"
      #primaryKey: "id"
      #keyType: "int"
      +incrementing: true
      #with: []
      #withCount: []
      #perPage: 15
      +exists: true
      +wasRecentlyCreated: false
      #attributes: array:11 [▶]
      #original: array:11 [▶]
      #changes: []
      #casts: []
      #dates: []
      #dateFormat: null
      #appends: []
      #dispatchesEvents: []
      #observables: []
      #relations: []
      #touches: []
      +timestamps: true
      #hidden: []
      #visible: []
      #fillable: []
      #guarded: array:1 [▶]
    }
    "sub_products" => Illuminate\Database\Eloquent\Collection {#1209 ▶}
  ]
  #touches: []
  #hidden: []
  #visible: []
  #fillable: []
  #guarded: array:1 [▶]
}

This is what I get when I dd it

Activity icon

Started a new Conversation Trying To Get Property 'sub_products' Of Non-object

How to fix this error.

$productExists = Product::on('tenant')->with(['brand'])->with('sub_products')->where('id', '=', $id)->first();

    $quantity_check = true;
    if(!empty(json_decode($productExists->sub_products,true))){   (the error is coming from this line)
        foreach(json_decode($productExists->sub_products,true) as $key=> $subProds){ 
            $newColor[$subProds['color']] = $subProds['color_name'];
            if(isset($subProds['quantity']) && $subProds['quantity'] > 0){
                $quantity_check = false;
            } 
        }
Oct
11
2 weeks ago
Activity icon

Started a new Conversation How To Fix If My Application Is Not Working In Microsoft Edge Browser?

My application is working fine in Firefox and chrome but its not working in Microsoft edge. It says not supported. Is there any way to fix this.

Oct
08
2 weeks ago
Activity icon

Started a new Conversation How To Add Border For This Button.I Tried Add Normally But No Luck.

<button type="button" data-id='{{$i}}' title="{{strtoupper($color_name)}}" 
                                    style="margin: 0.5em;background-color:{{$color_code}};{{($subProdQty[$i]['quantity'] <= 0) ? ' opacity:.2;pointer_events: none;':'opacity:1;'}}"
                                    class="color-btn {{($subProdQty[$i]['quantity'] <= 0) ? '':'color-active active'}}" {{($subProdQty[$i]['quantity'] <= 0) ? 'disabled':''}}>
                                    <span style="background-color:{{$color_code}};"></span></button>
~~~
Oct
07
2 weeks ago
Activity icon

Started a new Conversation How To Make The Message Disappear Without The User Refresh The Page?

<div class="col-9 col-xl-9 col-lg-9 pt-4 pr-0">
                        @if($errors->first('success'))
                        <div class="pb-1 text-success">{{ $errors->first('success') }}</div>
                        @endif
                        @if($errors->first('warning'))
                        <div class="pb-1 text-warning">{{ $errors->first('warning') }}</div>
                        @endif
                        <div class="tab-content collapse-inner2 mt-0">
                            <!--My Account-->
                            @include('_partial._myaccount')
                            <!--My Account-->

                            <div class="tab-pane fade text-left" id="myaddresstab" role="tabpanel"
                                aria-labelledby="myaddresstab">
                                <!--My Address-->
                                @include('_partial._address')
                                <!--My Address-->
                            </div>

Right once the condition is succussfull.There is pop up coming out but it stays ther till the user refresh the page.Please help.How to fix this.

Oct
01
3 weeks ago
Activity icon

Replied to How To Send Value As Null In Db?

the field is nullable in the db. this is a joined table.When I send the null value one table is updated and another one is not.I just need to makesure to set the value null iff sys_status = 4.Please help.And One table is set varchar and another is set int.

Activity icon

Started a new Conversation How To Send Value As Null In Db?

if($request->sys_status == 4){
            $sys_statu = 4;
            $role_val == NULL;
        }else{
            $sys_statu = $request->sys_status;
            $role_val = $request->role;
        }
Sep
30
3 weeks ago
Activity icon

Started a new Conversation How To Add Order By Id Desc In This Query?

$resultGetProducts = $dbh->query("SELECT * FROM " . env('DB_DATABASE') . ".allDBProducts ")->fetchAll(PDO::FETCH_ASSOC);

I tried something like this but it returns null

$resultGetProducts = $dbh->query("SELECT * FROM " . env('DB_DATABASE') . ".allDBProducts ORDER BY .id. DESC ")->fetchAll(PDO::FETCH_ASSOC);

Sep
29
3 weeks ago
Activity icon

Replied to How To Change This To Eloquent

Hi the reason I want to change to eloquent is to add new where condition to this query.I have been trying different ways but no luck.Because I taught it will be easier if change to eloquent.

 $query = Role::select(\DB::raw('roles.*, CONCAT(sso_users.first_name, " ", sso_users.last_name) as created_user, 
        sso_role_user.role_id COUNT (*) FROM sso_role_user INNER JOIN sso_users ON sso_role_user.user_id = sso_users.id 
        WHERE role_id = roles.id AND sso_users.sys_status < 4 as total_users '))
        ->where('roles.id', '>', 0);
Activity icon

Started a new Conversation How To Change This To Eloquent

$query = Role::select(\DB::raw('roles.*, CONCAT(sso_users.first_name, " ", sso_users.last_name) as created_user, (SELECT COUNT(sso_role_user.role_id) FROM sso_role_user WHERE role_id = roles.id) AS total_users'))->where('roles.id', '>', 0);

Sep
24
1 month ago
Activity icon

Replied to How To Fix Message: "Undefined Index: Product_id"

Thank you.I taught must do a check with empty function.

Activity icon

Replied to How To Fix Message: "Undefined Index: Product_id"

array(1) { ["store_id"]=> string(1) "1" } { "message": "Undefined index: product_id", "exception": "ErrorException", "file": "/ob1/domains/dCommerce/app/Http/Controllers/TagController.php", "line": 374, "trace": [ { "file": "/ob1/domains/dCommerce/app/Http/Controllers/TagController.php", "line": 374, "function": "handleError", "class": "Illuminate\Foundation\Bootstrap\HandleExceptions", "type": "->" }, { "function": "postAssignProduct", "class": "App\Http\Controllers\TagController", "type": "->" },

It looks like this

Activity icon

Replied to How To Fix Message: "Undefined Index: Product_id"

message: "Undefined index: product_id", exception: "ErrorException",…} exception: "ErrorException" file: "/ob1/domains/dCommerce/app/Http/Controllers/TagController.php" line: 373 message: "Undefined index: product_id" trace: [{file: "/ob1/domains/dCommerce/app/Http/Controllers/TagController.php", line: 373,…},…]

line 373 starts at the foreach loop.

Activity icon

Started a new Conversation How To Fix Message: "Undefined Index: Product_id"

public function postAssignProduct(Request $request)
    {
            
        $old = apiRequest('tag/showtag', ['id' => $request->id, 'store_id' => $request->store_id]);
    

        $response = apiRequest('tag/post-assign-product', $request->except('_token'));

        $auth = AuthUser()['id'];
        $data2 = $request->except('_token', 'id');
        $data2['product_assigned'] = [];
        foreach ($data2['product_id'] as $value) {
            $data2['product_assigned'][] = getProductName($data2['store_id'], $value);
        };
        $data2['product_assigned'] = implode(", ", $data2['product_assigned']);
        unset($data2['product_id']);
        

        $tag = "TagAssign: ".$old['tag']['name'];
        $auditing = auditCreate('App\TagAssign', $data2, $auth, $tag);
        return $response;
    }

I am getting this error.When try to use empty function is says invalid argument for foreach loop.Please help

Sep
15
1 month ago
Activity icon

Started a new Conversation How To Make The Total Price Column Same As The Html. Please Help.

<td style="padding:7px 0">
		<font size="2" face="Open-sans, sans-serif" color="#555454">
			<table class="table table-recap" bgcolor="#ffffff" style="width:100%;border-collapse:collapse"><!-- Title -->
				<tr>
					<!-- <th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Reference</th> -->
					<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;" width="50%">Product</th>
					<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;" width="25%">Unit price</th>
					<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;" width="25%">Quantity</th>
					<th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;" width="25%">Total price</th>
				</tr>
				<tr>
					<td colspan="5" style="border:1px solid #D6D4D4;text-align:center;color:#777;padding:7px 0">
						&nbsp;&nbsp;@@html 
					</td>
				</tr>
			
			
				<tr class="conf_body">
					<td bgcolor="#f8f8f8" colspan="4" style="border:1px solid #D6D4D4;color:#333;padding:7px 0">
						<table class="table" style="width:100%;border-collapse:collapse">
							<tr>
								<td width="10" style="color:#333;padding:0">&nbsp;</td>
								<td align="right" style="color:#333;padding:0">
									<font size="2" face="Open-sans, sans-serif" color="#555454">
										<strong>Discounts</strong>
									</font>
								</td>
								<td width="10" style="color:#333;padding:0">&nbsp;</td>
							</tr>
						</table>
					</td>

https://imgur.com/IDHf4HM

I want to make the length of total price is same siaze as the @@discount one.

Sep
09
1 month ago
Activity icon

Started a new Conversation How To Output Last 3 Digits From Number?

Currently I am getting the output as 711011

But I only wants to output it as 011

{{substr($order->order_id, -3) ?? ''}}

I tried the above but not working.Please help

Sep
08
1 month ago
Activity icon

Replied to How To Position Nicely Data From Foreach Loop?

Thank you...it worked

Activity icon

Started a new Conversation How To Position Nicely Data From Foreach Loop?

	<header>
			<address>
				<p>hello/p>
				<p>hello/p>
				<p>hello,</p>
				<p>hello</p>
				<p>hello</p>
				<p>Tel : 03-6768778686</p>
			
			</address>
			@foreach($address as $addresses)
      		<address>
			  
	  			<p>{{strtoupper($addresses->type_bill_ship). __(' ADDRESS ') }}</p>
				<p>{{$customer->first_name.' '.$customer->last_name}}</p>
				<p>{{$addresses->address1.', '.$addresses->city.', '.$addresses->state.', '.$addresses->country.' '.$addresses->postcode}}</p>
				<p>Contact :
                                        {{$customer->mobile_number}}</p>
			</address>

Right now its coming out like this.link provided. https://imgur.com/BWPCxcf

The shipping address should be in same line with billing address Please help

<style>
		/* reset */

*
{
	border: 0;
	box-sizing: content-box;
	color: inherit;
	font-family: inherit;
	font-size: 12px;
	font-style: inherit;
	font-weight: inherit;
	line-height: inherit;
	list-style: none;
	margin: 0;
	padding: 0;
	text-decoration: none;
	vertical-align: top;
}

/* content editable */

/* *[contenteditable] { border-radius: 0.25em; min-width: 1em; outline: 0 }
*[contentediaddresstable] { border-radius: 0.25em; min-width: 1em; outline: 0; padding-left:80px; }

*[contenteditable] { cursor: pointer; }

*[contenteditable]:hover, *[contenteditable]:focus, td:hover *[contenteditable], td:focus *[contenteditable], img.hover { background: #DEF; box-shadow: 0 0 1em 0.5em #DEF; }

span[contenteditable] { display: inline-block; } */
p {
    margin-top: 0;
    margin-bottom: 0rem;
	margin-left: 547px;
}


/* heading */

h1 { font: bold 100% sans-serif; letter-spacing: 0.5em; text-align: center; text-transform: uppercase; }
h2 { font: bold 100% sans-serif; letter-spacing: 0.5em; text-align: right; text-transform: uppercase;  }

/* table */

table { font-size: 75%; table-layout: fixed; width: 100%; margin-right: 69px; }
table { border-collapse: separate; border-spacing: 2px; }
th, td { border-width: 1px; padding: 0.5em; position: relative; text-align: left; }
th, td { border-radius: 0.25em; border-style: solid; }
th { background: #EEE; border-color: #BBB; }
td { border-color: #DDD; }

/* page */

html { font: 16px/1 'Open Sans', sans-serif; overflow: auto; padding: 0.5in; }
html { background: #999; cursor: default; }

body { box-sizing: border-box; height: 11in; margin: 0 auto; overflow: hidden; padding: 0.5in; width: 8.5in; }
body { background: #FFF; border-radius: 1px; box-shadow: 0 0 1in -0.25in rgba(0, 0, 0, 0.5); }

/* header */

header { margin: 0 0 3em; }
header:after { clear: both; content: ""; display: table; }

header h1 { background: #000; border-radius: 0.25em; color: #FFF; margin: 0 0 1em; padding: 0.5em 0; }
header address { float: left; font-size: 75%; font-style: normal; line-height: 1.25; margin: 0px 71px 1em 35px; }
header address p { margin: 0 -17px 0.25em; }
header span, header img { display: block; float: right; }
header span { margin: 0 0 1em 1em; max-height: 25%; max-width: 60%; position: relative; }
header img { max-height: 100%; max-width: 100%; }
header input { cursor: pointer; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; height: 100%; left: 0; opacity: 0; position: absolute; top: 0; width: 100%; }

/* article */

article, article address, table.meta, table.inventory { margin: 0 0 3em; }
article:after { clear: both; content: ""; display: table; }
article h1 { clip: rect(0 0 0 0); position: absolute; }

article address { float: left; font-size: 125%; font-weight: bold; }

/* table meta & balance */

table.meta, table.balance { float: right; width: 36%; }
table.meta:after, table.balance:after { clear: both; content: ""; display: table; }

/* table meta */

table.meta th { width: 40%; }
table.meta td { width: 60%; }

/* table items */

table.inventory { clear: both; width: 100%; }
table.inventory th { font-weight: bold; text-align: center; }

table.inventory td:nth-child(1) { width: 26%; }
table.inventory td:nth-child(2) { width: 38%; }
table.inventory td:nth-child(3) { text-align: center; width: 50px; }
table.inventory td:nth-child(4) { text-align: center; width: 12%; }
table.inventory td:nth-child(5) { text-align: center; width: 12%; }

/* table balance */

table.balance th, table.balance td { width: 50%; }
table.balance td { text-align: right; }

table.detail th, table.detail td { width: 50%; }
table.detail td { text-align: right; }

/* aside */

aside h1 { border: none; border-width: 0 0 1px; margin: 0 0 1em; }
aside h1 { border-color: #999; border-bottom-style: solid; }

/* javascript */

.add, .cut
{
	border-width: 1px;
	display: block;
	font-size: .8rem;
	padding: 0.25em 0.5em;	
	float: left;
	text-align: center;
	width: 0.6em;
}

.add, .cut
{
	background: #9AF;
	box-shadow: 0 1px 2px rgba(0,0,0,0.2);
	background-image: -moz-linear-gradient(#00ADEE 5%, #0078A5 100%);
	background-image: -webkit-linear-gradient(#00ADEE 5%, #0078A5 100%);
	border-radius: 0.5em;
	border-color: #0076A3;
	color: #FFF;
	cursor: pointer;
	font-weight: bold;
	text-shadow: 0 -1px 2px rgba(0,0,0,0.333);
}

.add { margin: -2.5em 0 0; }

.add:hover { background: #00ADEE; }

.cut { opacity: 0; position: absolute; top: 0; left: -1.5em; }
.cut { -webkit-transition: opacity 100ms ease-in; }

tr:hover .cut { opacity: 1; }

@media print {
	* { -webkit-print-color-adjust: exact; }
	html { background: none; padding: 0; scale:}
	body { box-shadow: none; margin: 0; }
	span:empty { display: none; }
	
	
}

@page { margin: 0; }
		</style>


The css is like this

Sep
02
1 month ago
Activity icon

Started a new Conversation How To Solve Uncaught TypeError?

https://imgur.com/HMCbbnQ

How to solve the this error.This error is inside the plugin file

acquireContext: function(t, e) {
            "string" == typeof t ? t = document.getElementById(t) : t.length && (t = t[0]),
            t && t.canvas && (t = t.canvas);
            var i = t && t.getContext && t.getContext("2d");
            return this._ensureLoaded(),
            i && i.canvas === t ? (function(t, e) {
                var i = t.style
                  , n = t.getAttribute("height")
                  , a = t.getAttribute("width");
                if (t[_e] = {
                    initial: {
                        height: n,
                        width: a,
                        style: {
                            display: i.display,
                            height: i.height,
                            width: i.width
                        }
                    }
                },
                i.display = i.display || "block",
                null === a || "" === a) {
                    var o = De(t, "width");
                    void 0 !== o && (t.width = o)
                }
                if (null === n || "" === n)
                    if ("" === t.style.height)
                        t.height = t.width / (e.options.aspectRatio || 2);
                    else {
                        var r = De(t, "height");
                        void 0 !== o && (t.height = r)
                    }
            }(t, e),
            i) : null
        },

https://imgur.com/Mkj6CmB

The source from browser tab

Sep
01
1 month ago
Activity icon

Replied to How To Do Display Message If The Output Is Empty?

Thank you...its working now...Sorry to ask...can you explain why you are saying this is a bit belt and braces ya?

Activity icon

Replied to How To Do Display Message If The Output Is Empty?

Illuminate\Database\Eloquent\Collection {#1677 ▼ #items: [] }

Yes it is..I dd it just now

Activity icon

Replied to How To Do Display Message If The Output Is Empty?


                            <div class="tab-pane fade text-left" id="mynotificationstab" role="tabpanel"
                                aria-labelledby="mynotificationstab">
                                <div class="col-lg-12">
                                    <span class="modal-sub-h d-block mb-4 mt-3 text-left font14"><img
                                            src="./images/notifications.png" class="img-fluid mr-2" alt="">MY
                                        NOTIFICATIONS</span>
                                    @if(!empty($notifications))
                                    <table class="table table-bordered" id="tableNotication">
                                        <tbody>
                                            @foreach($notifications as $notification)
                                            <tr class="notify-count @if($loop->iteration > 5) d-none @endif">
                                                <td class="color-g font12" width="100">
                                                    {{\Carbon\Carbon::parse($notification->created_on)->format('d-m-Y')}}
                                                </td>
                                                <td class="font12 color-g">{{$notification->message}}</td>
                                            </tr>
                                            @endforeach
                                        </tbody>
                                    </table>
                                    @else
                                    <div> Currently there in no notification</div>
                                    <a class="float-right color-b show-all" href="#">SHOW ALL</a>
                                    @endif
                                </div>
                            </div>

If I do this way....nothing comes out when there is no notification.

Activity icon

Replied to How To Do Display Message If The Output Is Empty?

<div class="tab-pane fade text-left" id="mynotificationstab" role="tabpanel"
                                aria-labelledby="mynotificationstab">
                                <div class="col-lg-12">
                                    <span class="modal-sub-h d-block mb-4 mt-3 text-left font14"><img
                                            src="./images/notifications.png" class="img-fluid mr-2" alt="">MY
                                        NOTIFICATIONS</span>
                                    @if(!empty($notifications))
                                    <div> Currently there is no notification</div>
                                    @else
                                    <table class="table table-bordered" id="tableNotication">
                                        <tbody>
                                            @foreach($notifications as $notification)
                                            <tr class="notify-count @if($loop->iteration > 5) d-none @endif">
                                                <td class="color-g font12" width="100">
                                                    {{\Carbon\Carbon::parse($notification->created_on)->format('d-m-Y')}}
                                                </td>
                                                <td class="font12 color-g">{{$notification->message}}</td>
                                            </tr>
                                            @endforeach
                                        </tbody>
                                    </table>
                                    <a class="float-right color-b show-all" href="#">SHOW ALL</a>
                                    @endif
                                </div>
                            </div>

Hi, I tried the following, but its only showing Currently there is no notification even though there is notification.Is anything wrong I did?

Activity icon

Started a new Conversation How To Do Display Message If The Output Is Empty?

<div class="tab-pane fade text-left" id="mynotificationstab" role="tabpanel"
                                aria-labelledby="mynotificationstab">
                                <div class="col-lg-12">
                                    <span class="modal-sub-h d-block mb-4 mt-3 text-left font14"><img
                                            src="./images/notifications.png" class="img-fluid mr-2" alt="">MY
                                        NOTIFICATIONS</span>
                                    @if(!$notifications)
                                    &nbsp;&nbsp;&nbsp;&nbsp;<span> Currently there is no notification</span>
                                    @endif
                                    @if(!empty($notifications))
                                    <table class="table table-bordered" id="tableNotication">
                                        <tbody>
                                            @foreach($notifications as $notification)
                                            <tr class="notify-count @if($loop->iteration > 5) d-none @endif">
                                                <td class="color-g font12" width="100">
                                                    {{\Carbon\Carbon::parse($notification->created_on)->format('d-m-Y')}}
                                                </td>
                                                <td class="font12 color-g">{{$notification->message}}</td>
                                            </tr>
                                            @endforeach
                                        </tbody>
                                    </table>
                                    <a class="float-right color-b show-all" href="#">SHOW ALL</a>
                                    @endif
                                </div>
                            </div>

When the notification is empty it should display there is no notification currently?I did if statement but its not working please help

Aug
28
1 month ago
Activity icon

Replied to How To Change Value Of Colorpicker Input To Hex Format In Laravel Blade

okay solved. It was because I placed the j query after edit ajax function.Thank you

Activity icon

Replied to How To Fix This Mysql Error?

Yes...that was cause it was not working.Now it works. after I removed the empty

Activity icon

Replied to How To Change Value Of Colorpicker Input To Hex Format In Laravel Blade

Okay I have managed to convert it to hex format Jquery

$("#color").spectrum({
      preferredFormat: "hex",
    showInput: true,
    showPalette: true,
    palette: [["red", "rgba(0, 255, 0, .5)", "rgb(0, 0, 255)"]]
});

in blade

<input type="text" class="form-control colorpicker" name="color" value="{{ isset($tag) ? $tag['color'] : '' }}" id="color">

but now my problem is, this is a popup.the color picker is only working in create. But when edit its not coming.Is it because of the id?

Aug
27
1 month ago
Activity icon

Replied to How To Change Value Of Colorpicker Input To Hex Format In Laravel Blade

Sorry for the late reply.I have found the jquery finally.I did like this.but its still saving in hsv format

<div class="row">
    <div class="col-md-12">
        <div class="form-group">
            <label for="color">Color<span style="color: #F00"> *</span></label>
            <!-- <input type="text" class="form-control" name="color" value="{{ isset($tag) ? $tag['color'] : '' }}"> -->
            <input type="text" class="form-control colorpicker" name="color" value="{{old('color')}}" id="color">
            <input type="text" class="form-control color_value" value="{{ isset($tag) ? $tag['color'] : '' }}" disabled>

        </div>
    </div>
</div>
@if (isset($tag))
    <input type="hidden" value="{{ $tag['id'] }}" name="id">
@endif

<script>


  $(".colorpicker").spectrum({
        allowEmpty: true,
        move: function (color) {
            $(this).parent().parent().next().find('.color_value').val(color.toHexString());
        }
    });

</script>
Aug
26
2 months ago
Activity icon

Replied to How To Fix This Mysql Error?

This is the code that causing the error

public function report(Request $request)
    {   
        // if(!Schema::hasTable('spendtrendReport')){ 
        //     Artisan::call('migrate:reset --path=/database/migrations/2020_02_23_055625_create_spendtrend_report_view.php');
        //     Artisan::call('migrate --path=/database/migrations/2020_02_23_055625_create_spendtrend_report_view.php'); 
        // }
        $fromDate = $request->from_date = '';
        $toDate = $request->to_date = '';
         
        $spendingTrend = DB::select(DB::raw("CALL `spending-trend`('". $request->store_name . "','". 
        $request->brand_name . "','" . $request->product_name . "','" . $request->priceRange . "',
        '" . $request->campaign_name . "','". $request->paymentMode . "','". $request->payStatus . "'
        ,'". $fromDate . "','". $toDate . "','". $request->campaignType . "','". $request->priceMin ."','". $request->priceMax ."','". $request->tenure ."')"));

        return response()->json($spendingTrend);
    }

Activity icon

Started a new Conversation How To Fix This Mysql Error?

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND tenure ='6'' at line 5 (SQL: CALL spending-trend('','','','', ◀ '','','' ,'','','','','','6')) """

Aug
21
2 months ago
Activity icon

Started a new Conversation How To Add Validation To Drag And Drop Input In Laravel

<fieldset class="form-group">    	
                            <legend>Images<span style='color:white;'>*</span></legend>
                            <div class="container" style='padding: 3%;'>
                                <div class="dropzone dz-clickable" name = "images_data" id="myDrop" style="min-height: 254px;">
                                    <div class="dz-default dz-message" data-dz-message="">
                                        <span>Drop files here to upload</span>
                                    </div>
                                </div>
                                <input type="button" id="add_file" value="Add" class="btn btn-primary mt-3" hidden="">
                            </div>
                        </fieldset>

Right now for normal input it is done this way and its working fine.

<div class="col-md-4">
                                    <div class="form-group">
                                        <label>Cost Price<span class="text-danger">*</span></label>
                                        <input type="text" class="form-control price price-two-decimal-val decimals_inputs" autocomplete="off" name="cost_price" value="{{old('cost_price')}}" id="cost_price">
                                        <span class="text-danger error decimals_inputs_messages"></span>
                                        @error('cost_price')
                                        <span class="text-danger error">{{ $message }}</span>
                                        @enderror
                                    </div>

When implement same thing for drag and drop its not working please help.

Aug
19
2 months ago
Activity icon

Replied to How To Do A Success Popup If The ValidateFormAdd Is True?

function validateFormAdd(formName) {
    $("#"+formName).validate({
      rules: {
        name: {
            required: true,
            maxlength: 100,
        },
        store_id: {
            required: true,
        },
        code: {
            required: true,
            maxlength: 100,
        },
        description: {
            maxlength: 255,
        },

        success: function(label) {
             showToastr('Created', 'Tag Created Successfully!', 'success');
        }else{
showToastr('Unsuccessful', 'Tag could not be Created!', 'info');
}


      },
    });
  }

Hi, I tried this method.but its not showing anyhing..

Activity icon

Started a new Conversation How To Do A Success Popup If The ValidateFormAdd Is True?

$(document).ready( function(){
    $('.brand-form-validation').on('click', function(e) {
        e.preventDefault();      
        validateFormAdd('add_brand').done(function(response){
            if (response.status == true) {
                showToastr('Created', 'Tag Created Successfully!', 'success');
            }else {
                showToastr('Unsuccessful', 'Tag could not be Created!', 'info');
            }
        }
    });

    $('#add_brand').keyup( function(e) {
        e.preventDefault();      
        validateFormAdd('add_brand');
    });

});

The function for the validate form

function validateFormAdd(formName) {
    $("#"+formName).validate({
      rules: {
        name: {
            required: true,
            maxlength: 100,
        },
        store_id: {
            required: true,
        },
        code: {
            required: true,
            maxlength: 100,
        },
        description: {
            maxlength: 255,
        },
      },
    });
  }
Aug
18
2 months ago
Activity icon

Replied to How To Change Value Of Colorpicker Input To Hex Format In Laravel Blade

There is no js code I could find.Right one page is already there with color picker...I need to implement the same thing to another page.If yo want I can show that here.

Activity icon

Replied to How To Change Value Of Colorpicker Input To Hex Format In Laravel Blade

<link href="{{ asset('admin/plugins/spectrum/spectrum.css') }}" rel="stylesheet">

I think this is the one

Activity icon

Started a new Conversation How To Change Value Of Colorpicker Input To Hex Format In Laravel Blade

 <input type="text" class="form-control colorpicker" name="color" value="{{ isset($tag) ? $tag['color'] : '' }}">

Right now it is taking hsv(165, 92%, 62%) in this format please help.

Aug
17
2 months ago
Activity icon

Replied to Why Its Taking Not Sorting Properly

if($search[9] != ''){
                            $innerQuery->where('orders.status' ,$search[9]  );
                        } 

Am I have to do ASC at the order.satatua?

Activity icon

Started a new Conversation Why Its Taking Not Sorting Properly

https://imgur.com/mJqAyPU

When I serch processing it is taking values for canncelled and refund subbitted


else if (i == 9) {
        var title = $(this).text();
        $(this).html( '<select name="filter-status" id="filter-status" class="form-control"><option value="">Select a Status</option><option value="1">Processing</option><option value="2">Pending Payment</option><option value="3">Failed</option><option value="4">Fully Verified</option><option value="6">Courier pickup</option><option value="8">Received by customer</option><option value="9">Cancellation Submitted</option><option value="10">Refund submitted</option><option value="11">Cancelled</option></select>' );
        $('.select2').select2();
        $( 'select', this ).on( 'change', function () {
          if ( table.column(i).search() !== this.value ) {
            table
              .columns(i)
              .search( this.value )
              .draw();
          }
        });
      }
Activity icon

Replied to How To Reduce Table Width?

Thank you so much...I am new i using datatables

Activity icon

Replied to How To Reduce Table Width?

The javascript for the table is like this.


var table = $('#categoryTable').DataTable();
    $('#categoryTable thead tr').clone(true).appendTo( '#categoryTable thead' );
    $('#categoryTable thead tr:eq(1) th').each( function (i) {
      
      if(i == 5){
        var title = $(this).text();
        $(this).html( '<select name="status" id="status" class="select2"><option value="">Select Status</option><option value="Active">Active</option><option value="Inactive">Inactive</option></select>' );
        $('.select2').select2();
        $(this).removeClass('sorting');
        $( 'select', this ).on( 'change', function () {
          if ( table.column(i).search() !== this.value ) {
            table
            .columns(i)
            .search( this.value )
            .draw();
          }
        });
      }
	  else if(i == 4){
        var title = $(this).text();
        $(this).html( '<select name="category" id="category" class="select2"><option value="">Select Type</option><option value="Main category">Main category</option><option value="Category">Category</option><option value="Sub category">Sub category</option></select>' );
        $('.select2').select2();
        $(this).removeClass('sorting');
        $( 'select', this ).on( 'change', function () {
          if ( table.column(i).search() !== this.value ) {
            table
            .columns(i)
            .search( this.value , false, false, false )
            .draw();
          }
        });
      } 
	  else if(i == 6){
        var title = $(this).text();
        $(this).html( '<select name="displayed" id="displayed" class="select2"><option value="">Select Status</option><option value="Yes">Yes</option><option value="No">No</option></option><option value="Not Applicable">Not Applicable</option></select>' );
        $('.select2').select2();
        $(this).removeClass('sorting');
        $( 'select', this ).on( 'change', function () {
          if ( table.column(i).search() !== this.value ) {
            table
            .columns(i)
            .search( this.value )
            .draw();
          }
        });
      } 
	  else if (i !== 7 && i !== 10 && i !== 1) {
        var title = $(this).text();
          $(this).html( '<input type="text" class="form-control" style="width: 200px" placeholder="'+title+'" />' );
    
        $( 'input', this ).on( 'keyup change', function () {
          if ( table.column(i).search() !== this.value ) {
            table
              .columns(i)
              .search( this.value )
              .draw();
          }
        });
      } else {
        $(this).removeClass('sorting');
        $(this).html( '' );
      }
      $(this).find('input').unwrap().wrap('<td/>');
    });
});
Activity icon

Started a new Conversation How To Reduce Table Width?

https://imgur.com/hfECAnf

How can I reduce the width of the collumn only for No. and the store increase the width.Please help.This table is using datable.I tried using inline css and columndef but its not working.