Location: PHPKode > projects > WorkOrder TS > workorder-ts/include/workorder_FormCustomerDetail.inc.php
<?PHP $inc_dir='./include/';require_once $inc_dir.'config-guest.inc.php';include $inc_dir.'conn-string-guest.inc.php';if( isset($_GET['Customer_ID']) ) { $Customer_ID=addslashes($_GET['Customer_ID']);} if( isset($_GET['Ticket_ID']) ) { $Ticket_ID=addslashes($_GET['Ticket_ID']);} if( isset($_GET['View']) ) { $View=addslashes($_GET['View']);} $_JQLL1="";$BBus_name="";$BName_last="";$BName_first="";$_Il6fL=NULL;$_Jt18f=Null;if( isset($_GET['Customer_ID']) ) { $Customer_ID=addslashes($_GET['Customer_ID']);} if( isset($_GET['SSID']) ) { $SSID=mysql_real_escape_string($_GET['SSID']);} if( isset($_POST['SSID']) ) { $_jotlC=mysql_real_escape_string($_POST['SSID']);} if( empty($SSID)==TRUE AND empty($_jotlC)==FALSE ) { $SSID=$_jotlC;} $CONF=_OFB10($inc_dir);$IsCustomerLogin=Null;if( _L0OPO( $inc_dir,$SSID,$CONF )==True ) { $IsCustomerLogin=1;} if( $IsCustomerLogin==1 ) { unset($Customer_ID);$Customer_ID=_L0O0D($inc_dir,$SSID,$CONF);} if( empty($SSID)==TRUE AND empty($_jotlC)==FALSE ) { $SSID=$_jotlC;} require_once $inc_dir.'workorder_function_isuserauthenticated.inc.php';if( _L00CR($SSID,$inc_dir,$_Il6fL,$CONF)=="FAILED" ) { $_Ilo8J=addslashes($_SERVER['PHP_SELF']);$_IlC1t=addslashes($_SERVER['QUERY_STRING']);$TargetQueryPass=str_replace('=','\=',$_IlC1t);echo($_Ilo8J);echo("<br>");echo($_IlC1t);die('<html>   <head>   <meta http-equiv="refresh" content="1; url=/login.php?TargetURLPass='.$_Ilo8J.'&amp;TargetQueryPass='.$TargetQueryPass.'">    </head>    <body>   Connecting ...   </body>   </html>');} $sql="select *,DATE_FORMAT(".$CONF['TableNameCustomers'].".Date_edit, '$confLocalFormatTime') AS Date_added,DATE_FORMAT(".$CONF['TableNameCustomers'].".Date_edit, '$confLocalFormatTime') AS Date_edit FROM ".$CONF['TableNameCustomers']." LEFT JOIN ".$CONF['TableNameCustomersShip']." ON ".$CONF['TableNameCustomers'].".ID = ".$CONF['TableNameCustomersShip'].".CUST_BID WHERE ".$CONF['TableNameCustomers'].".ID = '$Customer_ID'";$_Jt1OJ="select COUNT(*) from ".$CONF['TableNameTicket']." where Customer_ID='$Customer_ID'";$_JtQ6J=mysql_query($_Jt1OJ,$conn) or die("Error count of ticket Error:43257o2i3");$_JtQil=mysql_Fetch_array($_JtQ6J);$_JtIoj=$_JtQil['COUNT(*)'];$_Jtjtt="select DATE_FORMAT(CheckedIn, '$confLocalFormatTime') AS CheckedIn from ".$CONF['TableNameTicket']." where Customer_ID='$Customer_ID'  ORDER BY CheckedIn ASC";$_JtjOL=mysql_query($_Jtjtt,$conn) or die("Error count of ticket Error:4dsfo2i3");$_JtJjI=mysql_Fetch_array($_JtjOL);$_Jt61j=$_JtJjI['CheckedIn'];$_j6f0I=mysql_query( $sql,$conn) or die("Error 54864 $sql".mysql_error());$_j0l0C=0;while( $row=mysql_fetch_array($_j6f0I) ) { $_Jt6Oo=$CONF['TableNameCustomers'].'ID';$_jlI1C=$row[$_Jt6Oo];$Customer_ID=$row['ID'];$BBus_name=$row['BBus_name'];$_J1jQC=$row['BBus_cont_title'];$BBus_cont=$row['BBus_cont'];$_J1JoQ=$row['BBus_cont_alt_title'];$_J1ji1=$row['BBus_cont_alt'];$_J16jf=$row['BTitle'];$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'];$BState=$row['BState'];$BPhone1=$row['BPhone1'];$BPhone2=$row['BPhone2'];$BMobile1=$row['BMobile1'];$BMobile2=$row['BMobile2'];$BOffice1=$row['BOffice1'];$BOffice2=$row['BOffice2'];$_J1CC1=$row['BFax1'];$_J1CCl=$row['BFax2'];$BZip=$row['BZip'];$BCity=$row['BCity'];$_J1ClI=$row['Email1'];$_J1iJl=$row['Email2'];$_J1iii=$row['Web'];$_jCiCQ=$row['SBus_name'];$_jClji=$row['SBus_cont_title'];$_jCLt1=$row['SBus_cont'];$_ji06I=$row['SBus_cont_alt_title'];$_jClfi=$row['SBus_cont_alt'];$_ji1Q0=$row['STitle'];$_jiQ1Q=$row['SName_first'];$_jiQIi=$row['SName_last'];$_Jt6OL=$row['SAddress1'];$_jiIji=$row['SAddress2'];if( $_jiIji !="" ) { if( is_numeric($_jiIji) ) { $_jiIji='<br>Unit: '.$row['SAddress2'];} else{ $_jiIji='<br>'.$row['SAddress2'];} } $_jijjj=$row['SAddress3'];$_jiJ1I=$row['SState'];$_ji6C8=$row['SPhone1'];$_jifQi=$row['SPhone2'];$_jiftJ=$row['SMobile1'];$_jifLl=$row['SMobile2'];$_ji8ii=$row['SOffice1'];$_jitQf=$row['SOffice2'];$_jitoJ=$row['SFax1'];$_jiOjC=$row['SFax2'];$_ji6JO=$row['SZip'];$_jij6i=$row['SCity'];$_Jtfj8=$row['Date_edit'];$DisplayName="";$_JtfOi=$row['Cust_login_name'];if( $_JtfOi==Null || $_JtfOi=="" ) { $_JtfOi='Not Used';} $_Jt81l=mysql_num_rows($_j6f0I);if( $_Jt81l==1 ) { echo('<SCRIPT language="JavaScript1.2">     function updtpw()     {     window.open("include/pro/update_customer_password.php?Cid='.$Customer_ID.'&SSID='.$SSID.'",      "mywindow","location=0,status=0,scrollbars=1,width=650,height=250");     }     function opencustomerdetail()     {     window.open("include/pro/workorder_FormCustomerDetail_tables_form.inc.php?Step=NewDetail&Customer_ID='.$Customer_ID.'&SSID='.$SSID.'",      "mywindow","location=0,status=0,scrollbars=1,width=650,height=500");     }     </SCRIPT>');echo('     <table style="width: 100%; text-align: left;" border="1" cellpadding="2" cellspacing="2">     <tbody>     <tr><td style="vertical-align: top;"><center>Business Information</center>');if( empty($BBus_name) !=True ) { echo('<b>Business Name</b><br>'.$BBus_name.'<br>');} if( empty($BBus_cont) !=True ) { echo('<b>Contact: Title Name</b><br>'.ucfirst($_J1jQC).' '.$BBus_cont.'<br>');} if( empty($_J1ji1) !=True ) { echo('<b>Alternate Contact: Title Name</b><br>'.ucfirst($_J1JoQ).' '.$_J1ji1.'<br>');} if( empty($BName_last) !=True ) { echo('<b>Title Last, First Name</b><br>'.ucfirst($_J16jf).' '.$BName_last.', '.$BName_first.'<br>');} if( empty($BStreet) !=True ) { echo('<b>Address</b><br>'.$BStreet." ".$BAddress2.'<br>'.$BCity.', '.$BState.' '.$BZip.'<br>');} echo(' <b>Phone/Fax/EMail/Web</b><br>');if ( strlen($BPhone1) > 1 ) { echo('Phone1: '.$BPhone1.'<br>');} if ( strlen($BPhone2) > 1 ) { echo('Phone2: '.$BPhone2.'<br>');} if ( strlen($BMobile1) > 1 ) { echo('Mobile1: '.$BMobile1.'<br>');} if ( strlen($BMobile2) > 1 ) { echo('Mobile2: '.$BMobile2.'<br>');} if ( strlen($BOffice1) > 1 ) { echo('Office1: '.$BOffice1.'<br>');} if ( strlen($BOffice2) > 1 ) { echo('Office2: '.$BOffice2).'<br>';} if ( strlen($_J1CC1) > 1 ) { echo('Fax1: '.$_J1CC1).'<br>';} if ( strlen($_J1CCl) > 1 ) { echo('Fax2: '.$_J1CCl).'<br>';} if ( strlen($_J1ClI) > 1 ) { echo('Email1: '.$_J1ClI).'<br>';} if ( strlen($_J1iJl) > 1 ) { echo('Email2: '.$_J1iJl).'<br>';} if ( strlen($_J1iii) > 1 ) { echo('Web: '.$_J1iii).'<br>';} echo('</td><td style="vertical-align: top;"><center>Shipping Information</center>');if( empty($_jCiCQ) !=True ) { echo('<b>Business Name</b><br>'.$_jCiCQ.'<br>');} if( empty($_jCLt1) !=True ) { echo('<b>Contact: Title Name</b><br>'.ucfirst($_jClji).' '.$_jCLt1.'<br>');} if( empty($_jClfi) !=True ) { echo('<b>Alternate Contact: Title Name</b><br>'.ucfirst($_ji06I).' '.$_jClfi.'<br>');} if( empty($_jiQIi) !=True ) { echo('<b>Title Last, First Name</b><br>'.ucfirst($_ji1Q0).' '.$_jiQIi.', '.$_jiQ1Q.'<br>');} if( empty($_Jt6OL) !=True ) { echo('<b>Address</b><br>'.$_Jt6OL." ".$_jiIji.'<br>'.$_jij6i.', '.$_jiJ1I.' '.$_ji6JO.'<br>');} if( empty($_ji6C8) !=True || empty($_jifQi) !=True || empty($_jiftJ) !=True || empty($_jifLl) !=True || empty($_ji8ii) !=True || empty($_jitQf) !=True || empty($_jitoJ) !=True || empty($_jiOjC) !=True ) { echo(' <b>Phone/Fax/EMail</b><br>');} if ( strlen($_ji6C8) > 1 ) { echo('Phone1: '.$_ji6C8.'<br>');} if ( strlen($_jifQi) > 1 ) { echo('Phone2: '.$_jifQi.'<br>');} if ( strlen($_jiftJ) > 1 ) { echo('Mobile1: '.$_jiftJ.'<br>');} if ( strlen($_jifLl) > 1 ) { echo('Mobile2: '.$_jifLl.'<br>');} if ( strlen($_ji8ii) > 1 ) { echo('Office1: '.$_ji8ii.'<br>');} if ( strlen($_jitQf) > 1 ) { echo('Office2: '.$_jitQf).'<br>';} if ( strlen($_jitoJ) > 1 ) { echo('Fax1: '.$_jitoJ).'<br>';} if ( strlen($_jiOjC) > 1 ) { echo('Fax2: '.$_jiOjC).'<br>';} echo('</td>    </tr>    <tr>    <td style="vertical-align: top;"><b>Last Edit</b>: '.$_Jtfj8.'<br>        <b>Number of Tickets</b>: '.$_JtIoj.'<br>        <b>Last Checkin</b>: '.$_Jt61j.'<br>    </td><td><br></td></tr>');if( $CONF['EnableCustomerLogin']==1 ) { echo('<tr>     <td style="vertical-align: top;">Customer Login Account Details:<br />         Login Name: '.$_JtfOi.'<br>         <a href="javascript: updtpw()">Change Login Password</a><br>     </td><td><br></td></tr>');} echo('</tbody></table>    <a href="./workorder.php?Step=ShowAddCustomerUI&amp;EditCustomer=Yes&amp;Customer_ID='.$Customer_ID.'&amp;SSID='.$SSID.'">Edit Customer</a> &nbsp;&nbsp;    <a href="./workorder.php?Step=EditAddTicket&amp;Customer_ID='.$Customer_ID.'&amp;View=NewTicket&amp;SSID='.$SSID.'">New Ticket</a> &nbsp;&nbsp;');if( file_exists("$inc_dir/pro/calendar.php")==True ) { echo('<a href="./workorder.php?Step=EditAddTicket&amp;Customer_ID='.$Customer_ID.'&amp;View=NewTicket&amp;SSID='.$SSID.'&amp;serv_cont=1">New Service Contract</a> &nbsp;&nbsp;     <a href="javascript: opencustomerdetail()">Add New Customer Detail</a> &nbsp;&nbsp;     <a href="JavaScript:window.location.reload()">Refresh Customer</a><br><br>');$_Jt8fJ="select * from ".$CONF['TableNameCustomersDetail']." WHERE Customer_ID = '$Customer_ID'";$_JttI8=mysql_query($_Jt8fJ,$conn) or die("Error getting Customer Details info Error: 4353434, $_Jt8fJ");$_JttJt=mysql_num_rows($_JttI8);while( $_JtOJQ=mysql_fetch_array($_JttI8) ) { $_JtoQC=$_JtOJQ['Detail_ID'];echo('<SCRIPT language="JavaScript1.2">     function opencustomerdetails'.$_JtoQC.'()     {     window.open("include/pro/workorder_FormCustomerDetail_tables_form.inc.php?Step=UpdateDetail&Customer_ID='.$Customer_ID.'&Detail_ID='.$_JtoQC.'&SSID='.$SSID.'",      "mywindow","location=0,status=0,scrollbars=1,width=650,height=500");     }     </SCRIPT>');} if( $_JttJt !=0 ) { $_Jt8fJ="select * from ".$CONF['TableNameCustomersDetail']." WHERE Customer_ID = '$Customer_ID'";$_JttI8=mysql_query($_Jt8fJ,$conn) or die("Error getting Customer Details info Error: 4353434, $_Jt8fJ");echo('Customer Details Found in Database:<br>      <table style="width: 100%; text-align: left;" border="1" cellpadding="2" cellspacing="2">      <tbody>');$x=0;while( $_JtOJQ=mysql_fetch_array($_JttI8) ) { $_JtoQC=$_JtOJQ['Detail_ID'];$_JtoCL=$_JtOJQ['Details_Name'];if( empty($_JtoCL)==True) { $_JtoCL="No Name Entered";} echo('<tr>       <td style="vertical-align: top;"><a href="javascript: opencustomerdetails'.$_JtoQC.'()">'.htmlentities($_JtoCL).'</a>       </td>');$x++;} echo('</tbody></table><br>');} require_once 'customer_serv_contracts.php';} $_J6Ii1="select ID,Item_ID,Service_Desc, DATE_FORMAT(CheckedIn, '$confLocalFormatTime') AS CheckedIn from ".$CONF['TableNameTicket']." where Customer_ID='$Customer_ID' ORDER BY ID DESC";$_J6j01=mysql_query($_J6Ii1,$conn) or die("Error getting Ticket info Error: 435345");$_JtC8j=0;$_JtCOl=1;$_JtiJo=mysql_num_rows($_J6j01);while( $_J6jLO=mysql_fetch_array($_J6j01) ) { if( $_Jt18f==0 ) { echo('<p>      Tickets Found in Database:      <table style="width: 100%; text-align: left;" border="1" cellpadding="2"      cellspacing="2">      <tbody>      <tr>      <td style="vertical-align: top;">Ticket ID<br>      </td>      <td style="vertical-align: top;">Status<br>      </td>      <td style="vertical-align: top;">Item Model<br>      </td>      <td style="vertical-align: top;">Checked In<br>      </td>      <td style="vertical-align: top;">Service Desc<br>      </td>      </tr>');;$_Jt18f=1;} $Ticket_ID=$_J6jLO['ID'];$_j60Lt=$_J6jLO['Item_ID'];$Service_Desc=$_J6jLO['Service_Desc'];$CheckedIn=$_J6jLO['CheckedIn'];if( is_numeric($Ticket_ID)==True AND $_Jt81l <=1 ) { $_Jft0C="select Item_make,Item_model from ".$CONF['TableNameItem']." where Item_ticket_id ='$Ticket_ID'";$_JftOt=mysql_query($_Jft0C,$conn) or die("Error getting Ticket info Error: 435345");$_Jfto0=mysql_fetch_array($_JftOt);$Item_make=$_Jfto0['Item_make'];$Item_model=$_Jfto0['Item_model'];$_Jtii1="select Status_id,Service_Type from ".$CONF['TableNameTicket']." where ID='$Ticket_ID'";$_JtL6O=mysql_query($_Jtii1,$conn) or die("Error getting Ticket info Error: 43534d");$_JtlQI=mysql_fetch_array($_JtL6O);$Status_id=$_JtlQI['Status_id'];$_JjiIl=$_JtlQI['Service_Type'];echo('      <tr>      <td style="vertical-align: top;"><a href="workorder.php?Step=EditAddTicket&amp;Ticket_ID='.$Ticket_ID.'&amp;SSID='.$SSID.'">'.$Ticket_ID.'</a><br>      </td>      <td style="vertical-align: top;">');echo(GetStatusAsString2($inc_dir,$CONF,$Status_id));echo('<br>      </td>      <td style="vertical-align: top;">'.htmlentities($Item_model).'<br>      </td>      <td style="vertical-align: top;">'.htmlentities($CheckedIn).'<br>      </td>      <td style="vertical-align: top;">'.htmlentities($Service_Desc).'<br>      </td>      </tr>');if( $_JtCOl==$_JtiJo ) { echo ('</tbody></table></p>');} else { $_JtCOl=$_JtCOl+1;} } } } else{ die("Unhandled Error: 4535345");} } ?>
Return current item: WorkOrder TS