Skip to main content

Posts

Featured Post

Recent posts

store data to make grn and gp

  <?php require ( "connect.php" ); session_start (); date_default_timezone_set ( 'Asia/Kolkata' ); $date = date ( "Y-m-d" ); $time = date ( "h:i:sa" ); $gp = rand ( 111 , 999 ) . date ( "dmy" ) . date ( "hi" ); if ( isset ( $_GET [ 'del' ])) {     $query = " UPDATE `cart` SET `status` = '5' WHERE `id` = ' $_GET [del]' " ;     if ( mysqli_query ( $con , $query )) {         echo "<script>window.location.href='brief.php?id=1&oid= $_GET [oid]'</script>" ;     } } // if (isset($_GET['acc'])) { //     // } if ( isset ( $_POST [ 'value' ])) {     $query = " SELECT * FROM `socitems` WHERE `id` = ' $_POST [prodid]' " ;     $res = mysqli_query ( $con , $query );     $row = mysqli_fetch_assoc ( $res );     $rate0 = $_POST [ 'quan' ] * $row [ 'rate' ];     $rate = $rate0 + ( $rate0 * $row [ 'gst...

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'];                 ...

strings in javascript

 here in this blog we are going to learn about the strings in the javascript replit link(fb login) here are the following examples. let name ="anwar" // console.log(name) // console.log(name.length) // console.log(typeof name) // console.log(name[1]) // // template literals in StringList // let name1= "sabih" // let name2="anwar" // let sentence=`my name is ${name1} ${name2}` // console.log(sentence) // // escape sequence characters // name='anw\'ar' // console.log(name) // name='anw\nar' // console.log(name) // name='anw\tar' // console.log(name) // name='anw\rar' // console.log(name) // escape sequence character types // \b Backspace // \f Form Feed // \n New Line // \r Carriage Return // \t Horizontal Tabulator // \v Vertical Tabulator // console.log(name.toUpperCase()) // console.log(name.toLowerCase()) // console.log(name.slice(2)) // console.log(name.slice(2,4)) // console.log(name.replace("an...