";
}
function save_file($filepath, $fullfile)
{
if(file_exists("$filepath"))
{
echo "";
}
if($filehandle=fopen("$filepath", "w"))
{
echo "writing file....";
fputs($filehandle, $fullfile);
fclose($filehandle);
}
else
{
error_message("Can't save file");
}
$netpath=str_replace("/home/www/web22/html/","http://www.zappointments.com/",$filepath);
echo "";
}
/////////////BODY/////////////
session_start();
echo "Simple Web Page Builder";
if($_POST['action']=="login_pro")
{
$userProid_f=$_POST['userProid_f'];
$userPropassword_f=$_POST['userPropassword_f'];
$userProprov_f=$_POST['userProprov_f'];
$userlogged=auth_user($userProid_f, $userPropassword_f, $userProprov_f);
$_SESSION['userProid']=$userlogged;
$_SESSION['userProprov']=$userProprov_f;
echo $_SESSION['userProprov'];
editor_form($newfilename);
}
if(!empty($_SESSION['userProid']))
{
if($_SESSION['userProprov']=="BC"){$servProdb="service_providers";}
else if($_SESSION['userProprov']=="AB"){$servProdb="service_providers_ab";}
else if($_SESSION['userProprov']=="SK"){$servProdb="service_providers_sk";}
else if($_SESSION['userProprov']=="MB"){$servProdb="service_providers_mb";}
else if($_SESSION['userProprov']=="ON"){$servProdb="service_providers_on";}
else if($_SESSION['userProprov']=="QC"){$servProdb="service_providers_qc";}
else if($_SESSION['userProprov']=="NS"){$servProdb="service_providers_ns";}
else if($_SESSION['userProprov']=="NB"){$servProdb="service_providers_nb";}
else if($_SESSION['userProprov']=="PE"){$servProdb="service_providers_pe";}
else if($_SESSION['userProprov']=="NL"){$servProdb="service_providers_nl";}
else if($_SESSION['userProprov']=="YK"){$servProdb="service_providers_yk";}
else if($_SESSION['userProprov']=="NW"){$servProdb="service_providers_nw";}
else if($_SESSION['userProprov']=="NV"){$servProdb="service_providers_nv";}
$username=$_SESSION['userProid'];
$userProv=$_SESSION['userProprov'];
$protype=get_type_pro_num($username, $userProv);
$newfilename=get_newfilename($username, $protype);
if($_POST)
{
$action=$_POST['action1'];
switch ($action)
{
case "save_file":
echo "SAVE FILE FUNCTION ACTIVE...";
if($protype==1) $Pro_txt="Psychologist";
else if($protype==2) $Pro_txt="Physiotherapist";
else if($protype==5) $Pro_txt="Occupational Therapist";
else if($protype==6) $Pro_txt="Occupational Rehabilitation Program";
else if($protype==7) $Pro_txt="Pain Program";
else if($protype==8) $Pro_txt="Work Conditioning Program";
else if($protype==11) $Pro_txt="Medical Rehabilitation Program";
else if($protype==9) $Pro_txt="Massage Therapist";
else if($protype==10) $Pro_txt="Counsellor";
else if($protype==3) $Pro_txt="Chiropractor";
else if($protype==4) $Pro_txt="Chinese Medicine Practitioner/Acupuncturist";
else if($protype==12) $Pro_txt="Day Spa";
else if($protype==13) $Pro_txt="Dentist";
else if($protype==14) $Pro_txt="Laser Surgery Clinic";
else if($protype==15) $Pro_txt="Physician";
else if($protype==16) $Pro_txt="Naturopath";
$enhanced_text = "";
$enhanced_text .= $_POST['pagetitle'];
$enhanced_text .= "";
$enhanced_text .= "
";
$enhanced_text .= $_POST['pagetitle'];
$enhanced_text .= "
";
$filebody=$_POST['filebody'];
$filebody=str_replace(";","",$filebody);
$filebody=strip_tags($filebody);
$filebody=str_replace("\n","
",$filebody);
$enhanced_text .= $filebody;
$enhanced_text .= "
";
$enhanced_text .= "";
$enhanced_text .= "Book appointments with this ";
$enhanced_text .= $Pro_txt;
$enhanced_text .= " here";
$enhanced_text .= "";
$enhanced_text .= "";
save_file($newfilename, $enhanced_text);
break;
case "save_pic":
$userfile_name=$_FILES['userfile']['name'];
$userfile_size=$_FILES['userfile']['size'];
$userfile=$_FILES['userfile']['tmp_name'];
if($userfile_size > 200000) die ("File is too big
");
if(isset($WINDIR)) $userfile=str_replace("\\\\","\\", $userfile);
$ofilename=basename($userfile_name);
if($userfile_size <= 0) die ("$ofilename is empty");
$ofilenamearray=explode(".", $ofilename);
$fileextn=array_pop($ofilenamearray);
if($fileextn == "jpg"){$picpath=str_replace(".html",".jpg", $newfilename);}
else if($fileextn == "gif"){$picpath=str_replace(".html",".gif", $newfilename);}
else if($fileextn == "GIF"){$picpath=str_replace(".html",".gif", $newfilename);}
else if($fileextn == "gif89a"){$picpath=str_replace(".html",".gif89a", $newfilename);}
else if($fileextn == "png"){$picpath=str_replace(".html",".png", $newfilename);}
else if($fileextn == "jpeg"){$picpath=str_replace(".html",".jpg", $newfilename);}
else if($fileextn == "JPG"){$picpath=str_replace(".html",".jpg", $newfilename);}
else if($fileextn == ""){$picpath=str_replace(".html","", $newfilename);}
else {die("This site only accepts jpg, gif, png, or gif89a files.");}
if(!@copy($userfile, $picpath)) die ("Can't copy file $picpath!");
if(!isset($WINDIR) && (!@unlink($userfile))) die ("Can't unlink $userfile");
echo "Your file has been uploaded successfully! Use the back button and complete step 2, please.";
break;
default:
editor_form($newfilename);
break;
}//end switch
}///end if post
else {editor_form($newfilename);}
}////end of if session user logged in
else
{
login_form();
}
echo "
";
echo "";
?>