davy_yg

Experience

44,780

0 Best Reply Awards

  • Member Since 10 Months Ago
  • 305 Lessons Completed
  • 0 Favorites

15th February, 2018

davy_yg started a new conversation Certified Google Partner • 2 days ago

Any ever been a certified google partner?

If I become a certified google partner using my gmail account, how many badge can I obtain using 1 gmail?

Since I work for one company and have one freelance business, I interested to have 2 certified google partner badge. Do you think I need another gmail account to obtain another badge?

Thanks in advance.

13th February, 2018

davy_yg left a reply on Let's Build A Forum With Laravel And TDD Tutorial • 4 days ago

I would take ecommerce project as an example. If you build the whole project with a test method. At the end of the project, can you cek if the whole project works perfectly with just one button?

davy_yg left a reply on Let's Build A Forum With Laravel And TDD Tutorial • 4 days ago

You mean they teach both how-to-build the forum and how-to-test it?

Since as far as now, I only see the teaching on how-to-test the forum instead of how to build it. I already watched up to lesson 5.

davy_yg started a new conversation Let's Build A Forum With Laravel And TDD Tutorial • 4 days ago

Any has finished watching this: Let's Build A Forum with Laravel and TDD ?

I wonder if that's only a series of a test to the Forum instead of how-to-build the forum it's self.

12th February, 2018

davy_yg left a reply on Driver [] Is Not Supported. • 4 days ago

Which files? Here is my filesystems:

config/filesystems.php

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Default Filesystem Disk
    |--------------------------------------------------------------------------
|
    | Here you may specify the default filesystem disk that should be used
    | by the framework. The "local" disk, as well as a variety of cloud
    | based disks are available to your application. Just store away!
    |
    */

    'default' => env('FILESYSTEM_DRIVER', 'local'),

    /*
    |--------------------------------------------------------------------------
    | Default Cloud Filesystem Disk
    |--------------------------------------------------------------------------
    |
    | Many applications store files both locally and in the cloud. For this
    | reason, you may specify a default "cloud" driver here. This driver
    | will be bound as the Cloud disk implementation in the container.
    |
    */

    'cloud' => env('FILESYSTEM_CLOUD', 's3'),

    /*
    |--------------------------------------------------------------------------
    | Filesystem Disks
    |--------------------------------------------------------------------------
    |
    | Here you may configure as many filesystem "disks" as you wish, and you
    | may even configure multiple disks of the same driver. Defaults have
    | been setup for each driver as an example of the required options.
    |
    | Supported Drivers: "local", "ftp", "s3", "rackspace"
    |
    */

    'disks' => [

    'local' => [
        'driver' => 'local',
        'root' => storage_path('app'),
    ],

    'public-folder' => [
        'driver' => 'local',
        'root' => public_path(),
        'url' => env('APP_URL').'/storage',
        'visibility' => 'public',
    ],

    'public' => [
        'driver' => 'local',
        'root' => storage_path('public/images/products'),
        'url' => env('APP_URL').'/storage',
        'visibility' => 'public',
    ],

    'test' => [
        'driver' => 'local',
        'root' => storage_path('app/public/products/'),
        'url' => env('APP_URL').'/storage',
        'visibility' => 'public',
    ],

    'images_folder' => [
      'driver' => 'local',
      'root' => public_path() . '/images',
      'url' => env('APP_URL').'/images',
      'visibility' => 'public',
    ],

    'products_img' => [
      'driver' => 'local',
      'root' => public_path() . '/images/products',
      'url' => env('APP_URL').'/images/products',
      'visibility' => 'public',
    ],

    'slider_img' => [
      'driver' => 'local',
      'root' => public_path() . '/images/slides',
      'url' => env('APP_URL').'/images/slides',
      'visibility' => 'public',
    ],

    'index_featured' => [
      'driver' => 'local',
      'root' => public_path() . '/images/feature-content',
      'url' => env('APP_URL').'/images/feature-content',
      'visibility' => 'public',
    ],

    'catalog_ad' => [
      'driver' => 'local',
      'root' => public_path() . '/images/product-list',
      'url' => env('APP_URL').'/images/product-list',
      'visibility' => 'public',
    ],

    'banner-ads' => [
      'driver' => 'local',
      'root' => public_path() . '/images/banner-ads',
      'url' => env('APP_URL').'/images/banner-ads',
      'visibility' => 'public',
    ],

    'site_favicon' => [
      'driver' => 'local',
      'root' => public_path() . '/images/favicon',
      'url' => env('APP_URL').'/images/favicon',
      'visibility' => 'public',
    ],

    'site_logo' => [
      'driver' => 'local',
      'root' => public_path() . '/images/logo',
      'url' => env('APP_URL').'/images/logo',
      'visibility' => 'public',
    ],

    'thumb_products_img' => [
      'driver' => 'local',
      'root' => public_path() . '/images/products/thumbnails/',
      'url' => env('APP_URL').'/images/products/thumbnails/',
      'visibility' => 'public',
    ],

    's3' => [
        'driver' => 's3',
        'key' => env('AWS_KEY'),
        'secret' => env('AWS_SECRET'),
        'region' => env('AWS_REGION'),
        'bucket' => env('AWS_BUCKET'),
        ],

    ],

];

davy_yg left a reply on AppServiceProvider.php • 4 days ago

What's the point placing this code:

view()->composer('store.index', function ($view) {
        $view->with('information', \App\SiteSetting::getInformation());
        $view->with('slides', \App\Advertisements::getSlides());
        $view->with('index_featured', \App\Advertisements::getIndexFeatured());

Is it to make the data always accessible to store.index files?

If through the controllers, there will be many functions that would access the files. Is that true?

11th February, 2018

davy_yg left a reply on AppServiceProvider.php • 5 days ago

So it's taken from the models files?

app/Advertisements.php

class Advertisements extends Model
{
    protected $primaryKey = 'ad_id';
    protected $guarded = ['ad_id'];

    public static function getSlides()
    {
        return static::where('ad_type', 'slider')->latest()->get();
    }

What does this codes means?

return static::where('ad_type', 'slider')->latest()->get();

davy_yg left a reply on AppServiceProvider.php • 6 days ago

Where does this syntax comes from: getSlides()

10th February, 2018

davy_yg started a new conversation AppServiceProvider.php • 1 week ago

Can anyone help me explain what the following code means:

AppServiceProvider.php

class AppServiceProvider extends ServiceProvider
{
    /**
    * Bootstrap any application services.
    *
    * @return void
    */
    public function boot()
    {
    Schema::defaultStringLength(191);

    view()->composer('layouts.store.store', function ($view) {
        $view->with('information', \App\SiteSetting::getInformation());
    });


    //Only for Phone
    view()->composer('store.index', function ($view) {
        $view->with('information', \App\SiteSetting::getInformation());
        $view->with('slides', \App\Advertisements::getSlides());
        $view->with('index_featured', \App\Advertisements::getIndexFeatured());
    });

Someone mention it has to do with something with global variable. I still do not understand where the getSlides() comes from?

davy_yg started a new conversation Driver [] Is Not Supported. • 1 week ago

When trying to upload a picture to my cms I get this error message:

 InvalidArgumentException

Driver [] is not supported.

...

    } else {
        throw new InvalidArgumentException("Driver [{$config['driver']}] is not supported.");
    }

I cannot understand the error message. Please help.

davy_yg left a reply on Iterating Style • 1 week ago

Since there are 5 different background that's why I need to number each style tag. Also there are customize captions for each background that's why it's a background.

davy_yg started a new conversation Iterating Style • 1 week ago

Hello,

Can you iterate style?

index.blade.php

<style>

.carousel .item {
        background: -webkit-linear-gradient(rgba(23, 22, 23, 0.2), rgba(23, 22, 23, 0.5)), url("{{url("")}}/images/banner1.jpg") no-repeat;}

.carousel .item.item2 {
        background: -webkit-linear-gradient(rgba(23, 22, 23, 0.2), rgba(23, 22, 23, 0.5)), url("{{url("")}}/images/banner2.jpg") no-repeat;}

.carousel .item.item3 {
        background: -webkit-linear-gradient(rgba(23, 22, 23, 0.2), rgba(23, 22, 23, 0.5)), url("{{url("")}}/images/banner3.jpg") no-repeat;}

.carousel .item.item4 {
        background: -webkit-linear-gradient(rgba(23, 22, 23, 0.2), rgba(23, 22, 23, 0.5)), url("{{url("")}}/images/banner4.jpg") no-repeat;}

.carousel .item.item5 {
        background: -webkit-linear-gradient(rgba(23, 22, 23, 0.2), rgba(23, 22, 23, 0.5)), url("{{url("")}}/images/banner5.jpg") no-repeat;}
</style>

Since I am going to put cms in it, I am thinking about iterating it. Something like this:

index.blade.php

$i = 0;
@foreach($slides as $ad)
<style>

.carousel .item .item.$i{
        background: -webkit-linear-gradient(rgba(23, 22, 23, 0.2), rgba(23, 22, 23, 0.5)), url("{{ asset('images/$ad->ad_img_url') }}") no-repeat;}

$i++;
</style>
@endforeach

I wonder if my code is correct?

davy_yg left a reply on Asset() • 1 week ago

So it's the same thing like:

<img src="{{url("")}}/$ad->ad_img_url">

?

davy_yg started a new conversation Asset() • 1 week ago

I have a question:

What does this code for: asset() ?

index.blade.php

<img src="{{ asset($ad->ad_img_url) }}"  alt="image 1"/>

Thanks in advance.

8th February, 2018

davy_yg started a new conversation Configuring CRUDBooster • 1 week ago

Oops Please fill out the form correctly : The google analytics must be an integer.

Optionbox: Google Analytics:

o False o True' The google analytics must be an integer.

Label Name Type Validation Google Analytics Google Analytics Radio Integer

'dataenum'=>'0|False;1|True'

If I pick False then I get this error message: Please fill out the form correctly : The google analytics must be an integer.

Only true works. I wonder why?

6th February, 2018

davy_yg left a reply on Editing CRUDBooster • 1 week ago

I already try to add:

AdminPostsController.php

<?php namespace App\Http\Controllers;

use Session;
use Request;
use DB;
use CRUDbooster;

class AdminPostsController extends \crocodicstudio\crudbooster\controllers\CBController {


    public function getIndex() {
    
    }

}

and right now not know what else to do to add the side menu. The only thing exists right now is User menu.

davy_yg started a new conversation Editing CRUDBooster • 1 week ago

Hello,

I wonder how you can edit CRUDBooster?

I do not successfully install CRUDBooster from the beginning perhaps because I am using Windows and Xampp which makes the installation failed.

Yet, I do no have a ready-to-use CRUDBooster website that other web developer builds. Now, I am trying to edit the menu which right now only have one menu: User.

I try to follow the following tutorial : http://crudbooster.com/doc/5.3/create-a-menu

but do not understand it.

Do I have to create a new controller? I simply want to add another menu called settings.

davy_yg started a new conversation What Is REST Ful Form? • 1 week ago

Hello,

I watched a video about REST ful Form, but don't still get the gist. What is REST ful Form? Does it means form that uses resource routes?

Thanks in advance.

5th February, 2018

davy_yg started a new conversation Watch List • 1 week ago

I have:

  1. RESTful Forms
  2. Understanding REST

and I wonder why I cannot watch those list?

Is it because they are old videos (2013) ?

davy_yg left a reply on CRUDBooster • 1 week ago

I already set up the .env files and create the database.

Now, I wonder why it takes forever to install the crudbooster.

C:\xampp\htdocs\crudbooster2>php artisan crudbooster:install

__________ __ ______ ____ __

/ / __ / / / / __ / __ ) ____ _/ / _____

/ / / /_/ / / / / / / / __ / __ / __ / ___/ __/ _ / ___/

/ /___/ , / /_/ / /_/ / /_/ / /_/ / /_/ ( ) /_/ __/ /

____/_/ |_|____/_____/_____/____/____/____/__/___/_/

--------- :===: Thanks for choosing CRUDBooster :==: ---------------

System Requirements Checking: Laravel Version (>= 5.3.): [Good] PHP Version (>= 5.6.): [Good] Mbstring extension: [Good] OpenSSL extension: [Good] PDO extension: [Good] Tokenizer extension: [Good] XML extension: [Good] GD extension: [Good] PHP Fileinfo extension: [Good] public dir is writable: [Good] -- Installing: I remove some default migration files from laravel... Checking public/vendor directory... Checking public/uploads symlink... Upload Path: C:\xampp\htdocs\crudbooster2\public\uploads Checking public/vendor/crudbooster symlink... Vendor Path: C:\xampp\htdocs\crudbooster2\public\vendor\crudbooster

Do you have setting the database configuration at .env ? (yes/no) [no]:

yes

Publishing CRUDBooster needs file...

Then it stops right there! I already wait for several hours.

4th February, 2018

davy_yg left a reply on CRUDBooster • 1 week ago

ok well, right now I am trying to learn crudbooster from basic.

http://crudbooster.com/doc/5.3/installation

After installing the crudbooster I try to check the admin page:

http://localhost/crudbooster/public/admin

I get this error message and I wonder why?

Sorry, the page you are looking for could not be found.

31st January, 2018

davy_yg started a new conversation CRUDBooster • 2 weeks ago

Hello,

The previous web developer is using crudbooster to build the admin page.

Now, I am trying to edit the navigation of the admin page but do not know how to.

There are two menus in the admin page:

  1. Dashboard
  2. User

Now, I want to add another menu but do not know how to? How to edit the navigation menu of crudbooster?

23rd January, 2018

davy_yg started a new conversation Google Analytics Permission • 3 weeks ago

Is this the correct code to mark the google_analytics?

if $google_analytics = 1 then use the following the google analytics code otherwise skip it.

home.blade.php

$google_analytics = $user->google_analytics; ?>

@if ($google_analytics = 1){

window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date());

gtag('config', 'UA-112906645-1');

}

19th January, 2018

davy_yg left a reply on Alert Pop Up • 4 weeks ago

I change the alert to: - alert(profile_info);

I get the pop up which is difference from the profile_info value that I input. I wonder why?

18th January, 2018

davy_yg started a new conversation Alert Pop Up • 4 weeks ago

Hello,

I wonder why the alert do not pop up?

setting.blade.php

<div class="form-top">
    <label>profile info</label>
    <a class="setting-nav-edit setting-edit"></a>
    <a class="setting-nav-save setting_save"></a>
    <a class="setting-nav-cancel setting_cancel"></a>
</div>
<div class="form-body">
        <div class="setting-box profile" >
    
    {{ \Soulfy\Timeline::split_words($user_setting->info_profile,2000,"...")}} 
    
</div>
<!-- id="form_update_profile_info" -->
<div class="setting-box profile-open">
    <form role="form" id="form_update_profile_info" method="post" action="{{action('[email protected]')}}">


        <div class="form-group">
             
            <div class="col-group">
                <textarea style="height: 150px;" class="form-control" id="profile_info" name="profile_info">{{ $user_setting->info_profile }}</textarea>

            </div>
        </div>

...

$(".setting-nav-save").click(function(e){
    e.preventDefault();
     var profile_info = $("#profile_info").val();
     alert('123');

        $.ajax({
            type: "POST",
            url: '{{action("[email protected]")}}',
            dataType : "text",
            data : {
                 profile_info : profile_info,
            },
            success: function (response) {
                if (response!="error") {
                    $("div.profile").show();
                    $(".setting-nav-save").hide();
                    $(".setting-nav-cancel").hide();
                    $(".setting-nav-edit").show();
                    $("div.profile-open").hide();
                    response = response.replace('"',' ');
                    response = response.replace('"','');
                    response = response.replace("\u00A0", " ").replace(/[\r\n]+/g, "\n");
                    $("div.profile").html(response);

                    pesanOk("success update profile info");
                    
                }else{
                    pesanErr("Oops try again");
                }
                }
            });

I thought the alert will pop up. I only see the success message - "success update profile info".

davy_yg left a reply on Success Message • 4 weeks ago

I do not get a success message. I get the alert message but not the success message.

So I wonder if the problem is in the controller.

AjaxController.php

public function postPagePublish(Request $request)
    {
    $domain = $_SERVER['SERVER_NAME'];
    $user = User::where('domain', $domain)->first();

    if ($user) {
        $domain = $_SERVER['SERVER_NAME'];
        $user = User::where('domain', $domain)->first();

        $id = $request->input("id");
        $status = $request->input("status");
        echo $status;
        date_default_timezone_set("Asia/Jakarta");
        $page = Pages::where('user_id', $user['id'])->where('id', $id)->first();
        $page->status = $status;
        $page->updated_at = date("Y-m-d H:i:s");


        $act = $page->save();
        if ($act) {
            $message = "success";
        } else {
            $message = "error";
        }
        echo json_encode($message);
    }
}

davy_yg left a reply on NodeJs • 4 weeks ago

What is standalone javascript application? Is it only javascript?

17th January, 2018

davy_yg started a new conversation Success Message • 4 weeks ago

Hello,

I wonder when will the success message appears? Is it after the controller finished being processed successfully?

apages.blade.php

$(".btn-publish").click(function(e){
        e.preventDefault();
        var id = $(this).attr("data-id"),
        status = $(this).attr("data-status");
        alert(id);
        alert(status);

        $.ajax({
            method: "POST",
            url: '{{action("[email protected]")}}',
            data: { id : id, status : status, },
            success: function (response) {
                
                pesanOk("Status changed");
                setTimeout(function(){location.reload()},1000);
            },
        })

    });

davy_yg started a new conversation Json_encode() • 4 weeks ago

I wonder what this code means:

echo json_encode($message);

I have it in the end of my controller. Is it to pop up a message?

davy_yg started a new conversation NodeJs • 1 month ago

I wonder what is NodeJs and why do people use it?

Is it still popular? I only think about it since I once checking a job offer in my country and they offer a big salary for those who knows NodeJs.

davy_yg left a reply on Delete Edit Publish Button • 1 month ago

Someone else code. I just have to modify it to make it works.

So should I delete this code: e.preventDefault(); ?

"Prevent a link from opening the URL.". I already tried it and I still didn't go anywhere.

davy_yg started a new conversation Delete Edit Publish Button • 1 month ago

Hello,

I am trying to find the logic behind these codes:

PageController.php

public function show($id)
    {
    // Edit Page

    $pages = Pages::find($id);
    
    return view('soulfy.edit_pages', ['pages' => $pages]);
    }

soulfy/apages.blade.php

@foreach($pages as $data)

                                <div class="notes-nav">
                                                            <a href="#" class="btn btn-green btn-act-delete" onclick="deleteTimeLine(this)" data-id="{{$data->id}}" data-type="article"><img src="{{url('')}}/images//icon-trash.png"/></a>
                                                            <a href="#" class="btn btn-green btn-act-edit" data-id="{{$data->id}}" data-pages_title="{{$data->pages_title}}" data-content="{{$data->content}}"                
                                                            ><i class="fa fa-pencil"></i></a>
                                                            @if($data->status=="0")
                                                            <a href="#" class="btn btn-green btn-publish" data-toggle="tooltip" data-placement="top" title="publish?" data-id="{{$data->id}}" data-status="1"><span class="glyphicon glyphicon-ok"></span></a>
                                                            @else
                                                            <a href="#" class="btn btn-green btn-publish" data-toggle="tooltip" data-placement="top" title="cancel publish" data-id="{{$data->id}}" data-status="0"><span class="glyphicon glyphicon-minus"></span></a>
                                                            @endif
                                </div>
                                @endforeach
....

$(".btn-act-edit").click(function(e){
        e.preventDefault();
        var id = $(this).attr("data-id"),
        pages_title = $(this).attr("data-pages_title"),
        attachment = $(this).attr("data-attachment"),
        pages_content = $(this).attr("data-pages_content");            
        $(".create-article").hide();
        $(".edit-article-form").fadeIn();
        $(".id-edit").val(id);
        $(".tittle-edit").val(pages_title);

    
        CKEDITOR.instances["content-edit"].setData(content);
        $("#download-edit").attr("href", attachment);
        $("#download-edit").text("download");

        $.ajax({
            method: "POST",
            url: '{{action("[email protected]")}}',
            data: { pages_title : pages_title, pages_content : pages_content },
            
            success: function (response) {
                if (response=='"error"') {
                    pesanErr("please fill the title and content article");
                }else{ 
                pesanOk("Page created");
                setTimeout(function(){location.reload()},1000);
                };
            },
        })
       
    });

When you press the edit button I expect that it would go to the edit_pages.blade.php, but when I press the edit page it doesn't go anywhere. I wonder why?

15th January, 2018

davy_yg left a reply on Update Web Status • 1 month ago

I've been following the tutorial: Connecting to Facebook through Laravel Socialite : https://laravel.com/docs/5.5/socialite

and getting this error message in command prompt:

C:\xampp\htdocs\Tobageo\framework>composer require laravel/socialite

The "https://packagist.org/packages.json" file could not be downloaded: SSL: Handshake timed out Failed to enable crypto failed to open stream: operation failed https://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date

12th January, 2018

davy_yg left a reply on Update Web Status • 1 month ago

I don't understand this part:

'github' => [
        'client_id' => env('GITHUB_CLIENT_ID'),         // Your GitHub Client ID
        'client_secret' => env('GITHUB_CLIENT_SECRET'), // Your GitHub Client Secret
        'redirect' => 'http://your-callback-url',
],

Do I need to have a github to make facebook connection with my laravel?

11th January, 2018

davy_yg left a reply on Update Web Status • 1 month ago

Is Laravel Socialite a separate framework?

davy_yg started a new conversation Update Web Status • 1 month ago

Hello,

I am trying to configure my website so that wenever someone update status on the website, it also posted the status on facebook as well. But I wonder why it only posted on the website and not on my facebook? http://fresway.com/

Update facebook status. This update status is through the web admin:

partial/social.blade.php

<div class="form-body">
    <textarea name="update" id="txt_status" placeholder="what's on your mind?"></textarea>
</div>
...
function updateStatus(button, type) {
        var jqxhr = $.post("{{action('[email protected]')}}", {
            type: type,
            status: $("#txt_status").val()
        }, function (data) {
            alert("Successfully update status");
            $("#txt_status").val('');
            $(button).button("reset");
        }).fail(function () {
            alert("Publish status error");
            $("#txt_status").val('');
            $(button).button("reset");
        });
    }

SocialController.php

public function postPublishStatus(Request $request)
    {
    $type = $request->input("type");
    $status = $request->input("status");

    $domain = $_SERVER['SERVER_NAME'];
    //$domain =  $request->input("domain");

    echo self::http_post("http://callback.soulfy.com/social/status", ["type" => $type, "status" => $status, "domain" => $domain]);

    }

10th January, 2018

davy_yg started a new conversation Profile_info Value Remains The Same • 1 month ago

Hello,

After inputting the profile_info I wonder why after checking the dd($here) the result remains the same. I expect it to change the same just like the value that I input.

setting.blade.php

<div class="setting-box profile-open">
    <form role="form" id="form_update_profile_info" method="post" action="{{action('[email protected]')}}">


        <div class="form-group">
             
            <div class="col-group">
                <textarea style="height: 150px;" class="form-control" id="profile_info" name="profile_info">{{ $user_setting->info_profile }}</textarea>

            </div>
        </div>




</form>
</div>

...

$(".setting-nav-save").click(function(e){
    e.preventDefault();
     var profile_info = $("#profile_info").val();

        $.ajax({
            type: "POST",
            url: '{{action("[email protected]")}}',
            dataType : "text",
            data : {
                 profile_info : profile_info,
            },
            success: function (response) {
                if (response!="error") {
                    $("div.profile").show();
                    $(".setting-nav-save").hide();
                    $(".setting-nav-cancel").hide();
                    $(".setting-nav-edit").show();
                    $("div.profile-open").hide();
                    response = response.replace('"',' ');
                    response = response.replace('"','');
                    response = response.replace("\u00A0", " ").replace(/[\r\n]+/g, "\n");
                    $("div.profile").html(response);

                    pesanOk("success update profile info");
                    
                }else{
                    pesanErr("Oops try again");
                }
                }
            });
});     

AjaxController.php

public function postUpdateprofileInfo(Request $request)
    {

    $domain = $_SERVER['SERVER_NAME'];
    $user = User::where('domain', $domain)->first();

    $here = $request->input("profile_info");
    dd($here);

    if ($user) {
        $user_setting = Setting::where('user_id', $user->id)->first();
        $user_setting->info_profile = $request->input("profile_info");
        $act = $user_setting->save();
        if (!$act) {
            $message = "error";
        } else {

            $message = \Soulfy\Timeline::split_words($request->input("profile_info"), 2000, "...");
        }


        return response()->json($message);

    }
}

4th January, 2018

davy_yg started a new conversation Redirect With A Button • 1 month ago

Hello,

How to create a button which redirect to certain location within the same page ?

I think using Jquery?

davy_yg started a new conversation Saving Form With Javascript • 1 month ago

partial/setting.blade.php

<div class="setting-box profile-open">
    <form role="form" id="form_update_profile_info" method="post" action="{{action('[email protected]')}}">


        <div class="form-group">
             
            <div class="col-group">
                <textarea style="height: 150px;" class="form-control" id="profile_info" name="profile_info">{{$user_setting['info_profile']}}</textarea>

            </div>
        </div>




</form>
</div>

...

$(".setting-nav-save").click(function(e){
    e.preventDefault();
     var profile_info = $("#profile_info").val();
                 
        $.ajax({
            type: "POST",
            url: '{{action("[email protected]")}}',
            dataType : "text",
            data : {
                 profile_info : profile_info,
            },
            success: function (response) {
                if (response!="error") {
                    $("div.profile").show();
                    $(".setting-nav-save").hide();
                    $(".setting-nav-cancel").hide();
                    $(".setting-nav-edit").show();
                    $("div.profile-open").hide();
                    response = response.replace('"',' ');
                    response = response.replace('"','');
                    response = response.replace("\u00A0", " ").replace(/[\r\n]+/g, "\n");
                    $("div.profile").html(response);

                    pesanOk("success update profile info");
                    
                }else{
                    pesanErr("Oops try again");
                }
                }
            });
});

AjaxController.php

 public function postUpdateprofileInfo(Request $request)
{

    $domain = $_SERVER['SERVER_NAME'];
    $user = User::where('domain', $domain)->first();

    $here = $request->input("profile_info");
    dd($here);

    if ($user) {
        $user_setting = Setting::where('user_id', $user->id)->first();
        $user_setting->info_profile = $request->input("profile_info");
        $act = $user_setting->save();
        if (!$act) {
            $message = "error";
        } else {

            $message = \Soulfy\Timeline::split_words($request->input("profile_info"), 2000, "...");
        }


        return response()->json($message);

    }
}

I printed out $here and the value does not changes after I update the date. I wonder why?

3rd January, 2018

davy_yg left a reply on Update Business Card • 1 month ago

Where does this : .ajaxForm(options) - refers to?

davy_yg started a new conversation Update Business Card • 1 month ago

bcard.blade.php

<form role="form" method="post" id="form_update_business_card" action="{{action("[email protected]")}}">

                        <div class="form-top">
                            <label>My Business Card</label>
                        </div>
                        <div class="form-body">
                            <div class="form-inline">
                                <ul id="business_card">
                                    <li>
                                        <span>Name </span> : <input style="width: 64%" name="full_name" type="text" value="{{$user->full_name}}">
                                        <br>
                                    </li>
                                    <li>
                                        <span>Address</span> : <input style="width: 64%" name="address" type="text" value="{{$user->address}}">
                                    </li>
                                    {{--<li>--}}
                                        {{--<span>Occupation</span> : <input style="width: 64%" name="occupation" type="text" value="{{$user->occupation}}">--}}
                                    {{--</li>--}}
                                    <li>
                                        <span>Phone</span> : <input style="width: 64%" name="phone" type="text" value="{{$user->phone}}">
                                    </li>
                                    <li>
                                        <span>Fax</span> : <input style="width: 64%" name="fax" type="text" value="{{$user->fax}}">
                                    </li>
                                    <li>
                                        <span>Email</span> : <input style="width: 64%" name="website" type="text" value="{{$user->email}}">
                                    </li>

                                </ul>
                            </div>
                        </div>

...

$('#form_update_business_card').ajaxForm(options);

What does this code means?

$('#form_update_business_card').ajaxForm(options);

davy_yg left a reply on Upgrade Php Version • 1 month ago

I change the .htaccess to this:

 <IfModule mod_rewrite.c>
 <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%    {HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “alt-php56” package as the default “PHP” programming language.
<IfModule mime_module>
AddType application/x-httpd-alt-php56___lsphp .php .php5    .phtml

sudo apt-get install php7.0-fpm 
sudo apt-get install php7.0-mbstring 
sudo apt-get install php7.0-mcrypt 
sudo apt-get install php7.0-zip

</IfModule>
# php -- END cPanel-generated handler, do not edit

# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation  (https://go.cpanel.net/EA4ModifyINI)
<IfModule php5_module>
php_value date.timezone "Asia/Jakarta"
</IfModule>
# END cPanel-generated php ini directives, do not edit

Now, I am getting this error:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

davy_yg left a reply on Upgrade Php Version • 1 month ago

I also get this error:

Warning: require(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/advancew/framework_vitalami/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 233

If I use this code:

require DIR.'/../../framework_vitalami/vendor/autoload.php';

davy_yg left a reply on Upgrade Php Version • 1 month ago

Warning: require(/home/advancew/public_html/vitalami.advance-web-studio.com../../framework_vitalami/vendor/autoload.php): failed to open stream: No such file or directory in /home/advancew/public_html/vitalami.advance-web-studio.com/index.php on line 24

I place line 24:

require DIR.'../../framework_vitalami/vendor/autoload.php';

in advancew/framework_vitalami/vendor/autoload.php

That's where the auto load is.

Why the error still exist?

http://www.vitalami.advance-web-studio.com/

2nd January, 2018

davy_yg started a new conversation Modifying Url Part #2 • 1 month ago

Hello,

Cek this site: http://www.soulfy.com/?a=add&pid=5

I wonder why there is something after the last /

I search the code looking for ?a and found:

index.html

    $(document).ready(function () {
        if (searchQuery('a') && searchQuery('pid')) {
            $.get('cart.php?a=add&pid=5');
            return;
        }
        var uri = location.href;
        uri = updateQueryStringParameter(uri, 'a', 'add');
        uri = updateQueryStringParameter(uri, 'pid', '5');

        location.href = uri;
    });

</script>

I wonder what it means. If I delete this: a=add&pid=5 will it creates problem?

Someone mention that it is a redirect to that page. but I am not quite sure about this.

Thanks for advice.

davy_yg started a new conversation Modifying The Url • 1 month ago

Cek this website: www.soulfy.com/index.php

I wonder how do they create this website. This is the value of index.php and I am assign to delete the value after index.php

http://www.soulfy.com/index.php?a=add&pid=5 which is ?a=add&pid=5 how?

index.php

<?php //00e57
// *************************************************************************
// *                                                                       *
// * WHMCS - The Complete Client Management, Billing & Support Solution    *
// * Copyright (c) WHMCS Ltd. All Rights Reserved,                         *
// * Version: 6.2.0 (6.2.0-release.1)                                      *
// * BuildId: 9700299.89                                                   *
// * Build Date: 09 Dec 2015                                               *
// *                                                                       *
// *************************************************************************
// *                                                                       *
// * Email: [email protected]                                                 *
// * Website: http://www.whmcs.com                                         *
// *                                                                       *
// *************************************************************************
// *                                                                       *
// * This software is furnished under a license and may be used and copied *
// * only  in  accordance  with  the  terms  of such  license and with the *
// * inclusion of the above copyright notice.  This software  or any other *
// * copies thereof may not be provided or otherwise made available to any *
// * other person.  No title to and  ownership of the  software is  hereby *
// * transferred.                                                          *
// *                                                                       *
// * You may not reverse  engineer, decompile, defeat  license  encryption *
// * mechanisms, or  disassemble this software product or software product *
// * license.  WHMCompleteSolution may terminate this license if you don't *
// * comply with any of the terms and conditions set forth in our end user *
// * license agreement (EULA).  In such event,  licensee  agrees to return *
// * licensor  or destroy  all copies of software  upon termination of the *
// * license.                                                              *
// *                                                                       *
// * Please see the EULA file for the full End User License Agreement.     *
// *                                                                       *
// *************************************************************************
if(!extension_loaded('ionCube Loader')) {$__oc=strtolower(substr(php_uname(),0,3));$__ln='ioncube_loader_'.$__  oc.'_'.substr(phpversion(),0,3).(($__oc=='win')?'.dll':'.so');  if(function_exists('dl')){@dl($__ln);}if(function_exists('_il_exec')){return    _il_exec();}$__ln='/ioncube     /'.$__ln;$__oid=$__id=realpath(ini_get('extension_dir'));$__here=dirname(   __FILE__);if(strlen($__id)>1&&$__id[1]==':')    {$__id=str_replace('\','/',substr($__id,2));$__here=str_replace('  \','/',substr($__here,2));}$__rd=str_repeat('/..',substr_count($__id,' /')).$__here.'/';$__i=strlen($__rd);while($__i--){if($__rd[$__i]==' /'){$__lp=substr($__rd,0,$__i).$__ln;if(file_exists($__oid.$__lp)){$__ln=$__lp; break;}}}if(function_exists('dl')){@dl($__ln);}}else{die('The file '.__FILE__." is corrupted.\n");}if(function_exists('_il_exec')){return   _il_exec();}echo('Site error: the file <b>'.__FILE__.'</b> requires the     ionCube PHP Loader '.basename($__ln).' to be installed by the website   operator. If you are the website operator please use the <a     href="http://www.ioncube.com/lw/">ionCube Loader Wizard</a> to  assist with installation.');exit(199);
?>

davy_yg left a reply on Upgrade Php Version • 1 month ago

Laravel Framework 5.5.24

I have an .htaccess file in my public_html/vitalami.advance-web-studio.com

.htaccess

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews -Indexes
</IfModule>

RewriteEngine On

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

php -- BEGIN cPanel-generated handler, do not edit

Set the “alt-php56” package as the default “PHP” programming language.

AddType application/x-httpd-alt-php56___lsphp .php .php5 .phtml

php -- END cPanel-generated handler, do not edit

BEGIN cPanel-generated php ini directives, do not edit

Manual editing of this file may result in unexpected behavior.

To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)

For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)

php_value date.timezone "Asia/Jakarta"

END cPanel-generated php ini directives, do not edit

I don't know what I did wrong.

davy_yg started a new conversation Upgrade Php Version • 1 month ago

Hello,

My website : http://www.vitalami.advance-web-studio.com/

After I upgrade my php version from php 5 to php 7 turns into a blank white screen. What should I do ?

I upgrade it since I have another website in that same domain in order to make it works.

davy_yg started a new conversation Edit Product • 1 month ago

Parse error: syntax error, unexpected '@' (View: C:\xampp\htdocs\eliteshop\resources\views\admin\products\edit_product.blade.php)

        <?php ($i = 0)
      @foreach($categories as $category)
        <label class="checkbox">

Line: @foreach($categories as $category)

is highlighted. What's wrong with it?

davy_yg left a reply on @extends Or @include • 1 month ago

Is this:

<link rel="stylesheet" href="{{ URL::asset('themes/style/add.css') }}"      /> 

The same like:

 <link rel="stylesheet" href="{{ url('')/themes/style/add.css') }}">
Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.