Jump to content

vikaspa

Members
  • Posts

    74
  • Joined

  • Last visited

About vikaspa

  • Birthday 11/13/1959

Contact Methods

  • Website URL
    http://www.prajaktasoftware.com

Profile Information

  • Gender
    Not Telling
  • Location
    India

vikaspa's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Dear All I tacked this issue in following manner when php read a cell that stores "TRUE" or "FALSE" suppose php variable $a1 stores cell A:1<TRUE> php variable $a2 stores cell A:2<FALSE> in this case a1=1 when it gets ($a1 php value) value "TRUE" and a2(cell A:2 value) will have value NULL ($a2 php value) ------------------------------------------------------- php variable $a2 stores cell A:1<TRUE> php variable $a1 stores cell A:2<FALSE> if ( ($a2=='') or ($a2==' ') or ($a2=='')) // check for false and oter variable eis true { $a2='FALSE'; $a1='TRUE'; } php variable $a2 stores cell A:1<FALSE> php variable $a2 stores cell A:2<TRUE> in this case a2=1 when it gets value "TRUE" and a2(cell A:2 value) will have value NULL ------------------------------------------------------- if ( ($a1=='') or ($a1==' ') or ($a1=='')) ) // check for false and other variable true { $a1='FALSE'; $a2='TRUE'; }
  2. Dear All Using following code We can read data properly except when cell value stored is “TRUE” or “FALSE” I get 1 and blank I want TRUE or FALSE as text and not logical operator How to read / get only values stored in cell My code include(‘PHPExcel-develop/Classes/PHPExcel/IOFactory.php’); try { $objPHPExcel = PHPExcel_IOFactory::load($inputFileName); } catch(Exception $e) { die(‘Error loading file "’.pathinfo($inputFileName,PATHINFO_BASENAME).’": '.$e->getMessage()); } $allDataInSheet = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true); $arrayCount = count($allDataInSheet); // the to get cell data $excelsrno=trim($allDataInSheet[$i][“A”]); $q= trim($allDataInSheet[$i][“B”]); $a1= trim($allDataInSheet[$i][“C”]); $a2= trim($allDataInSheet[$i]["D"] ); $a3= trim($allDataInSheet[$i]["E"] ); $a4= trim($allDataInSheet[$i]["F"] ); $a= preg_replace('/[^0-9]/', '', trim($allDataInSheet[$i]["G"])); $level=trim($allDataInSheet[$i]["H"]); $marks=trim($allDataInSheet[$i]["I"]);
  3. I tried the reverse part when timing is blank, uncheck the checkbox however let weekday = $(".weekday[data-id="+id+"]") ; ==> I am getting this undefined pls help code $('.timing').blur(function() { let id = $(this).data("id") let timing=$(this).text().trim(); //text stored in timing console.log('timing text ='+timing); // display the text stored in timing let weekday = $(".weekday[data-id="+id+"]") ; // find timing input with same data-id value // i am getting weekday as unefined console.log( 'timing blur weekday '+weekday ); // timing blur weekday [object Object] if (timing =='') // text is blank { $(weekday).prop('checked', true);// set checkbox checked } }); else { $(weekday).prop('checked', false);// set checkbox un-checked } });
  4. <input name="weekday[8]" type="checkbox" value="21" class="weekday" checked=""> <input name="timing[8]" type="text" id="name" value="11" size="45" /> <input name="weekday[9]" type="checkbox" value="99" class="weekday" checked=""> <input name="timing[9]" type="text" id="name" value="12" size="45" /> <input name="weekday[10]" type="checkbox" value="77" class="weekday" checked=""> <input name="timing[10]" type="text" id="name" value="13" size="45" /> I have above html code 1. when checkbox for checkbox name="weekday[8]" is clicked, I want to check whether timing[8] is empty or not (we need to derive field name timing[8] from field name weekday[8] 2. when timing[8] some value is entered , i want to name="weekday[8]" -> checked (we need to derive field name weekday[8] from timing[8] we can find the name (jquery) $('.weekday').click(function(){ var checkboxname=$(this).attr('name'); // we get checkbox clicked name=name[8] console.log('checkbox name='+checkboxname); }) In simple case (without dimension) this is easy we get name of field (checkbox is clicked) as name[8] i want to derive field name timing[8] i tried (jquery) $('.weekday').click(function(){ var checkboxname=$(this).attr('name'); console.log('checkboxname='+checkboxname);// i got this correct weekday[8] in this case var splitname=checkboxname.split('weekday');// seperated [8] , console.log(splitname[0]+' 1='+splitname[1]); //splitname[1] will have [8] //now want to form or generate value of variable mobile[8] var n='mobile'+splitname[1];//the n will be mobile[8] console.log('n='+n);// ths will be mobile[8] var inp=$('input[name="'+n+'"]').val(); console.log(' inp='+inp);// but no success //here I want value of $('input[name=name[8]').val(); }) Please guide how i derive (using jquery) filed name mobile[8] from filed name[8]
  5. I really appreciate prompt reply As specified by you I am getting values for $_POST['weekday'][$i] code do { //reading weekday table and assigning id as index ?> <tr> <td class='text15' > <input name="weekday[<?php $rows['id'];?>]" type="checkbox" value="<?php echo $rows['id'];?>" class='weekday' /> <?php echo $rows['name'] ;?> <br>Timing <input type="text" name="timing[<?php $rows['id'];?>]" class='timepicker timing' /> </td> </tr> <?php } while ($rows=$query->fetch()); ?> after submit $cntr=count($_POST['weekday']); echo "weekday count=".count($_POST['weekday']); echo "timing count=".count($_POST['timing']); for($i=8; $i < 18 ; $i++) { echo "<br>".$i." Loop Week day =>". $_POST['weekday'][$i]." timing =>". $_POST['timing'][$i]; } output weekday count=5 8 Loop Week day => timing => 9 Loop Week day =>9 timing => 10 Loop Week day =>10 timing => 11 Loop Week day =>11 timing => 12 Loop Week day =>12 timing => 13 Loop Week day =>13 timing => 14 Loop Week day => timing => 15 Loop Week day => timing => 16 Loop Week day => timing => 17 Loop Week day => timing => We get the values for weekday[9], weekday[10], weekday[11], weekday[12], weekday[13] ------------------------------------------------------------ but not getting any values for timing[9], timing[10], timing[11], timing[12], timing[13] pls help
  6. Dear All I am accepting following 2 field in a form one is checkbox and another is input <input name="weekday[]" type="checkbox" value="<?php echo $rows['id'];?>" class='weekday' /> <?php echo $rows['name'] ;?> <br>Timing <input type="text" name="timing[]" ' class='timepicker ' /> the form look like this (refer image) after submit i can get checkbox value After submit I tried $cntr=count($_POST['weekday']); for($i=0; $i < $cntr=count($_POST['weekday']) ; $i++) { echo "<br>".$i." Loop Week day =>". $_POST['weekday'][$i]." timing =>". $_POST['timing'][$i]; // Addcenterdaystime($staffcompanyid, $newid, $_POST['weekday'][$i], $_POST['timing'][$i] ) ; } However could not get values of timing pls help
  7. Dear Sir if (version_compare(PHP_VERSION, '5.3', '>=')) { error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED); } else { error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE); } I want to know whether this code DONOT ALLOW execution in case PHP verson is > 5.3 and above complete code switch (ENVIRONMENT) { case 'development': error_reporting(-1); ini_set('display_errors', 1); break; case 'testing': case 'production': ini_set('display_errors', 0); if (version_compare(PHP_VERSION, '5.3', '>=')) { error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED); } else { error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE); } break; default: header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); echo 'The application environment is not set correctly.'; exit(1); // EXIT_ERROR }
  8. Dear GIZMOLA Thanks a TON for the reply. I will check this and revert
  9. Dear All Code generated from https://github.com/dompdf/dompdf/issues/2481 I am using dompdf 2.0 Main program to create pdf https://prajaktasoftware.com/onlineexam/vendor-special-message.php <- input html file forms input to generated PDF https://prajaktasoftware.com/onlineexam/testfont-1.php <- program that generates pdf using above program I am using dompdf (testfont-1.php) the output generated shows ??? characters pls help <?php ob_start(); include 'vendor-special-message.php'; // pdf generatef from this file $_template = ob_get_clean(); require( 'dompdf/autoload.inc.php'); use Dompdf\Dompdf; $dompdf=new Dompdf(); //$dompdf->loadHtml($_template, "UTF-8"); $dompdf->loadHtml($_template, "UTF-8"); $dompdf->setPaper("A4", "portrait"); $dompdf->set_option('isFontSubsettingEnabled', true); $dompdf->set_option('defaultMediaType', 'all'); $dompdf->set_option('isRemoteEnabled', true); $dompdf->render(); $dompdf->stream( time() . ".pdf", array("Attachment" => false)); // $dompdf->stream(); // stream the pdf in browser exit; ?> vendor-special-message.php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; UTF-8"> <style> @import url('https://fonts.googleapis.com/css2?family=Hind:wght@300&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200&display=swap'); div {font-family: 'Hind', sans-serif;} body { font-family: 'Oswald', sans-serif } </style> </head> <body> <p>Happy Birthday</p> <p>Happy Birthday</p> <p>Happy Birthday</p> <div>सभ मानव जन्मतः स्वतन्त्र अछि तथा गरिमा आʼ अधिकारमे समान अछि। सभकेँ अपन–अपन बुद्धि आʼ विवेक छैक आओर सभकेँ एक दोसराक प्रति सौहार्दपूर्ण व्यवहार करबाक चाही।</div> </body> </html>
  10. Dear All Can I display display url http://www.mywebsite.com/abcd.php?id=1 as http://www.mywebsite.com/abcd.php/1 or http://www.mywebsite.com/contact.php as http://www.mywebsite.com/contact pls help
  11. Dear All I am trying to seperate the rows from a table (html) in order to do this as a 1st step I am doing $str1 = preg_replace('/<tr >/', "<tr>", $str1); $str1 = preg_replace('/<td >/', "<td>", $str1); so that all <tr > will become <tr> .. removing space and <td > will become </td>.. removing spaces As a next step I am trying $str1 = preg_replace('/<tr> <td>/', "\n", $str1); replace start of row with \n i.e. new line feed But it doesnot work pls help <tr> <td> दिनांक</td> <td> वार</td> <td> मास</td> <td> कृष्ण / शुक्ल</td> <td> तिथी</td> <td> वार</td> <td> यात्रा/जत्रा/ ऊरुस/ उत्सव/ जयंती/ पुण्यतिथी</td> <td> ठिकाण</td> <td> तालुका जिल्हा</td> </tr> I have Unicode data ..whether the unicode data is an issue or something else Pls help no replacements are made
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.