This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$link = mysqli_connect("localhost", "newuser", "password", "proj1"); | |
if($link === false){ | |
die("ERROR: Could not connect. " . mysqli_connect_error()); | |
} | |
// Attempt select query execution | |
$q = $_GET['q']; | |
$sql = "SELECT * FROM t2 WHERE f1 = '$q'"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const getDataSearch = ({ fulldata }) => { | |
return { | |
type: GET_DATA_SEARCH, | |
payload: fulldata | |
} | |
} | |
export const searchChanged = (text) => { | |
return { | |
type: SEARCH_TEXT, | |
payload: text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const contains = ({ name, date, place }, query) => { | |
if ( | |
name.toLowerCase().includes(query) || | |
date.toLowerCase().includes(query) || | |
place.toLowerCase().includes(query) || | |
name.includes(query) || | |
date.includes(query) || | |
place.includes(query) | |
) { | |
return true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
searchChanged, | |
contains, | |
getDataSearch | |
} from '../../actions/searchActions'; | |
import _ from 'lodash'; | |
class Search extends React.component { | |
// function yang akan dipanggil ketika TextInput diisi | |
handleSearch = (text) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { createStore } from "redux"; | |
import { Provider } from "react-redux"; | |
import reducer from './src/Reducer/index'; | |
import TextInputChecker from './src/Component/TextInputChecker'; | |
class App extends React.Component { | |
render() { | |
return ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PASSWORD_CHANGED } from './types'; | |
export const passwordChecker = (text) => { | |
return { | |
type: PASSWORD_CHANGED, | |
payload: text | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PASSWORD_CHANGED } from '../Action/types'; | |
const initialState = { password: '' } | |
export default function textInputCheckerReducer (state= initialState, action){ | |
console.log(action); | |
switch(action.type) { | |
case PASSWORD_CHANGED: | |
return { ...state, password: action.payload } | |
default: | |
return state |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { combineReducers } from "redux"; | |
import textInputCheckerReducer from '../Reducer/TextInputCheckerReducer'; | |
export default combineReducers({ | |
textInputCheckerReducer | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { View, TextInput, Text, StyleSheet, TouchableOpacity } from 'react-native'; | |
import { connect } from "react-redux"; | |
import { passwordChecker } from '../Action/TextInputCheckerAction'; | |
class TextInputChecker extends React.Component { | |
checker(){ | |
const passwordParam = "^(?=.{5,})(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=]).*$" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const passport = require('passport'); | |
const GoogleStrategy = require('passport-google-oauth20').Strategy; | |
const keys = require('./config/key') | |
const app = express(); | |
passport.use(new GoogleStrategy( | |
{ |
OlderNewer