	<?php
    $sql =
    " SELECT admin_id, username, password ".
    " FROM user ";
    if ($s_text) {
        $sql .= 
        " WHERE UPPER(username) ".
        " like '%".strtoupper($s_text)."%' ";
    }
    $sql .= " ORDER BY username ";
    
    $hasil	= (mysql_query($sql) ? mysql_query($sql) : null);
    $max	= mysql_num_rows($hasil);
    
    $page = (isset($_REQUEST["page"]) ? $_REQUEST["page"] : 0);
    $perhalaman = 15;
    
    if ($page) $start = ($page - 1) * $perhalaman; else $start = 0;    
    $counter = $start;
    
    $sql   .= " LIMIT $start, $perhalaman ";
    $hasil	= (mysql_query($sql) ? mysql_query($sql) : null);
    //echo $sql;
    
    if (mysql_num_rows($hasil) > 0) {
        echo '						
        <div style="display:block;">
            <div style="margin-top:15px"></div>
            <div style="float:left">
                <form name="Searchform" id="Searchform" class="form" action="'.$thisPage.'adm1n/'.$curPage1.'" onsubmit="return validate(this)" method="post">
                    <strong>Search user</strong>: <br>
                    <input type="text" name="s_text" size="50" value="'.$s_text.'">
                    <input type="submit" name="s_submit" class="button1" value="Search">
                </form>
            </div>
        </div>
        <div style="clear:both; margin-top:15px">&nbsp;</div>
        <div class="tabel font15">';
			$addButton = '
			<div class="hvr-sweep-to-right align-center" style="float:right; clear:both" >
				<a href="'.$thisPage.'adm1n/'.$curPage1.'?add='.$data["admin_id"].'">
					Add New Record
				</a>
			</div>';
			$addButton = '';
            echo $addButton . '
			<div class="head-column border-both">
                <div class="tabel10 padding10 alignCenter">
                    <strong>NO</strong>
                </div>
                <div class="tabel35 border-left padding10">
                    <strong>USER LIST</strong>
                </div>
                <div class="tabel55 border-left padding10 align-center">
                    <strong>STATUS</strong>
                </div>
            </div>
            <form name="formManageForm" id="formManageForm" class="form" action="'.$thisPage.'adm1n/'.$curPage1.'" onsubmit="return validate(this)" method="post">';
                while ($data = mysql_fetch_array($hasil)) {
                    if ($counter % 2 == 0) 
                        $bgColor = "#f9f9f9";	
                    else 
                        $bgColor = "#ffffff";	
                    
                    $passButton   = '<a href="'.$thisPage.'adm1n/'.$curPage1.'?pass='.$data["admin_id"].'">Change Password</a>';
                    $editButton   = '<a href="'.$thisPage.'adm1n/'.$curPage1.'?edit='.$data["admin_id"].'">Edit User</a>';
                    $deleteButton = '<a href="'.$thisPage.'adm1n/'.$curPage1.'?delete='.$data["admin_id"].'">Delete User</a>';
                    $counter++;
                    
					echo '
                    <div style="background-color:'.$bgColor.'" class="content-column border-right border-bottom border-left">
                        <div class="tabel10 padding10 alignCenter">
                            '.$counter.'
                        </div>
                        <div class="tabel35 border-left padding10">
                            '.$data["username"].'
                        </div>
                        <div class="align-center tabel55 border-left padding10">
                            <div style="background-color:'.$bgColor.'"/>
                                <div class="align-center tabel25 padding0">
                                    '.$passButton.'
                                </div>
                                <div class="align-center tabel15 border-left padding0">	
                                    '.$editButton.'
                                </div>';
                                //<div class="align-center tabel15 border-left padding0">
                                  //  '.$deleteButton.'
                                //</div>
								echo '
                            </div>
                        </div>
                    </div>';
                }
                echo '
            </form>
        </div>
        <div align="center" style="margin:15px 0px 35px 0px">';
            include($thisUrl."functions/fungsi_paging.php");
            halaman($max, $perhalaman, 3, "&s_text=$s_text&");
            echo '
        </div>';
    }
	?>
