Skip to content

Instantly share code, notes, and snippets.

View VikashBlabs's full-sized avatar

Vikash Kumar VikashBlabs

View GitHub Profile
@VikashBlabs
VikashBlabs / jspdf-invoice-template.php
Created July 3, 2024 11:34
jsPDF Invoice Template Generator
<script src="https://unpkg.com/jspdf-invoice-template@1.4.4/dist/index.js"></script>
<script>
async function generatePdf() {
// Extract product details from server-side variable
var productDetails = <?php echo json_encode($ProductDetailsforInvoices); ?>;
var tableData = [];
var index = 1;
// Construct table data for the invoice
for (var productId in productDetails) {
@VikashBlabs
VikashBlabs / msg91.php
Last active May 13, 2025 07:57
SMS Integration with MSG91 in cURL PHP
<?php
/**
* Steps Required Before Execution
* 1. Login/Signup to MSG91
* 2. Create a Sender ID and get the sender id approved by MSG91
* 3. Get AuthKey
*/
// Initialize request array
@VikashBlabs
VikashBlabs / croppedimageupload.php
Created March 4, 2024 11:10
Image Upload using FTP in PHP with Cropper.js Plugin
<!-- --------------HTML CODE ---------------- -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/cropper/4.1.0/cropper.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/cropper/4.1.0/cropper.min.js"></script>
<!-- Image Upload Section -->
<div class="form-group" id="image_section">
<label>Event Images</label>
<div class="image_preview_main"></div>
<div style="width: 600px;height: 364px;" class="center-block">
<img id="preview_img" class='img-thumbnail center-block' src="https://www.motiv8search.com/images/1709386060_7f878ed5-ee52-4c1f-a5e0-92f3cfc91942.jpg" alt="preview image" style="display: block; max-width: 100%;">
</div>
@VikashBlabs
VikashBlabs / OrderCSV.php
Created March 2, 2024 10:31
CSV Data Download in PHP
<?php
// Set headers for CSV download
header('Content-Type:text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename=data.csv');
// Open output stream
$output = fopen("php://output", "w");
// Define CSV columns
$columns = array('order_id', 'user_id', 'userName', 'user_email', 'user_phone', 'product_Srno', 'product_Name', 'product_Link', 'product_total', 'product_status');
@VikashBlabs
VikashBlabs / imageUpload.php
Created August 4, 2023 13:57
UPLOAD IMAGES FROM URL
<?php
$getphoto = "https://maps.googleapis.com/maps/api/place/photo?maxwidth=400&photo_reference=".$row["photo_reference"] ."&key=" .$key;
$photoData = file_get_contents($getphoto);
$path = tempnam(sys_get_temp_dir(), "php");
file_put_contents($path, $photoData);
$username = brilliantDirectories::getDatabaseConfiguration("website_user");
$password = brilliantDirectories::getDatabaseConfiguration("website_pass");