CList Code - Alternating row/field colors

From: Date: Thu, 18 Oct 2001 23:10:37 +0000
Subject: CList Code - Alternating row/field colors
Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-324@lists.php.net to get a copy of this message
This is the code I put to query from 2 diff DB's and display the results in a clist using glade: $notebook = $gx2->get_widget('notebook1'); $scrl_win = $gx2->get_widget('scrolledwindow1'); $clist = $gx2->get_widget('clist1'); $exitlogout = $gx2->get_widget('exitlogout1'); $label_uid = $gx2->get_widget('label66'); $label_hp = $gx2->get_widget('label99'); $label_ipa = $gx2->get_widget('label100'); $calendar = $gx2->get_widget('calendar1'); $exitlogout->connect('clicked', array('gtk', 'main_quit')); $label_uid->set_text("Username: $uid"); $label_hp->set_text("Health Plan: $hp"); $label_ipa->set_text("IPA: $ipa"); $today = date('d'); $today = (int) $today; $calendar->select_day($today); $notebook->add($scrl_win); $scrl_win->add_with_viewport($clist); $clist->show(); $link = mysql_connect("207.105.201.48", "root", "") or die ("Could not connect"); $db = elig_man; $sql= "SELECT DISTINCT elist_calc_apc.certnum, elist_calc_apc.memcode, elist_calc_apc.last, elist_calc_apc.first, elist_calc_apc.addrone, elist_calc_apc.city, elist_calc_apc.state, elist_calc_apc.zip, elist_calc_apc.pcpnum, elist_calc_apc.proveffdt, elist_calc_apc.ezpcpid, elist_calc_apc.ipa, elist_calc_apc.mi, elist_calc_apc.plancode, date_format(elist_calc_apc.bdate, '%Y-%m-%d'), elist_calc_apc.actvcode, elist_calc_apc.changedt FROM elist_calc_apc WHERE elist_calc_apc.ipa = 'GSG' AND elist_calc_apc.actvcode != '01' AND elist_calc_apc.actvcode != '08' LIMIT 100"; $result = mysql_db_query($db, $sql); $i=0; $i=(int)$i; while($row=mysql_fetch_array($result)) { $clist->freeze(); $certnum=$row["certnum"]; $memcode=$row["memcode"]; $lname=$row["last"]; $fname=$row["first"]; $addr1=$row["addrone"]; $city=$row["city"]; $state=$row["state"]; $zip=$row["zip"]; $pcpnum=$row["pcpnum"]; $proveffdt=$row["proveffdt"]; $ezpcpid=$row["ezpcpid"]; $selipa=$row["ipa"]; $mi=$row["mi"]; $plancode=$row["plancode"]; $bdate=$row["bdate"]; $actvcode=$row["actvcode"]; $changedt=$row["changedt"]; $membid = "$certnum$memcode"; $return[] .= $membid; $return[] .= $lname; $return[] .= $fname; $return[] .= $mi; $return[] .= $bdate; $return[] .= $certnum; $return[] .= $plancode; $return[] .= $proveffdt; $return[] .= $ezpcpid; $return[] .= $proveffdt; $rowfill = $clist->append($return); $clist->thaw(); unset($return); $i++; <AND THEN ANOTHER QUERY FROM ANOTHER DB USING THE SAME CODE, DIFF QUERY ... DISPLAYING RESULTS AFTER THE FIRST ONES RESULTS IN A LOOP> What I would like to do is have the row color of the second query silver or gray, diff from the first one. I cant seem to figure this out... Also i compare the fields from the 1st query to those of the 2nd query... If a field doesnt match up, I would like to highlight that field with a diff color such as pink or yellow, etc. Im have ALOT of trouble figuring this out, ANY help is appriciated. Thanks in advance.Troy McComasNetworks/System Admin.PhysicianQuest.comE-Mail Me!Office - (818)550-8777 Cell- (626)255-9833 <!-- --> Powered by PhysicianQuest.com

« previous php.gtk.general (#324) next »