This file contains 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
// using JQuery | |
function copyToClipboard(element) { | |
var $temp = $("<input>"); | |
$("body").append($temp); | |
$temp.val($(element).text()).select(); | |
document.execCommand("copy"); | |
$temp.remove(); | |
} | |
This file contains 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
protected function downloadCSV(Request $request){ | |
$table = UserAccount::orderBy('created_at','desc')->with('user')->get(); | |
$filename = "writers.csv"; | |
$handle = fopen($filename, 'w+'); | |
fputcsv($handle, array('user_name','user_email','mobile','account_no','account_holdername','account_type','bank_name','bank_ifsc_code','country','state','address','zip_code','city')); | |
foreach($table as $row) { | |
fputcsv($handle, array( | |
$row['user']['name'], | |
$row['user_email'], | |
$row['mobile'], |
This file contains 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
use GuzzleHttp\Client; | |
$client = new \GuzzleHttp\Client(); | |
$response = $client->request('POST','http://51.15.140.211:3333/send',[ | |
'headers' => [ | |
'content-type' => 'application/x-www-form-urlencoded', | |
], | |
'form_params' => [ | |
'name'=>$event->user->name, |
This file contains 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
$to =$user->email; | |
$subject = 'the subject'; | |
$message = 'hello'; | |
$headers = 'From: [email protected]' . "\r\n" . | |
'Reply-To: [email protected]' . "\r\n" . | |
'X-Mailer: PHP/' . phpversion(); | |
mail($to, $subject, $message, $headers); |
This file contains 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
<html> | |
<script defer src="https://use.fontawesome.com/releases/v5.0.8/js/all.js"></script> | |
<input id="file" type="file" name="files[]" accept=".jpg,.jpeg,.png" multiple/> | |
<div id="preview"></div> | |
</html> | |
<script> | |
var finalFiles = {}; | |
This file contains 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
function getParameterByName(name, url) { | |
if (!url) url = window.location.href; | |
name = name.replace(/[\[\]]/g, "\\$&"); | |
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), | |
results = regex.exec(url); | |
if (!results) return null; | |
if (!results[2]) return ''; | |
return decodeURIComponent(results[2].replace(/\+/g, " ")); | |
} |