Location: PHPKode > projects > WorkOrder TS > workorder-ts/include/workorder_function_general.inc.php
<?PHP function _OEDO6( $inc_dir,$CONF,$_j0fjJ ) { require $inc_dir.'config-guest.inc.php';require $inc_dir.'conn-string-guest.inc.php';$sql='SELECT `serv_contract` FROM '.$CONF['TableNameServiceTypes'].' WHERE `ID`="'.$_j0fjJ.'" LIMIT 1';$res=mysql_query($sql,$conn) or die("Unable to find out if it is a service contract. Error: 57ghtrf <br />$sql");$row=mysql_fetch_array($res);if( isset($row['serv_contract']) ) { if( $row['serv_contract']==1 ) { return True;} else { return False;} } else { return False;} return False;} function _OEE08( $inc_dir,$CONF,$_JOJll ) { require $inc_dir.'config-guest.inc.php';require $inc_dir.'conn-string-guest.inc.php';$sql='SELECT `Service_Type` FROM '.$CONF['TableNameTicket'].' WHERE `ID`="$_JOJll" LIMIT 1';$res=mysql_query($sql,$conn) or die("Unable to get ticket ID Error: 56ghtrf <br />$sql");$row=mysql_fetch_array($res);$tid=$row['Service_Type'];$sql='SELECT `serv_contract` FROM '.$CONF['TableNameServiceTypes'].' WHERE `ID`="'.$tid.'" LIMIT 1';$res=mysql_query($sql,$conn) or die("Unable to find out if it is a service contract. Error: 57ghtrf <br />$sql");$row=mysql_fetch_array($res);if( isset($row['serv_contract']) ) { if( $row['serv_contract']==1 ) { return True;} else { return False;} } else { return False;} return False;} function _OEEQ1( $_jJiOj ) { if( $_jJiOj !=Null) { if( is_numeric($_jJiOj)==False ) { die("The time field only takes integer values");} $_IlJtQ=Null;$_JO6oL=Null;$_JO6iL=Null;$_JjjLt=Null;if( $_jJiOj !=Null && $_jJiOj !=0 ) { $_JOf6C=explode('.',$_jJiOj);if( $_jJiOj < 0 ) { die("Negative string time passed, not supported: $_jJiOj");} if( is_numeric($_JOf6C[0])==False || $_JOf6C[0] < 0 ) { die("Negative hour time passed, not supported: $_JOf6C[0]");} if( isset($_JOf6C[1])==False ) { $_JOf6C[1]=0;} else { if( is_numeric($_JOf6C[1])==False || $_JOf6C[1] < 0 ) { if( $_JOf6C[1]==Null ) { $_JOf6C[1]=0;} else { die("Negative minute time passed, not supported: $_JOf6C[1]");} } } if( strlen($_JOf6C[1])==1 ) { $_JOf6C[1]=$_JOf6C[1]."0";} $_JO6oL=$_JOf6C[1] / 60;if( $_JO6oL >=1 ) { $_JjjLt=explode('.',$_JO6oL);$_JO6oL=$_JOf6C[0]+$_JjjLt[0];$_JO6iL=$_JOf6C[1]-( 60 * $_JjjLt[0] );} else { $_JO6oL=$_JOf6C[0];$_JO6iL=$_JOf6C[1];} $_IlJtQ[0]=$_JO6oL;$_IlJtQ[1]=$_JO6iL;if( strlen($_IlJtQ[1])==1 ) { $_IlJtQ[1]="0".$_IlJtQ[1];} return $_IlJtQ;} $_IlJtQ[0]=0;$_IlJtQ[1]=0;return $_IlJtQ;} } function _OEF0R() { define("SSID_NAME","SSID");if( isset($_GET[SSID_NAME]) ) { return mysql_real_escape_string($_GET[SSID_NAME]);} else { if( isset($_POST[SSID_NAME]) ) { return mysql_real_escape_string($_POST[SSID_NAME]);} else { return False;} } } function _OEFBF($inc_dir,$CONF ) { require $inc_dir.'config-guest.inc.php';require $inc_dir.'conn-string-guest.inc.php';$_jiLCi=0;$sql="SELECT COUNT(*) FROM {$CONF['TableNameUsers']}";$res=mysql_query($sql,$conn);$row=mysql_fetch_array($res);if( $row['COUNT(*)'] > 3 ) { return 1;} else { return 0;} } function GetTechID( $inc_dir,$CONF,$SSID ) { require $inc_dir.'config-guest.inc.php';require $inc_dir.'conn-string-guest.inc.php';$SSID=mysql_real_escape_string($SSID);$sql="select `User_ID` from `{$CONF['TableNameUsers']}`,`{$CONF['TableNameUsersLogin']}` WHERE {$CONF['TableNameUsers']}.User_ID = {$CONF['TableNameUsersLogin']}.Login_USER_ID AND {$CONF['TableNameUsersLogin']}.Login_ssid ='$SSID' LIMIT 1";$res=mysql_query($sql,$conn) or die("</table>Unable to fetch Tech ID for function: Error 32423".mysql_error());$row=mysql_fetch_array($res);return $row['User_ID'];} function _OF1QO($inc_dir,$SSID,$TicketID,$CONF) { require $inc_dir.'config-guest.inc.php';require $inc_dir.'conn-string-guest.inc.php';$sql='SELECT `Login_USER_ID` from '.$CONF['TableNameUsersLogin'].' WHERE '.$CONF['TableNameUsersLogin'].'.`Login_ssid` = "'.$SSID.'"';$res=mysql_query($sql,$conn) or die("Unable to Technician to validate Error 1s45r<Br>$sql");$row=mysql_fetch_array($res);$_JO8i0=$row['Login_USER_ID'];$sql='SELECT COUNT(*) AS count FROM '.$CONF['TableNameTicket'].' WHERE `assigned_tech_id` = "'.$_JO8i0.'" AND `ID` = "'.$TicketID.'"';$res=mysql_query($sql,$conn) or die("Unable to validate Assigned Technician Error 1s46r<Br>$sql");$row=mysql_fetch_array($res);$_J0I1C=$row['count'];if( $_J0I1C !=0 || $_J0I1C !='0' ) { return True;} return False;} function _OE1CA($_j68CQ,$l=1) { do {$_jJCfj[]=substr($_j68CQ,0,$l);$_j68CQ=substr($_j68CQ,$l);} while($_j68CQ !="");return $_jJCfj;} function _OF18E($_JO8Lf,$_j0LIQ,$_JOtL0,$_JOO8t) { if ($_JOtL0) { $_JOojC=date('I');if ($_JOojC){ if ($_JO8Lf=="-"){ $_j0LIQ=$_j0LIQ-1;} else { $_j0LIQ=$_j0LIQ+1;} } } $_JOCQC=$_j0LIQ * 60;$_JOCjj=$_JOCQC * 60;if ($_JO8Lf=="-"){ $_JOi08=time()-($_JOCjj);} else { $_JOi08=time()+($_JOCjj);} $_JOL00=gmdate("$_JOO8t",$_JOi08);return $_JOL00;} function _OFQQC($inc_dir,$_j6OOO,$_IL101,$_IL1if) { $_j6oJi=Null;$_jjQIJ=Null;$_jJCfj=Null;require $inc_dir.'config-user.inc.php';require $inc_dir.'conn-string-user.inc.php';$sql="insert into $_j6OOO($_IL101) values($_IL1if)";$res=mysql_query($sql,$conn);$_j6oJi=mysql_error();$_jjQIJ=mysql_errno();if( $_jjQIJ !="" || $_jjQIJ !=Null ) { echo("$_j6oJi <br /> $sql");return $_jjQIJ;} else { return '1';} } function _OFQA0($inc_dir,$_j6OOO,$_IL101,$_IL1if,$_JOLt1=Null) { $_j6oJi=Null;$_jjQIJ=Null;$_jJCfj=Null;$_JOlfj=Null;require $inc_dir.'config-user.inc.php';require $inc_dir.'conn-string-user.inc.php';$sql="insert into $_j6OOO($_IL101) values($_IL1if)";$res=mysql_query($sql,$conn);if( $_JOLt1==True ) { $_JOlfj=mysql_insert_id($conn);} $_j6oJi=mysql_error();$_jjQIJ=mysql_errno();if( $_jjQIJ !="" || $_jjQIJ !=Null ) { echo("$_j6oJi <br /> $sql");return FALSE;} else { if( $_JOLt1==True ) { return $_JOlfj;} else { return TRUE;} } } function _OFQAF($inc_dir,$_j6OOO,$_Jo0Q1,$_Jo08o) { $_j6oJi="";$_jjQIJ=Null;$_jJCfj="";require $inc_dir.'config-user.inc.php';require $inc_dir.'conn-string-user.inc.php';$sql="update $_j6OOO SET $_Jo0Q1 where $_Jo08o";$res=mysql_query($sql,$conn);$_j6oJi=mysql_error();$_jjQIJ=mysql_errno();if( mysql_error() ) { echo mysql_error();echo("<p> $sql </p>");return $_jjQIJ;} else { return '1';} } function _OFOOD($inc_dir,$_j6OOO,$_IL101,$_IL1if) { $_j6oJi=Null;$_jjQIJ=Null;$_jJCfj=Null;require $inc_dir.'config-user.inc.php';require $inc_dir.'conn-string-user.inc.php';$sql="insert into $_j6OOO($_IL101) values($_IL1if)";$res=mysql_query($sql,$conn);$_j6oJi=mysql_error();$_jjQIJ=mysql_errno();return $_j6oJi;} function _OFOEF($inc_dir,$_j6OOO,$_IL101 ) { $_j6oJi=Null;$_jjQIJ=Null;$_jJCfj=Null;$_Jo0lO=Null;require $inc_dir.'config-user.inc.php';require $inc_dir.'conn-string-user.inc.php';$sql="DELETE FROM $_j6OOO WHERE $_IL101";$res=mysql_query($sql,$conn);$_Jo0lO=mysql_affected_rows($conn);if( is_numeric($_Jo0lO) ) { return TRUE;} else { $_j6oJi=mysql_error();$_jjQIJ=mysql_errno();return $_j6oJi;} } function _OFLL0($inc_dir,$_j6OOO,$_j6oIo) { $_j6oJi="";$_jjQIJ="";$_jJCfj="";require $inc_dir.'config-user.inc.php';require $inc_dir.'conn-string-user.inc.php';$sql="create table $_j6OOO($_j6oIo) ENGINE=MyISAM DEFAULT CHARSET=latin1";$res=mysql_query($sql,$conn);$_j6oJi=mysql_error();$_jjQIJ=mysql_errno();if( is_numeric($_jjQIJ)==True ) { $_jjQIJ=1;echo $_j6oJi;} Return $_jjQIJ;} function _OFL6B( $inc_dir,$CONF,$SSID ) { if( $CONF['EnableAssignTechsTicketLock']==1 ) { } } function ServiceAsTable($_Jo18O,$_Jo1LL,$_JoQC1) { $_JoI88='<table style="width: 100%; text-align: left; background-color: rgb('.$_Jo18O.');" border="0" cellpadding="0" cellspacing="0">    <tbody>    <tr>    <td style="vertical-align: top;"><small><b>'.$_Jo1LL.'</b></small><br />';$_JoQC1=htmlentities($_JoQC1,ENT_QUOTES);$_JoQC1=nl2br($_JoQC1);$_JoQC1=str_replace('&amp;nbsp;','&nbsp;',$_JoQC1);$_JoI88="$_JoI88"."$_JoQC1";$_JoI88="$_JoI88"."</td></tr></tbody></table>";return $_JoI88;} function _OFJCB($_Jo18O,$_Jo1LL,$_JoQC1) { $_JoI88='<div style="width: 100%; text-align: left; background-color: rgb('.$_Jo18O.'); border-width: .1em; border-style: solid;border-color: black;">';$_JoI88.='<div style="font-size: 10px; font-weight: bold;" >'.$_Jo1LL.'</div>';$_JoQC1=htmlentities($_JoQC1,ENT_QUOTES);$_JoQC1=nl2br($_JoQC1);$_JoQC1=str_replace('&amp;nbsp;','&nbsp;',$_JoQC1);$_JoI88="$_JoI88"."$_JoQC1".'</div>';return $_JoI88;} function GenStatFromId($inc_dir,$CONF,$_JjiIl ) { $_jJCfj=Null;require $inc_dir.'config-guest.inc.php';require $inc_dir.'conn-string-guest.inc.php';$sql='SELECT `selection_name` FROM '.$CONF['TableNameMenus'].' WHERE `menu_value` = "'.$_JjiIl.'"';$res=mysql_query($sql,$conn);$row=mysql_fetch_array($res);$_jJCfj=htmlspecialchars($row['selection_name']);return $_jJCfj;} function _OF66A($_jlJOO) { $_jl600=0;if( strlen($_jlJOO)==25 || strlen($_jlJOO)==29 ) { if(stristr($_jlJOO,'-')===FALSE) { $_jl6lL=array( 0=> $_jlJOO{0}.$_jlJOO{1}.$_jlJOO{2}.$_jlJOO{3}.$_jlJOO{4},1=> $_jlJOO{5}.$_jlJOO{6}.$_jlJOO{7}.$_jlJOO{8}.$_jlJOO{9},2=> $_jlJOO{10}.$_jlJOO{11}.$_jlJOO{12}.$_jlJOO{13}.$_jlJOO{14},3=> $_jlJOO{15}.$_jlJOO{16}.$_jlJOO{17}.$_jlJOO{18}.$_jlJOO{19},4=> $_jlJOO{20}.$_jlJOO{21}.$_jlJOO{22}.$_jlJOO{23}.$_jlJOO{24});} else { $_jl6lL=explode("-",$_jlJOO);} if( count($_jl6lL) > 2 ) { $_jlfOJ=( (($_jl6lL[0]-$_jl6lL[3])+($_jl6lL[1]-$_jl6lL[2])) /-1 );if( $_jl6lL[4]==$_jlfOJ ) { $_jl600=1;} } else { $_jl600="Invalid";} } else { $_jl600=0;} return $_jl600;} function _OF6BA($inc_dir,$_j6OOO,$_Jo0Q1,$_Jo08o) { $_j6oJi="";$_jjQIJ="";$_jJCfj="";require $inc_dir.'config-user.inc.php';require $inc_dir.'conn-string-user.inc.php';$sql="update $_j6OOO SET $_Jo0Q1 where $_Jo08o";$res=mysql_query($sql,$conn);$_j6oJi=mysql_error();$_jjQIJ=mysql_errno();if( is_numeric($_jjQIJ)==True ) { echo("$_j6oJi");} return $_jjQIJ;} function _OFROQ($inc_dir,$_j6OOO,$_IL101,$_IL1if) { $_j6oJi="";$_jjQIJ="";$_jJCfj="";require $inc_dir.'config-user.inc.php';require $inc_dir.'conn-string-user.inc.php';$sql="insert into $_j6OOO($_IL101) values($_IL1if)";$res=mysql_query($sql,$conn);$_jjQIJ=mysql_errno();if( is_numeric($_jjQIJ)==FALSE ) { $_jjQIJ=1;} Return $_jjQIJ;} function _OFR8R($inc_dir,$_j6OOO,$_JojIO,$_JoJQJ,$_IL1if=Null) { $_j6oJi="";$_jjQIJ="";$_jJCfj="";require $inc_dir.'config-user.inc.php';require $inc_dir.'conn-string-user.inc.php';$sql="alter table $_j6OOO $_JojIO $_JoJQJ $_IL1if";$res=mysql_query($sql,$conn);$_j6oJi=mysql_error();$_jjQIJ=mysql_errno();if( is_numeric($_jjQIJ)==FALSE ) { $_jjQIJ=1;echo($_j6oJi);} Return $_jjQIJ;} function _OFRF0($inc_dir,$_j6OOO,$_JojIO,$_JoJQJ,$_IL1if=Null) { $_j6oJi="";$_jjQIJ="";$_jJCfj="";require $inc_dir.'config-user.inc.php';require $inc_dir.'conn-string-user.inc.php';$sql="alter table $_j6OOO $_JojIO $_JoJQJ $_IL1if";$res=mysql_query($sql,$conn);$_j6oJi=mysql_error();$_jjQIJ=mysql_errno();if( is_numeric($_jjQIJ)==FALSE ) { $_jjQIJ=1;echo($_j6oJi);} Return $_jjQIJ;} function _OF86O() { $_JoJi0="";$_Jo6IL=0;while( $_Jo6IL==0 ) { $_j0Of0=mt_rand(10000,99999);$_j0o00=mt_rand(10000,99999);$_j0o6o=mt_rand(10000,99999);$_j0ol6=mt_rand(10000,99999);$_j0C8f=0;$_j0C8f=( (($_j0Of0-$_j0ol6)+($_j0o00-$_j0o6o)) /-1);if( strlen($_j0C8f)==5 && $_j0C8f > 0 ) { $_Jo6IL=1;$_JoJi0[0]=$_j0Of0.'-'.$_j0o00.'-'.$_j0o6o.'-'.$_j0ol6.'-'.$_j0C8f;$_JoJi0[1]=$_j0Of0.$_j0o00.$_j0o6o.$_j0ol6.$_j0C8f;} } return $_JoJi0;} function _OF88O($CONF,$inc_dir,$_Jo6LC) { $_IlJtQ=Null;require $inc_dir.'config-guest.inc.php';require $inc_dir.'conn-string-guest.inc.php';if( $_Jo6LC=="instore" ) { $sql='SELECT ID FROM '.$CONF['TableNameServiceTypes'].' WHERE serv_instore = "1"';} elseif( $_Jo6LC=="onsite" ) { $sql='SELECT ID FROM '.$CONF['TableNameServiceTypes'].' WHERE serv_onsite = "1"';} $res=mysql_query($sql,$conn) or die("Can't get Service Types from DB<br>$sql<br>, Error: 43521j3fd");   while( $row = mysql_fetch_array($res) ) {     $_IlJtQ .= $row['ID'].',';   }    $_IlJtQ = rtrim( $_IlJtQ, ',' );    return $_IlJtQ;   }   function _OFPLE($inc_dir, $_j6OOO, $_JI11L, $_IL101) {   $_j6oJi = Null;   $_jjQIJ = Null;   $_jJCfj = Null;   $x = 0;   require $inc_dir.'config-user.inc.php';   require $inc_dir.'conn-string-user.inc.php';    $sql = "select $_JI11L from $_j6OOO WHERE $_IL101";  echo("$sql <br />");   $res = mysql_query($sql, $conn);   while( $row = mysql_fetch_array($res) ) {    foreach( $row as $_j10o0 ) {      if( $_jJCfj[($x-1)] != $_j10o0 ) {       $_jJCfj[$x] = $_j10o0;      $x++;     }     }    }   $_jjQIJ = mysql_errno();    if( $_jjQIJ != 0 ) {     $_jJCfj = mysql_error();   }   Return $_jJCfj;  }   function _OFPJ6($inc_dir, $_j6OOO, $_JI11L, $_IL101) {   $_j6oJi = Null;   $_jjQIJ = Null;   $_jJCfj = Null;   $x = 0;   require $inc_dir.'config-user.inc.php';   require $inc_dir.'conn-string-user.inc.php';    $sql = "select $_JI11L from $_j6OOO WHERE $_IL101";   $res = mysql_query($sql, $conn);   while( $row = mysql_fetch_array($res) ) {    foreach( $row as $_j10o0 ) {      if( $_jJCfj[($x-1)] != $_j10o0 ) {       $_jJCfj[$x] = $_j10o0;      $x++;     }     }    }   $_jjQIJ = mysql_errno();    if( $_jjQIJ != 0 ) {     $_jJCfj = mysql_error();   }   return $_jJCfj;  }   function _OFPPF($inc_dir, $_j6OOO, $_JI11L, $_IL101) {   $_j6oJi = Null;   $_jjQIJ = Null;   $_jJCfj = Null;   $x = 0;   require $inc_dir.'config-user.inc.php';   require $inc_dir.'conn-string-user.inc.php';    $sql = "select $_JI11L from $_j6OOO WHERE $_IL101";  echo("$sql <br />");   $res = mysql_query($sql, $conn);   while( $row = mysql_fetch_array($res) ) {    $_jJCfj[$x] = $row[$_JI11L];    $x++;   }   $_jjQIJ = mysql_errno();    if( $_jjQIJ != 0 ) {     $_jJCfj = mysql_error();   }   Return $_jJCfj;  }   function _OFPAC($inc_dir, $_j6OOO, $_JI11L, $_IL101) {   $_j6oJi = Null;   $_jjQIJ = Null;   $_jJCfj = Null;   $x = 0;   require $inc_dir.'config-user.inc.php';   require $inc_dir.'conn-string-user.inc.php';    $sql = "select $_JI11L from $_j6OOO WHERE $_IL101";   $res = mysql_query($sql, $conn);   while( $row = mysql_fetch_array($res) ) {    $_jJCfj[$x] = $row[$_JI11L];    $x++;   }   $_jjQIJ = mysql_errno();    if( $_jjQIJ != 0 ) {     $_jJCfj = mysql_error();   }   Return $_jJCfj;  }   function _OFPD8($inc_dir, $_j6OOO, $_JI11L, $_IL101) {   $_j6oJi = "";   $_jjQIJ = "";   $_jJCfj = "";   require $inc_dir.'config-user.inc.php';   require $inc_dir.'conn-string-user.inc.php';    $sql = "select $_JI11L from $_j6OOO WHERE $_IL101";   $res = mysql_query($sql, $conn);   $_jjQIJ = mysql_errno();    if( is_numeric($_jjQIJ) == FALSE ) {     $_jjQIJ = 1;    }   Return $_jjQIJ;  }   function _OFPDC( $_Jof0L ) {   $_JofOj = explode("/",$_Jof0L);    $_JofCJ = count($_JofOj);    $_Jo8J0 = NULL;   $_Jo8LC = false;   for ( $x = 0 ; $_JofCJ > $x AND $_Jo8LC == false ; $x++ ) {     $_JotIL = "pro";     if ( $_JofOj[$x] == $_JotIL AND $_Jo8LC == false ) {     for ( $_IljlI = 0 ; ($_JofCJ-3)  != $_IljlI ; $_IljlI++ ) {       if ( $_JofOj[$_IljlI] != "" ) {       $_Jo8J0 = $_Jo8J0 . '/'. $_JofOj[$_IljlI];        $_Jo8LC = true;      }      }    }   }    if ( empty($_Jo8J0) == false ) {     $_Jof0L = $_Jo8J0.'/';    }   return $_Jof0L;  }   function _OFADA( $_Jot8J, $_JoOQi ) {    $_Jot8J = array_values( (array) $_Jot8J );   $_JoOQi = array_values( (array) $_JoOQi );   $_JoOlQ = max( count( $_Jot8J ), count( $_JoOQi ) );   $_Joot1 = array();   for( $_j0l0C=0; $_j0l0C<$_JoOlQ; $_j0l0C++ ) {    $_Joot1[ $_Jot8J[ $_j0l0C ] ] = $_JoOQi[ $_j0l0C ];   }   return $_Joot1;  }   function _OFB10($inc_dir) {   require $inc_dir.'config-guest.inc.php';   include $inc_dir.'conn-string-guest.inc.php';     $sql = "select * from $TableConfig";   $res = mysql_query($sql, $conn) or die("Unable to retrieve configuration values from the database. Error 4312323<br />Database Reports: ".mysql_error()."<br /> $sql");   $x=0;   $_jOOo0 = array();   while( $row = mysql_fetch_array($res) ) {    $_jOOOi[$x] = $row['config_name'];    $_jOOlo[$x] = $row['config_value'];    if( empty($_jOOlo[$x]) == True && is_numeric($_jOOlo[$x]) == False ) {      $_jOOlo[$x] = $row['config_value_text'];    }    $_jOOo0[$_jOOOi[$x]] = $_jOOlo[$x];    $x = $x + 1;   }  return $_jOOo0;  }   function GetStatusAsString2($inc_dir,$CONF,$_JoCJt) {   if( is_string($inc_dir) == False ) { die("inc_dir must be string"); }   if( is_array($CONF) == False ) { die("CONF must be string"); }   require $inc_dir.'config-guest.inc.php';   require $inc_dir.'conn-string-guest.inc.php';     $sql = 'SELECT selection_name FROM '.$CONF['TableNameMenus'].' WHERE menu_value='.$_JoCJt.'';   $res = mysql_query( $sql, $conn);   $row = @mysql_fetch_array($res);   $_IlJtQ = $row['selection_name'];   return $_IlJtQ;  }   function GenDropTicketMenu( $inc_dir, $CONF, $_JoijQ, $Status_id, $_JoiCt ) {   if( is_string($inc_dir) == False ) { die("inc_dir must be string"); }   if( is_array($CONF) == False ) { die("CONF must be string"); }   if( is_int($_JoijQ) == False ) { die("MenuGroup must be integer"); }   if( isset($_Joii1) == False) { $_Joii1 = Null; }    if( isset($_GET['SSID']) ) {     $SSID = mysql_real_escape_string($_GET['SSID']);    } else {     if( isset($_POST['SSID']) ) { $SSID = mysql_real_escape_string($_POST['SSID']); } else { die("Unable to get SSID"); }    }    require $inc_dir.'config-guest.inc.php';   require $inc_dir.'conn-string-guest.inc.php';     $sql = 'SELECT * FROM '.$CONF['TableNameMenus'].' WHERE menu_group_id="'.$_JoijQ.'" AND menu_value="'.$Status_id.'"';   $res = mysql_query( $sql, $conn);   $row = mysql_fetch_array($res);   if( isset($row['selection_name']) ) {     $_JJ1jC = $row['selection_name'];   } else {    unset($_JJ1jC);    }    $_IlJtQ = '<select name="'.$_JoiCt.'" id="'.$_JoiCt.'" '.$_Joii1.'>';    if( isset($_JJ1jC) ) { $_IlJtQ .= '<option value="'.$Status_id.'">'.$_JJ1jC.'</option>'; }    $sql = 'SELECT * FROM '.$CONF['TableNameMenus'].' WHERE menu_group_id="'.$_JoijQ.'" ORDER BY menu_position ASC';   $res = mysql_query( $sql, $conn) or die("Unable to retrieve TableNameMenus E: 32432 <br />$sql");   while( $row = mysql_fetch_array($res) ) {    $_j10o0 = $row['menu_value'];    $_j0llj = $row['selection_name'];    $_IlJtQ .= '<option value="'.$_j10o0.'">'.$_j0llj.'</option>';    }    $_IlJtQ .= '</select>';   return $_IlJtQ;  }  function _OFCEB($inc_dir, $CONF ) {   require $inc_dir.'config-guest.inc.php';   require $inc_dir.'conn-string-guest.inc.php';   $_jiLCi = 0;    $sql = "SELECT `User_chksum` FROM {$CONF['TableNameUsers']}";   $res = mysql_query($sql, $conn);   $x = 0;   while( $row = mysql_fetch_array($res) ) {    $_JoiiI[$x] = $row['User_chksum'];    $x++;   }   unset($x);   $_JoLQL = count($_JoiiI);   for( $x = 0 ; $x < $_JoLQL ; $x++ ) {    $_JoLjo = $_JoiiI[$x];    for($_IljlI = 0 ; $_IljlI < $_JoLQL ; $_IljlI++ ) {     if( $_JoLjo == $_JoiiI[$_IljlI] && $x != $_IljlI ) {       $_jiLCi++;     }    }   }   return $_jiLCi;  }  function GenDropNavMenu( $inc_dir, $CONF, $_JoijQ, $_Joii1, $IsCustomerLogin ) {   if( is_string($inc_dir) == False ) { die("inc_dir must be string"); }   if( is_array($CONF) == False ) { die("CONF must be string"); }   if( is_int($_JoijQ) == False ) { die("MenuGroup must be integer"); }   if( isset($_Joii1) == False) { $_Joii1 = Null; }    if( isset($IsCustomerLogin) == False) { $IsCustomerLogin = Null; }   if( isset($_GET['SSID']) ) {     $SSID = mysql_real_escape_string($_GET['SSID']);    } else {     if( isset($_POST['SSID']) ) { $SSID = mysql_real_escape_string($_POST['SSID']); } else { die("Unable to get SSID"); }    }    require $inc_dir.'config-guest.inc.php';   require $inc_dir.'conn-string-guest.inc.php';     $_IlJtQ = '<select name="menu'.$_JoijQ.'" id="menu'.$_JoijQ.'" '.$_Joii1.'>';    $_JoLC0 = 'TemplateMenuName'.$_JoijQ;    $_IlJtQ .= '<option value="" name="">'.htmlentities($CONF[$_JoLC0]).'</option>';   if( file_exists("$inc_dir/pro/workorder_functions_pro.inc.php") == True || $_JoijQ != 2 ) {    if( $IsCustomerLogin == 1 ) {     $sql = 'SELECT * FROM '.$CONF['TableNameMenus'].' WHERE menu_group_id="'.$_JoijQ.'" AND guest_visible=1 ORDER BY menu_position ASC';    } else {     $sql = 'SELECT * FROM '.$CONF['TableNameMenus'].' WHERE menu_group_id="'.$_JoijQ.'" ORDER BY menu_position ASC';    }     $res = mysql_query( $sql, $conn) or die("Unable to retrieve TableNameMenus E: 32432 <br />$sql");    $_joC6l = mysql_num_rows($res);     while( $row = mysql_fetch_array($res) ) {     $_j10o0 = Null;      if( isset($row['menu_value']) ) {       $_j10o0 = '&Fb='.$row['menu_value'];     }     if( strstr($row['menu_string'], '?') == True ) {       $_JoLCj = '&';     } else {       $_JoLCj = '?';     }      $_j0llj = htmlentities($row['selection_name']);     $url = $row['menu_string'].$_JoLCj."SSID=".$SSID.$_j10o0;     $_IlJtQ .= '<option value="'.$url.'">'.$_j0llj.'</option>';     }    }    $_IlJtQ .= '</select>';   return $_IlJtQ;  }  function _OFDEF( $CONF, $Service_Type=NULL ) {   $_JolI1 = explode("," , $CONF['ServiceTypesOnsite']);   foreach( $_JolI1 as $_JC0QJ) {    if( $Service_Type == $_JC0QJ ) {     return true;     }    }   return false;   }   function _OFECL($inc_dir, $CONF, $_jlI1C) {    $_JjolI = Null;   require $inc_dir.'config-guest.inc.php';   require $inc_dir.'conn-string-guest.inc.php';     if ( isset($_jlI1C) ) {    $sql = 'SELECT serv_name FROM '.$CONF['TableNameServiceTypes'].' WHERE `ID`="'.$_jlI1C.'"';   $res = mysql_query($sql,$conn) or die("Can't get Service Types from DB<br>$sql<br>, Error: 435jj3fd");$row=mysql_fetch_array($res);$_JjOCl=$row['serv_name'];return($_JjOCl);} else { $_JjOCl="Done";} return($_JjOCl);} function GetServiceType($CONF,$_jlI1C) { $inc_dir='./include/';$_JjolI=Null;require $inc_dir.'config-guest.inc.php';require $inc_dir.'conn-string-guest.inc.php';if ( isset($_jlI1C) ) { $sql='SELECT serv_name FROM '.$CONF['TableNameServiceTypes'].' WHERE `ID` = "'.$_jlI1C.'"';$res=mysql_query($sql,$conn) or die("Can't get Service Types from DB<br>$sql<br>, Error: 435jj3fd");   $row = mysql_fetch_array($res);   $_JjOCl = $row['serv_name'];   return($_JjOCl);   }   else {       $_JjOCl="Done"; }   return($_JjOCl);  }   function _OFFR1($CONF,$_JjiIl) {   $_JjOCl = False ;    $inc_dir = './include/';   require $inc_dir.'config-guest.inc.php';   require $inc_dir.'conn-string-guest.inc.php';     $sql = 'SELECT serv_instore FROM '.$CONF['TableNameServiceTypes'].' where ID="'.$_JjiIl.'"';   $res = mysql_query($sql,$conn) or die("Can't get Service Types from DB<br>$sql<br>, Error: 4353fxaxd");$row=mysql_fetch_array($res);if( $row['serv_instore']==1 ) { $_JjOCl=True;} else { $_JjOCl=False;} return $_JjOCl;} function _OFFRJ($_JC1QQ) { $_JC1Ct='zA1BxC2DyEw3FvGu4tHI5rJrK6LM7qpNoOP8QnRSmT9UVlW0kXYjZabcdefghi';settype($_JC1QQ,"integer");settype($_JCQ01,"string");settype($_j0o00,"integer");for ($x=1;$x <=$_JC1QQ;$x++) { $_j0o00=mt_rand(0,strlen($_JC1Ct)-1);$_JCQ01.=$_JC1Ct[$_j0o00];} return $_JCQ01;} ?>
Return current item: WorkOrder TS