Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of agus hariyanto  >  VSFlexGrid XP  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: VSFlexGrid XP
Compose and output a table like VSFlexGrid in PHP5
Author: By
Last change:
Date: 2004-09-29 00:21
Size: 1,444 bytes
 

Contents

Class file image Download
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="main.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php
    
include_once('class/vsflexgridxp.php');
    include_once(
'class/db.php');
    
$grid=new VSFlexGridXP();
    
$data=new DB;
    
$result=$data->get_record('*','t_mahasiswa',"mhs_ank='2000'");
    
$num_result=mssql_num_rows($result);
    
    
$i=0;
    
$z=0;

    
    
$grid->Cols(5);
    
//$grid->FixedRow=2;
    
$grid->FixedRow=2;//set the header row
    
$grid->FixedAlignment("C",0);
    
$grid->ColAlignment("C",0);
    
$grid->ColAlignment("C",4);
    
$grid->FixedAlignment("C",4);
    
$grid->ColAlignment("C",5);
    
$grid->Border=1;
    
//$grid->ColorbackgroundData="aqua";
    //$grid->ColHidden(0,1);
    //$grid->ColHidden(2,3);
    
$grid->ColBoolean(5);
    
//$grid->ColButton(5,'Tombol');
    //$grid->ColText(7);
    
$grid->TextHeader("No,NIM,Nama,IPK,Check",0); //u can add the header depend on num of fixed row
    
$grid->TextHeader("No,NIM,Nama,IPK,Check",1);
    
    
    for (
$i=0;$i<$num_result;$i++)
    {
        
        
$row=mssql_fetch_array($result);
        
$grid->TextMatrix($i+1,$i,0);
        
$grid->TextMatrix($row[5],$i,1);
        
$grid->TextMatrix($row[7],$i,2);
        
$grid->TextMatrix($row[8],$i,3);
        
$grid->TextMatrix($row[9],$i,4);
    }

    
$grid->Display();

?>    
</body>
</html>