Location: PHPKode > projects > WorkOrder TS > workorder-ts/include/workorder_function_findcustomermulti.php
<?PHP function _OECFF($inc_dir,$CONF) { $IsCustomerLogin=Null;if( _L0OPO( $inc_dir,$SSID,$CONF )==True ) { $IsCustomerLogin=1;} require $inc_dir.'config-guest.inc.php';include $inc_dir.'conn-string-guest.inc.php';$View=mysql_real_escape_string($_GET['View']);$_JQLL1="";$BBus_name="";$BName_last="";$BName_first="";$_Jtl61=Null;$_JO0IL=Null;$_J0o1J=mysql_real_escape_string($_GET['CustomerSearchString']);$_JJl0j=explode(" ",$_J0o1J);if( isset($_GET['Customer_ID']) ) { $Customer_ID=mysql_real_escape_string($_GET['Customer_ID']);} else { $Customer_ID=Null;} if( isset($_GET['Date']) ) { $Date=mysql_real_escape_string($_GET['Date']);} else { $Date=Null;} $SSID=mysql_real_escape_string($_GET['SSID']);echo("<b>Finding Customer:</b><br>Search String: $_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>');$_JO0o8=0;while( $_JO0o8 < count($_JJl0j) ) { $_JO1Oj[$_JO0o8]="select *,DATE_FORMAT(Date_edit, '$confLocalFormatTime') AS Date_added from ".$CONF['TableNameCustomers']." where    BBus_name LIKE '%$_JJl0j[$_JO0o8]%' OR   BBus_cont LIKE '%$_JJl0j[$_JO0o8]%' OR   BBus_cont_alt LIKE '%$_JJl0j[$_JO0o8]%' OR    BName_first like '%$_JJl0j[$_JO0o8]%' OR   BName_last like '%$_JJl0j[$_JO0o8]%' OR     ID like '%$_JJl0j[$_JO0o8]%' OR    BAddress1 like '%$_JJl0j[$_JO0o8]%' OR    BAddress2 like '%$_JJl0j[$_JO0o8]%' OR    BAddress3 like '%$_JJl0j[$_JO0o8]%' OR    BPhone1 like '%$_JJl0j[$_JO0o8]%' OR    BPhone2 like '%$_JJl0j[$_JO0o8]%' OR    BMobile1 like '%$_JJl0j[$_JO0o8]%' OR    BMobile2 like '%$_JJl0j[$_JO0o8]%' OR    BOffice1 like '%$_JJl0j[$_JO0o8]%' OR    BOffice2 like '%$_JJl0j[$_JO0o8]%' OR    BFax1 like '%$_JJl0j[$_JO0o8]%' OR    BFax2 like '%$_JJl0j[$_JO0o8]%'";if( $debug==1 ) { echo("<BR>$sql<BR>");} if( $debug==1 ) { echo("<br>$_JO1Oj[$_JO0o8]<br>");} $_JO0o8=$_JO0o8+1;} if( $IsCustomerLogin==1 ) { $_J6ICO=_L0O0D($inc_dir,$SSID,$CONF);if( $_J6ICO==0 ) { die("Error, unable to validate customer user account. E:342fe");} unset($_JO1Oj);$_JO1Oj[0]="select *,DATE_FORMAT(Date_edit, '$confLocalFormatTime') AS Date_added from ".$CONF['TableNameCustomers']." where ID = $_J6ICO";} $_j0l0C=0;$_JOQfI=1;if( isset($_JO1Oj) ) { $_JOQ8f=count($_JO1Oj);} else{ $_JOQ8f=0;} for( $x=0;$x < $_JOQ8f;$x++) { if( isset($_JO1Oj) ) { $_j6f0I=mysql_query( $_JO1Oj[$x],$conn) or die("Error 54864".mysql_error());if( $debug==1 ) { echo("<br>Double Check Enabled<br>");} $_JOQi1=1;} $_Jt81l=mysql_num_rows($_j6f0I);$_JOQiJ=0;while( $row=mysql_fetch_array($_j6f0I) AND $_Jt81l !=0 ) { $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'];$_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( $_JOQi1==1 ) { $_JOQL0=0;$_JOIJl=count($_Jtl61);if( $debug==1 ) { echo("<br>Array Size: $_JOIJl");} $_j0l0C=0;while( $_j0l0C < $_JOIJl ) { if( $debug==1 ) { echo("<br>Comparing $_Jtl61[$_j0l0C] with $Customer_ID<br>");} if( $_Jtl61[$_j0l0C]==$Customer_ID ) { if( $debug==1 ) { echo("<br>Found Double $_Jtl61[$_j0l0C] ii $Customer_ID<br>");} $_JOQL0=1;$_JO0IL="1";} $_j0l0C++;} } if( $_JO0IL !=1 ) { $_Jtl61[$_JOQiJ]=$Customer_ID;$_JOQiJ++;if ( isset($BPhone1) ) { $BPhone=$BPhone1;} elseif ( isset($BPhone2) ) { $BPhone=$BPhone2;} elseif ( isset($BMobile1) ) { $BPhone=$BMobile1;} elseif ( isset($BMobile2) ) { $BPhone=$BMobile2;} elseif ( isset($BOffice1) ) { $BPhone=$BOffice1;} elseif ( isset($BOffice2) ) { $BPhone=$BOffice2;} } if( $_JOQL0==0 ) { echo("<tr>");if( empty($BBus_name)==False AND empty($Date)==True ) { 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>');} elseif( empty($BBus_name) !=True AND empty($Date) !=True ) { 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>');} else{ echo(' <td style="vertical-align: top;">'.$BBus_name.'<br>     </td>');} if( $BName_last AND $BName_first 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.'">'.$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>');} } 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.'<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