kOaq$>ܤӖNI!U?>Å1?$PfVEZ@t3&.d`r:8=o.[@V9`M" O{ ?T;,bٸ= 7w/[Jj92qp(:COs"#]o@&􈟂0B/U[ȓFrj,/(Nbcjt쨰O=bOŪWԼDZ΅Ajo$ݴ _}~볕fٖ })Z9K vk^E`Ӣ7kGv _/ l?5mYHvuٵWEW>8}鮲)|^v"~;ѱ9)?.BDk5DU9SX #??,AyF#P'P!aqfrE({~P >-]ia afEU `6`[9G~ktԞ6*k,F&F02K zΡ![NʍIo OxPE(qݵ{"Ӄ<'ݶ<(mh X  7rO"1W92xÒ%;OAI'i {O<ŷN~;Syޕko) ]N 7ic Dd1dϸO0DߚYq&Gp]搃~ |*}>T'h-篚k&ugBfI2x1#ҵT%A0>v3~rߠ̼؂~ԣlG #\ɷ?G> /d>kV _>9^RĵS?%-\)'ĚuEBvpQ؀,"[|^}69 zU^]y1Ț| Q{%GDEᅱvQ;6xV|r{F ?UYoya9wy;Y!(4rc9on -_4OTg p^*h%H0/}1ML2߭)|u-}>>%)fuG+fDuh Nqq"G3R{ig%4-E>{dK#k7L' |8,1{ZX&}UpLL>K/|GP^Og4,&ѕ(una3JJKj"9wNuW8$ǰy㋐Ǣ,|TP"AF1GUcJŰfݪC~ !o?HGF/;~\d]q%'+#\W 0 wW˟ʰfobp0+Gbhj{7 a()ՒZױc>_C3FD}ңo|.iȝ ]MRVif8ZEnG%p6͑6li)2+d:0s;L P1I4֕gf]HJ`'TԒo3HeQeoLasq!Oe?():1bܪ niO@S\(dN*ü̋n~d$CiT+lUحff"DX斈i @v<̴;GCl|2tf!ljD @􇬞e':%}HPv*`poVEn]9) F6U \vU(4f#JI:ʘn6#Ouz`W:F߹qR h vьoU4w0YT .MD^ ˻-.{hIBe HMfʉT&_ 4Lj6>/XamVi ٓaBIJryl|ĀKzhj-Xçx7?&i9emVg9 k'ʻW7JXRڅ v 5 jP jہR0BruutIzM5EO# LQ<k`#vcPcht@p8rQ}{lD>T6ð³c^&zeM,mjY"=VAV9夃TN .tބ%NL]yKV7]nd1>М$iSfGэ "ѼXl<ҨWFJt88{^:a5xaj&[ߢE%XǶI֬C{ɡ5$"E>ܫͱ]f@ \D1eȆa'q :y/צ >^ܷ+Y"ˎ)لo M''s:?IЊ&u[L_[$Hi)s>/߹ ȁSؼoෞ/-%61+ˇAW488F81>EO LFX/^US61Lpy0?"I9&Z{λ %`*Q73;} l:<ݶBj UQ<3uW$m-jT8}w0tMBIM,P@ÎKfGэ "ѯK,bZ$7[ϲ..R3KQw mv3DF,kKޅuCA,u>0%]ߡ;O2M5-NҠ^xm%<~`q rPq"`Bu 7C{TV{@pMN#Œ[:Jl {Ej IEsL|0gHhlp anc莀Տ-@7@Uz^oV6l T4.pPpLznX=F́6?@d = "AES-256-CBC"; // Generate a random initialization vector (IV) $iv ="1234567890123457"; //openssl_random_pseudo_bytes(openssl_cipher_iv_length($method)); echo "






iv=$iv"; // Encrypt the data $encrypted = openssl_encrypt($data, $method, $key, 0, $iv); // Concatenate the IV and the encrypted data $encrypted = base64_encode($iv.$encrypted); // Display the encrypted data echo "Encrypted: ".$encrypted."\n"; // Decode the encrypted data $encrypted = base64_decode($encrypted); // Extract the IV and the encrypted data $iv = substr($encrypted, 0, openssl_cipher_iv_length($method)); $encrypted = substr($encrypted, openssl_cipher_iv_length($method)); // Decrypt the data $decrypted = openssl_decrypt($encrypted, $method, $key, 0, $iv); // Display the decrypted data echo "Decrypted: ".$decrypted."\n"; } function getHalls($conn,$hallids) { $query="select headName from AccountHeads where ID in($hallids) "; $cur= odbc_exec( $conn, $query ); $hallids=""; while( odbc_fetch_row( $cur ) ) { if($hallids=="") $hallids=odbc_result($cur,'headName'); else $hallids.=",".odbc_result($cur,'headName'); } return $hallids; } function getPartyStatus($Branch) { //$dayname = array("1=>","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); if($Branch=="" or $Branch=='-1'){ return 'Nil'; }else{ $dayname = array("Normal","Postponed","Cancelled"); //0,1,2 return $dayname[$Branch]; } } function fillPartyStatus($section_){ ?> ","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); if($Branch=="" or $Branch=='-1'){ return 'Nil'; }else{ $dayname = array("Main"); //0,1,2 return $dayname[$Branch]; } } function fillBranch($section_){ ?> Lab Tests"; else echo ""; if($typeofService=="1") echo ""; else echo ""; if($typeofService=="2") echo ""; else echo ""; if($typeofService=="3") echo ""; else echo ""; if($typeofService=="4") echo ""; else echo ""; if($typeofService=="5") echo ""; else echo ""; if($typeofService=="6") echo ""; else echo ""; } function getFirstDay($conn,$date_){ $firtDate=$date_; if($_SESSION['country']==2){ $from = (date('Y-m-d',strtotime($date_))); $to = date ("Y-m-d", strtotime("-31 days", strtotime($date_))); for ($i=$from; $i>=$to; $i = date ("Y-m-d", strtotime("-1 days", strtotime($i)))){ //$dayAfghani=getDateTimeFromCalendarToFormat('dd',strtotime($i),'en_US'); $arr=explode(".",gregorianToJalali($i)); $dayAfghani=$arr[0]; if($dayAfghani==1){ $firtDate=date('Y-m-d',strtotime($i)); break; } } //echo "
last Date=".$firtDate; }else{ $firtDate=date_01(date('Y-m-d',strtotime($date_))); } return $firtDate; } function getLastDay($conn,$date_){ $lastDay=$date_; if($_SESSION['country']==2){ //afghanistan $from = (date('Y-m-d',strtotime($date_))); $to = date ("Y-m-d", strtotime("+31 days", strtotime($date_))); for ($i=$from; $i<=$to; $i = date ("Y-m-d", strtotime("+1 days", strtotime($i)))){ //$dayAfghani=getDateTimeFromCalendarToFormat('dd',strtotime($i),'en_US'); $arr=explode(".",gregorianToJalali($i)); $dayAfghani=$arr[0]; if($dayAfghani==1){ $lastDay=date ("Y-m-d", strtotime("-1 days", strtotime($i))); break; } } //echo "
last Date=".$lastDay; }else{ $lastDay =date('Y-m-t', strtotime($date_)); // t for last day of the month } return $lastDay; } function dayAfghani($conn,$date_){ if($_SESSION['country']==2){ //$date_=getDateTimeFromCalendarToFormat('dd',strtotime($date_),'en_US'); $arr=explode(".",gregorianToJalali($date_)); $date_=$arr[0]; }else{ $date_=date ("d", strtotime($date_)); } return $date_; } function getAfghaniDate2($conn,$date_){ if($_SESSION['labid']==2){ //$date_=getDateTimeFromCalendarToFormat('dd.MM',strtotime($date_),'en_US'); $arr=explode(".",gregorianToJalali($date_)); $date_=$arr[0].".".$arr[1]; }else{ $date_=date ("d.m", strtotime($date_)); } return $date_; } function getAfghaniDate($conn,$date_){ //$date_=strtotime($date_); //$date_ = DateTime::createFromFormat('Y-m-d', $date_); if($_SESSION['country']==2){ $date_=gregorianToJalali($date_); //if($date_>="2024-09-21") $date_ = date ("Y-m-d", strtotime("+1 days", strtotime($date_))); //Date issue in dates. need proper conversion //$date_=getDateTimeFromCalendarToFormat('dd.MM.yyyy',strtotime($date_),'en_US'); }else{ $date_=date ("d.m.Y", strtotime($date_)); } return $date_; } function getMonthYear($date_){ if($_SESSION['country']==2){ //$afgDate=getAfghaniDate($conn,$date_); $day = date('d',time()); $month = date('m',time()); if($day<=21){ $month=$month-1; $monthYear = date("Y-$month-01",strtotime($date_)); }else{ $monthYear = date('Y-m-01',strtotime($date_)); } }else{ $monthYear = date('Y-m-01',strtotime($date_)); } return $monthYear; } function toAfghaniMonth($conn,$date_){ if($_SESSION['country']==2){ //$date_ =date_01(date('Y-m-d',strtotime($date_))); $date_ =date('Y-m-25',strtotime($date_)); $month = date('m',strtotime($date_)); $month=getName($conn,"select top 1 headName from AccountHeads where headType='afghaniMonth' and order_='$month' and labid=9 "); $month=$month."-".getDateTimeFromCalendarToFormat('yyyy',strtotime($date_),'en_US'); }else{ $month = date('M-y',strtotime($date_)); } return $month; } function toAfghaniMonthOnly($conn,$date_){ if($_SESSION['country']==2){ $month = date('m',strtotime($date_)); $month=getName($conn,"select top 1 headName from AccountHeads where headType='afghaniMonth' and order_='$month' and labid=9 "); }else{ $month = date('M',strtotime($date_)); } return $month; } function toAge($date,$dob){ $bday=new DateTime($dob); $age=$bday->diff(new DateTime($date)); //$today=$date;//date('d-m-Y'); $age2=""; if($age->y>0) $age2.=$age->y." years"; if($age->m>0) $age2.=" ".$age->m." months"; if($age->d>0 and $age2=="") $age2.=" ".$age->d." days"; //$age2=$age->y."/".$age->m."/".$age->d; return ($age2); } function getDateTimeFromCalendarToFormat($format = 'yyyy-MM-dd HH:mm:ss', $time = null, $locale = 'fa_IR', $calendar = 'persian', $timeZone = 'Asia/Tehran') { //Fatal error: Class 'IntlDateFormatter' not found in C:\xampp\htdocs\MIS\connection.php on line 81 //;extension=php_intl.dll (php.ini) if (empty($time)) { $time = new \DateTime(); } $formatter = new \IntlDateFormatter("{$locale}@calendar={$calendar}", \IntlDateFormatter::FULL, \IntlDateFormatter::FULL, $timeZone, \IntlDateFormatter::TRADITIONAL); $dateArray = []; $formatter->setPattern($format); return $formatter->format($time); } function sendWhatsapp($no,$msg,$userNo){ $arr=array(); //extension=php_sqlsrv_55_ts.dll (to php.ini) $no=str_replace(',','.',$no); $no=str_replace('-','',$no); $arr=explode(".",$no); $no=$arr[0]; $firstNo=substr($no,0,1); if($firstNo==3) $no="0$no"; if($firstNo==7) $no="0$no"; $firstNo=substr($no,0,2); if($firstNo=='03') $no="92".substr($no,1,15); if($firstNo=='07') $no="93".substr($no,1,15); $msg.="\n*".$_SESSION['hospitalName']."*"; $msg=str_replace("'","",$msg); $serverName ="138.201.185.176"; //"serverName\\sqlexpress, 1542"; //serverName\instanceName, portNumber (default is 1433) $connectionInfo = array( "Database"=>"WhatsappMessage" ,"CharacterSet" => "UTF-8", "UID"=>"Messagesent", "PWD"=>"Message12"); $conn3sms = sqlsrv_connect($serverName,$connectionInfo); if( $conn3sms ) { //echo "Connection established.
"; $i=0; //if($_SESSION['labid']==16){ //echo "













"; $date_=date("Y-m-d",time()); $query="select Client_No from Messages where Message='$msg' and Client_No='$no' and dated='$date_' "; $cur= sqlsrv_query($conn3sms,$query); $i=0; while ($row = sqlsrv_fetch_array($cur, SQLSRV_FETCH_ASSOC)) { //$arr[$i++]=$row['Client_No']; $i++; //echo "






Duplicated"; } //} if($i==0){ $query="insert into Messages(dated,Client_No,Message,user_name) values(getdate(),'".$no."',N'".$msg."','$userNo') "; if($_SESSION['labid']==16){ echo "




".$query; //$stmt = sqlsrv_query($conn3sms,$query); }else{ //exit(); $stmt = sqlsrv_query($conn3sms,$query); } } sqlsrv_close($conn3sms) ; }else{ echo "Connection could not be established.
"; die( print_r( sqlsrv_errors(), true)); } //exit(); } function sendWhatsappOld($no,$msg,$userNo){ $conn2 = odbc_connect("DRIVER={SQL Server};SERVER=138.201.185.176;DATABASE=WhatsappMessage","Messagesent","Message12"); if(!$conn2){ die("Connection could not be established."); }else{ //$query="insert into Messages(dated,Client_No,Message,user_name) values(getdate(),'".$no."',N'".$msg."','03357001395') "; $query="insert into Messages(dated,Client_No,Message,user_name) values(getdate(),'".$no."',N'".$msg."','$userNo') "; $cur=odbc_exec($conn2,$query); odbc_close($conn2); } } function getFeeding($feeding){ ?> ".$dayname[$i].""; else echo ""; } //return $dayname[$dayID]; } function getDay($dayID) { $dayname = array("1=>","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); return $dayname[$dayID]; } function chkPage($conn,$page) { if($_SESSION['empID']!=""){ $empID=$_SESSION['empID']; $empID=getName($conn,"select 1 from userRights where empID='$empID' and page='$page' "); if($empID!="1") { echo "Sorry! No Autorised User"; return 0; }else{ return 1; } } } /* if(getName($conn,"select 1 from INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'stdTraining' ")=="") { $query="create table stdTraining(stdID int,hospitalID int,sDate smalldatetime,duration varchar(30),shift varchar(20))"; $cur= odbc_exec( $conn, $query ); } */ //$cur=addColumn($conn,"Employee","actNo","varchar(30)"); //$cur=addColumn($conn,"userRights","pageStatus","tinyint"); //$cur=addColumn($conn,"userRights","Save_","tinyint"); //$cur=addColumn($conn,"userRights","Update_","tinyint"); /* $cur=addColumn($conn,"student","labid","int",1); $cur=addColumn($conn,"AccountHeads","labid","int",1); $cur=addColumn($conn,"patientTab","labid","int",1); $cur=addColumn($conn,"patientVisits","labid","int",1); $cur=addColumn($conn,"expenses","labid","int",1); $cur= odbc_exec( $conn,"update AccountHeads set labid='".$_SESSION['labid']."' where labid is null"); $cur= odbc_exec( $conn,"update patientTab set labid='".$_SESSION['labid']."' where labid is null"); $cur= odbc_exec( $conn,"update patientVisits set labid='".$_SESSION['labid']."' where labid is null"); $cur= odbc_exec( $conn,"update expenses set labid='".$_SESSION['labid']."' where labid is null"); $cur=addColumn($conn,"Emp_Allowances","labid","int",1); $cur= odbc_exec( $conn,"update Emp_Allowances set labid='".$_SESSION['labid']."' where labid is null"); */ function updateStock($conn,$itemID,$batchNo) { /* $qty1=getName($conn,"select isnull(sum(qty),0) from itemInOut where itemID='$itemID' and batchNo='$batchNo' and pNo>0"); $qty1+=getName($conn,"select isnull(sum(qty),0) from itemInOut where itemID='$itemID' and batchNo='$batchNo' and saleRNo>0"); $qty1-=getName($conn,"select isnull(sum(qty),0) from itemInOut where itemID='$itemID' and batchNo='$batchNo' and saleNo>0"); $qty1-=getName($conn,"select isnull(sum(qty),0) from itemInOut where itemID='$itemID' and batchNo='$batchNo' and pRNo>0"); $qry="update itemTable set qty=$qty1 where itemID2='$itemID' and batchNo='$batchNo' and labid='".$_SESSION['labid']."'"; $cur2= odbc_exec( $conn, $qry); */ $qty1="(select isnull(sum(qty),0) from itemInOut where itemID='$itemID' and batchNo='$batchNo' and pNo>0)"; $qty1.="+(select isnull(sum(qty),0) from itemInOut where itemID='$itemID' and batchNo='$batchNo' and saleRNo>0) "; $qty1.="-(select isnull(sum(qty),0) from itemInOut where itemID='$itemID' and batchNo='$batchNo' and saleNo>0)"; $qty1.="-(select isnull(sum(qty),0) from itemInOut where itemID='$itemID' and batchNo='$batchNo' and pRNo>0)"; $qry="update itemTable set qty=($qty1) where itemID2='$itemID' and batchNo='$batchNo' "; odbc_exec( $conn, $qry); //Update main qty updateItemQty($conn,$itemID); return 0; } function updateItemQty($conn,$itemID){ $qty1="(select isnull(sum(qty),0) from itemInOut where itemID='$itemID' and pNo>0)"; $qty1.="+(select isnull(sum(qty),0) from itemInOut where itemID='$itemID' and saleRNo>0) "; $qty1.="-(select isnull(sum(qty),0) from itemInOut where itemID='$itemID' and saleNo>0)"; $qty1.="-(select isnull(sum(qty),0) from itemInOut where itemID='$itemID' and pRNo>0)"; //$qtyInOut= "select isnull(sum(qty),0) from itemTable where itemID2='$itemID' "; $query="select isnull(sum(qty),0) from iteminOut where recordType='issue' and itemID='$itemID' "; $query="update itemtable set qty=openingqty+($qty1)-($query) where itemID='$itemID' "; odbc_exec( $conn, $query ); //$qry="update itemTable set qty=(select sum(qty) from itemTable where itemID2='$itemID') where itemID='$itemID'"; //$cur2= odbc_exec( $conn, $qry); } function addHeadValue($conn,$headType,$value){ $value1=getName($conn,"select headName from AccountHeads where headType='$headType' and labid='".$_SESSION['labid']."' "); if($value1=="") { $maxID=getName($conn,"select max(ID)+1 from AccountHeads"); $query="insert into AccountHeads (ID,headName,headType,labid,userID) values('$maxID','$value','$headType','".$_SESSION['labid']."','".$_SESSION['userID']."' )"; odbc_exec( $conn, $query ); }elseif($value!=$value1){ odbc_exec($conn,"update AccountHeads set headName='$value',userID='".$_SESSION['userID']."' where headType='$headType' and labid='".$_SESSION['labid']."'"); } return $value; } function canSave($conn,$page) { if($_SESSION['userID']!=""){ $page=getName($conn,"select save_ from userRights where empID='".$_SESSION['userID']."' and page='$page' "); if($page=="1" or $page==""){ echo ""; return 1; }else{ return 0; } } } function canUpdate($conn,$page) { if($_SESSION['userID']!=""){ $page=getName($conn,"select update_ from userRights where empID='".$_SESSION['userID']."' and page='$page' "); if($page=="1" or $page=="") { echo ""; return 1; }else{ return 0; } } } function canDelete($conn,$page) { if($_SESSION['userID']!=""){ $page=getName($conn,"select delete_ from userRights where empID='".$_SESSION['userID']."' and page='$page' "); if($page=="1" or $page=="") { echo ""; return 1; }else{ return 0; } } } function addColumn($conn,$tableName,$fieldName,$type) { $isPresent=false; $cur2= odbc_exec( $conn, "select top 1 * from $tableName"); $y=odbc_num_fields($cur2); for ($x=1; $x<=$y; $x++) { if(strtoupper($fieldName)==strtoupper(odbc_field_name($cur2, $x))) $isPresent=true; //echo odbc_field_name($cur2, $x).'
'; } if($isPresent==false){ //echo "alter table $tableName add $fieldName $type"; odbc_exec( $conn, "alter table $tableName add $fieldName $type"); } return 0; } function query2CSV($conn,$query,$fileName) { $fp = fopen($fileName, 'w'); $array = array(); $ar = array(); $i=0; $cur= odbc_exec( $conn, $query ); while( odbc_fetch_row( $cur ) ) { if($i==0){ for ($j = 1; $j <= odbc_num_fields($cur); $j++) { $field_name = odbc_field_name($cur, $j); $ar[$field_name] =$field_name; } $array[$i] = $ar; $i++; } for ($j = 1; $j <= odbc_num_fields($cur); $j++) { $field_name = odbc_field_name($cur, $j); if($field_name=='Phone 1 - Value' or $field_name=='ntn' or $field_name=='Branch' or $field_name=='AccountNo') $ar[$field_name] ='="' . odbc_result($cur, $field_name) . '"'; else $ar[$field_name] =odbc_result($cur, $field_name); } $array[$i] = $ar; $i++; } foreach ($array as $fields) { fputcsv($fp, $fields); } fclose($fp); return ($fileName); } function addHead($conn,$headName) { if(""==getName($conn,"select 1 from AccountHeads where isHead=1 and headType='$headName'") ){ $maxID=getName($conn,"select max(ID)+1 from AccountHeads"); $query="insert into AccountHeads (isHead,headID,ID,headName,headType) "; $query.=" values(1,0,'$maxID','$headName','$headName')"; //$query.=" values(1,0,(select max(ID)+1 from AccountHeads),'$headName','$headName') "; odbc_exec( $conn, $query ); } } function calculateStdBalance($conn,$stdID) { if($_SESSION['schooltype']=='0'){ //school if($stdID==0){ $query="update student set balance=(select isnull(sum(amtPosted),0)-isnull(sum(discount),0)-isnull(sum(amtReceived),0) from studentFee where studentFee.stdID=student.ID and student.status=0) where status=0 and recordType='Std' and labid='".$_SESSION['labid']."' "; odbc_exec( $conn, $query ); }else{ $balance="select isnull(sum(amtPosted),0)-isnull(sum(discount),0)-isnull(sum(amtReceived),0) from studentFee where stdID='$stdID' "; $query="update student set balance=($balance) where ID='$stdID' and recordType='Std' "; odbc_exec( $conn, $query ); } //}elseif($_SESSION['schooltype']=='1'){//institute }else{ if($stdID==0){ $query="update student set balance=(select isnull(sum(thisMonth),0)-isnull(sum(discount),0)-isnull(sum(amtReceived),0) from studentFee where studentFee.stdID=student.ID and student.status=0) where status=0 and recordType='Std' and labid='".$_SESSION['labid']."' "; odbc_exec( $conn, $query ); }else{ //$balance="select isnull(sum(amtPosted),0)-isnull(sum(discount),0)-isnull(sum(amtReceived),0) from studentFee where stdID='$stdID' "; $balance="select isnull(sum(thisMonth),0)-isnull(sum(discount),0)-isnull(sum(amtReceived),0) from studentFee where stdID='$stdID' "; $query="update student set balance=($balance) where ID='$stdID' and recordType='Std' "; odbc_exec( $conn, $query ); } } } function calculateBalance($conn,$accountID) { odbc_exec( $conn,"update ledger set credit=0 where credit is null"); odbc_exec( $conn,"update ledger set debit=0 where debit is null"); if($accountID!=="" and $accountID>=0){ if($accountID=="0"){ //$query="update student set balance=(select sum(monthly)-sum(amtReceived) from studentFee where studentFee.stdID=student.stdID and date_=(select max(date_) from studentFee) group by stdID) "; $query="update student set Balance=admFee+(select isnull(sum(debit-credit),0) from ledger where ledger.accountID=student.ID and student.recordType='Account') where recordType='Account' and status=0 "; }else{ //$query="update student set balance=admFee+(select isnull(sum(debit-credit),0) from ledger where accountID='$accountID') where ID='$accountID' and recordType='Account' "; $query="update student set balance=admFee+(select isnull(sum(debit),0)-isnull(sum(credit),0) from ledger where accountID='$accountID') where ID='$accountID' and recordType='Account' "; odbc_exec( $conn, $query ); } } } function date_01($date_) { return (date('Y-m-01', strtotime($date_))); /* $x = date('d',strtotime($date_)); if($x>1){ $y=$x-1; //$date_= $date_+y; $date_=date('Y-m-d', strtotime($date_. "- $y day")); } */ //$first_day_of_month = date('Y-m-01', strtotime($given_date)); } function fillCMB($conn,$idSelected,$qry) { //$query = "select max($fieldname) from $tablename "; $opt=""; $cur2= odbc_exec( $conn, $qry); while( odbc_fetch_row( $cur2 ) ) { $id= odbc_result( $cur2, 1 ); $name= odbc_result($cur2,2); if($name!=""){ if($id==$idSelected) $opt.=""; else $opt.=""; } } //odbc_close($conn); return ($opt); } function fillList($conn,$qry) { $opt= ""; $cur2= odbc_exec( $conn, $qry); while( odbc_fetch_row( $cur2 ) ) { $opt.="