Skip to main content

Posts

Showing posts from March, 2024

Here is a code to convert a div section to pdf directly by clicking on a button

  <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title > Document </ title > </ head > < body > < script src = "//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" ></ script > < script src = "//cdnjs.cloudflare.com/ajax/libs/jspdf/1.2.61/jspdf.debug.js" ></ script > < script > $ ( document ). ready ( function () {     var doc = new jsPDF ();     $ ( '#cmd' ). click ( function () {         doc . fromHTML ( $ ( '#content' ). html (), 15 , 15 , {             'width' : 170 ,         }, function () {             doc . save ( 'sample-file.pdf' )         });     }); }); </ script > ...

upload.php for the app for uploading the excel sheet in kdp data of samudra

<?php include("../header.php"); require("connect.php"); if (isset($_POST['samudra'])) {     $file = $_FILES['doc']['tmp_name'];     $ext = pathinfo($_FILES['doc']['name'], PATHINFO_EXTENSION);     if ($ext == 'xlsx' or 'XLSX') {         require('PHPExcel/PHPExcel.php');         require('PHPExcel/PHPExcel/IOFactory.php');         $obj = PHPExcel_IOFactory::load($file);         foreach ($obj->getWorksheetIterator() as $sheet) {             $getHighestRow = $sheet->getHighestRow();             for ($i = 0; $i <= $getHighestRow; $i++) {                 $bmc = $sheet->getCellByColumnAndRow(0, $i)->getValue();                 $route = $sheet->getCellByColumnAndRow(1, $i)->getValue();           ...

coding for the rate calculation of dcs

if ($_GET['updatekg']==0) {     $query = "SELECT * FROM `samudra` WHERE `date`='$_GET[date]' AND `status`='0' ";     $res = mysqli_query($con, $query);     while ($row = mysqli_fetch_assoc($res)) {         $fatkg = ($row['fat'] * $row['qty']) / 100;         $snfkg = ($row['snf'] * $row['qty']) / 100;         if (3 <= $row['fat'] && $row['fat'] <= 5.4 ) {             $queryrate = "SELECT * FROM `rate0` WHERE `fat`='$row[fat]' AND `snf`='$row[snf]'";             $resrate = mysqli_query($con, $queryrate);             if (mysqli_num_rows($resrate) != 0) {                 $rowrate = mysqli_fetch_assoc($resrate);                 $rate = $row['qty'] * $rowrate['rate'];                 ...