Location: PHPKode > projects > WorkOrder TS > workorder-ts/setup_files/populate.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");$inc_dir='../include/';require_once $inc_dir.'magic_quotes.php';require_once 'MySQLErr.php';require_once 'tables_values.php';$_IlJtQ=Null;$_IlJIl=Null;$_j6O6l=0;require_once $inc_dir.'workorder_function_general.inc.php';require_once $inc_dir.'config-user.inc.php';require_once $inc_dir.'conn-string-user.inc.php';function _OE0RJ($inc_dir,$_j6OOO,$_j6oIo) { $_j6oJi=Null;$_jjQIJ=Null;$_jJCfj=Null;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();echo $_j6oJi;$_jjQIJ=mysql_errno();return $_jjQIJ;} function _OE0BR( $inc_dir,$_j6OOO ) { require_once $inc_dir.'config-guest.inc.php';require_once $inc_dir.'conn-string-guest.inc.php';$_jjQIo=Null;$_j6oCI="desc ".$_j6OOO;$_j6CJl=mysql_query($_j6oCI,$conn);@$_jjQIo=mysql_num_rows($_j6CJl);if( !$_jjQIo ) { return $_jjQIo;} } function _OE11Q($inc_dir,$_j6CLQ,$_jILCI,$_jJfCi,$_j6iOC,$_j6LO6,$_j6Lo6,$_jIOtO,$_j6LLO) { $_j6oJi=Null;$_jjQIJ=Null;$_jJCfj="";$_jJfCi=html_entity_decode($_jJfCi);require $inc_dir.'config-user.inc.php';$conn=mysql_connect("$_j6CLQ","$_jILCI","$_jJfCi");$sql="GRANT $_j6iOC ON $_j6LO6.* TO '$_j6Lo6'@'$_j6LLO' IDENTIFIED BY '$_jIOtO'";$res=mysql_query($sql,$conn);$_j6oJi=mysql_error();$_jjQIJ=mysql_errno();mysql_close($conn);return $_j6oJi;} function _OE1LB($inc_dir,$_j6CLQ,$_jILCI,$_jJfCi,$_j6lCC) { $_j6oJi="";$_jjQIJ="";$_jJCfj="";require $inc_dir.'config-user.inc.php';$conn=mysql_connect("$_j6CLQ","$_jILCI","$_jJfCi");$sql="create database $_j6lCC";@$res=mysql_query($sql,$conn);$_j6oJi=mysql_error();$_jjQIJ=mysql_errno();if( is_numeric($_jjQIJ)==FALSE ) { $_jjQIJ=1;} mysql_close($conn);Return $_jjQIJ;} if( isset($_GET['wodb']) ) { $wodb=addslashes(html_entity_decode($_GET['wodb']));} else { $wodb=Null;} if( isset($_GET['woip']) ) { $woip=addslashes(html_entity_decode($_GET['woip']));} else { $woip=Null;} if( isset($_GET['wologip']) ) { $wologip=addslashes(html_entity_decode($_GET['wologip']));} else { $wologip=Null;} if( isset($_GET['worootu']) ) { $worootu=addslashes(html_entity_decode($_GET['worootu']));} else { $worootu=Null;} if( isset($_GET['worootp']) ) { $worootp=html_entity_decode($_GET['worootp']);} else { $worootp=Null;} if( isset($_GET['wogu']) ) { $wogu=addslashes(html_entity_decode($_GET['wogu']));} else { $wogu=Null;} if( isset($_GET['wogp']) ) { $wogp=addslashes(html_entity_decode($_GET['wogp']));} else { $wogp=Null;} if( isset($_GET['wouu']) ) { $wouu=addslashes(html_entity_decode($_GET['wouu']));} else { $wouu=Null;} if( isset($_GET['woup']) ) { $woup=addslashes(html_entity_decode($_GET['woup']));} else { $woup=Null;} if( isset($_GET['wotp']) ) { $wotp=addslashes(html_entity_decode($_GET['wotp']));} else { $wotp=Null;} if( isset($_GET['wouap']) ) { $wouap=addslashes(html_entity_decode($_GET['wouap']));$disp_wouap=$wouap;} else { $wouap=Null;$disp_wouap=Null;} if( isset($_GET['woutp']) ) { $woutp=addslashes(html_entity_decode($_GET['woutp']));$disp_woutp=$woutp;} else { $woutp=Null;$disp_woutp=Null;} if( isset($_GET['wolk']) ) { $wolk=addslashes(html_entity_decode($_GET['wolk']));} else { $wolk=Null;} if( isset($_GET['sn']) ) { $StoreNum=addslashes(html_entity_decode($_GET['sn']));} else { $StoreNum=Null;} if( $worootu !="" ) { $_jf6jO=$worootu;$_jff11=$worootp;$_jffIt=True;} else { $_jf6jO=$wouu;$_jff11=$woup;$_jffIt=False;} if( isset($_GET['pcdb']) ) { $_jIiOQ=html_entity_decode($_GET['pcdb']);$_jIiOQ=settype($_jIiOQ,'bool');} else { $_jIiOQ=Null;} if( isset($_GET['pddb']) ) { $_jIilQ=html_entity_decode($_GET['pddb']);$_jIilQ=settype($_jIilQ,'bool');} else { $_jIilQ=Null;} if( isset($_GET['pct']) ) { $_jQfL8=html_entity_decode($_GET['pct']);$_jQfL8=settype($_jQfL8,'bool');} else { $_jQfL8=Null;} if( isset($_GET['pdt']) ) { $_jILt8=html_entity_decode($_GET['pdt']);$_jILt8=settype($_jILt8,'bool');} else { $_jILt8=Null;} if( $_jIiOQ==True ) { $_IlJIl=Null;$_jffoJ=Null;$_jf8OC=@mysql_connect("$woip","$worootu","$worootp");$_jffoJ=@mysql_select_db( $wodb,$_jf8OC);if( !$_jffoJ ) { $_IlJIl=mysql_errno();if( $_IlJIl=="1049" ) { $_IlJIl=Null;$_IlJIl=_OE1LB($inc_dir,$woip,$_jf6jO,$_jff11,$wodb);if( $_IlJIl=="" ) { $_IlJtQ.='Database Created. <img src="'.OK_IMG.'" width="22" height="11" />'."\n";} $_IlJtQ.=_ODBDA($_IlJIl,NULL);} } else { $_IlJtQ.='Database Already Exists. <img src="'.OK_IMG.'" width="22" height="11" />'."\n";$_IlJtQ.=_ODBDA($_IlJIl,NULL);} } else { } $_jftOQ=True;if( $_jftOQ==True ) { require_once 'tables_values.php';$_jftlj=Null;$_jftlj=@mysql_connect( "$woip","$wouu","$woup");if ( !$_jftlj ) { $_IlJIl=Null;$_IlJIl=_OE11Q($inc_dir,$woip,$worootu,$worootp,'LOCK TABLES,ALTER,SELECT,INSERT,UPDATE,DELETE,CREATE,DROP',$wodb,$wouu,$woup,$wologip);if( $_IlJIl !=0 ) { $_IlJtQ.=_ODBDA($_IlJIl,NULL);$_IlJtQ.='Failed to Create User. <img src="'.ERROR_IMG.'" width="22" height="11" />'."\n";} else { $_IlJtQ.='User Created. <img src="'.OK_IMG.'" width="22" height="11" />'."\n";} } else { $_IlJtQ.='User Account already exists, login successful. <img src="'.OK_IMG.'" width="22" height="11" />'."\n";} $_jfOQ8=Null;$_jfOQ8=@mysql_connect( "$woip","$wogu","$wogp");if ( !$_jfOQ8 ) { $_IlJIl=Null;$_IlJIl=_OE11Q($inc_dir,$woip,$worootu,$worootp,'SELECT',$wodb,$wogu,$wogp,$wologip);if( $_IlJIl !=0 ) { $_IlJtQ.=_ODBDA($_IlJIl,NULL);$_IlJtQ.='Failed to Create Limited User. <img src="'.ERROR_IMG.'" width="22" height="11" />'."\n";} else { $_IlJtQ.='Limited User Created. <img src="'.OK_IMG.'" width="22" height="11" />'."\n";} } else { $_IlJtQ.='Limited User already exists, login successful. <img src="'.OK_IMG.'" width="22" height="11" />'."\n";} } if( $_jQfL8==True ) { require_once 'create_tables.php';} $_jfOoC=True;if( $_jfOoC==True && $_j6O6l !=2 ) { require_once 'add_table_values.php';switch ($_ILj0O) { case 0:$_IlJtQ.='Values added successfully. </span><img src="'.OK_IMG.'" width="22" height="11" />'."\n";break;case 1:$_IlJtQ='At least one Warning issued, please check the test warning below. </span>' .'<img src="'.WARNING_IMG.'" width="22" height="11" />'."\n";if( $_j6O6l < 1 ) { $_j6O6l=1;} break;case 2:$_IlJtQ.='FATAL ERROR, error while inserting default values!. <img src="'.ERROR_IMG.'" width="22" height="11" />'."\n";if( $_j6O6l < 2 ) { $_j6O6l=2;} break;} } if( $_j6O6l !=2 ) { require_once 'update.php';} switch ($_j6O6l) { case 0:$_IlJtQ='<span style="background-color: #33CC00;">Installation 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" .$_IlJtQ;break;case 1:$_IlJtQ='<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" .$_IlJtQ;break;case 2:$_IlJtQ='<span style="background-color: #FF0000;">' .'FATAL ERROR, installation FAILED!. <img src="'.ERROR_IMG.'" width="22" height="11" />'."\n\n" .'</span>'.$_IlJtQ;break;} $_IlJtQ=nl2br($_IlJtQ);print_r($_IlJtQ);?>
Return current item: WorkOrder TS