function tablolistele3_5_4($tablo, $baslik, $alan, $filtre, $sirala, $linkyazi, $linkdosya, $linkalan, $baslangic, $satirsayisi, $aramayap = true) { // bu suanda eksik calisiyor. dige yerde yapmistim. ordan alacam. // tablolistele3_4 den fark bilgilerin belli gruplarda listelenmesi. ileri geri tular v.b. // bir farki da echo yapmaz // 3_5_2 den fark, mssqlden de okuyabilmesi olacak.. yeni yazyorum. adodb ye gectim. global $confdir, $dbtype, $output, $aranan, $arananalan, $app; include $confdir . "dbconf.php"; $color1 = "#FFE8B2"; $color2 = "#E2E2E2"; if (!isset($baslangic1)) { $baslangic1 = $baslangic; } if (!isset($satirsayisi1)) { $satirsayisi1 = $satirsayisi; } if (!isset($baslangic1)) { $baslangic1 = 0; } if (!isset($satirsayisi1)) { $satirsayisi1 = 10; } if ($baslangic1 == '') { $baslangic1 = 0; } if ($satirsayisi1 == '') { $satirsayisi1 = 10; } $result2 = ""; $alansayisi = count($alan); $alansayisi2 = count($linkyazi); $satirno = 0; // listelemedeki arama fonksiyonlary: degiskenal(array("arananalan", "aranan", "hepsi")); if ($hepsi != "1") { $sess_arananalan = $_SESSION['sess_arananalan']; $sess_aranan = $_SESSION['sess_aranan']; } else { $_SESSION['sess_arananalan'] = ""; $_SESSION['sess_aranan'] = ""; } if ($arananalan != "" or $sess_arananalan != "") { $output .= "Arananalan:({$arananalan}), aranan:({$aranan}) , sess_arananalan:({$sess_arananalan}), sess_aranan({$sess_aranan})..<br>"; } if ($aranan != "") { $_SESSION['sess_arananalan'] = $arananalan; $_SESSION['sess_aranan'] = $aranan; $baslangic = 0; if ($arananalan == "") { $output .= "Aranacak Alany belirtmediniz. Bir alan seçiniz."; } else { $filtre = andle($filtre, "{$arananalan} like '%{$aranan}%'"); //$output.="Filtre: $filtre <br>"; } } elseif ($sess_arananalan != "") { // bu session olayy, arama yapynca sayfalamanyn çaly?asy için $filtre = andle($filtre, "{$sess_arananalan} like '%{$sess_aranan}%'"); } else { $_SESSION['sess_arananalan'] = ""; $_SESSION['sess_aranan'] = ""; } //------------------ arama bitti ------------------- $kayitsayisi = kayitsayisi($tablo, $filtre); //$res[0]; if ($kayitsayisi == 0) { $result2 .= $app->sayinmylang("norecordfound"); return $result2; } $selectalan = $alan; if (!in_array($linkalan, $selectalan)) { array_push($selectalan, $linkalan); } //$query=buildquery3("select ".selectstring($selectalan)." from $tablo",$filtre,$sirala,$baslangic,$satirsayisi); $query = buildquery2("select " . selectstring($selectalan) . " from {$tablo}", $filtre, $sirala); //$result2.="<hr>query: ($query) <hr>filt: ($filtre)"; //$res = mysql_db_query($dbadi, $query); include_once "adodb/adodb.inc.php"; //$db = NewADOConnection("mysql"); //$db->connect($dbhost,$dbkullaniciadi,$dbsifre,$dbadi); $res = $app->conn->selectlimit($query, $satirsayisi, $baslangic); // echo print_r2($res); //$output.= "**query: $query <br>"; if ($res) { $result2 .= "\n<table border=1>"; if ($kayitsayisi > 0) { $result2 .= tablobaslikyaz($alan, $baslik, $linkyazi); } while (!$res->EOF) { $r = $res->FetchRow(); //$output.=print_r2($r); if (iseven($satirno)) { $satirrengi = $color1; } else { $satirrengi = $color2; } $satirno++; $result2 .= "<tr bgcolor='{$satirrengi}'>"; for ($i = 0; $i < $alansayisi; $i++) { if (is_array($alan[$i])) { $al = $alan[$i][0]; } else { $al = $alan[$i]; } $yaz = $r[$al]; if ($yaz == "") { $result2 .= "<td> </td>"; } else { // buras 1.128.3 de degisti. eskiden sayy otomatik say gibi yazyordu. telefonlarda sknt oluyordu. //if(is_numeric($yaz)){$yaz="<p align=right>".number_format($yaz,2)."</p>";}; if (is_array($alan[$i])) { if ($alan[$i][1] == "sayi") { $yaz = "<p align=right>" . number_format($yaz, 2) . "</p>"; } } $result2 .= "<td>{$yaz}</td>"; } //if($al==$linkalan){$link=$r[$al];}; } $link = $r[$linkalan]; for ($i = 0; $i < $alansayisi2; $i++) { $ly = $linkyazi[$i]; $ld = $linkdosya[$i]; $char = "&"; if (strpos($ld, "?") === false) { $char = "?"; } $result2 .= "<td><a href='{$ld}{$char}{$linkalan}={$link}'><img src='{$ly}' border='0'></a></td>"; } $result2 .= "</tr>\n"; } $result2 .= "</table>"; $ilerimiktar = $baslangic + $satirsayisi; $result2 .= ilerigeriekle($kayitsayisi, $baslangic, $satirsayisi, $querystring); $self = $_SERVER['PHP_SELF']; $querystring = $_SERVER['QUERY_STRING']; $self2 = $self . "?" . $querystring; // aramalarn ayarlanmas. if ($aramayap and $kayitsayisi > 0) { $arama = "<form method=post>Arama yap:" . buildoption2("arananalan", $alan, $arananalan) . "<input type=text name=aranan value='{$aranan}'><input type=submit value=Ara></form>"; $result2 .= $arama; } if ($aranan != "") { $result2 .= "<a href={$self2}>Hepsini Listele</a>"; } //mysql_free_result($result); } else { $output .= "Bir hata olustu:<br>sql:{$query}<br>" . mysql_error(); //.$res->ErrorMsg(); } // $result2.="<br>tablo bitti.<br>"; //echo "query:$query"; $result2 .= $app->conn->ErrorMsg(); return $result2; }
function tablolistele3_5_4($tablo, $baslik, $alan, $filtre, $sirala, $linkyazi, $linkdosya, $linkalan, $baslangic1, $satirsayisi1, $aramayap = true, $altbilgi = true, $baslikgoster = true) { # this lists table rows in a paged view // // ehcp icin modifiye edildi, gelistirildi. // tablolistele3_4 den fark bilgilerin belli gruplarda listelenmesi. ileri geri tular v.b. // bir farki da echo yapmaz // 3_5_2 den fark, mssqlden de okuyabilmesi olacak.. yeni yazyorum. adodb ye gectim. global $aranan, $arananalan, $app, $baslangic, $satirsayisi, $listall; $this->getVariable(array("arananalan", "aranan", "hepsi", 'baslangic', 'satirsayisi', 'listall')); $color1 = "#FFE8B2"; $color2 = "#E2E2E2"; if (!isset($baslangic1)) { $baslangic1 = $baslangic; } if (!isset($satirsayisi1) or $satirsayisi1 == 0) { $satirsayisi1 = $satirsayisi; } if (!isset($baslangic1) or trim($baslangic1) == '') { $baslangic1 = 0; } if (!isset($satirsayisi1) or $satirsayisi1 == 0 or trim($satirsayisi1) == '') { $satirsayisi1 = 10; } $result2 = ''; $alansayisi = count($alan); $alansayisi2 = count($linkyazi); $satirno = 0; $ilkfiltre = $filtre; #$this->output.="<hr>(ks: $kayitsayisi, iks: $ilkkayitsayisi, filtre: $filtre, ilkfiltre: $ilkfiltre)<hr>"; $ilkkayitsayisi = $this->recordcount($tablo, $ilkfiltre); //$res[0]; // listelemedeki arama fonksiyonlary: if ($listall != "1") { $sess_arananalan = $_SESSION['sess_arananalan']; $sess_aranan = $_SESSION['sess_aranan']; } else { $_SESSION['sess_arananalan'] = ''; $_SESSION['sess_aranan'] = ''; } if ($arananalan != '' or $sess_arananalan != '') { $this->output .= " Searchfield:({$arananalan}), searchvalue:({$aranan}) , sess_searchfield:({$sess_arananalan}), sess_searchvalue({$sess_aranan})..<br>"; } if ($aranan != '') { $_SESSION['sess_arananalan'] = $arananalan; $_SESSION['sess_aranan'] = $aranan; $baslangic1 = 0; if ($arananalan == '') { $this->output .= "Aranacak Alanı belirtmediniz. Bir alan seciniz."; } else { $filtre = andle($filtre, "{$arananalan} like '%{$aranan}%'"); //$this->output.="Filtre: $filtre <br>"; } } elseif ($sess_arananalan != '') { // bu session olayy, arama yapynca sayfalamanyn �aly?asy i�in $filtre = andle($filtre, "{$sess_arananalan} like '%{$sess_aranan}%'"); } else { $_SESSION['sess_arananalan'] = ''; $_SESSION['sess_aranan'] = ''; } //------------------ arama bitti ------------------- $kayitsayisi = $this->recordcount($tablo, $filtre); //$res[0]; $topkayitsayisi = $this->recordcount($tablo, ''); if ($kayitsayisi == 0) { $result2 .= $this->sayinmylang("norecordfound"); //return $result2; } $selectalan = array(); foreach ($alan as $al) { if (is_array($al)) { $selectalan[] = $al[0]; } else { $selectalan[] = $al; } } $baslikalan = $selectalan; if (!in_array($linkalan, $selectalan)) { array_push($selectalan, $linkalan); } //linkalan yoksa, ekle //$query=buildquery3("select ".selectstring($selectalan)." from $tablo",$filtre,$sirala,$baslangic,$satirsayisi1); $query = buildquery2("select " . selectstring($selectalan) . " from {$tablo}", $filtre, $sirala); $this->queries[] = $query; $res = $this->conn->selectlimit($query, $satirsayisi1, $baslangic1); #$this->output.="res:".print_r2($res); $tr = "<tr class='list'>"; $td = "<td class='list'>"; if ($res) { $result2 .= "\n<table id='table{$tablo}' class='list'>"; if ($kayitsayisi > 0 and $baslikgoster) { $result2 .= tablobaslikyaz($baslikalan, $baslik, $linkyazi); } while (!$res->EOF) { $r = $res->FetchRow(); #$this->output.=print_r2($r); #if(iseven($satirno)){$satirrengi=$color1;} else {$satirrengi=$color2;};$satirno++; #$result2.="<tr bgcolor='$satirrengi'>"; $result2 .= $tr; for ($i = 0; $i < $alansayisi; $i++) { if (is_array($alan[$i])) { $al = $alan[$i][0]; } else { $al = $alan[$i]; } $yaz = htmlspecialchars($r[$al]); if ($yaz == '') { $result2 .= "{$td} </td>"; } else { if (is_array($alan[$i])) { $yaz1 = $yaz; if ($alan[$i]['linktext'] != '') { $yaz1 = $alan[$i]['linktext']; } if ($alan[$i][1] == "sayi") { $yaz = "<p align=right>" . number_format($yaz, 2) . "</p>"; } if ($alan[$i][1] == "link_newwindow") { $yaz = "<a target=_blank href='{$yaz}'>{$yaz1}</a>"; } if ($alan[$i][1] == "link") { $yaz = "<a href='{$yaz}'>{$yaz1}</a>"; } if ($alan[$i][1] == "image") { $yaz = "<img src='{$yaz}'>"; } } $result2 .= "{$td}{$yaz}</td>"; } //if($al==$linkalan){$link=$r[$al];}; } $link = $r[$linkalan]; for ($i = 0; $i < $alansayisi2; $i++) { $ly = $linkyazi[$i]; $ld = $linkdosya[$i]; $char = "&"; if (strpos($ld, "?") === false) { $char = "?"; } if (strpos($ld, "href=") === false) { $ld = "href='{$ld}"; } $result2 .= "{$td}<a {$ld}{$char}{$linkalan}={$link}'><img src='{$ly}' border='0'></a></td>"; } $result2 .= "</tr>\n"; } $result2 .= "</table>"; $ilerimiktar = $baslangic1 + $satirsayisi1; $self = $_SERVER['PHP_SELF']; $querystring = $_SERVER['QUERY_STRING']; $self2 = $self . "?" . $querystring; if ($altbilgi) { $result2 .= $this->ilerigeriekle($kayitsayisi, $baslangic1, $satirsayisi1, $querystring); } // aramalarn ayarlanmas. if ($aramayap and $topkayitsayisi > 5) { $arama = "<form method=post>" . $this->sayinmylang('search_') . ": " . buildoption2("arananalan", $alan, $arananalan) . "<input type=text name=aranan value='{$aranan}'><input type=submit value=" . $this->sayinmylang('search_') . "></form>"; $result2 .= $arama; } if (($aranan != '' or $arananalan != '' or $_SESSION['sess_arananalan'] != '' or $filtre != '') and $ilkkayitsayisi > $kayitsayisi) { # sonuclarda arama, filtreleme yapildi ise, filtrelemeyi kaldir.. $result2 .= "<a href={$self2}&listall=1>" . $this->sayinmylang('list_all') . "</a><br>"; } } else { $this->error_occured("(tablolistele_3_5_4)", "query:{$query}"); } // $result2.="<br>tablo bitti.<br>"; //echo "query:$query"; $result2 .= $this->conn->ErrorMsg(); return $result2; }