lundi 1 novembre 2021

How to retrive from other table and input it again into another table in laravel?

I want to retrieve some data from 'tbl_karyawan' and input into 'tbl_absen' which is if the NIP exist from 'tbl_karyawan' then parshing some data into 'tbl_absen'. I was create the code, and the data is going well. but i have something trouble with tbl_absen

i want the data input in Nip_kyn be like 'KIP001' not [{"Nip_kyn":"KIP001"}].

this is my Model

 public function presensi($data)
{
    $isExist = DB::table('tbl_karyawan')
        ->where('Nip_kyn', $data)->exists();

    if ($isExist) {

        
        $namakyn = DB::table('tbl_karyawan')->where($data)->get('Nama_kyn');
        $nippppp = DB::table('tbl_karyawan')->where($data)->select('Nip_kyn')->get($data);

        $values = array('Nip_kyn' => $nippppp, 'Nama_kyn' => $namakyn, 'Jam_msk' => now(), 'Log_date' => today());
        DB::table('tbl_absen')->insert($values);
    } else {
        echo 'data not available';
    }
}

this is my controller

public function get()
{
    $day = [
        'time_in' => $this->AbsenModel->timeIN(),
        'time_out' => $this->AbsenModel->timeOut(),
        'break' => $this->AbsenModel->break(),
        // absen here
        's' => $this->AbsenModel->absensi(),
    ];

    $data = [
        'Nip_kyn' => Request()->Nip_kyn,
    ];
    $this->AbsenModel->presensi($data);

    return view('v_absen', $data, $day);
}



Issues with Freenom Domains [closed]

I resigested a freenom domain recently with a .tk address and have wanted to use it for email. How do you do it? I assume that the target is the IP of my server and the name is a subdomain. Help would be appreciated. Freenom MX Record Thing




MS Visual Studio "Error CS0103 The name 'GridView1' does not exist in the current context"

I have an old Web App (ASP.NET Web forms) developed in VS 2015 and it runs fine under that version (see details here). Microsoft Visual Studio Community 2015 Version 14.0.25420.01 Update 3

When I open it with VS 2019 (version details below) I get the above error but it runs fine when I start it up. Microsoft Visual Studio Community 2019 Version 16.11.5

Have been searching around but no luck - very perplexing - any ideas please ?




Follow up - Google Script to Fill out HTML Form

I tried commenting on the response by Rob in the original post: Google Script to Fill out HTML Form

But I am shy of 11 points to do so, hence asking my own question here. I have a similar web form automation requirement and I like Rob's response on using

UrlFetchApp.fetch(url, options)

I like this approach as it is clean, and can wait for response from server. This helps in batch processing multiple forms. There is no fiddling around with DOM elements or adding delays that may fail due to runtime issues like sudden drop in internet speed.

My question however is, how do I create session if the website requires me to login? I did lookup documentation but couldn't find session options: https://developers.google.com/apps-script/reference/url-fetch/url-fetch-app

I am open to suggestions if I can write my own program in VSCode using Node.js, JQuery, javascript etc, that loads json file as data and something that I can post on GitHub/GitLab for others to use as well. I know VBA method of doing it, but it relies on DOM elements to mimic user interaction. There is another program mini mouse macro that has a great reputation, but its an exe and mimics user interaction of clicks and delays. I want to see code that I am running.




Why is the state undefined in redux

I am trying to get some data from a reducer in redux and when I get the state using useSelector it return undefined I have tried to use console.log to log the data as well seeking help from other stackoverflow posts can anyone help?

Thanks!

Code:

import foo from "foo";
import React from "react";
import useSelector from "react-redux";

function fooBar():React.FC {
let data = useSelector(state:StateType=>{state.fooBar});
return(
<div>
<p>{data}</p>
</div>
);
}



Idea for distributed web services project [closed]

I have a project assignment about web services in a distributed environment and I could use some ideas. Technologies are HTTP, SOAP, XML, UDDI.

What would you recommend in terms of the environment? I have access to a local server running VMWare, I can go on AWS or even O365.

What are the products that I need to quickly create a concept?

So far I have analysed the requirements and installed tools like python, docker, etc.




Signup email confirmation onclick button stopped work with no code change?! Help appreciated

so I've encountered a problem where the submit button on a web page built on the Microsoft Azure platform is not responding as it should.

After entering their information and clicking submit the site should redirect to the thank you page and automatically send the user a confirmation email.

It was working fine before, and the code has not been changed since.

Anybody have any idea why would be super helpful thanks.

Maybe be helpful idk: The submit button has an onclick function call __doPostBack(...)

Thanks for the help.