Location: PHPKode > projects > Shell Providers Customer/Accounts DB > shelldb/process/cust_search.php
<?php include("../includes/session.php");?><?php include("..//includes/head.php") ;include("..//includes/config.php"); // Contains the header file ?>
<? 

if(!is_user()) {
echo '<a href="/login.php">Sorry please login</a>';
exit;
}

?>
<BODY text=#333333 bottomMargin=0 vLink=#6666aa aLink=#aa6666 link=#6666aa 
bgColor=#6c7198 leftMargin=0 topMargin=0 rightMargin=0 marginheight="0" 
marginwidth="0">

<!-- Navbar -->
<?php include("..//includes/navbar.php"); ?>
<!-- End of NavBar -->

<IMG height=5 alt="" 
src="../images/blank.gif" width=100><BR>
<!-- start page body -->
<DIV align=center>
<TABLE cellSpacing=0 cellPadding=0 width="99%" border=0>
  <TBODY>
  <TR>
      <TD width="1%" background=../images/tbar1.png height=17><IMG height=17 
      src="../images/tleft1.png" width=17 border=0></TD>
      <TD align=middle width="99%" background=../images/tbar1.png 
      colSpan=3><IMG height=17 src="../images/tbar1.png" width=1 border=0></TD>
      <TD><IMG height=17 src="../images/tright1.png" width=17 border=0></TD>
    </TR>
  <TR>
      <TD vAlign=bottom align=left width=17 
      background=../images/leftbar1.png><IMG height=25 
      src="../images/leftbar1.png" width=17 border=0></TD>
    <TD bgColor=#ffffff colSpan=3>
<!-- start main body cell -->
      <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
            <TD vAlign=top align=left width=141 
          background="../images/steel3(1).jpg" 
          bgColor=#cfd1d4>
              <!-- VA Linux Stats Counter -->
              <IMG height=1 
            alt=Counter src="../images/clear.gif" width=140><BR>
            <CENTER>
                <IMG height=79 
            src="../images/sflogo-hammer1.jpg" width=136 border=0> 
              </CENTER>
            <P>
<!-- menus -->
            <TABLE cellSpacing=0 cellPadding=0 width=140 border=0>
              <TBODY>
              <TR>
                   <!--Beginning of Status Submenu --><TD vAlign=center align=left><B>
                    Status:</B></TD>
                </TR>
              <TR>
                  <TD vAlign=center align=right> 
                    <H4><FONT color=#990000>
                      <?php include("..//menu/status.php"); ?><BR>
                      </FONT></H4>
                    </TD>
                </TR></TBODY></TABLE>
            <TABLE cellSpacing=0 cellPadding=0 width=140 border=0>
              <TBODY>
              <TR>
                  <!-- Beginning  of Customers Submenu --><TD vAlign=center align=left><B>Customers</B><BR>
                  </TD></TR>
              <TR>
                <TD vAlign=center align=right>
<CENTER>
                      <?php include("..//menu/customers.php"); ?>
                      <BR>
                    </CENTER>
                  </TD></TR></TBODY></TABLE>
            <TABLE cellSpacing=0 cellPadding=0 width=140 border=0>
              <TBODY>
              <TR>
                  <!--Beginning of Accounts Submenu --><TD vAlign=center align=left><B>
                    Accounts</B><BR>
                  </TD></TR>
              <TR>
                  <TD vAlign=center align=right><BR>
                    <?php include("..//menu/accounts.php"); ?>
                  </TD>
                </TR></TBODY></TABLE>
            <TABLE cellSpacing=0 cellPadding=0 width=140 border=0>
              <TBODY>
              <TR>
                  <TD vAlign=center align=left><B>Ips</B><BR>
                  </TD></TR>
              <TR>
                  <!-- Beginning of IP Submenu -->
				  <TD vAlign=center align=right> 
                    <?php include("..//menu/ips.php"); ?>
                    <BR>
                  </TD>
                </TR></TBODY></TABLE>
            <TABLE cellSpacing=0 cellPadding=0 width=140 border=0>
              <TBODY>
              <TR>
                  <!--Beginning of Port Submenu --><TD vAlign=center align=left><B>Ports</B></TD>
                </TR>
              <TR>
                  <TD vAlign=center align=right> 
                    <?php include("..//menu/ports.php"); ?>
                    <BR>
                  </TD></TR></TBODY></TABLE>
            <TABLE cellSpacing=0 cellPadding=0 width=140 border=0>
              <TBODY>
              <TR>
                  <!-- Beginning of Bills Submenu--><TD vAlign=center align=left><B>Bills</B></TD>
                </TR>
              <TR>
                  <TD vAlign=center align=right>
                    <?php include("..//menu/bills.php"); ?>
                    <BR>
                  </TD>
                </TR></TBODY></TABLE>
            <P></P></TD>
            <TD noWrap width=20 background=../images/fade1.png>&nbsp;</TD>
          <TD vAlign=top width="99%" bgColor=#ffffff><BR>
              <!-- Body of Page -->
              <?php
			  
			  /* Connect To Database */
			 
			  mysql_connect ($shelldb_host, $shelldb_user, $shelldb_pass);
			  mysql_select_db ($shelldb_db);
			  
			 /* Determain what to search for and where */
			
			  if($cust_name != "") {
			  	$like_cust_name = "%".$cust_name."%";
			  	$query = mysql_query("SELECT * FROM customers WHERE cust_name LIKE '$like_cust_name' order by cust_name");
			  } else {
			  		if($cust_id == "") { $cust_id = "%"; }
			  	$query = mysql_query("SELECT * FROM customers WHERE cust_id LIKE '$cust_id' order by cust_name");
			  }
			 
			 /* Determain Number Of Results */
			 
			 $num_results = mysql_num_rows($query); 
			 echo "Number of  Results Found: <B> $num_results </B><BR>";
			  
			 /* Print Results */
			 
			 for ($i=0; $i <$num_results; $i++)
			 {
			 	$row = mysql_fetch_array($query);
				echo "<p><strong>".($i+1).". Customers Name: ";
				echo htmlspecialchars( stripslashes($row["cust_name"]));
				echo "</strong><BR> Customers Phone:";
				echo htmlspecialchars( stripslashes($row["cust_phone"]));
				echo "<BR> Customers Email: ";
				echo htmlspecialchars( stripslashes($row["cust_email"]));
				echo "<BR> Customers Country: ";
				echo htmlspecialchars( stripslashes($row["cust_country"]));
				echo "<BR> Customers Address: ";
				echo htmlspecialchars( stripslashes($row["cust_addr"]));
				echo "<BR> Customer ID: ";
				echo htmlspecialchars( stripslashes($row["cust_id"]));
			 }
			 
			 ?>
			  <!-- End of Body -->
            </TD>
          <TD width=9 bgColor=#ffffff>&nbsp; </TD></TR></TBODY></TABLE></TD>
      <TD vAlign=bottom align=right width=17 
      background=../images/rightbar1.png><IMG height=17 
      src="../images/rightbar1.png" width=17 border=0></TD>
    </TR>
  <TR>
      <TD background=../images/bbar1.png height=17><IMG height=17 
      src="../images/bleft1.png" width=17 border=0></TD>
      <TD align=middle background=../images/bbar1.png colSpan=3><IMG height=17 
      src="../images/bbar1.png" width=1 border=0></TD>
      <TD background=../images/bbar1.png bgColor=#7c8188><IMG height=17 
      src="../images/bright1.png" width=17 border=0></TD>
    </TR></TBODY></TABLE></DIV>
<!-- themed page footer -->

</BODY></HTML>
Return current item: Shell Providers Customer/Accounts DB