Location: PHPKode > projects > WorkOrder TS > workorder-ts/include/workorder_function_findcustomersingle.php
<?PHP function _OED0L($_J0C10,$inc_dir,$SSID,$CONF) { require_once $inc_dir.'workorder_function_isuserauthenticated.inc.php';$IsCustomerLogin=Null;if( _L0OPO( $inc_dir,$SSID,$CONF )==True ) { $IsCustomerLogin=1;} $_J0o1J=NULL;$Customer_ID=NULL;require $inc_dir.'config-guest.inc.php';include $inc_dir.'conn-string-guest.inc.php';$_JQLL1="";if( isset($_GET['CustomerSearchString']) ) { $_J0o1J=mysql_real_escape_string($_GET['CustomerSearchString']);} if( isset($_GET['Date']) ) { $Date=mysql_real_escape_string($_GET['Date']);} if( isset($_POST['Date']) ) { $_JOIL6=mysql_real_escape_string($_POST['Date']);} if( isset($_J0C10)==True or is_numeric($Customer_ID)==True ) { $_JOjLj=1;if( is_numeric($Customer_ID)==True ) { $_J0C10=$Customer_ID;} $sql="select *,DATE_FORMAT(Date_edit, '$confLocalFormatTime') AS Date_added from ".$CONF['TableNameCustomers']." where ID='$_J0C10' ";} else{ $sql="select *,DATE_FORMAT(Date_edit, '$confLocalFormatTime') AS Date_added from ".$CONF['TableNameCustomers']." where    BBus_name LIKE '%$_J0o1J%' OR    BBus_cont LIKE '%$_J0o1J%' OR   BBus_cont_alt LIKE '%$_J0o1J%' OR    BName_first like '%$_J0o1J%' OR    BName_last like '%$_J0o1J%'OR    ID like '%$_J0o1J%' OR    BAddress1 like '%$_J0o1J%'OR    BAddress2 like '%$_J0o1J%'OR    BAddress3 like '%$_J0o1J%'OR    BPhone1 like '%$_J0o1J%'OR    BPhone2 like '%$_J0o1J%'OR    BMobile1 like '%$_J0o1J%'OR    BMobile2 like '%$_J0o1J%'OR    BOffice1 like '%$_J0o1J%'OR    BOffice2 like '%$_J0o1J%'OR    BFax1 like '%$_J0o1J%'OR    BFax2 like '%$_J0o1J%'";} if( $IsCustomerLogin==1 ) { $_J6ICO=_L0O0D($inc_dir,$SSID,$CONF);if( $_J6ICO==0 ) { die("Error, unable to validate customer user account. E:342fd");} $sql="select *,DATE_FORMAT(Date_edit, '$confLocalFormatTime') AS Date_added from ".$CONF['TableNameCustomers']." where ID = $_J6ICO";} if( $debug==1 ) { echo("<br>SQL Query: $sql<br>");} $_j6f0I=mysql_query( $sql,$conn) or die("Error 543654");$_JOjLJ=mysql_num_rows($_j6f0I);if( is_numeric($_JOjLJ) ) { $_JOJCo="Found $_JOjLJ Customers";} echo("<br><b>Finding Customer:</b><br>$_JOJCo<br>Search String: ".htmlspecialchars(stripslashes($_J0o1J))."<br>");echo('    <table style="width: 100%; text-align: left;" border="1" cellpadding="2"    cellspacing="2">    <tbody>    <tr>    <td style="vertical-align: top;">Business Name<br>    </td>    <td style="vertical-align: top;">Last, First Name<br>    </td>    <td style="vertical-align: top;">Phone<br>    </td>    <td style="vertical-align: top;">Street<br>    </td>    <td style="vertical-align: top;">City<br>    </td>    <td style="vertical-align: top;">Date Added<br>    </td>    </tr>');while( $row=mysql_fetch_array($_j6f0I) ) { $Customer_ID=$row['ID'];$BBus_name=$row['BBus_name'];$BName_first=$row['BName_first'];$BName_last=$row['BName_last'];$BStreet=$row['BAddress1'];$BAddress2=$row['BAddress2'];if( $BAddress2 !="" ) { if( is_numeric($BAddress2) ) { $BAddress2='<br>Unit: '.$row['BAddress2'];} else{ $BAddress2='<br>'.$row['BAddress2'];} } $_J18Ol=$row['BAddress3'];$BPhone1=$row['BPhone1'];$BPhone2=$row['BPhone2'];$BMobile1=$row['BMobile1'];$BMobile2=$row['BMobile2'];$BOffice1=$row['BOffice1'];$BOffice2=$row['BOffice2'];$BCity=$row['BCity'];$_J6O0l=$row['Date_added'];if ( !empty($BPhone1) ) { $BPhone=$BPhone1;} elseif ( !empty($BPhone2) ) { $BPhone=$BPhone2;} elseif ( !empty($BMobile1) ) { $BPhone=$BMobile1;} elseif ( !empty($BMobile2) ) { $BPhone=$BMobile2;} elseif ( !empty($BOffice1) ) { $BPhone=$BOffice1;} elseif ( !empty($BOffice2) ) { $BPhone=$BOffice2;} echo("<tr>");if( $BBus_name AND empty($_J0C10) ) { if( empty($Date) ) { echo('<td style="vertical-align: top;"><a href="workorder.php?Step=View&amp;FormType=CustomerDetail&amp;Customer_ID='.$Customer_ID.'&amp;SSID='.$SSID.'">'.$BBus_name.'</a><br>      </td>');} else { echo('<td style="vertical-align: top;"><a href="../../workorder.php?Step=EditAddTicket&amp;View=NewTicket&amp;Date='.$Date.'&amp;Customer_ID='.$Customer_ID.'&amp;SSID='.$SSID.'">'.$BBus_name.'</a><br>      </td>');} } elseif( $BBus_name AND isset($_J0C10) ) { if( empty($Date) ) { echo('<td style="vertical-align: top;"><a href="workorder.php?Step=EditAddTicket&Customer_ID='.$Customer_ID.'&amp;View=NewTicket&amp;SSID='.$SSID.'">'.$BBus_name.'</a><br>      </td>');} else { echo('<td style="vertical-align: top;"><a href="../../workorder.php?Step=EditAddTicket&amp;View=NewTicket&amp;Date='.$Date.'&amp;Customer_ID='.$Customer_ID.'&amp;View=NewTicket&amp;SSID='.$SSID.'">'.$BBus_name.'</a><br>      </td>');} } else{ echo(' <td style="vertical-align: top;">'.$BBus_name.'<br>     </td>');} if( $BName_last AND $BName_first and empty($_J0C10) ) { if( empty($SSID) ) { echo('<td style="vertical-align: top;"><a href="workorder.php?Step=View&amp;FormType=CustomerDetail&amp;Customer_ID='.$Customer_ID.'">'.$BName_last.', '.$BName_first.'</a><br>      </td>');} else { if( empty($Date) ) { echo('<td style="vertical-align: top;"><a href="workorder.php?Step=View&amp;FormType=CustomerDetail&amp;Customer_ID='.$Customer_ID.'&amp;SSID='.$SSID.'">'.$BName_last.', '.$BName_first.'</a><br>      </td>');} else { echo('<td style="vertical-align: top;"><a href="../../workorder.php?Step=EditAddTicket&amp;Date='.$Date.'&amp;View=NewTicket&amp;Customer_ID='.$Customer_ID.'&amp;SSID='.$SSID.'">'.$BName_last.', '.$BName_first.'</a><br>      </td>');} } } elseif( $BName_last AND $BName_first AND isset($_J0C10) ) { if ( empty($_JOIL6)==true ) { echo('<td style="vertical-align: top;"><a href="workorder.php?Step=EditAddTicket&Customer_ID='.$Customer_ID.'&amp;View=NewTicket&amp;SSID='.$SSID.'">'.$BName_last.', '.$BName_first.'</a><br>      </td>');} else { echo('<td style="vertical-align: top;"><a href="workorder.php?Step=EditAddTicket&Customer_ID='.$Customer_ID.'&amp;View=NewTicket&amp;SSID='.$SSID.'&amp;Date='.$_JOIL6.'">'.$BName_last.', '.$BName_first.'</a><br>      </td>');} } else{ echo(' <td style="vertical-align: top;">'.$BName_last.', '.$BName_first.'<br>     </td>');} echo('     <td style="vertical-align: top;">'.$BPhone.'<br>     </td>     <td style="vertical-align: top;">'.$BStreet.$BAddress2.'<br>     </td>     <td style="vertical-align: top;">'.$BCity.'<br>     </td>     <td style="vertical-align: top;">'.$_J6O0l.'<br>     </td></tr>');} echo ('</tbody></table>');} ?>
Return current item: WorkOrder TS