Location: PHPKode > projects > phprofession job board > phProfession_SA/install.php
<?
if (!eregi("install.php",$PHP_SELF)) 
{ 
	die ("You can't access this file form indirectly.. you will need to locate the install.php file directly");
}
//open this file directly in your browser to install phprofession.
include("config.php");
?>
<html>
<head>
	<title>Installing  phprofession <? echo "$Version"; ?></title>
</head>
<body>

<?
error_reporting();
#####################################
#   phprofession   September 2005   #
#   by Aidan Peiser	    	    #
#   Recruitment module for PN.712   #
#   www.galore.co.za	    #
#	.,.,.,,			    #
#	C 'C' C			    #
#	 > * <			    #
#####################################


echo "<a href=\"https://sourceforge.net/projects/profession/\"><img src=\"logo-X.gif\" border=\"0\"></a><br>.,&nbsp;.,&nbsp;.,,<br>c 'c' c<br>> * <<br>";

if (!$_POST[submit] == "Install")
{
	echo "<br><br>this script must be run from the install.php file page, please make shure that you have filled out the correct database details for your site in the config.php file all these fields must be filled out :
	<br><br>	\$database = \"$database\";<br>	\$user = \"$user\";<br>	\$pass = \"$pass\";<br>	\$hostname = \"$hostname\";
	<br>	\$prefix = \"$prefix\";<br>	<br>You will now install all the tables you will need:<br>
	<form action=\"$PHP_SELF\" method=\"post\"><input type=\"checkbox\" name=\"upgrade\" value=\"true\">check if you want to upgrade from version 2.4<br>
	<br><input type=\"submit\" name=\"submit\" value=\"Install\"></form>";

}
else
{
if($_POST[upgrade] == true)
	{
		echo "creating tables needed for upgrade<br>";
		mysql_connect($hostname, $user, $pass);
		mysql_select_db("$database") or die ("<br><font class=\"post-failed\">Unable to select database -- You must either create your database manually or if you have root access let the install script do it for you.</font></font>");
	
		do_upgrade($prefix);
		echo "<hr>Now select what language version would you like to use?<br><a href=\"install/install2usa.php\">English USA</a>&nbsp;|&nbsp;<a href=\"install/install2uk.php\">English UK</a>&nbsp;|&nbsp;<a href=\"install/install2franco.php\">French</a><br>";
	}
	else
	{
		echo "you are going to create your tables now!<br>";
		mysql_connect($hostname, $user, $pass);
		mysql_select_db("$database") or die ("<br><font class=\"post-failed\">Unable to select database -- You must either create your database manually or if you have root access let the install script do it for you.</font></font>");
	
		create_tables($prefix);
		echo "<hr>Now select what language version would you like to use?<br><a href=\"install/install2usa.php\">English USA</a>&nbsp;|&nbsp;<a href=\"install/install2uk.php\">English UK</a>&nbsp;|&nbsp;<a href=\"install/install2franco.php\">French</a><br>";
	}
}


function do_upgrade($prefix)
{

$result = mysql_query("CREATE TABLE ".$prefix."_joblisting_install (
  jcode int(10) NOT NULL auto_increment,
  designation varchar(255) NOT NULL default '',
  responsibilities text NOT NULL,
  qualifications text NOT NULL,
  cname varchar(255) NOT NULL default '',
  cmail varchar(255) NOT NULL default '',
  posted date NOT NULL default '0000-00-00',
  fk_department int(3) unsigned NOT NULL default '0',
  fk_location int(3) unsigned NOT NULL default '0',
  fk_salary int(3) unsigned NOT NULL default '0',
  checked int(3) unsigned NOT NULL default '0',
  hits tinyint(10) NOT NULL default '0',
  PRIMARY KEY  (jcode)
)") or die ("Unable to make ".$prefix."_joblisting_install");
    echo "<br><font class=\"post-sub\">".$prefix."_joblisting_install Made.</font>";
    
}


function create_tables($prefix)
{

$result = mysql_query("CREATE TABLE ".$prefix."_jobaccounts (
  user varchar(125) NOT NULL default '',
  pass varchar(125) NOT NULL default '',
  rand varchar(125) NOT NULL default '',
  md5 varchar(125) NOT NULL default '',
  email varchar(125) NOT NULL default '',
  company varchar(200) NOT NULL default '',
  phone int(100) NOT NULL default '',
  usertype varchar(10) NOT NULL default '',
  ipaddress varchar(100) NOT NULL default '',
  host varchar(150) NOT NULL default '',
  count int(10) NOT NULL default '0',
  PRIMARY KEY  (user)
)") or die ("Unable to make ".$prefix."_jobaccounts");
    echo "<br><font class=\"post-sub\">".$prefix."_jobaccounts Made.</font>";

$result = mysql_query("CREATE TABLE ".$prefix."_jobclient (
   id int(10) unsigned NOT NULL auto_increment,
   clientname varchar(100) NOT NULL,
   clientcompany varchar(255) NOT NULL,
   clientphone varchar(255) NOT NULL,
   clientemail varchar(255) NOT NULL,
   clientcomments text NOT NULL,
   PRIMARY KEY (id)
)") or die ("Unable to make ".$prefix."_jobclient");
    echo "<br><font class=\"post-sub\">".$prefix."_jobclient Made.</font>";

$result = mysql_query("CREATE TABLE ".$prefix."_jobcountry (
    id int(10) unsigned NOT NULL auto_increment,
    country varchar(255) NOT NULL,
    PRIMARY KEY (id)
    )") or die ("Unable to make ".$prefix."_jobcountry");
    echo "<br><font class=\"post-sub\">".$prefix."_jobcountry Made.</font>";

$result = mysql_query("CREATE TABLE ".$prefix."_jobdegree (
       id int(10) unsigned NOT NULL auto_increment,
       degree varchar(255) NOT NULL,
       PRIMARY KEY (id)
    )") or die ("Unable to make ".$prefix."_jobdegree");
    echo "<br><font class=\"post-sub\">".$prefix."_jobdegree Made.</font>";

$result = mysql_query("CREATE TABLE ".$prefix."_jobdepartment (
       id int(10) unsigned NOT NULL auto_increment,
       department varchar(255) NOT NULL,
       PRIMARY KEY (id)
    )") or die ("Unable to make ".$prefix."_jobdepartment");
    echo "<br><font class=\"post-sub\">".$prefix."_jobdepartment Made.</font>";

$result = mysql_query("CREATE TABLE ".$prefix."_jobeducation (
   rid int(10) unsigned DEFAULT '0' NOT NULL,
   institute varchar(255) NOT NULL,
   fk_degree tinyint(3) unsigned DEFAULT '0' NOT NULL,
   fk_subject tinyint(3) unsigned DEFAULT '0' NOT NULL,
   year year(4) DEFAULT '0000' NOT NULL,
   KEY fk_degree (fk_degree),
   KEY fk_subject (fk_subject),
   KEY rid (rid)
)") or die ("Unable to make ".$prefix."_jobeducation");
    echo "<br><font class=\"post-sub\">".$prefix."_jobeducation Made.</font>";

$result = mysql_query("CREATE TABLE ".$prefix."_jobemployment (
   rid int(10) unsigned DEFAULT '0' NOT NULL,
   employer varchar(255) NOT NULL,
   fk_industry tinyint(3) unsigned DEFAULT '0' NOT NULL,
   start_year year(4) DEFAULT '0000' NOT NULL,
   end_year year(4) DEFAULT '0000' NOT NULL,
   responsibilities text NOT NULL,
   KEY rid (rid)
)") or die ("Unable to make ".$prefix."_jobemployment");
    echo "<br><font class=\"post-sub\">".$prefix."_jobemployment Made.</font>";

$result = mysql_query("CREATE TABLE ".$prefix."_jobindustry (
       id int(10) unsigned NOT NULL auto_increment,
       industry varchar(255) NOT NULL,
       PRIMARY KEY (id)
    )") or die ("Unable to make ".$prefix."_jobindustry");
    echo "<br><font class=\"post-sub\">".$prefix."_jobindustry Made.</font>";

$result = mysql_query("CREATE TABLE ".$prefix."_joblisting (
  jcode int(10) NOT NULL auto_increment,
  designation varchar(255) NOT NULL default '',
  responsibilities text NOT NULL,
  qualifications text NOT NULL,
  cname varchar(255) NOT NULL default '',
  cmail varchar(255) NOT NULL default '',
  posted date NOT NULL default '0000-00-00',
  fk_department int(3) unsigned NOT NULL default '0',
  fk_location int(3) unsigned NOT NULL default '0',
  fk_salary int(3) unsigned NOT NULL default '0',
  checked int(3) unsigned NOT NULL default '0',
  hits tinyint(10) NOT NULL default '0',
  PRIMARY KEY  (jcode)
)") or die ("Unable to make ".$prefix."_joblisting");
    echo "<br><font class=\"post-sub\">".$prefix."_joblisting Made.</font>";

$result = mysql_query("CREATE TABLE ".$prefix."_jobtemplisting (
  jcode int(10) NOT NULL auto_increment,
  designation varchar(255) NOT NULL default '',
  responsibilities text NOT NULL,
  qualifications text NOT NULL,
  cname varchar(255) NOT NULL default '',
  cmail varchar(255) NOT NULL default '',
  posted date NOT NULL default '0000-00-00',
  fk_department int(3) unsigned NOT NULL default '0',
  fk_location int(3) unsigned NOT NULL default '0',
  fk_salary int(3) unsigned NOT NULL default '0',
  checked int(3) unsigned NOT NULL default '0',
  hits int(10) NOT NULL default '0',
  PRIMARY KEY  (jcode)
)") or die ("Unable to make ".$prefix."_jobtemplisting");
    echo "<br><font class=\"post-sub\">".$prefix."_jobtemplisting Made.</font>";


$result = mysql_query("CREATE TABLE ".$prefix."_joblocation (
   id int(10) unsigned NOT NULL auto_increment,
   location varchar(255) NOT NULL,
   PRIMARY KEY (id)
)") or die ("Unable to make ".$prefix."_joblocation");
    echo "<br><font class=\"post-sub\">".$prefix."_joblocation Made.</font>";

$result = mysql_query("CREATE TABLE ".$prefix."_jobreference (
   rid int(10) unsigned DEFAULT '0' NOT NULL,
   name varchar(255) NOT NULL,
   phone varchar(25) NOT NULL,
   email varchar(255),
   KEY rid (rid)
)") or die ("Unable to make ".$prefix."_jobreference");
    echo "<br><font class=\"post-sub\">".$prefix."_jobreference Made.</font>";

$result = mysql_query("CREATE TABLE ".$prefix."_jobresume (
  id int(10) unsigned NOT NULL auto_increment,
  cvname varchar(255) NOT NULL,
  cvphone varchar(25) NOT NULL,
  cvemail varchar(255) NOT NULL,
  source_name varchar(255) NOT NULL,
  jcode varchar(255) NOT NULL,
  ip_address varchar(100) NOT NULL default '',
  host varchar(100) NOT NULL default '',
  KEY id (id)
)") or die ("Unable to make ".$prefix."_jobresume");
    echo "<br><font class=\"post-sub\">".$prefix."_jobresume Made.</font>";

$result = mysql_query("CREATE TABLE ".$prefix."_jobskill (
   rid int(10) unsigned DEFAULT '0' NOT NULL,
   skill varchar(255) NOT NULL,
   experience tinyint(3) unsigned DEFAULT '0' NOT NULL,
   KEY skill (skill),
   KEY experience (experience),
   KEY rid (rid)
)") or die ("Unable to make ".$prefix."_jobskill");
    echo "<br><font class=\"post-sub\">".$prefix."_jobskill Made.</font>";

$result = mysql_query("CREATE TABLE ".$prefix."_jobsubject (
   id int(10) unsigned NOT NULL auto_increment,
   subject varchar(255) NOT NULL,
   PRIMARY KEY (id)
)") or die ("Unable to make ".$prefix."_jobsubject");
    echo "<br><font class=\"post-sub\">".$prefix."_jobsubject Made.</font>";

$result = mysql_query("CREATE TABLE ".$prefix."_jobuser (
   rid int(10) unsigned NOT NULL auto_increment,
   jcode varchar(10) NOT NULL,
   fname varchar(255) NOT NULL,
   lname varchar(255) NOT NULL,
   dob date DEFAULT '0000-00-00' NOT NULL,
   addr1 varchar(255) NOT NULL,
   addr2 varchar(255),
   city varchar(255) NOT NULL,
   state varchar(255) NOT NULL,
   zip varchar(255) NOT NULL,
   fk_country tinyint(3) unsigned DEFAULT '0' NOT NULL,
   phone varchar(25) NOT NULL,
   email varchar(255) NOT NULL,
   url varchar(255),
   relo tinyint(4) DEFAULT '0' NOT NULL,
   hearabout varchar(150) DEFAULT '0' NOT NULL,
   posted date DEFAULT '0000-00-00' NOT NULL,
   PRIMARY KEY (rid),
   KEY jcode (jcode),
   KEY rid (rid)
)") or die ("Unable to make ".$prefix."_jobuser");
    echo "<br><font class=\"post-sub\">".$prefix."_jobuser Made.</font>";

$result = mysql_query("CREATE TABLE ".$prefix."_jobsalary (
   id int(10) unsigned NOT NULL auto_increment,
   salary varchar(255) NOT NULL,
   PRIMARY KEY (id)
)") or die ("Unable to make ".$prefix."_jobsalary");
    echo "<br><font class=\"post-sub\">".$prefix."_jobsalary Made.</font>";

}
?>
</body>
</html>
Return current item: phprofession job board