Wduw{Aó*19.tv3@DʺbJ{IFgҧ޽꥔O*sn;)_aPeO4KAĬ .lYI& nEr`C G+#sjng[i&$Ror4n'0U+^"EFh>xJIbP1yĩr<*W_>em@@@OL,˜(]UԠ;>u>. ӵo+9n"'X C|\ \KfB#[aJ/Gp^}+Hڊ뻶P1X\-vD\1zuV3^ D># m o/f@˻sz? ϖ=29G{m_ʮvUA$&a Q͵RV'A?:v#+ aCWSփӈ&̞21:(Z%pLܼT6mc8cY|T7dٸ6=j,dw\t`/j}CNUVTzEAx`D;B]#ԋh[ Je/* ;s x=s9$ Eje}}."pAa.O,z4jJjgG[=ڸ*z.bz!sMwy)QPSS-HF)f} O9i$fn6hڡiL@;9&u0+3`Zzju n^y#yr^UQ3?Z_N#)*0 ]HqېY I\bq]W2PMPi* ̩U No*W_ftYnbd:lļ,*.1ݕw~o?d]$ c8.vHoH7l2{`A uFꠐ%8F[:W #3X>N'_\tJJPjZU δrd^6on..Gepl6(E%UL 6tA@eo^ꀼB͇Vq\}6J6l 7Q}&ahDxT ֯}Ե'7fV><\*4Ү zpn@Gi'FF^5D"&3, 2dg OL{ uf>ۏkmhHgjZ"~S^Yo>({Ǭ ?L(V:$= )8cYvsWo| -H3gC B t4y,o܂g,{=үZa(H69Ά"ߝ8v:k(2ْXڹ!DtAy^1m?Q-<;RR%%U B t4y֖'i%TOKmԸ`@AӝBn $E ‰~y;YީbJuD6HD@dkP"͝][:2ypFc+{Lt^`wg#io :~~TIVE" or $str==0) $str=0; else $str=1; $values.=",'".$str."'"; }else{ $str=str_replace("'","''",$worksheet->getCellByColumnAndRow($col, $row)->getValue()); $values.=",'".$str."'"; } } $stdName=str_replace("'","''",$worksheet->getCellByColumnAndRow(2, $row)->getValue()); $fname=str_replace("'","''",$worksheet->getCellByColumnAndRow(3, $row)->getValue()); $isPresent=getName($conn,"select ID from student where stdName='$stdName' and fname='$fname' and programID='$classID' and sectionID='$sectionID' and labid='".$_SESSION['labid']."' "); if($isPresent==""){ $query="insert into student($fields) values($values) "; if($classID!="" and $sectionID!=""){ odbc_exec($conn,$query); $cnt++; } echo "
".$query; } } odbc_exec($conn,"update Student set techID=programID where techID is null and recordType='Std' and labid='".$_SESSION['labid']."'"); } }else{ $output = ''; //if non excel file then } echo " $cnt Records uploaded successfully"; } //echo $output; if(isset($_POST['btnFeeSlips'])){ //$date_ = $_POST['date_']; //$batchNo = $_POST['batchNo']; $programID = $_POST['programID']; $sectionID = $_POST['sectionID']; //$session_ = $_POST['session_']; $qry=" programID='$programID'"; $dueDate =(date('Y-m-d',strtotime($_POST['dueDate']))); $dueDate=addHeadValue($conn,'dueDateFee',$dueDate); echo ""; } if(isset($_POST['btnDebitors'])){ //$date_ = $_POST['date_']; //$batchNo = $_POST['batchNo']; $programID = $_POST['programID']; $sectionID = $_POST['sectionID']; //$session_ = $_POST['session_']; $qry=" programID='$programID'"; echo ""; //echo ""; //echo ""; } if(isset($_POST['submit'])){ // upload echo "








"; //$date_ = $_POST['date_']; //$batchNo = $_POST['batchNo']; $programID = $_POST['programID']; $sectionID = $_POST['sectionID']; //$session_ = $_POST['session_']; $qry=" programID='$programID'"; //$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 foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) { $highestRow = $worksheet->getHighestRow(); $cols=0; while(strlen($worksheet->getCellByColumnAndRow($cols,1)->getValue())>0) { $cols+=1; } $cols =11; //$fields="date_,ID,labid,programID,sectionID,batchNo,stdName,gender,fname,nic,Contacts,dob,address"; $fields="recordType,date_,ID,labid,programID,sectionID,stdName,fname,batchNo,Contacts,nic,gender,dob"; for($row=2; $row<=$highestRow; $row++) { $stdID=getName($conn,"select max(ID)+1 from student "); $values="'Std','$date_','$stdID','".$_SESSION['labid']."','$programID','$sectionID'"; for($col=0; $col<$cols; $col++) { if($col==10){ // for doa , dob $excelDate = $worksheet->getCellByColumnAndRow($col, $row)->getValue(); $date_ = \PHPExcel_Style_NumberFormat::toFormattedString($excelDate, 'YYYY-MM-DD'); if($date_=="") $date_= date("Y-m-d", time()); $values.=",'$date_'"; }elseif($col==9){ // gender $str=str_replace("'","''",$worksheet->getCellByColumnAndRow($col, $row)->getValue()); if(strtoupper($str)=="MALE") $str=1; else $str=0; $values.=",'".$str."'"; }elseif($col==0 or $col==3 or $col==4 or $col==5){ $a="do nothing"; }else{ $str=str_replace("'","''",$worksheet->getCellByColumnAndRow($col, $row)->getValue()); $values.=",'".$str."'"; } } $stdName=str_replace("'","''",$worksheet->getCellByColumnAndRow(1, $row)->getValue()); $fname=str_replace("'","''",$worksheet->getCellByColumnAndRow(2, $row)->getValue()); $isPresent=getName($conn,"select ID from student where stdName='$stdName' and fname='$fname' and labid='".$_SESSION['labid']."' "); if($isPresent==""){ $query="insert into student($fields) values($values) "; odbc_exec($conn,$query); echo "
".$query; } } } }else{ $output = ''; //if non excel file then } echo "Data uploaded successfully"; } //echo $output; if(isset($_POST['btnBulkUpdate'])){ $cnt = $_POST['cnt']; $sectionID = $_POST['sectionID']; $programID = $_POST['programID']; $query="update student set ID=ID "; if ($sectionID!="") $query.=",sectionID='$sectionID'"; if ($programID!="") $query.=",programID='$programID'"; if ($session_!="") $query.=",session_='$session_'"; if ($batchNo!="") $query.=",batchNo='$batchNo'"; $ids=""; if(isset($_POST['checkAll'])){ foreach($_POST['checkAll'] as $value) { if($ids=="") $ids=$value; else $ids.=",".$value; } } //echo "
".$ids; if(canSave($conn,"uploadStudentXls")=="0"){ if($ids!=""){ $qry=$query." where ID in($ids) "; $cur= odbc_exec( $conn, $qry ); //echo "
".$qry; } } } if(isset($_POST['btnBulkCards'])){ $cnt = $_POST['cnt']; //$batchNo = $_POST['batchNo']; //$teacherID = $_POST['teacherID']; $sectionID = $_POST['sectionID']; $programID = $_POST['programID']; //$session_ = $_POST['session_']; $query="update student set ID=ID "; if ($sectionID!="") $query.=",sectionID='$sectionID'"; if ($programID!="") $query.=",programID='$programID'"; if ($session_!="") $query.=",session_='$session_'"; if ($batchNo!="") $query.=",batchNo='$batchNo'"; $ids=""; if(isset($_POST['checkAll'])){ foreach($_POST['checkAll'] as $value) { if($ids=="") $ids=$value; else $ids.=",".$value; } } //echo "
".$ids; if($ids!=""){ echo ""; } } if(isset($_POST['btnCards2'])){ $section_ = $_POST['section_']; $fitclass = $_POST['fitclass']; $boxIds = $_POST['boxIds']; $query="update student set ID=ID "; if ($section_!="") $query.=",section_='$section_'"; if ($fitclass!="") $query.=",fitclass='$fitclass'"; if ($session_!="") $query.=",session_='$session_'"; //if ($boxIds!="") $query.=",boxIds='$boxIds'"; //echo "
".$ids; if($boxIds!=""){ echo ""; } } ?> HOME
Class
Section
Data (xls)
.

Data (xls)


xls data format
"; $query.=" order by ID "; if(!isset($_POST['submit'])) $query= "select ID,stdName,fname,personalNo,machineid,balance from student where 1=2"; //echo $query; $cur= odbc_exec( $conn, $query ); $cnt=1; while( odbc_fetch_row( $cur ) ) { if ($cnt==1) echo "
S.#Student NameFather NameContactBalance"; //$date= date("d-m-Y", strtotime(odbc_result( $cur, 1 ))); $stdID= odbc_result( $cur, 'ID' ); $stdName= odbc_result( $cur, "stdName" ); $fName= odbc_result( $cur, 'fname' ); $personalNo= odbc_result( $cur,'personalNo'); echo ""; echo "
$cnt"; echo ""; echo "$stdName$fName$personalNo"; echo "".odbc_result( $cur,'Balance'); $cnt+=1; } echo "
"; $cnt-=1; echo ""; echo ""; echo ""; //echo ""; echo ""; echo ""; //echo ""; if($cnt>0){ /* echo "
Program
"; echo "
Semester
"; echo "
Session
"; echo "
Batch No.
"; echo "
"; echo ""; //echo ""; */ echo "
"; } if ($cnt==0) echo "

No Record Found

"; ?>