Location: PHPKode > projects > WorkOrder TS > workorder-ts/setup_files/update.php
<?PHP error_reporting(E_ALL);@define("ERROR_IMG","grfx/check_error.png");@define('OK_IMG',"grfx/check_ok.png");@define('WARNING_IMG',"grfx/check_warning.png");if( count($_GET) < 2 ) { die("You can not run this script directly.");} if( isset($_GET['wouau']) ) { $wouau=html_entity_decode($_GET['wouau']);} else { $wouau='admin';} if( isset($_GET['wouap']) ) { $wouap=addslashes(html_entity_decode($_GET['wouap']));} else { $wouap=Null;} if( isset($_GET['wouap']) ) { $disp_wouap=addslashes(html_entity_decode($_GET['wouap']));} else { $disp_wouap=Null;} if( isset($_GET['woutp']) ) { $disp_woutp=addslashes(html_entity_decode($_GET['woutp']));} else { $disp_woutp=Null;} $inc_dir='../include/';require_once $inc_dir.'magic_quotes.php';require_once $inc_dir.'config-user.inc.php';require_once $inc_dir.'conn-string-user.inc.php';require_once $inc_dir.'workorder_function_general.inc.php';$_jCjft=Null;$_jCjCI=0;$CONF=_OFB10($inc_dir);$_jCJJQ=$wouap;$wouap=md5($wouap);$_jCQtj=sprintf("SELECT `User_ID` FROM `%s` WHERE `User_name` = '%s' AND `Userpassword` = '%s' AND `User_system` = '1' AND `User_active` = '1'",mysql_real_escape_string($CONF['TableNameUsers'],$conn),mysql_real_escape_string($wouau,$conn),mysql_real_escape_string($wouap,$conn));$res=mysql_query($_jCQtj,$conn);if( @mysql_num_rows($res) !=1 ) { $_jCQtj=sprintf("SELECT `User_ID` FROM `%s` WHERE `User_name` = '%s' AND `User_password` = '%s' AND `User_system` = '1' AND `User_active` = '1'",mysql_real_escape_string($CONF['TableNameUsers'],$conn),mysql_real_escape_string($wouau,$conn),mysql_real_escape_string($wouap,$conn));$res=mysql_query($_jCQtj,$conn) or die("Error running query: $_jCQtj <br />".mysql_error());if( mysql_num_rows($res) !=1 ) { if( file_exists("../SkipPasswd")==False && file_exists("../SkipPasswd.pwd")==False ) { die('FATAL ERROR, invalid System Username or Password. You can skip this check by creating the file SkipPasswd or SkipPasswd.pwd in the WorkOrder TS root directory. Update Aborted! <img src="'.ERROR_IMG.'" width="22" height="11" />');} } } function _OEOOR($inc_dir) { include $inc_dir.'config-guest.inc.php';include $inc_dir.'conn-string-guest.inc.php';$_jCJCf="";$sql='select config_value from '.$TableConfig.' WHERE config_name="VersionStringDatabase"';$res=mysql_query($sql,$conn);$row=mysql_fetch_array($res);$_jCJCf=$row['config_value'];Return $_jCJCf;} function _OELOL($inc_dir) { include $inc_dir.'config-guest.inc.php';include $inc_dir.'conn-string-guest.inc.php';$_jC6tl="";$sql='select config_value from '.$TableConfig.' WHERE config_name="VersionStringCode"';$res=mysql_query($sql,$conn);$row=mysql_fetch_array($res);$_jC6tl=$row['config_value'];Return $_jC6tl;} function _OELO8($_jC6lJ,$_jCf0o) { $_jCf6J=explode(".",$_jC6lJ);$_jC8If=explode(".",$_jCf0o);$_jC8t8=count($_jCf6J);$_jCt0C=count($_jC8If);if( $_jC8t8 !=$_jCt0C ) { $_jCjft.='FATAL ERROR, '."Version Strings are not the same length O1:$_jC6lJ P1: $_jC8t8 O2:$_jCf0o P2: $_jCt0C".' <img src="'.ERROR_IMG.'" width="22" height="11" />'."\n";if( $_j6O6l < 2 ) { $_j6O6l=2;} } $x=0;if( $_jCf6J[$x] < $_jC8If[$x] ) { Return "1";} elseif( $_jCf6J[$x]==$_jC8If[$x] ) { if( $_jCf6J[$x+1] < $_jC8If[$x+1] ) { Return "1";} elseif( $_jCf6J[$x+1]==$_jC8If[$x+1] ) { if( $_jCf6J[$x+2] < $_jC8If[$x+2] ) { Return "1";} elseif( $_jCf6J[$x+2]==$_jC8If[$x+2] ) { Return "0";} elseif( $_jCf6J[$x+2] > $_jC8If[$x+2] ) { Return "2";} } elseif( $_jCf6J[$x+1] > $_jC8If[$x+1] ) { Return "2";} } elseif( $_jCf6J[$x] > $_jC8If[$x] ) { Return "2";} else{ Return "Error";} } $_jCJCf=_OEOOR($inc_dir);$x=_OELO8("$_jCJCf","0.2.0");if( $x==1 ) { die('FATAL ERROR, this setup requires at least WorkOrder TS 0.2.0! Please contact technical support on how to proceed. <img src="'.ERROR_IMG.'" width="22" height="11" />');} if( @$CONF['ServiceTypesInstore']=="" ) { _OF6BA($inc_dir,$TableConfig,'config_value="ServiceTypesInstore"','config_name="0,1,2,3,9,6,7"');} if( @$CONF['ServiceTypesOnsite']=="" ) { _OF6BA($inc_dir,$TableConfig,'config_value="ServiceTypesOnsite"','config_name="4,8,5"');} require_once 'sample_customer_details_samples.inc.php';$_jCJCf=_OEOOR($inc_dir);$x=_OELO8("$_jCJCf","0.2.0");if( $x==0 ) { _OF6BA($inc_dir,$TableConfig,"config_value_text='$customer_detail_sample_customer_info'",'config_name="CustomersDetailsForm0"');_OF6BA($inc_dir,$TableConfig,"config_value_text='$customer_detail_sample_computer'",'config_name="CustomersDetailsForm1"');_OF6BA($inc_dir,$TableConfig,"config_value_text='$customer_detail_sample_passwords'",'config_name="CustomersDetailsForm2"');_OF6BA($inc_dir,$TableConfig,"config_value_text='$customer_detail_sample_empty'",'config_name="CustomersDetailsForm3"');_OF6BA($inc_dir,$TableConfig,"config_value_text='$customer_detail_sample_empty'",'config_name="CustomersDetailsForm4"');_OF6BA($inc_dir,$TableConfig,"config_value_text='$customer_detail_sample_empty'",'config_name="CustomersDetailsForm5"');_OF6BA($inc_dir,$TableConfig,"config_value_text='$customer_detail_sample_empty'",'config_name="CustomersDetailsForm6"');_OF6BA($inc_dir,$TableConfig,"config_value_text='$customer_detail_sample_empty'",'config_name="CustomersDetailsForm7"');_OF6BA($inc_dir,$TableConfig,"config_value_text='$customer_detail_sample_empty'",'config_name="CustomersDetailsForm8"');_OF6BA($inc_dir,$TableConfig,"config_value_text='$customer_detail_sample_empty'",'config_name="CustomersDetailsForm9"');_OF6BA($inc_dir,$TableConfig,'config_value="0.2.1"','config_name="VersionStringDatabase"');} $_jC6tl=_OELOL($inc_dir);$x=_OELO8("$_jC6tl","0.2.0");if( $x==0 ) { _OF6BA($inc_dir,$TableConfig,'config_value="0.2.1"','config_name="VersionStringCode"');} $_jCJCf=_OEOOR($inc_dir);$x=_OELO8("$_jCJCf","0.2.1");if( $x==0 ) { $CONF=_OFB10($inc_dir);$_jIOL6=$CONF['TablePrefix'];$_jCtl8=$_jIOL6."ticket_images";_OFROQ($inc_dir,$TableConfig,'config_name,config_value','"TableNameTicketImages","'.$_jCtl8.'"');_OFLL0($inc_dir,$_jCtl8,'ID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,FileDesc varchar(255) NULL,FileName varchar(255) NOT NULL,SubDir varchar(255) NOT NULL,TicketID INT UNSIGNED NOT NULL');_OFROQ($inc_dir,$TableConfig,'config_name,config_value','"UploadTargetPath","uploads"');_OFROQ($inc_dir,$TableConfig,'config_name,config_value','"ImageTicketFilesPerDir","5000"');_OFROQ($inc_dir,$TableConfig,'config_name,config_value','"ImageTicketSubDir","ticketgrfx-1"');_OFROQ($inc_dir,$TableConfig,'config_name,config_value','"UploadMaxSizeb","102400"');_OFROQ($inc_dir,$TableConfig,'config_name,config_value','"ImageTicketEXT","jpeg,jpg,png,gif"');_OF6BA($inc_dir,$TableConfig,'config_value="0.3.0"','config_name="VersionStringDatabase"');} $_jC6tl=_OELOL($inc_dir);$x=_OELO8("$_jC6tl","0.2.1");if( $x==0 ) { _OF6BA($inc_dir,$TableConfig,'config_value="0.3.0"','config_name="VersionStringCode"');} $_jC6tl=_OELOL($inc_dir);$x=_OELO8("$_jC6tl","0.3.0");if( $x==0 ) { _OF6BA($inc_dir,$TableConfig,'config_value="0.3.1"','config_name="VersionStringCode"');} $_jCJCf=_OEOOR($inc_dir);$x=_OELO8("$_jCJCf","0.3.0");if( $x==0 ) { $CONF=_OFB10($inc_dir);$_jOj81=$CONF['TableNameUsers'];_OFRF0($inc_dir,$_jOj81,'Add','User_skills','varchar(255)');_OFRF0($inc_dir,$_jOj81,'Add','User_email','varchar(255)');_OFROQ($inc_dir,$TableConfig,'config_name,config_value','"SMTPServer","localhost"');_OFROQ($inc_dir,$TableConfig,'config_name,config_value','"SMTPServerPort","25"');_OFROQ($inc_dir,$TableConfig,'config_name,config_value','"SMTPUser",""');_OFROQ($inc_dir,$TableConfig,'config_name,config_value','"SMTPPassword",""');_OFROQ($inc_dir,$TableConfig,'config_name,config_value','"EmailContact",""');_OFROQ($inc_dir,$TableConfig,'config_name,config_value','"EnableCheckinEmail","0"');_OF6BA($inc_dir,$TableConfig,'config_value="0.3.2"','config_name="VersionStringDatabase"');} $_jC6tl=_OELOL($inc_dir);$x=_OELO8("$_jC6tl","0.3.1");if( $x==0 ) { _OF6BA($inc_dir,$TableConfig,'config_value="0.3.2"','config_name="VersionStringCode"');} $_jCJCf=_OEOOR($inc_dir);$x=_OELO8("$_jCJCf","0.3.2");if( $x==0 ) { $CONF=_OFB10($inc_dir);$_jOj81=$CONF['TableNameUsers'];_OFROQ($inc_dir,$CONF['TableNameConfig'],'config_name,config_value','"EnableGuestKeyImageDL",""');_OFRF0($inc_dir,$CONF['TableNameCustomers'],'Modify','SZip','varchar(15)');_OFRF0($inc_dir,$CONF['TableNameCustomers'],'Modify','BZip','varchar(15)');_OF6BA($inc_dir,$TableConfig,'config_value="0.3.3"','config_name="VersionStringDatabase"');} $_jC6tl=_OELOL($inc_dir);$x=_OELO8("$_jC6tl","0.3.2");if( $x==0 ) { _OF6BA($inc_dir,$TableConfig,'config_value="0.3.3"','config_name="VersionStringCode"');} $_jCJCf=_OEOOR($inc_dir);$x=_OELO8("$_jCJCf","0.3.3");if( $x==0 ) { $CONF=_OFB10($inc_dir);for( $_jCO1l=0;$_jCO1l < $CONF['StoreNum'];$_jCO1l++) { _OFROQ($inc_dir,$TableConfig,'config_name,config_value','"DefaultValuesStoreName'.$_jCO1l.'Date","F-j-Y, g:i a"');_OFROQ($inc_dir,$TableConfig,'config_name,config_value','"DefaultValuesStoreName'.$_jCO1l.'TimeZone","5"');_OFROQ($inc_dir,$TableConfig,'config_name,config_value','"DefaultValuesStoreName'.$_jCO1l.'TimeZoneSign","-"');_OFROQ($inc_dir,$TableConfig,'config_name,config_value','"DefaultValuesStoreName'.$_jCO1l.'DayLightSavings","True"');} _OFRF0($inc_dir,$CONF['TableNameItem'],'Modify','Item_accessories','Text  null');_OFRF0($inc_dir,$CONF['TableNameItem'],'Modify','Item_required_parts','Text  null');_OFRF0($inc_dir,$CONF['TableNameTicket'],'CHANGE','Call_cust5_notes','Custom_ticket_id varchar(255)');_OFROQ($inc_dir,$TableConfig,'config_name,config_value','"EnableCustomTicketID","0"');_OFROQ($inc_dir,$TableConfig,'config_name,config_value','"TicketStubAmmount","4"');_OFROQ($inc_dir,$TableConfig,'config_name,config_value','"PrintTicketWidth","595"');_OFROQ($inc_dir,$TableConfig,'config_name,config_value','"TicketStub1","echo(\'<span style=\"font-weight:bold;font-size:small\">\'.\$TSCompanyName.\'</span><br>\');"');_OFROQ($inc_dir,$TableConfig,'config_name,config_value','"TicketStub2","echo(\'<span  style=\"font-size:x-small\">\'.\$TSCompanyAddress.\'</span>\');"');_OFROQ($inc_dir,$TableConfig,'config_name,config_value','"TicketStub3","echo(\'<span style=\"font-weight:bold;font-size:small\">Ticket: \'. \$Ticket_ID .\'</span><br>\');"');_OFROQ($inc_dir,$TableConfig,'config_name,config_value','"TicketStub4","echo(\'<span style=\"font-size:small\">\'. \$BName.\' \'.\$TBPhone1.\' \'.\$TBMobile1.\' \'.\$TBOffice1.\'<br>\'.\$CheckedIn.\' </span>\');"');$_jCOoj=_OFPAC($inc_dir,$TableConfig,'config_value','config_name="Rate-Onsite"');$_jCOoj=addslashes($_jCOoj[0]);_OF6BA($inc_dir,$TableConfig,'config_value="<span style=\"font-weight: bold; font-size: small\">Onsite-Rate:</span><span style=\"font-size: small\"> '.$_jCOoj.'</span>"','config_name="Rate-Onsite"');$_jCOl8=_OFPAC($inc_dir,$TableConfig,'config_value','config_name="Rate-Instore"');$_jCOl8=addslashes($_jCOl8[0]);_OF6BA($inc_dir,$TableConfig,'config_value="<span style=\"font-weight: bold; font-size: small\">Instore-Rate:</span><span style=\"font-size: small\"> '.$_jCOl8.'</span>"','config_name="Rate-Instore"');_OF6BA($inc_dir,$TableConfig,'config_value="0.4.0"','config_name="VersionStringDatabase"');} $_jC6tl=_OELOL($inc_dir);$x=_OELO8("$_jC6tl","0.3.3");if( $x==0 ) { _OF6BA($inc_dir,$TableConfig,'config_value="0.4.0"','config_name="VersionStringCode"');} $_jCJCf=_OEOOR($inc_dir);$x=_OELO8("$_jCJCf","0.4.0");if( $x==0 ) { $CONF=_OFB10($inc_dir);_OFROQ($inc_dir,$TableConfig,'config_name,config_value','"TicketStubAmmount","4"');_OF6BA($inc_dir,$TableConfig,'config_value="0.4.1"','config_name="VersionStringDatabase"');} $_jC6tl=_OELOL($inc_dir);$x=_OELO8("$_jC6tl","0.4.0");if( $x==0 ) { _OF6BA($inc_dir,$TableConfig,'config_value="0.4.1"','config_name="VersionStringCode"');} $_jCJCf=_OEOOR($inc_dir);$x=_OELO8("$_jCJCf","0.4.1");if( $x==0 ) { $CONF=_OFB10($inc_dir);_OFRF0($inc_dir,$CONF['TableNameUsers'],'Add','User_chksum','varchar(25) UNIQUE');_OFROQ($inc_dir,$CONF['TableNameConfig'],'config_name,config_value','"EnableCustomerShipping","0"');if( file_exists("$inc_dir/pro/workorder_functions_pro.inc.php")==False ) { echo("Updating Free User accounts and more .... <br />");_OFRF0($inc_dir,$CONF['TableNameUsers'],'CHANGE','User_password','Userpassword VARCHAR( 35 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL');_OFRF0($inc_dir,$CONF['TableNameUsers'],'ADD','User_password','VARCHAR( 35 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL AFTER `Userpassword`');for( $_jCoCO=1;$_jCoCO < 4;$_jCoCO++) { $_jCoLt=_OF86O();$_jCCI1=md5(rand(0,10000));_OF6BA($inc_dir,$CONF['TableNameUsers'],'User_chksum="'.$_jCoLt[1].'"','User_ID="'.$_jCoCO.'"');if( $_jCoCO==1 ) { _OF6BA($inc_dir,$CONF['TableNameUsers'],'User_password="DISABLED"','User_ID="'.$_jCoCO.'"');} else { _OF6BA($inc_dir,$CONF['TableNameUsers'],'User_password="'.$_jCCI1.'"','User_ID="'.$_jCoCO.'"');} } }else{ echo("Updating Professional User accounts and more .... <br />");_OFRF0($inc_dir,$CONF['TableNameUsers'],'CHANGE','User_password','Userpassword VARCHAR( 35 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL');_OFRF0($inc_dir,$CONF['TableNameUsers'],'ADD','User_password','VARCHAR( 35 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL AFTER `Userpassword`');require_once $inc_dir.'config-guest.inc.php';require_once $inc_dir.'conn-string-guest.inc.php';$sql="select User_ID from ".$CONF['TableNameUsers'];$res=mysql_query($sql,$conn);while( $row=mysql_fetch_array($res) ) { $_jCC86=$row['User_ID'];$_jCoLt=_OF86O();$_jCCI1=md5(rand(0,10000));_OF6BA($inc_dir,$CONF['TableNameUsers'],'User_chksum="'.$_jCoLt[1].'"','User_ID="'.$_jCC86.'"');if( $_jCC86==1 ) { _OF6BA($inc_dir,$CONF['TableNameUsers'],'User_password="DISABLED"','User_ID="'.$_jCC86.'"');} else { _OF6BA($inc_dir,$CONF['TableNameUsers'],'User_password="'.$_jCCI1.'"','User_ID="'.$_jCC86.'"');} } } _OF6BA($inc_dir,$TableConfig,'config_value="0.4.2"','config_name="VersionStringDatabase"');} $_jC6tl=_OELOL($inc_dir);$x=_OELO8("$_jC6tl","0.4.1");if( $x==0 ) { _OF6BA($inc_dir,$TableConfig,'config_value="0.4.2"','config_name="VersionStringCode"');} $_jCJCf=_OEOOR($inc_dir);$x=_OELO8("$_jCJCf","0.4.2");if( $x==0 ) { _OFRF0($inc_dir,$CONF['TableNameCustomers'],'ADD','BCountry','varchar(50) NULL');_OFRF0($inc_dir,$CONF['TableNameCustomers'],'ADD','SCountry','varchar(50) NULL');$CONF=_OFB10($inc_dir);$_jIOL6=$CONF['TablePrefix'];_OFQQC($inc_dir,$CONF['TableNameConfig'],'config_name,config_value','"TableNameCustomersShip","'.$_jIOL6.'customers_ship"');$CONF=_OFB10($inc_dir);_OFLL0($inc_dir,$CONF['TableNameCustomersShip'],'CUST_BID  INT UNSIGNED NOT NULL PRIMARY KEY, SBus_name varchar(100), SBus_cont varchar(100), SBus_cont_title varchar(100), SBus_cont_alt varchar(100), SBus_cont_alt_title varchar(100), STitle varchar(100), SName_first varchar(100), SName_last varchar(100), SAddress1 varchar(200), SAddress2 varchar(200), SAddress3 varchar(200), SCity varchar(100), SState varchar(20), SCountry varchar(50), SZip varchar(15), SPhone1 varchar(30), SPhone2 varchar(30), SMobile1 varchar(30), SMobile2 varchar(30), SOffice1 varchar(30), SOffice2 varchar(30), SFax1 varchar(30), SFax2 varchar(30)');$sql='SELECT * FROM '.$CONF['TableNameCustomers'].' WHERE (SBus_name <> NULL OR SBus_name <> "") OR (SBus_cont <> NULL OR SBus_cont <> "") OR (SBus_cont_alt <> NULL OR SBus_cont_alt <> "") OR (SName_first <> NULL OR SName_first <>"") OR (SName_last <> NULL OR SName_last <> "") OR (SAddress1 <> NULL OR SAddress1 <> "") OR (SAddress2 <> NULL OR SAddress2 <> "") OR (SAddress3 <> NULL OR SAddress3 <> "") OR (SCity <> NULL OR SCity <> "") OR (SCountry <> NULL OR SCountry <> "") OR (SZip <> NULL OR SZip <> "") OR (SPhone1 <> NULL OR SPhone1 <> "" ) OR (SPhone2 <> NULL OR SPhone2 <> "") OR (SMobile1 <> NULL OR SMobile1 <> "") OR (SMobile2 <> NULL OR SMobile2 <> "") OR (SOffice1 <> NULL OR SOffice1 <> "") OR (SOffice2 <> NULL OR SOffice2 <> "") OR (SFax1 <> NULL OR SFax1 <> "") OR (SFax2 <> NULL OR SFax2 <> "")';$res=mysql_query( $sql,$conn ) OR die("Unable to get count of shipping customer's unable to update. Aborted!".mysql_error());   $_joC6l = mysql_num_rows($res);   while( $row = mysql_fetch_array($res) ) {     $_jCi0f = $row['ID'];    $_jCiCQ = $row['SBus_name'];    $_jCLt1 = $row['SBus_cont'];    $_jClji = $row['SBus_cont_title'];    $_jClfi = $row['SBus_cont_alt'];    $_ji06I = $row['SBus_cont_alt_title'];    $_ji1Q0 = $row['STitle'];    $_jiQ1Q = $row['SName_first'];    $_jiQIi = $row['SName_last'];    $_jiQCC = $row['SAddress1'];    $_jiIji = $row['SAddress2'];    $_jijjj = $row['SAddress3'];    $_jij6i = $row['SCity'];    $_jiJ1I = $row['SState'];    $_jiJCQ = $row['SCountry'];    $_ji6JO = $row['SZip'];    $_ji6C8 = $row['SPhone1'];    $_jifQi = $row['SPhone2'];    $_jiftJ = $row['SMobile1'];    $_jifLl = $row['SMobile2'];    $_ji8ii = $row['SOffice1'];    $_jitQf = $row['SOffice2'];    $_jitoJ = $row['SFax1'];    $_jiOjC = $row['SFax2'];    _OFQQC($inc_dir,$CONF['TableNameCustomersShip'], 'CUST_BID,SBus_name,SBus_cont,SBus_cont_title,SBus_cont_alt,SBus_cont_alt_title,STitle,SName_first,SName_last,SAddress1,SAddress2,SAddress3,SCity,SState,SCountry,SZip,SPhone1,SPhone2,SMobile1,SMobile2,SOffice1,SOffice2,SFax1,SFax2','"'.$_jCi0f.'","'.$_jCiCQ.'","'.$_jCLt1.'","'.$_jClji.'","'.$_jClfi.'","'.$_ji06I.'","'.$_ji1Q0.'","'.$_jiQ1Q.'","'.$_jiQIi.'","'.$_jiQCC.'","'.$_jiIji.'","'.$_jijjj.'","'.$_jij6i.'","'.$_jiJ1I.'","'.$_jiJCQ.'","'.$_ji6JO.'","'.$_ji6C8.'","'.$_jifQi.'","'.$_jiftJ.'","'.$_jifLl.'","'.$_ji8ii.'","'.$_jitQf.'","'.$_jitoJ.'","'.$_jiOjC.'"');   }    _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'DROP', '','SBus_name');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'DROP', '','SBus_cont');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'DROP', '','SBus_cont_title');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'DROP', '','SBus_cont_alt');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'DROP', '','SBus_cont_alt_title');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'DROP', '','STitle');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'DROP', '','SName_first');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'DROP', '','SName_last');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'DROP', '','SAddress1');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'DROP', '','SAddress2');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'DROP', '','SAddress3');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'DROP', '','SCity');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'DROP', '','SState');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'DROP', '','SCountry');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'DROP', '','SZip');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'DROP', '','SPhone1');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'DROP', '','SPhone2');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'DROP', '','SMobile1');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'DROP', '','SMobile2');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'DROP', '','SOffice1');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'DROP', '','SOffice2');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'DROP', '','SFax1');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'DROP', '','SFax2');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'ADD', 'Store_id', 'INT UNSIGNED NOT NULL AFTER `ID`');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'ADD', 'Cust_login_name', 'VARCHAR( 255 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'ADD', 'Cust_login_password', 'VARCHAR( 35 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL AFTER Cust_login_name');   _OFRF0($inc_dir, $CONF['TableNameCustomers'] , 'ADD', 'Login_active', 'INT UNSIGNED NULL AFTER `Cust_login_password`');   _OFQQC($inc_dir,$CONF['TableNameConfig'], 'config_name,config_value','"CustAuthTimeoutMin","30"');   _OFQQC($inc_dir,$CONF['TableNameConfig'], 'config_name,config_value','"EnableCustomerLogin","0"');   $_jIOL6 = $CONF['TablePrefix'];    _OFQQC($inc_dir,$CONF['TableNameConfig'], 'config_name,config_value','"TableNameCustomersLogin","'.$_jIOL6.'customers_login"');    $CONF = _OFB10($inc_dir);    _OFLL0($inc_dir, $CONF['TableNameCustomersLogin'] , 'Login_ID BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,Login_CUST_ID INT UNSIGNED NOT NULL,Login_ssid varchar(200) NOT NULL,Login_ip varchar(200) NOT NULL,Login_time datetime NOT NULL');    $CONF = _OFB10($inc_dir);    $_jIOL6 = $CONF['TablePrefix'];    _OFQQC($inc_dir,$CONF['TableNameConfig'], 'config_name,config_value','"TableNameMenus","'.$_jIOL6.'menus"');    $CONF = _OFB10($inc_dir);    _OFLL0($inc_dir, $CONF['TableNameMenus'] , 'ID INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,menu_group_id INT UNSIGNED DEFAULT 0,selection_name varchar(255) NOT NULL,menu_value varchar(255) NULL,menu_string varchar(255) NULL,menu_position TINYINT UNSIGNED DEFAULT 0,guest_visible TINYINT UNSIGNED DEFAULT 0');    _OFQQC($inc_dir,$CONF['TableNameConfig'], 'config_name,config_value','"TemplateMenuName1","In-Store Menu"');    _OFQQC($inc_dir,$CONF['TableNameMenus'], 'menu_group_id,selection_name,menu_value,menu_string,menu_position,guest_visible','"1","Checked In","1","workorder.php?Or=a","1","1"');    _OFQQC($inc_dir,$CONF['TableNameMenus'], 'menu_group_id,selection_name,menu_value,menu_string,menu_position,guest_visible','"1","On Bench","2","workorder.php?Or=a","2","1"');    _OFQQC($inc_dir,$CONF['TableNameMenus'], 'menu_group_id,selection_name,menu_value,menu_string,menu_position,guest_visible','"1","Awaiting Call","3","workorder.php?Or=a","3","1"');    _OFQQC($inc_dir,$CONF['TableNameMenus'], 'menu_group_id,selection_name,menu_value,menu_string,menu_position,guest_visible','"1","Ready For Pickup","4","workorder.php?Or=a","4","1"');    _OFQQC($inc_dir,$CONF['TableNameMenus'], 'menu_group_id,selection_name,menu_value,menu_string,menu_position,guest_visible','"1","Delivered/Claimed","8","workorder.php?Or=a","6","1"');    _OFQQC($inc_dir,$CONF['TableNameMenus'], 'menu_group_id,selection_name,menu_value,menu_string,menu_position,guest_visible','"1","Ready for Delivery","7","workorder.php?Or=a","5","1"');    _OFQQC($inc_dir,$CONF['TableNameConfig'], 'config_name,config_value','"TemplateMenuName2","Onsite Menu"');    _OFQQC($inc_dir,$CONF['TableNameMenus'], 'menu_group_id,selection_name,menu_value,menu_string','"2","New Onsite","1","workorder.php?Sortby=onsite&amp;Sortby=onsite&amp;Or=a"');    _OFQQC($inc_dir,$CONF['TableNameMenus'], 'menu_group_id,selection_name,menu_value,menu_string,menu_position,guest_visible','"2","Onsites On Bench","11","workorder.php?Sortby=onsite&amp;Or=a","2","1"');    _OFQQC($inc_dir,$CONF['TableNameMenus'], 'menu_group_id,selection_name,menu_value,menu_string,menu_position,guest_visible','"2","Onsites Awaiting Call","10","workorder.php?Sortby=onsite&amp;Or=a","3","1"');    _OFQQC($inc_dir,$CONF['TableNameMenus'], 'menu_group_id,selection_name,menu_value,menu_string,menu_position,guest_visible','"2","Completed Onsite","12","workorder.php?Sortby=onsite&amp;Or=a","5","1"');    _OFQQC($inc_dir,$CONF['TableNameMenus'], 'menu_group_id,selection_name,menu_value,menu_string,menu_position,guest_visible','"2","Scheduled Onsite","17","workorder.php?Or=a","1","1"');    _OFQQC($inc_dir,$CONF['TableNameConfig'], 'config_name,config_value','"TemplateMenuName3","Main Menu"');    _OFQQC($inc_dir,$CONF['TableNameMenus'], 'menu_group_id,selection_name,menu_value,menu_string,menu_position,guest_visible','"3","New Customer","13","workorder.php?Step=sacui","2","0"');    _OFQQC($inc_dir,$CONF['TableNameMenus'], 'menu_group_id,selection_name,menu_value,menu_string,menu_position,guest_visible','"3","New Ticket","","workorder.php?Step=newticket","3","0"');    _OFQQC($inc_dir,$CONF['TableNameMenus'], 'menu_group_id,selection_name,menu_string,menu_position,guest_visible','"3","Store Overview","workorder.php","1","1"');    _OFQQC($inc_dir,$CONF['TableNameMenus'], 'menu_group_id,selection_name,menu_string,menu_position,guest_visible','"3","Scheduler","include/pro/calendar.php","4","0"');    _OFQQC($inc_dir,$CONF['TableNameConfig'], 'config_name,config_value','"TemplateMenuName4","Single Strings"');    _OFQQC($inc_dir,$CONF['TableNameMenus'], 'menu_group_id,selection_name,menu_value,guest_visible','"4","Find Customer","14","1"');    _OFQQC($inc_dir,$CONF['TableNameMenus'], 'menu_group_id,selection_name,menu_value,guest_visible','"4","Find Ticket","15","1"');    _OFQQC($inc_dir,$CONF['TableNameMenus'], 'menu_group_id,selection_name,menu_value,guest_visible','"4","Ticket by ID","16","1"');    $CONF = _OFB10($inc_dir);    $_jIOL6 = $CONF['TablePrefix'];    _OFQQC($inc_dir,$CONF['TableNameConfig'], 'config_name,config_value','"TableNameTechHours","'.$_jIOL6.'tech_hours"');    $CONF = _OFB10($inc_dir);    _OFLL0($inc_dir, $CONF['TableNameTechHours'] , 'ID INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,User_ID INT UNSIGNED NOT NULL,Ticket_ID INT UNSIGNED NOT NULL,time_spent double(6,2) NOT NULL,posted datetime NOT NULL');    _OF6BA($inc_dir,$TableConfig, 'config_value="0.4.3"','config_name="VersionStringDatabase"');  }   $_jC6tl = _OELOL($inc_dir);   $x = _OELO8("$_jC6tl","0.4.2");   if( $x == 0 ) {    _OF6BA($inc_dir,$TableConfig, 'config_value="0.4.3"','config_name="VersionStringCode"');   }   $_jCJCf = _OEOOR($inc_dir);    $x = _OELO8("$_jCJCf","0.4.3");   if( $x == 0 ) {    $CONF = _OFB10($inc_dir);    $_jIOL6 = $CONF['TablePrefix'];    _OFQQC($inc_dir,$CONF['TableNameConfig'], 'config_name,config_value','"TableNameServiceTypes","'.$_jIOL6.'serv_type"');    $CONF = _OFB10($inc_dir);    _OFLL0($inc_dir, $CONF['TableNameServiceTypes'] , 'ID INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,serv_name varchar(255) NOT NULL,serv_instore TINYINT UNSIGNED NULL,serv_onsite TINYINT UNSIGNED NULL,serv_expedited TINYINT UNSIGNED NULL,serv_position TINYINT UNSIGNED NULL');    for( $x = 1 ; $x < 10 ; $x++ ) {    $sql = "select config_name,config_value from ".$CONF['TableNameConfig']." where config_name = \"ServiceTypeName$x\"";    $res = mysql_query( $sql, $conn ) OR die("Aborted! Code 43535".mysql_error());    $row = mysql_fetch_array($res);    $_j0llj = addslashes($row['config_value']);    $sql = "select config_name,config_value from ".$CONF['TableNameConfig']." where config_name = \"ServiceTypeValue$x\"";    $res = mysql_query( $sql, $conn ) OR die("Aborted! Code 4564337".mysql_error());    $row = mysql_fetch_array($res);    $_j10o0 = $row['config_value'];     _OFQQC($inc_dir,$CONF['TableNameServiceTypes'], 'ID,serv_name','"'.$_j10o0.'","'.$_j0llj.'"');   }     $sql = "select config_name,config_value from ".$CONF['TableNameConfig']." where config_name = \"ServiceTypeName0\"";    $res = mysql_query( $sql, $conn ) OR die("Aborted! Code 43535".mysql_error());    $row = mysql_fetch_array($res);    $_j0llj = addslashes($row['config_value']);    _OFQQC($inc_dir,$CONF['TableNameServiceTypes'], 'serv_name,serv_instore','"'.$_j0llj.'","1"');    _OF6BA($inc_dir,$CONF['TableNameTicket'], 'Service_Type="10"','Service_Type="0"');     $sql = 'SELECT config_value from '.$CONF['TableNameConfig'].' where config_name="ServiceTypesInstore"';    $res = mysql_query( $sql, $conn ) OR die("Aborted! Code 43535".mysql_error());    $row = mysql_fetch_array($res);    $_jio0J = explode(',', $row['config_value'] );     $sql = 'SELECT config_value from '.$CONF['TableNameConfig'].' where config_name="ServiceTypesOnsite"';    $res = mysql_query( $sql, $conn ) OR die("Aborted! Code 43535".mysql_error());    $row = mysql_fetch_array($res);    $_jioo0 = explode(',', $row['config_value'] );     foreach( $_jio0J as $_jiCt0 ) {     _OF6BA($inc_dir,$CONF['TableNameServiceTypes'], 'serv_instore="1"','ID="'.$_jiCt0.'"');     }    foreach( $_jioo0 as $_jiCt0 ) {     _OF6BA($inc_dir,$CONF['TableNameServiceTypes'], 'serv_onsite="1"','ID="'.$_jiCt0.'"');     }    _OF6BA($inc_dir,$CONF['TableNameServiceTypes'], 'serv_expedited="1"','ID="9"');    _OF6BA($inc_dir,$CONF['TableNameServiceTypes'], 'serv_position="1"','ID="10"');    _OF6BA($inc_dir,$CONF['TableNameServiceTypes'], 'serv_position="2"','ID="1"');    _OF6BA($inc_dir,$CONF['TableNameServiceTypes'], 'serv_position="3"','ID="2"');    _OF6BA($inc_dir,$CONF['TableNameServiceTypes'], 'serv_position="4"','ID="3"');    _OF6BA($inc_dir,$CONF['TableNameServiceTypes'], 'serv_position="5"','ID="9"');    _OF6BA($inc_dir,$CONF['TableNameServiceTypes'], 'serv_position="6"','ID="4"');    _OF6BA($inc_dir,$CONF['TableNameServiceTypes'], 'serv_position="7"','ID="8"');    _OF6BA($inc_dir,$CONF['TableNameServiceTypes'], 'serv_position="8"','ID="5"');    _OF6BA($inc_dir,$CONF['TableNameServiceTypes'], 'serv_position="9"','ID="6"');    _OF6BA($inc_dir,$CONF['TableNameServiceTypes'], 'serv_position="10"','ID="7"');    _OF6BA($inc_dir,$CONF['TableNameTicket'], 'Status_id="1"','Status_id="18"');   _OF6BA($inc_dir,$TableConfig, 'config_value="0.4.4"','config_name="VersionStringDatabase"');  }   $_jC6tl = _OELOL($inc_dir);   $x = _OELO8("$_jC6tl","0.4.3");   if( $x == 0 ) {    _OF6BA($inc_dir,$TableConfig, 'config_value="0.4.4"','config_name="VersionStringCode"');   }   $_jCJCf = _OEOOR($inc_dir);    $x = _OELO8("$_jCJCf","0.4.4");   if( $x == 0 ) {    _OFQQC($inc_dir,$CONF['TableNameConfig'], 'config_name,config_value','"EnableCheckinEmailSMTP","1"');    _OF6BA($inc_dir,$TableConfig, 'config_value="0.4.5"','config_name="VersionStringDatabase"');  }   $_jC6tl = _OELOL($inc_dir);   $x = _OELO8("$_jC6tl","0.4.4");   if( $x == 0 ) {    _OF6BA($inc_dir,$TableConfig, 'config_value="0.4.5"','config_name="VersionStringCode"');   }   $_jCJCf = _OEOOR($inc_dir);    $x = _OELO8("$_jCJCf","0.4.5");   if( $x == 0 ) {    _OFRF0($inc_dir, $CONF['TableNameTicket'] , 'Add', 'assigned_tech_id', 'INT UNSIGNED');    _OF6BA($inc_dir,$TableConfig, 'config_value="0.4.6"','config_name="VersionStringDatabase"');  }   $_jC6tl = _OELOL($inc_dir);   $x = _OELO8("$_jC6tl","0.4.5");   if( $x == 0 ) {    _OF6BA($inc_dir,$TableConfig, 'config_value="0.4.6"','config_name="VersionStringCode"');   }   $_jCJCf = _OEOOR($inc_dir);    $x = _OELO8("$_jCJCf","0.4.6");   if( $x == 0 ) {    _OF6BA($inc_dir,$CONF['TableNameMenus'], 'menu_string="workorder.php?Sortby=onsite&Or=a"','selection_name="Scheduled Onsite"');   _OFRF0($inc_dir, $CONF['TableNameServiceTypes'] , 'Add', 'serv_tick_isdone', 'TINYINT UNSIGNED NULL');    _OF6BA($inc_dir,$TableConfig, 'config_value="0.4.7"','config_name="VersionStringDatabase"');  }   $_jC6tl = _OELOL($inc_dir);   $x = _OELO8("$_jC6tl","0.4.6");   if( $x == 0 ) {    _OF6BA($inc_dir,$TableConfig, 'config_value="0.4.7"','config_name="VersionStringCode"');   }   $_jCJCf = _OEOOR($inc_dir);    $x = _OELO8("$_jCJCf","0.4.7");   if( $x == 0 ) {    _OFRF0($inc_dir, $CONF['TableNameServiceTypes'] , 'DROP', 'serv_tick_isdone');    _OFRF0($inc_dir, $CONF['TableNameMenus'] , 'Add', 'serv_menu_isdone', 'TINYINT UNSIGNED NULL');    _OF6BA($inc_dir,$TableConfig, 'config_value="0.4.8"','config_name="VersionStringDatabase"');  }   $_jC6tl = _OELOL($inc_dir);   $x = _OELO8("$_jC6tl","0.4.7");   if( $x == 0 ) {    _OF6BA($inc_dir,$TableConfig, 'config_value="0.4.8"','config_name="VersionStringCode"');   }   $_jCJCf = _OEOOR($inc_dir);    $x = _OELO8("$_jCJCf","0.4.8");   if( $x == 0 ) {    _OFROQ($inc_dir,$CONF['TableNameConfig'], 'config_name,config_value','"EnableAssignedTickets","0"');    _OF6BA($inc_dir,$TableConfig, 'config_value="0.4.9"','config_name="VersionStringDatabase"');  }   $_jC6tl = _OELOL($inc_dir);   $x = _OELO8("$_jC6tl","0.4.8");   if( $x == 0 ) {    _OF6BA($inc_dir,$TableConfig, 'config_value="0.4.9"','config_name="VersionStringCode"');   }   $_jCJCf = _OEOOR($inc_dir);    $x = _OELO8("$_jCJCf","0.4.9");   if( $x == 0 ) {    $sql = 'SELECT `User_ID`,`User_rights` FROM '.$CONF['TableNameUsers'];    $res = mysql_query($sql, $conn) or die("Unable to get complete User List, updated stopped, Error Code: 45GH8J");   while( $row = mysql_fetch_array($res) ) {     if( $row['User_rights'] != Null ) {     $_jii6o = $row['User_ID'];     $_jJO6Q = $row['User_rights'];     $_jJO6Q .= '-0';      _OF6BA($inc_dir, $CONF['TableNameUsers'] , 'User_rights="'.$_jJO6Q.'"','User_ID="'.$_jii6o.'"');    }    }    _OFROQ($inc_dir,$CONF['TableNameConfig'], 'config_name,config_value','"EnableAssignTechsTicketLock","0"');    _OFRF0($inc_dir, $CONF['TableNameUsers'] , 'Add', 'User_unflitered_search', 'TINYINT UNSIGNED NULL');   _OF6BA($inc_dir,$TableConfig, 'config_value="0.4.10"','config_name="VersionStringDatabase"');  }   $_jC6tl = _OELOL($inc_dir);   $x = _OELO8("$_jC6tl","0.4.9");   if( $x == 0 ) {    _OF6BA($inc_dir,$TableConfig, 'config_value="0.4.10"','config_name="VersionStringCode"');   }   $_jCJCf = _OEOOR($inc_dir);    $x = _OELO8("$_jCJCf","0.4.10");   if( $x == 0 ) {    $sql = 'SELECT `User_ID`,`User_rights` FROM '.$CONF['TableNameUsers'];    $res = mysql_query($sql, $conn) or die("Unable to get complete User List, updated stopped, Error Code: 45GH8Ja");   while( $row = mysql_fetch_array($res) ) {     if( $row['User_rights'] != Null ) {     $_jii6o = $row['User_ID'];     $_jJO6Q = $row['User_rights'];     $_jJO6Q .= '-0';      _OF6BA($inc_dir, $CONF['TableNameUsers'] , 'User_rights="'.$_jJO6Q.'"','User_ID="'.$_jii6o.'"');    }    }    _OF6BA($inc_dir,$TableConfig, 'config_value="0.4.11"','config_name="VersionStringDatabase"');  }   $_jC6tl = _OELOL($inc_dir);   $x = _OELO8("$_jC6tl","0.4.10");   if( $x == 0 ) {    _OF6BA($inc_dir,$TableConfig, 'config_value="0.4.11"','config_name="VersionStringCode"');   }   $_jCJCf = _OEOOR($inc_dir);    $x = _OELO8("$_jCJCf","0.4.11");   if( $x == 0 ) {    $CONF = _OFB10($inc_dir);    $_jIOL6 = $CONF['TablePrefix'];   _OFROQ($inc_dir,$CONF['TableNameConfig'], 'config_name,config_value','"SkinPath","default"');    _OFROQ($inc_dir,$CONF['TableNameConfig'], 'config_name,config_value','"TableNameDownloads","'.$_jIOL6.'downl"');    _OFROQ($inc_dir,$CONF['TableNameConfig'], 'config_name,config_value','"TableNameDownloadsCat","'.$_jIOL6.'downl_cat"');    $CONF = _OFB10($inc_dir);    $_jiioL = $CONF['TableNameDownloads'];   _OFLL0($inc_dir, $_jiioL , 'ID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,FileDesc varchar(255) NULL,FileName varchar(255) NULL,SubDir varchar(255) NULL,URL text NULL,CategoryID INT UNSIGNED NOT NULL');    $_jiLOi = $CONF['TableNameDownloadsCat'];   _OFLL0($inc_dir, $_jiLOi , 'ID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,Cat_name varchar(200) NOT NULL');    _OFROQ($inc_dir,$CONF['TableNameConfig'], 'config_name,config_value','"DownloadSubDir","company_dl-1"');    $sql = 'SELECT `User_ID`,`User_rights` FROM '.$CONF['TableNameUsers'];    $res = mysql_query($sql, $conn) or die("Unable to get complete User List, updated stopped, Error Code: 45GH8Ja");   while( $row = mysql_fetch_array($res) ) {     if( $row['User_rights'] != Null ) {     $_jii6o = $row['User_ID'];     $_jJO6Q = $row['User_rights'];     $_jJO6Q .= '-0';      _OF6BA($inc_dir, $CONF['TableNameUsers'] , 'User_rights="'.$_jJO6Q.'"','User_ID="'.$_jii6o.'"');    }    }    _OF6BA($inc_dir,$CONF['TableNameUsers'], 'User_rights="1-1-1-1-1-1-1"','User_ID="2"');   _OFROQ($inc_dir,$CONF['TableNameDownloadsCat'], 'Cat_name','"Main"');    _OFQQC($inc_dir,$CONF['TableNameMenus'], 'menu_group_id,selection_name,menu_string,menu_position,guest_visible','"3","Company Downloads","file_downloads.php?CatID=1","4","0"');    _OF6BA($inc_dir,$TableConfig, 'config_value="0.4.12"','config_name="VersionStringDatabase"');  }   $_jC6tl = _OELOL($inc_dir);   $x = _OELO8("$_jC6tl","0.4.11");   if( $x == 0 ) {    _OF6BA($inc_dir,$TableConfig, 'config_value="0.4.12"','config_name="VersionStringCode"');   }   $_jCJCf = _OEOOR($inc_dir);    $x = _OELO8("$_jCJCf","0.4.12");   if( $x == 0 ) {    _OFOEF( $inc_dir, $CONF['TableNameConfig'], 'config_name LIKE "ServiceTypeName%" OR config_name LIKE "ServiceType%"');   _OFOEF( $inc_dir, $CONF['TableNameConfig'], 'config_name LIKE "TicketStatusControlName%" OR config_name LIKE "TicketStatusControlValue%"');   _OF6BA($inc_dir,$TableConfig, 'config_value="0.4.13"','config_name="VersionStringDatabase"');  }   $_jC6tl = _OELOL($inc_dir);   $x = _OELO8("$_jC6tl","0.4.12");   if( $x == 0 ) {    _OF6BA($inc_dir,$TableConfig, 'config_value="0.4.13"','config_name="VersionStringCode"');   }   $_jCJCf = _OEOOR($inc_dir);    $x = _OELO8("$_jCJCf","0.4.13");   if( $x == 0 ) {    $CONF = _OFB10($inc_dir);    _OFQQC($inc_dir,$CONF['TableNameConfig'], 'config_name,config_value','"TableNameContractSuperTickets","'.$CONF['TablePrefix'].'serv_cont_super"');    $CONF = _OFB10($inc_dir);    _OFLL0($inc_dir, $CONF['TableNameContractSuperTickets'] , 'ID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,Customer_ID INT UNSIGNED NOT NULL,service_type INT NOT NULL,service_desc text NULL,service_performed text NULL,created datetime NOT NULL,created_by varchar(100),Tech_Notes text NULL,store_id INT UNSIGNED,BackStop varchar(100)');    _OFRF0($inc_dir, $CONF['TableNameServiceTypes'], 'Add', 'serv_contract', 'TINYINT UNSIGNED DEFAULT \'0\'');   _OFQQC($inc_dir,$CONF['TableNameConfig'], 'config_name,config_value','"TableNameContractTickets","'.$CONF['TablePrefix'].'serv_cont_ticket"');    $CONF = _OFB10($inc_dir);    _OFLL0($inc_dir, $CONF['TableNameContractTickets'] , 'ID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,super_id INT UNSIGNED NOT NULL,service_desc text NULL,service_performed text NULL,created datetime NOT NULL,created_by varchar(100),store_id INT UNSIGNED,BackStop varchar(100)');    _OFQQC($inc_dir,$CONF['TableNameConfig'], 'config_name,config_value','"TableNameContractDevices","'.$CONF['TablePrefix'].'serv_cont_devices"');    $CONF = _OFB10($inc_dir);    _OFLL0($inc_dir, $CONF['TableNameContractDevices'] , 'ID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,super_id INT UNSIGNED NOT NULL,disp_name varchar(255) NOT NULL,device_desc text NULL,device_history text NULL,created datetime NOT NULL,created_by varchar(100),BackStop varchar(100)');   _OFQQC($inc_dir,$CONF['TableNameConfig'], 'config_name,config_value','"TableNameTechHoursSuperTicket","'.$CONF['TablePrefix'].'tech_hours_super"');    $CONF = _OFB10($inc_dir);    _OFLL0($inc_dir, $CONF['TableNameTechHoursSuperTicket'] , 'ID INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,User_ID INT UNSIGNED NOT NULL,Ticket_ID INT UNSIGNED NOT NULL,time_spent double(6,2) NOT NULL,posted datetime NOT NULL');    _OFQQC($inc_dir,$CONF['TableNameConfig'], 'config_name,config_value','"TableNameTechHoursSub","'.$CONF['TablePrefix'].'tech_hours_sub"');    $CONF = _OFB10($inc_dir);    _OFLL0($inc_dir, $CONF['TableNameTechHoursSub'] , 'ID INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,User_ID INT UNSIGNED NOT NULL,Ticket_ID INT UNSIGNED NOT NULL,time_spent double(6,2) NOT NULL,posted datetime NOT NULL');    $sql = 'DESC '.$CONF['TableNameTicket'];   $res = mysql_query($sql, $conn) or die('Unable to get DESC from TicketTable'.mysql_error());   $_jiLCi = 0;   while( $row = mysql_fetch_array($res) ) {    if( strcmp($row['Field'], 'GuestKey') == 0 ) {     $_jiLCi = 1;    }   }   if( $_jiLCi == 0 ) {    _OFR8R($inc_dir, $CONF['TableNameTicket'] , 'ADD', '','GuestKey varchar(15) NULL');   }   _OF6BA($inc_dir,$TableConfig, 'config_value="0.5.0"','config_name="VersionStringDatabase"');  }   $_jC6tl = _OELOL($inc_dir);   $x = _OELO8("$_jC6tl","0.4.13");   if( $x == 0 ) {    _OF6BA($inc_dir,$TableConfig, 'config_value="0.5.0"','config_name="VersionStringCode"');   }   $_jCJCf = _OEOOR($inc_dir);    $x = _OELO8("$_jCJCf","0.5.0");   if( $x == 0 ) {    $CONF = _OFB10($inc_dir);    $_jIOL6 = $CONF['TablePrefix'];   _OFR8R($inc_dir, $CONF['TableNameMenus'], 'MODIFY', '', '`serv_menu_isdone` tinyint signed NULL');   _OFQAF($inc_dir, $CONF['TableNameMenus'], '`serv_menu_isdone`=0', '`serv_menu_isdone` IS NULL');   _OF6BA($inc_dir,$CONF['TableNameConfig'], 'config_value="0.5.1"','config_name="VersionStringDatabase"');  }   $_jC6tl = _OELOL($inc_dir);   $x = _OELO8("$_jC6tl","0.5.0");   if( $x == 0 ) {    _OF6BA($inc_dir,$CONF['TableNameConfig'], 'config_value="0.5.1"','config_name="VersionStringCode"');   }   $_jCJCf = _OEOOR($inc_dir);    $x = _OELO8("$_jCJCf","0.5.1");   if( $x == 0 ) {    $CONF = _OFB10($inc_dir);    _OF6BA($inc_dir,$CONF['TableNameConfig'], 'config_value="0.5.2"','config_name="VersionStringDatabase"');  }   $_jC6tl = _OELOL($inc_dir);   $x = _OELO8("$_jC6tl","0.5.1");   if( $x == 0 ) {    _OF6BA($inc_dir,$CONF['TableNameConfig'], 'config_value="0.5.2"','config_name="VersionStringCode"');   }   $_jCJCf = _OEOOR($inc_dir);    $x = _OELO8("$_jCJCf","0.5.2");   if( $x == 0 ) {    $CONF = _OFB10($inc_dir);    _OFQAF($inc_dir, $CONF['TableNameMenus'], '`menu_string`="calendar.php"', '`menu_string`="include/pro/calendar.php"');   _OFR8R($inc_dir, $CONF['TableNameServiceTypes'], 'MODIFY', '', '`serv_instore` tinyint signed NULL');   _OFQAF($inc_dir, $CONF['TableNameServiceTypes'], '`serv_instore`=0', '`serv_instore` IS NULL');   _OFR8R($inc_dir, $CONF['TableNameServiceTypes'], 'MODIFY', '', '`serv_onsite` tinyint signed NULL');   _OFQAF($inc_dir, $CONF['TableNameServiceTypes'], '`serv_onsite`=0', '`serv_onsite` IS NULL');   _OFR8R($inc_dir, $CONF['TableNameServiceTypes'], 'MODIFY', '', '`serv_expedited` tinyint signed NULL');   _OFQAF($inc_dir, $CONF['TableNameServiceTypes'], '`serv_expedited`=0', '`serv_expedited` IS NULL');   _OFR8R($inc_dir, $CONF['TableNameServiceTypes'], 'MODIFY', '', '`serv_position` tinyint signed NULL');   _OFQAF($inc_dir, $CONF['TableNameServiceTypes'], '`serv_position`=0', '`serv_position` IS NULL');   _OF6BA($inc_dir,$CONF['TableNameConfig'], 'config_value="0.5.3"','config_name="VersionStringDatabase"');  }   $_jC6tl = _OELOL($inc_dir);   $x = _OELO8("$_jC6tl","0.5.2");   if( $x == 0 ) {    _OF6BA($inc_dir,$CONF['TableNameConfig'], 'config_value="0.5.3"','config_name="VersionStringCode"');   }   switch ($_jCjCI) {    case 0:    $_jCjft .=  '<span style="background-color: #33CC00;">Update Successful.</span>'       .'<img src="'.OK_IMG.'" width="22" height="11" />'."\n"       .'<a href="setup_complete.php?wouap='.$disp_wouap.'&woutp='.$disp_woutp.'">Continue</a>'."\n\n";    break;   case 1:    $_jCjft .=  '<span style="background-color: #FF9900;">'       .'At least one Warning issued,please check the test warning below.</span>'       .'<img src="'.WARNING_IMG.'" width="22" height="11" />'."\n"       .'<a href="setup_complete.php?wouap='.$disp_wouap.'&woutp='.$disp_woutp.'">Continue</a>'."\n\n";    break;   case 2:    $_jCjft .=  '<span style="background-color: #FF0000;">'       .'FATAL ERROR,update FAILED!.<img src="'.ERROR_IMG.'" width="22" height="11" />'."\n\n"       .'</span>';    break;  }   $_jCjft = nl2br($_jCjft);  print_r($_jCjft);  ?>
Return current item: WorkOrder TS