KikoLdasd

Member Since 1 Year Ago

Experience Points
3,650
Total
Experience

1,350 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.

  • Community Pillar

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

Level 1
3,650 XP
Apr
05
1 week ago
Activity icon

Started a new Conversation Syntax Error, Unexpected '}', Expecting ')'

What are be the problem here?

<div class="carousel-item active" style="background-image: url({{asset('storage/{{$md->id}}/{{$md->file_name}}')}})">


Mar
15
4 weeks ago
Activity icon

Replied to Create And Save Don`t Does Not Occur

I create in this url ?viaResource=campaigns&viaResourceId=13&viaRelationship=campaignStocks with via resources Does it have connection beetwen?

{dusk:"update-and-continue-editing-button",disabled:e.isWorking,processing:e.wasSubmittedViaUpdateResourceAndContinueEditing},
Activity icon

Replied to Create And Save Don`t Does Not Occur

So in some pages I have the create button and add another in some not What is the reason? @mostafagamal

Activity icon

Started a new Conversation Create And Save Don`t Does Not Occur

For example, I edit on a page, I go into it and I have a "Create premium" button on that page, don't I have this button? What is the specific reason? That it's a subpage of a page? Or is it a rule to have that button appear? In fields I have this

 public function fields(Request $request)
    {
        return [
            // ID::make()->sortable()->onlyOnForms(),
            BelongsTo::make(__('Fields.Campaign'),'Campaign','App\Nova\Campaign')->searchable(),
         //  BelongsTo::make('Campaign')->searchable(),
            BelongsTo::make(__('Fields.Prize'),'Prize','App\Nova\Prize'),
            Number::make(__('Fields.Stock'),'stock')->sortable()->min(0),
            Number::make(__('Fields.MinStockNotification'),'min_stock_notification')->sortable()->min(0),
        ];
    }
Mar
13
1 month ago
Activity icon

Replied to Module Not Found: Error: Can't Resolve

 "scripts": {
    "dev": "npm run development",
    "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch": "npm run development -- --watch",
    "watch-poll": "npm run watch -- --watch-poll",
    "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
    "prod": "npm run production",
    "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
  },
  "devDependencies": {
    "axios": "^0.19",
    "bootstrap": "^4.0.0",
    "cross-env": "^7.0.3",
    "jquery": "^3.2",
    "laravel-mix": "^5.0.9",
    "lodash": "^4.17.13",
    "popper.js": "^1.12",
    "resolve-url-loader": "^2.3.1",
    "sass": "^1.32.8",
    "sass-loader": "^8.0.2",
    "vue": "^2.5.17",
    "vue-template-compiler": "^2.6.10"
  },
mix.js('resources/js/app.js', 'dist')
    .sass('resources/sass/app.scss', 'dist')
    .setPublicPath('dist');
<div id="app">
                                            <chat-component :messages="messages"></chat-component>
                                            <chat-form v-on:messagesend="addMessage" :user="{{ Auth::user() }}"></chat-form>
                                            </div>

@apex1

Activity icon

Replied to Module Not Found: Error: Can't Resolve

Now I get this error: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.

But component have name ..

Activity icon

Replied to Module Not Found: Error: Can't Resolve

same problem

* ./components/ChatMesssages.vue in ./resources/js/app.js
       Asset     Size   Chunks             Chunk Names
/css/app.css  179 KiB  /js/app  [emitted]  /js/app
  /js/app.js  1.6 MiB  /js/app  [emitted]  /js/app

ERROR in ./resources/js/app.js
Module not found: Error: Can't resolve './components/ChatMesssages.vue' in 'C:\xampp\htdocs\bruteForce\resources\js'
 @ ./resources/js/app.js 21:31-72
 @ multi ./resources/js/app.js ./resources/sass/app.scss
npm ERR! code ELIFECYCLE
Activity icon

Started a new Conversation Module Not Found: Error: Can't Resolve

Hello, I use Laravel mix for Vue, I have all components in components folder In app.js I import all components

Vue.component('example-component', require('./components/ExampleComponent.vue').default);
Vue.component('chat-messages', require('./components/ChatMesssages.vue'));
Vue.component('chat-form', require('./components/ChatForm.vue'));

But I get this error when put chat-message and chat-form. Without all is good What are will be the problem?

@ ./resources/js/components/ChatForm.vue?vue&type=template&id=6fb73fa7& 1:0-212 1:0-212
 @ ./resources/js/components/ChatForm.vue
 @ ./resources/js/app.js
 @ multi ./resources/js/app.js ./resources/sass/app.scss

ERROR in ./resources/js/app.js
Module not found: Error: Can't resolve './components/ChatMesssages.vue' in 'C:\xampp\htdocs\bruteForce\resources\js'
 @ ./resources/js/app.js 21:31-72
 @ multi ./resources/js/app.js ./resources/sass/app.scss
Mar
12
1 month ago
Activity icon

Started a new Conversation Nova Saves And Returns To The Same Creative Page

Hi, how can I make a button in the nova where I save and still return to the same page to create something else? For example, create and continue to create

Mar
08
1 month ago
Activity icon

Started a new Conversation Product 0 Stock Alert

Hi, I have a cron that runs on multiple alerts and I wanted to implement an alert for stock 0. how can i do in sql to see if i have 0 stock on a product? I tried this My product table name is "product"

select from product where product.stoc = 0

Is it ok for this command to run to detect if a product is 0? I use sqlDoQuery in php core

$sql->doQuery("SELECT FROM product wheere product.stoc = 0");
if($sql->rows)
... email
Mar
01
1 month ago
Activity icon

Started a new Conversation Sum Of Subelements Of Array

Hi, I have for example 4 elements in an array and each has sub-elements. For example I want to access under the element quantity and take the quantity from all 4 and calculate it in a variable for example

 this.cartItems.forEach(element => console.log(element.quantity))
How can I get all quantity from all elements and make a sum?
element1 from array - >element.quantity = 4
element2 from array - >element.quantity = 5
sum = 9
Activity icon

Started a new Conversation Simplify Code

$area1 = 'HU';
        
        $area2 = array('CZ', 'SK', 'SI', 'BG', 'RS');
        
        $area3 = array('PL', 'DE', 'CH', 'NL',
                        'LI', 'AT', 'IT', 'HR');
                        
        $area4 = array('DK', 'FR', 'UK', 'IE', 'SM',
                        'VA', 'MC', 'PT', 'ES', 'IC');
                        
        $area5 = array('GR', 'AD', 'GI', 'SE', 'FI', 'NO',
                        'MT', 'CY', 'EE', 'LT', 'LV', 'TR');

        switch ($cart->shipping_address->country)
        {
            case $area1:
                if ($weight > 2 && $weight < 3) {
                    $object->price = 30;
                    $object->base_price = 30;   
                } else if($weight > 3 && $weight < 5) {
                    $object->price = 44;
                    $object->base_price = 44; 
                } else if($weight > 5 && $weight < 10) {
                    $object->base_price = 54; 
                } else if($weight > 10 && $weight < 15) {
                    $object->base_price = 61; 
                } else if($weight > 15 && $weight < 20) {
                    $object->base_price = 67; 
                } else if($weight > 20 && $weight < 25) {
                    $object->base_price = 76; 
                }  else if($weight > 25 && $weight < 30) {
                    $object->base_price = 83; 
                } else if($weight > 30 && $weight < 40) {
                    $object->base_price = 90; 
                }  else if($weight == 40) {
                    $object->base_price = 109; 
                }
            break;

            case array_search($cart->shipping_address->country, $area2):
               if ($weight > 2 && $weight < 3 || $weight < 2) {
                    $object->base_price = 36;   
                } else if($weight > 3 && $weight < 5) {
                    $object->base_price = 58; 
                } else if($weight > 5 && $weight < 10) {
                    $object->base_price = 71; 
                } else if($weight > 10 && $weight < 15) {
                    $object->base_price = 82; 
                } else if($weight > 15 && $weight < 20) {
                    $object->base_price = 89; 
                } else if($weight > 20 && $weight < 25) {
                    $object->base_price = 101; 
                }  else if($weight > 25 && $weight < 30) {
                    $object->base_price = 110; 
                } else if($weight > 30 && $weight < 40) {
                    $object->base_price = 120; 
                }  else if($weight == 40) {
                    $object->base_price = 147; 
                }
            break;

            case array_search($cart->shipping_address->country, $area3): 
               if ($weight > 2 && $weight < 3 || $weight < 2) {
                    $object->base_price = 44;   
                } else if($weight > 3 && $weight < 5) {
                    $object->base_price = 73; 
                } else if($weight > 5 && $weight < 10) {
                    $object->base_price = 89; 
                } else if($weight > 10 && $weight < 15) {
                    $object->base_price = 102; 
                } else if($weight > 15 && $weight < 20) {
                    $object->base_price = 111; 
                } else if($weight > 20 && $weight < 25) {
                    $object->base_price = 125; 
                }  else if($weight > 25 && $weight < 30) {
                    $object->base_price = 138; 
                } else if($weight > 30 && $weight < 40) {
                    $object->base_price = 149; 
                }  else if($weight == 40) {
                    $object->base_price = 184; 
                }
            break;

            case array_search($cart->shipping_address->country, $area4): 
                if ($weight > 2 && $weight < 3 || $weight < 2) {
                    $object->base_price = 53;   
                } else if($weight > 3 && $weight < 5) {
                    $object->base_price = 88; 
                } else if($weight > 5 && $weight < 10) {
                    $object->base_price = 105; 
                } else if($weight > 10 && $weight < 15) {
                    $object->base_price = 122; 
                } else if($weight > 15 && $weight < 20) {
                    $object->base_price = 134; 
                } else if($weight > 20 && $weight < 25) {
                    $object->base_price = 152; 
                }  else if($weight > 25 && $weight < 30) {
                    $object->base_price = 165; 
                } else if($weight > 30 && $weight < 40) {
                    $object->base_price = 179; 
                }  else if($weight == 40) {
                    $object->base_price = 220; 
                }
            break;

            case array_search($cart->shipping_address->country, $area5): 
               if ($weight > 2 && $weight < 3 || $weight < 2) {
                    $object->base_price = 179;   
                } else if($weight > 3 && $weight < 5) {
                    $object->base_price = 284; 
                } else if($weight > 5 && $weight < 10) {
                    $object->base_price = 268; 
                } else if($weight > 10 && $weight < 15) {
                    $object->base_price = 335; 
                } else if($weight > 15 && $weight < 20) {
                    $object->base_price = 420; 
                } else if($weight > 20 && $weight < 25) {
                    $object->base_price = 504; 
                }  else if($weight > 25 && $weight < 30) {
                    $object->base_price = 600; 
                } else if($weight > 30 && $weight < 40) {
                    $object->base_price = 695; 
                }  else if($weight == 40) {
                    $object->base_price = 875; 
                }
            break;
        }

Hello, how can I simplify this code? Existing a method? In db i can`t put the price, I need in code

Feb
28
1 month ago
Activity icon

Started a new Conversation Function For Get Exactly Price

For example, I have a certain price and a certain kilogram

2kilo 30EURO, 4KG 44 EURO, 5kilo 54 EURO, 10Kilo 61 EURO 15 Kilo 67 EURO, 20 Kilo 76 EURO,  25 Kilo 83 EURO 30 Kilo 90 EURO, 40 kilo 109 EURO

Is there a way to do for example when it increases by 0.1 to increase the price in the basket? I don't realize how I could calculate in my position. The prices come from an operator, but they come without a bee, is there a formula or a function in laravel that can make me take the exact price if the kilogram increases?

Feb
27
1 month ago
Activity icon

Started a new Conversation Array_search() Expects Parameter 2 To Be Array

Hi, I made a switch with an array search based on 5 areas I have but do I get this error? Do you know why?

$area2 = array('Czechia', 'Slovakia', 'Slovenia', 'Bulgaria', 'Serbia');
  switch ($cart->shipping_address->country)
        {
            case $area1:
                $object->price = 3;
            break;

            case array_search($area2, $cart->shipping_address->country):
                $object->price = 5;
            break;
}

What is wrong this?

Feb
26
1 month ago
Activity icon

Started a new Conversation Calculate The Price In Kg Depending On The Country

        2       3kilo    5kilo    10kilo    15kilo 20 kilo 30 kilo 40 kilo
Area 1 30 EURO, 44 EURO, 54 EURO, 61 EURO, 76 EURO, 83 EURO, 90 EURO, 109 EURO

        2       3kilo    5kilo    10kilo    15kilo 20 kilo 30 kilo 40 kilo
Area 2 35 EURO, 45 EURO, 60 EURO, 70 EURO, 80 EURO, 90 EURO, 120 EURO, 150 EURO

... Area 5

Hi, I have a table of values. For example, I have a table with the values ​​in money according to the kilograms transported and the country. How could I make it easier without making a switch depending on each country and depending on prices? I was thinking of putting the countries in an array, searching for them and putting ifs based on price. What would you do with it? Area means the price area in which the country will fit. For example, in area 1 will be Bulgaria and the prices are the same depending on the kilograms

switch ($cart->shipping_address->city)
        {
            case $area1:
                $object->price = 3 ;
            break;
        }

And how could I make it possible to gain weight as easily as possible?

Feb
21
1 month ago
Activity icon

Replied to Array To String Conversion Problem

Yes, but I want to hide data from print_r

Activity icon

Started a new Conversation Array To String Conversion Problem

Hi, I did for example to automatically click on a form but I have everything in an array, how could I solve this error? I tried the implode function but it didn't work

  $output['data'] = $response->getData();
        // dd($output['data']);
        $output['endpoint'] = $response->getRedirectUrl();
        $output['html'] = '<form action="'. $output['endpoint'] .'" method="post" id="hh_standard_checkout">
                            <p>Redirecting to payment page...</p>
                            <p>
                                <input type="hidden" name="env_key" value="'. $output['data']['env_key'].'" />
                                <input type="hidden" name="data" value="'. $output['data']['data'].'" />

                                <input type="submit" value="Continue" />
                            </p>
                        </form>
                        <script type="text/javascript">
                            document.getElementById("hh_standard_checkout").submit();
                        </script>';
        echo $output;
Feb
13
2 months ago
Feb
12
2 months ago
Activity icon

Started a new Conversation Ttmlspecialchars() Expects Parameter 1 To Be String, Object Given

Hello, I tried to send a mail with bagisto platform and i get this error Email template:

<h2>Hello Admin,</h2>
Here are the details:
<b>Name:</b> {{ $name }}
<b>Email:</b> {{ $email }}
<b>Phone Number:</b> {{ $phone}}
<b>Message:</b> {{ $message }}
Thank You

Controller

 public function send(Request $request) {
        Mail::send('shop::emails.customer.contact-us', [
            'name' => $request->get('name'),
            'email' => $request->get('email'),
            'phone' => $request->get('phone'),
            'message' => $request->get('message') ],
            function ($message) {
                    $message->from('[email protected]_domain');
                    $message->to('[email protected]_domain', 'Your Name')
                            ->subject('Your Website Contact Form');
        });

        return back()->with('success', 'Thanks for contacting me, I will get back to you soon!');
    }

Form

<form method="post" action="/page/cutomer-service">@csrf
<h3>Contacteaza-ne!</h3>
<div class="row">
<div class="col-md-6">
<div class="form-group"><input type="text" name="name" class="form-control" placeholder="Numele tau *" value="" /></div>
<div class="form-group"><input type="text" name="email" class="form-control" placeholder="Email-ul tau *" value="" /></div>
<div class="form-group"><input type="text" name="phone" class="form-control" placeholder="Numarul tau de telefon *" value="" /></div>
<div class="form-group"><input type="submit" name="btnSubmit" class="theme-btn" value="Send Message" /></div>
</div>
<div class="col-md-6">
<div class="form-group"><textarea name="message" class="form-control" placeholder="Mesajul tau *" style="width: 100%; height: 150px;"></textarea></div>
</div>
</div>
</form></div>
Feb
11
2 months ago
Activity icon

Started a new Conversation Csv To Json Route

Hi, I'd like to do something like restful api. E.g Have a single controller with which to convert a csv to json and a query to json and give a json response with them. After the route I would like something like that to appear Route :: get ('convert /?source={type}) Type being csv or db meaning I return to the route How could I make it easier?

Look what I have so far

public function convert() {
        $csv = Reader::createFromPath();
        $json = json_encode($csv, JSON_PRETTY_PRINT);
		
		//here will be the query to json
        return response([$json]);
    }
Route::get('/convert/?source={type}', 'App\Http\Controllers\[email protected]');

And type I would like to be the type csv or query How can I proceed?

Feb
08
2 months ago
Activity icon

Started a new Conversation Convert Csv To Json

Hi, I would like to do two routes to give them for example a parameter convert?source = something.csv that I can take from a folder and turn it into a json and I would do the same for a sql

function csvToJson($fname) {
    if (!($fp = fopen($fname, 'r'))) {
        die("Can't open file...");
    }
    

    $key = fgetcsv($fp,"1024",",");

    $json = array();
        while ($row = fgetcsv($fp,"1024",",")) {
        $json[] = array_combine($key, $row);
    }
    

    fclose($fp);

    return json_encode($json);
}
Route::get('/convert/source?=/something.csv', '[email protected]');

But I don't know how I could do that, giving the path only something.csv and taking only the .csv files

Feb
01
2 months ago
Activity icon

Replied to Update Value Vue.js Without Page Refresh

I tested this method, but it will not work. I practically in that data array, save the data and notify them in view using a forum in a list

    <li v-for="dt in data" :key="dt.id" class="list-group-item">
            {{ dt.ype }}
        <br>
        <button type="button" v-on:click="add(dt.id)">Add</button>
        <br>
        <span class="badge badge-primary"><strong>{{ dt.results }}</strong></span>
        </li>
Activity icon

Started a new Conversation Update Value Vue.js Without Page Refresh

Hi, at the moment if I send an axios post trb to refresh the page so I can see the data. How can I do it in the best way possible so as not to refresh the page when posting data? I don't use it in a form, I have a button after which I put a value.

 <button type="button" v-on:click="add(data.id)">ADD</button>
data() {
            return {
              data[],
            }
        },
add(id) {
               axios.post('add/' + id)
                    .then(() => {
                        this.Data()
                    })
            },

I now call the data view function but how could I give a then response? I would like something cleaner

Jan
28
2 months ago
Activity icon

Started a new Conversation Inherits A Variable With Its Data

Hi, how can I inherit a variable in another class with its data? For example, I call a get from an api and make the exchange rate in a variable but I would like to have it global and to be able to have its data anywhere. Look what I mean

$usdPrice = round(($base_price * $response_object->rates->USD), 2);

For example, I have this in the NewList class, how can I have the same variable with the same data in the NewDetails class?

Jan
21
2 months ago
Activity icon

Started a new Conversation Add A Custom Market To Default Google Maps Iframe

Hello, how I can to change the default market from google maps iframe? I write this but hes dont changed

<script>
 <iframe
                        src="--"
                        width="600"
                        height="450"
                        frameborder="0"
                        style="border: 0;"
                        allowfullscreen
                    ></iframe>
var icon = {
        url: "/app/images/favicon.png",
        scaledSize: new google.maps.Size(30, 30), 
        origin: new google.maps.Point(0, 0), 
        anchor: new google.maps.Point(0, 0) 
    };
    
var marker = new google.maps.Marker({
        position: {lat: -, lng: -},
        icon: icon,
        map: map
    });
</script>
Jan
19
2 months ago
Activity icon

Replied to Set Unvailable Dates

yes in calendar I have 25 date and I want to block it

Activity icon

Started a new Conversation Set Unvailable Dates

Hi, how can the days that are not valid be marked in red? So far I've written this but I don't know what to do next

const setUnavaibleDates = () => {

                $('.vanilla-calendar-date').each(function (e ,ee) {
                    console.log(ee);
                    ee.classList.remove('.vanilla-calendar-date');

                    const date = new Date($(this).data('calendar-date'));

                    const format = `${String(date.getFullYear())}-${String(date.getMonth() + 1).padStart(2, 0)}-${String(date.getDate()).padStart(2, 0)}`;

                    if(unavaibleDates.includes(format)) {
                        // console.log(this);

                        $(this).removeClass('vanilla-calendar-date--active');
                        $(this).addClass('vanilla-calendar-date--inactive');
                        $(this).data('calendar-status', '');
                        $(this).remove();
                    }
                    
                });
            }
myCalendar.set({availableDates: [{date: '2021-01-20'}] });
            // console.log(unavaibleDates);
            $('.vanilla-calendar-date').each(setUnavaibleDates);

Jan
09
3 months ago
Activity icon

Started a new Conversation Movie Booking Application

Okay, so I created 3 tables in the database. The first table has hourly intervals that are every 10 minutes in a day and a table shows where you can get tickets. My question is, how can I make that day or somehow create a calendar that has those intervals and if an interval was selected by a user it should not be used on that date ? For example, I have today and the 8:10 interval, I took that interval and I would like to save somewhere and know if I could do that.

  public function up()
    {
        Schema::create('ticket_office', function (Blueprint $table) {
            $table->id();
            $table->string('ticket_office')->nullable(); // ca be ticket_office_1, ticket_office_2 max 6
            $table->string('type')->nullable(); // horror etc
            $table->timestamps();
        });
    }
public function up()
    {
        Schema::create('intervals', function (Blueprint $table) {
            $table->id();
            $table->string('intervals')->null(); //can be 8:10, 8:20 to 16:50
            $table->timestamps();
        });
    }

My question is

Create a new table with retrieved intervals and save today's date + that day's interval? I mention that I want to have 6 ticket rooms. How should I proceed to be able to take over the interval and today's date, to save them in the fixed database with that interval? Is such a thing possible? As in this case I could put a condition.

Jan
08
3 months ago
Activity icon

Started a new Conversation How Should It Be Done?

Hi, I would like to make an application in which to display for example this month, next and to put an interval of hours at which customers can make a reservation requesting some data, how should I do with this part of the calendar and how could I set the hours more easily from the database? Could I take a direct calendar and somehow set the hours through a bookstore? How would you proceed, I would like the best opinion

Jan
07
3 months ago
Activity icon

Started a new Conversation Update Boolean In Db Based Checkbox

Hello, how can I update a value in dabatase based on checkbox ?

var html = '<div class="question col-lg-12"><div class="row"><div class="col-lg-10">\n' +
                '        <div class="form-group">\n' +
                '    <input name="question[]" type="text" id="input-name" class="form-control form-control-sm form-control-alternative" placeholder="">\n' +
                '        </div>\n' +
                '        </div>\n' +
                '        <div class="col-lg-2">\n' +
                '        <div class="form-group">\n' +
                '        <div class="btn btn-sm btn-danger delete-question">Remove Question</div>\n' +
                '    </div>\n' + '<input type="checkbox" class="form-check-input" name="checkBoxQuestion[]"><label class="form-check-label" for="exampleCheck1">Checked</label>'
                '    </div></div></div>';
            $('.append_here').append(html);

Controller

 function editSpecialization($data){
        $dataInsert = $data;
        $inserted = $data['id'];
        if(@$data['question']) {
            unset($dataInsert['question']);
            unset($dataInsert['id']);
        }
        $this->db->where('id',$inserted);
        $this->db->update('specializations',$dataInsert);
        $checked_value = $dataInsert['checkBoxQuestion'] ? 1 : 0; 

        $this->deleteQuestions($inserted);

        $insert['specialization_id'] = $inserted;
        $insert['sort_nr'] = 0;
        if(@$data['question']){
            foreach($data['question'] as $question){
                $insert['question'] = $question;
                $this->db->insert('questions',$insert);
                $this->db->update('isMultiple', $checked_value);
            }
        }
    }
Dec
21
3 months ago
Activity icon

Replied to Query Not Execute Php

Look, i tried this query in sql

$wpdb->query = "INSERT INTO `wp_pms_member_subscriptions`(`id`, `user_id`, `subscription_plan_id`, `start_date`, `expiration_date`, `status`, `payment_profile_id`, `payment_gateway`, `billing_amount`, `billing_duration`, `billing_duration_unit`, `billing_cycles`, `billing_next_payment`, `billing_last_payment`, `trial_end`) VALUES (4,12,233,NULL,NULL,'active','','',0,0,0,0,0,null,null)";

he works but but if I run it in the top function, it doesn't work Btw, I use wordpress and wpdb

Activity icon

Replied to Query Not Execute Php

function change_role_on_purchase ($order_id ) {

    global $wpdb;
	$order = new WC_Order( $order_id );
	$items = $order->get_items();

	$product_id = 193; // that's a specific product ID

	foreach ( $items as $item ) {

		if( $product_id == $item['product_id'] && $order->user_id ) {
			$user = new WP_User( $order->user_id );
      
      
            $query = $wpdb->insert('wp_pms_member_subscriptions', array(
    	        'user_id' => $user->id,
    	        'subscribtion_plan_id' => 233,
                'start_date' => null,
    	        'expiration_date' => null,
    	        'status' => 'active',
    	        'paymanet_profile_id' => '',
    	        'payment_gateway' => '',
    	        'billing_amount' => '0',
    	        'billing_duration' => '0',
    	        'biling_duration_unit' => '0',
    	        'billing_cycles' => '0',
    	        'billing_next_payment' => null,
    	        'billing_last_payment' => null,
    	        'trial_end' => null
	        ));
            $wpdb->query($query);
		}
	}
}
Activity icon

Replied to Query Not Execute Php

not work...

Activity icon

Replied to Query Not Execute Php

nothing

Activity icon

Started a new Conversation Query Not Execute Php

nothing is sent to the database, what could I solve for it?

 global $wpdb;
	$order = new WC_Order( $order_id );
	$items = $order->get_items();

	$product_id = 193; // that's a specific product ID
	
	$query = $wpdb->insert('wp_pms_member_subscriptions', array(
	        'id' => 4,
	        'user_id' => 12,
	        'subscribtion_plan_id' => 233,
            'start_date' => null,
	        'expiration_date' => null,
	        'status' => 'active',
	        'paymanet_profile_id' => ' ',
	        'payment_gateway' => ' ',
	        'billing_amount' => ' ',
	        'billing_duration' => ' ',
	        'biling_duration_unit' => ' ',
	        'billing_cycles' => ' ',
	        'billing_next_payment' => null,
	        'billing_last_payment' => null,
	        'trial_end' => null
	    ));
	    
	    
    $wpdb->query($query);

Dec
14
3 months ago
Activity icon

Started a new Conversation Query For Add Multiples Values For Different Data

Hi, how can I add for example multiple data in the database, for hours every 10 minutes for certain data of the month? For example I have monday, sunday, thursday 13:00 - 16:00

and an interval of 10 minutes. I have 6 values ​​in one hour and 18 in 3 hours. How can I write a fixed query for those days of the month and put an interval of 10 minutes?

Dec
10
4 months ago
Activity icon

Started a new Conversation Autoplay Music Chrome

Hi, is it possible to autoplay a chrome song?

 <script>
    window.onload = function() {
      var context = new AudioContext();
    }
  </script>

  <audio autoplay>
        <source src="../assets/3.mp3">
  </audio>
Dec
01
4 months ago
Activity icon

Replied to Popup With Multiple Pictures From Imgur

For example, if I have a link from imgur with 3 pictures, how could I display a popup with those pictures? For example, click "show more" and open a popup with the 3 pictures

Nov
30
4 months ago
Activity icon

Started a new Conversation Popup With Multiple Pictures From Imgur

Hi, in javascript how could I display a popup with multiple pictures from a different source? For example imgur

Nov
23
4 months ago
Activity icon

Started a new Conversation Slider Name

https://i.imgur.com/1lNuXcL.png What name should this slider have in Wordpress css? I inspected but I don't know exactly I would like to make it bigger

Nov
19
4 months ago
Activity icon

Started a new Conversation Wordpress Math Plugin For Tests

Is there a wordpress plugin with which I can do math tests in wordpress? Or an integration of a math plugin into a quiz plugin?

Nov
16
4 months ago
Activity icon

Replied to Count Divs And Show One Div

So if I have i == 0 I display the value, but can I display values in 3 in 3? i == 3 i == 6 without me putting it manually

Activity icon

Replied to Count Divs And Show One Div

Okay, I have another idea. How can I display forum values every 3 values? May?

Activity icon

Replied to Count Divs And Show One Div

Can I make the for work in 3 values?

Activity icon

Replied to Count Divs And Show One Div

So I have a value. I put a value in the box and it will be displayed to me 3 times in 3 divs. And I would like only a value to be displayed. If I do as I did, it will not display the other values I set . Here are the divas in their entirety https://i.imgur.com/9WNsxfB.png Couldn't I differentiate between divs to give them an id via javascript? And to display the other values but only once?

Activity icon

Replied to Count Divs And Show One Div

 let divs = document.getElementsByClassName('add_icon');
    for(let i = 0; i < divs.length; i++){
  //Display the first div and hide the rest
   if(i == 0)
    divs[i].style.display = 'block';
   else
    divs[i].style.display = 'none';
   }

I did this but if I want to add another value it will not show me the second one because it only shows me the first div. How can I differentiate when I add a value to show it to me? Because due to a foreach it shows me 3 values one after the other and I would like to hide the 2 values

Can I give divs an id via javascript?

Activity icon

Started a new Conversation Count Divs And Show One Div

Hi, how can I count the divs with the same name and display only one and put a display on none of the others? this is the divs

<div class="add_icon">
I get 3 and I would like to count them and if there are 3 to display only one
Activity icon

Started a new Conversation It Adds 3 Values ​​without Wanting To

Hi, what do you think is the problem in this code of adding 3 values?

Only one is added in db but in view 3 is added

function add_note(student_id)
        {
            student_name = $("#add_note_" +student_id).data("name");
            $('#student_name').val(student_name);
            $('#text_add_note').html("Adaugare note");
            $("#edit_note_form").submit(function(e)
            {
                e.preventDefault();
                let new_data= $('#data_adaugare_note').val();
                let new_note= $('#student_notes').val();
                if(new_data == "" || new_note == "")
                {   
                    $('#myModalLabel_edit').css('color','red');
                }
                else
                {
                       $.post( "/professor/add_note_ajax", { student_id: student_id,  class: class, group:group, discipline: discipline, new_data: new_data, new_note:new_note   }, function( data ){
                            if(data)
                            {
                                
                                 $('#message_event').text();
                                $('#message_event').text(message);
                                $('#editare_popup').hide();
                                // $("#myModal_delete").data("myModal_delete").show();
                                $('#myModal_succes').modal('toggle');
                                setTimeout(location.reload.bind(location), 1000);
                            }
                        });
                }
            }); 
        }

{foreach from=$elev.situatie.note item=situation_note key=key_n}
                                <div class="add_icon">
                                    <!--{if $situation_note.note}-->
                                        {if $situation_note.note <5}
                                            {$style="style='color: red';"}
                                        {else}
                                            {$style="style='color: green';"}
                                        {/if}
                                        <button type="button" {$style} class="btn btn-default nota" data-container="body" data-toggle="popover" data-placement="bottom" data-content=" {$situation_note.date}" data-original-title="" title="">
                                         {$situation_note.note}
                                         {$situation_note.date} 
                                        </button>
                                        <div class="secundar_but">
                                        <button id="edit_{$situation_note.date_time}_{$situation_note.note_id}" onclick="edit_nota({$situation_note.date_time},{$situation_note.note_id});" type="button" data-nota={$situation_note.note} data-data_time={$situation_note.date_time} data-id_nota={$situation_note.note_id} data-data_nota="{$situation_note.date}" data-name='{$student.name_el}' data-id_student="{$student.student_id}" class="btn btn-info btn-circle edit_nota" data-toggle="modal" data-target="#myModal_edit"><i class="fa fa-edit"></i> </button>
                                            <button type="button" onclick="delete_nota({$situation_note.note_id})" class="btn btn-warning btn-circle" data-toggle="modal" data-target="#myModal_delete"><i class="fa fa-times"></i> </button>
                                        </div>
                                    <!--{/if}-->
                                    </div>
                                {/foreach}