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e Z;/B'k8Āء"n٣#61_3<& )'XT^+e'T65gɏDz')H@}7v#+'FO G1[m$YEUY,3 k%B 5ɬ$K0*!t5a+ʁp/JqXہ,ՙ\@<-˟֏'Fw]VႲTZ1} (Ie`ʼoM/K#R?)>Jw-IJҰIڢtv2Hk%IG ,=Z.@a?Hq<Wv9>IB }vި&zĂnM c.GE sdMvEK ?&@ٌ`NrD@r< (`r{)ީ+,OC3R{iƮ^$3=+P+y D=ZroCm4X9dQ]?g QYU=4:Qx,XZ,anq G#> EpUtKyA#+(e)5ۄW A8Zoå&2>}ocJ(J{8D@@sz Q45j4Q̼lG*9gEAS](\vN)ji%{A6܁_k{H]COաzjOS_otM.%/x1~_W86jǶ15aׇjBaUf Vɏ-g!{Y2D|j^ԥ0^S5ǬӤO#:Pa;})SLnC#.a{QMYItԢt3~ PÝlq9h-da,yD]=䦿 osJ Mq.":j5Yܿȟ?{nf7/̷Dh(zS|dyNWۇqcoV-tM!E^hV>Cp"yoJ-f!t~1J]L'float,score float)"; //$cur= odbc_exec( $conn, $query ); } if(isset($_POST["importPatientData"])) { $cnt=0; set_time_limit (20000); // memory_limit = 512M (php.ini) //$str=ini_set('memory_limit', '1024M'); /* $limit = ini_get('memory_limit'); ini_set('memory_limit', -1); // ... do heavy stuff ini_set('memory_limit', $limit); */ $limit = ini_get('memory_limit'); //ini_set('memory_limit', '1024M'); ini_set('memory_limit', -1); $date_= date("Y-m-d", strtotime($_POST["date_"])); $extension = end(explode(".", $_FILES["excel"]["name"])); // For getting Extension of selected file $allowed_extension = array("xls", "xlsx", "csv"); //allowed extension if(in_array($extension, $allowed_extension)) //check selected file extension is present in allowed extension array { $file = $_FILES["excel"]["tmp_name"]; // getting temporary source of excel file include("classesExcel/PHPExcel/IOFactory.php"); // Add PHPExcel Library in this code $objPHPExcel = PHPExcel_IOFactory::load($file); // create object of PHPExcel library by using load() method and in load method define path of selected file //$cur= odbc_exec($conn,"truncate table kpDatatbl "); foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) { $highestRow = $worksheet->getHighestRow(); $cols=0; while(strlen($worksheet->getCellByColumnAndRow($cols,1)->getValue())>0) { $cols+=1; //exit for; } $cols=7; //$query="create table kpDatatbl(autoID numeric,mrno varchar(20),date_ smalldatetime,dob smalldatetime,pName varchar(50),hospitalName varchar(20),age float,ageStatus varchar(20),address varchar(100),district varchar(30),outcome varchar(20) )"; $fields="autoID,date_,mrno,pName,gender,dob,address,department,hospitalName,time_";// for($row=2; $row<=$highestRow; $row++) { $query=$values="(select isnull(max(autoID),0)+1 from kpDatatbl )"; for($col=0; $col<$cols; $col++) { if($col==0 or $col==4){ // for date and dob $excelDate = $worksheet->getCellByColumnAndRow($col, $row)->getValue(); // gives you a number like 44444, which is days since 1900 $date_ = \PHPExcel_Style_NumberFormat::toFormattedString($excelDate, 'YYYY-MM-DD'); //$date_ = \PHPExcel_Style_NumberFormat::toFormattedString($excelDate, 'DD/MM/YYYY hh:mm:ss'); if($col==0){ if($date_=="") $date_= date("Y-m-d", strtotime($_POST["date_"])); $values.=",'$date_'"; } if($col==0) $doa=$date_; if( $col==4){ //Fatal error: Call to undefined function str_contains() in D:\xampp\htdocs\MIS\loadExcel.php on line 181 $excelDate=strtoupper($excelDate); //if(strtoupper($excelDate)=="YEAR(S)"){ //KTH like(04 Year(s) 07 Month(s) 24 Day(s) ) //if (str_contains($excelDate,"YEAR(S)")) { if((strpos($excelDate,"YEAR(S)")==true) or (strtoupper($worksheet->getCellByColumnAndRow($col,0)->getValue())=='AGE')){ //$arr=explode(" ",$excelDate); $excelDate2 = $worksheet->getCellByColumnAndRow(0, $row)->getValue(); //get admission date from 1st column $date_ = \PHPExcel_Style_NumberFormat::toFormattedString($excelDate2, 'YYYY-MM-DD'); //$age=$arr[0]; $dob=getDOB($date_,$excelDate); //echo "
age=$excelDate, dob:".$dob; /* if(strtoupper($arr[1])=='YEARS') $dob=date('Y-m-d', strtotime($date_. "- $age year")); elseif(strtoupper($arr[1])=='MONTHS') $dob=date('Y-m-d', strtotime($date_. "- $age month")); elseif(strtoupper($arr[1])=='DAYS') $dob=date('Y-m-d', strtotime($date_. "- $age day")); elseif(strtoupper($arr[1])=='HOURS') $dob=date('Y-m-d', strtotime($date_. "- $age hour")); */ $values.=",'$dob'"; //echo "
age:".$arr[0].", t:".$arr[1]; }else{ $values.=",'$date_'"; } } }elseif($col==1){ //$mrno=$worksheet->getCellByColumnAndRow($col,$row)->getValue(); $mrno=$str=$worksheet->getCellByColumnAndRow($col,$row)->getValue(); $values.=",'".$str."'"; }else{ $str=str_replace("'","",$worksheet->getCellByColumnAndRow($col, $row)->getValue()); //$str=$worksheet->getCellByColumnAndRow($col,$row)->getValue(); $values.=",'".$str."'"; } } //$values.=",'".$worksheet->getCellByColumnAndRow($col,2)->getValue()."'"; //last column hospital name $values.=",'".$worksheet->getCellByColumnAndRow(7,2)->getValue()."'"; //last column hospital name $values.=",getdate()"; if(strtoupper($worksheet->getCellByColumnAndRow(6,$row)->getValue())!='GYNAE'){ $isPresent=getName($conn,"select 1 from kpDatatbl where date_='$doa' and mrno='$mrno' "); if($isPresent!=1){ $query="insert into kpDatatbl($fields) values($values) "; $cur= odbc_exec($conn,$query); //echo "
".$query; $cnt++; } } } } //Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 14 bytes) in D:\xampp\htdocs\MIS\classesExcel\PHPExcel\CachedObjectStorage\Memory.php on line 47 } ini_set('memory_limit', $limit); // restore limit echo " Records uploaded successfully : ".$cnt." Limit: ".$limit; } if(isset($_POST["importKTHData"])){ $cnt=0; set_time_limit (2000); // memory_limit = 512M (php.ini) //$str=ini_set('memory_limit', '1024M'); $limit = ini_get('memory_limit'); ini_set('memory_limit', -1); $doa=$date_= date("Y-m-d", strtotime($_POST["date_"])); //$cur= odbc_exec($conn,"delete from patientTab where labid='".$_SESSION['labid']."' and date_>='$date_' "); $cur= odbc_exec($conn,"update patientTab set userID='4182' where userID='4183' and labid='".$_SESSION['labid']."' "); $extension = end(explode(".", $_FILES["excel"]["name"])); // For getting Extension of selected file $allowed_extension = array("xls", "xlsx", "csv"); //allowed extension if(in_array($extension, $allowed_extension)) //check selected file extension is present in allowed extension array { $file = $_FILES["excel"]["tmp_name"]; // getting temporary source of excel file include("classesExcel/PHPExcel/IOFactory.php"); // Add PHPExcel Library in this code $objPHPExcel = PHPExcel_IOFactory::load($file); // create object of PHPExcel library by using load() method and in load method define path of selected file foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) { $highestRow = $worksheet->getHighestRow(); $cols=0; while(strlen($worksheet->getCellByColumnAndRow($cols,1)->getValue())>0) { $cols+=1; //exit for; } $cols=10; $fields="labid,userID,patientID,districtID,patientType,yearlyno,monthlyNo,name,mrno,consultant,doa,dod,diagnose,outcome,date_,time_";// // $query="insert into patientTab(districtID,Findings,consultant,diagnose,labid,mrno,history,time_,diseaseID,age,ageStatus,regCharges,date_,dob,gender,operation,patientType,doctorID,patientID,name,yearlyno,outcome,monthlyNo,Procedures,doa,dod)"; for($row=2; $row<=$highestRow; $row++) { $patientID=getName($conn,"select isnull(count(*),0)+1 from patientTab where date_='$date_' and labid='".$_SESSION['labid']."' "); $patientID = date('ymd',strtotime($_POST['date_']))."".sprintf("%02d",$_SESSION['labid'])."".sprintf("%04d",$patientID); $values=" '".$_SESSION['labid']."',".$_SESSION['userID'].",'$patientID',4183,4185"; //PEshwa=r=4183 for($col=0; $col<=$cols; $col++) { if($col==8 or $col==5){ }elseif($col==6 or $col==7){ // for date and dob $excelDate = $worksheet->getCellByColumnAndRow($col, $row)->getValue(); // gives you a number like 44444, which is days since 1900 $date2 = \PHPExcel_Style_NumberFormat::toFormattedString($excelDate, 'YYYY-MM-DD'); if($date2=="") $date2= date("Y-m-d", strtotime($_POST["date_"])); $values.=",'$date2'"; if($col==6) $doa=$date2; }else{ $str=str_replace("'","",$worksheet->getCellByColumnAndRow($col, $row)->getValue()); //$str=$worksheet->getCellByColumnAndRow($col,$row)->getValue(); $values.=",'".$str."'"; } if($col==3) $mrno=$str; } //$values.=",'".$worksheet->getCellByColumnAndRow(7,2)->getValue()."'"; //last column hospital name $values.=",'$date_',getdate()"; $isPresent=getName($conn,"select 1 from patientTab where doa='$doa' and mrno='$mrno' "); if($isPresent!=1){ $query="insert into patientTab($fields) values($values) "; $cur= odbc_exec($conn,$query); //echo "
".$query; } $cnt++; //} //exit(); } } //Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 14 bytes) in D:\xampp\htdocs\MIS\classesExcel\PHPExcel\CachedObjectStorage\Memory.php on line 47 } ini_set('memory_limit', $limit); // restore limit echo " Records uploaded successfully : ".$cnt." Limit: ".$limit; } if(isset($_POST["importData"])) { $date_= date("Y-m-d", strtotime($_POST["date_"])); $extension = end(explode(".", $_FILES["excel"]["name"])); // For getting Extension of selected file $allowed_extension = array("xls", "xlsx", "csv"); //allowed extension if(in_array($extension, $allowed_extension)) //check selected file extension is present in allowed extension array { $file = $_FILES["excel"]["tmp_name"]; // getting temporary source of excel file include("classesExcel/PHPExcel/IOFactory.php"); // Add PHPExcel Library in this code $objPHPExcel = PHPExcel_IOFactory::load($file); // create object of PHPExcel library by using load() method and in load method define path of selected file //remove old data //$cur= odbc_exec($conn,"delete from knowledgeData "); $output .= "
"; foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) { $highestRow = $worksheet->getHighestRow(); $cols=0; while(strlen($worksheet->getCellByColumnAndRow($cols,1)->getValue())>0) { $cols+=1; //exit for; } //$fields="name,subject,bookName,hwCompleted,completion,score,accessionNo,classID,sectionID,date_"; //$query="insert into bookTable(library,date_,subTitle,subAuthor,volume,ddc_no,auth_mark,remarks,language,keywords,subject,bookName,author,pages,accessionNo,isbn,bookID2,publicationPlace,year_,publisher,edition) "; $fields="library,accessionNo,date_,ddc_no,isbn,author,bookName,pages,publisher,publicationPlace,year_";// hwCompleted,completion,score,date_,classID,sectionID"; for($row=2; $row<=$highestRow; $row++) { $output .= ""; $query=$values="1"; $update="update bookTable set "; $date_= date("Y-m-d", strtotime($_POST["date_"])); for($col=0; $col<$cols; $col++) { if($col==0){ // for accessionNo $accessionNo=$worksheet->getCellByColumnAndRow($col, $row)->getValue(); //if(!is_int($accessionNo)) $accessionNo=getName($conn,"select max(accessionNo)+1 from bookTable"); $values.=",'".$accessionNo."'"; $subject=$worksheet->getCellByColumnAndRow($col, $row)->getValue(); $update.="accessionNo='".$accessionNo."'"; }elseif($col==1){ // for date $excelDate = $worksheet->getCellByColumnAndRow($col, $row)->getValue(); // gives you a number like 44444, which is days since 1900 $date_ = \PHPExcel_Style_NumberFormat::toFormattedString($excelDate, 'YYYY-MM-DD'); if($date_=="") $date_= date("Y-m-d", strtotime($_POST["date_"])); $values.=",'$date_'"; //$update.="date_='".$date_."'"; }else{ $str=str_replace("'","''",$worksheet->getCellByColumnAndRow($col, $row)->getValue()); $values.=",'".$str."'"; //$update.=",'".$worksheet->getCellByColumnAndRow($col,1)->getValue()."'='".$str."'"; } if($col!=0){ $str=str_replace("'","''",$worksheet->getCellByColumnAndRow($col, $row)->getValue()); $update.=",".$worksheet->getCellByColumnAndRow($col,1)->getValue()."='".$str."'"; } } //if(""==getName($conn,"select 1 from knowledgeData where accessionNo='$accessionNo' and classID='$classID' and subject='$subject'")){ if($accessionNo==""){ //$cur= odbc_exec( $conn,"delete from bookTable where accessionNo='$accessionNo'"); $query="insert into bookTable($fields) values($values) "; //echo "
".$query; //$cur= odbc_exec( $conn, $query); }else{ //$cur= odbc_exec( $conn,"delete from bookTable where accessionNo='$accessionNo'"); $update.=" where accessionNo='$accessionNo'"; echo "
".$update; //$cur= odbc_exec( $conn, $update); } } } $output .= '
'; } else { $output = ''; //if non excel file then } echo "Data uploaded successfully"; } echo $output; /*

*/ echo ""; echo ""; echo "
UPLOAD FILE
Date"; echo "
Select File"; //echo "
"; echo "
"; echo "
"; //echo "

"; //echo "

"; //echo "

"; //ecgho " echo "
"; if(isset($_POST['btnGenerateSMS'])){ $firstTime=false; $message= $_POST['message']; //$Status=$_POST['Status']; $ids=""; /* foreach($_POST['checkAll'] as $value) { if($ids=="") $ids=$value; else $ids.=",".$value; } */ if($ids==""){ echo "

Select any option please

"; }else{ $cur= odbc_exec( $conn, "select ID,Name,fName,resPhone,fitClass,Balance from studentView where ID in($ids) " ); while( odbc_fetch_row( $cur ) ) { $smsNo=getFirstNumber(odbc_result( $cur, 'resPhone')); //if(strlen($smsNo)>11){ if(strlen($smsNo)>8){ $message2=str_replace('',odbc_result( $cur, 'Name'),$message); $message2=str_replace('',odbc_result( $cur, 'fName'),$message2); $message2=str_replace('',odbc_result( $cur, 'fitClass'),$message2); $message2=str_replace('',odbc_result( $cur, 'Balance'),$message2); $message2=str_replace('',$date_,$message2); $autoid=getName($conn,"select isnull(max(autoid),0)+1 from smsInfo "); $qry= "insert into smsinfo(SMSType,ID,date_,text,cellNo,autoid) "; $qry.= "values ('SMS Text','".odbc_result( $cur, 'ID' )."','$date_','$message2','$smsNo','$autoid')"; //echo "
".$qry; odbc_exec( $conn,$qry); } } echo "

Messages Send successfully

"; } $query=""; $firstTime=true; } ?>
Testing Card