[insert_php]
if ($_SERVER[‘REQUEST_METHOD’] == ‘POST’)
{
//form submitted //check if other form details are correct //verify captcha
$f1recaptcha_secret = “6LfQVBMTAAAAAGkk4tUaivf3PKaj5mjCxG9BTlZF”;
$f1response = file_get_contents(“https://www.google.com/recaptcha/api/siteverify?secret=” . $f1recaptcha_secret . “&response=” . $_POST[‘g-recaptcha-response’]);
$f1responses = json_decode($f1response, true);
if($f1responses[“success”] == true)
{
$f1listname= $_POST[‘f1listname’];

if ($_POST[‘f1contact’]==””)
{$f1contact= $f1listname;}
else
{$f1contact =$_POST[‘f1contact’];}
$f1cemail=$_POST[‘f1email’];
$f1phone=$_POST[‘f1phone’];
$f1address=$_POST[‘f1address’];
$f1city = $_POST[‘f1city’];
$f1state = $_POST[‘f1state’];
$f1zip=$_POST[‘f1zip’];
$f1country = $_POST[‘f1country’];
$f1model=$_POST[‘f1model’];
$f1busyear=$_POST[‘f1year’];
$f1busdescription=$_POST[‘f1description’];
$f1price = str_replace(‘$f1’,”,$_POST[‘f1price’]);
//ftp info
$f1ftp_server=”ftp.flxibleowners.org”;
$f1ftp_user_name=”listing@flxibleowners.org”;
$f1ftp_user_pass=”!4busnuts”;
$f1conn_id = ftp_connect($f1ftp_server);
$f1login_result = ftp_login($f1conn_id, $f1ftp_user_name, $f1ftp_user_pass);
//ftp_mkdir ($f1conn_id,listing_images);

//Settings
$f1max_allowed_file_size = 10000; // size in KB
$f1allowed_extensions = array(“JPG”, “JPEG”, “GIF”, “BMP”, “PNG”);

//Validations
$f1coverfile = 1;
$f1add1file = 1;
$f1add2file = 1;
$f1add3file = 1;
$f1add4file = 1;
$f1nocover = 1;
$f1noaddpic1 = 1;
$f1noaddpic2 = 1;
$f1noaddpic3 = 1;
$f1noaddpic4 = 1;
$f1upload_folder = “listing_images/”;
//test for files
if (empty($_FILES[‘f1coverpic’][‘name’])) {
$f1nocover = 0; // No file was selected for upload, your (re)action goes here
}
if (empty($_FILES[‘f1addpic1’][‘name’])) {
$f1noaddpic1 = 0;// No file was selected for upload, your (re)action goes here
}
if (empty($_FILES[‘f1addpic2’][‘name’])) {
$f1noaddpic2 = 0;// No file was selected for upload, your (re)action goes here
}
if (empty($_FILES[‘f1addpic3’][‘name’])) {
$f1noaddpic3 = 0;// No file was selected for upload, your (re)action goes here
}
if (empty($_FILES[‘f1addpic4’][‘name’])) {
$f1noaddpic4 = 0;// No file was selected for upload, your (re)action goes here
}

//if files exist then
if ($f1nocover==1)
{
//Get the uploaded file information
$f1name_of_coverpic_file = strtoupper(basename($_FILES[‘f1coverpic’][‘name’]));
//get the file extension of the file
$f1coverpicFileType = pathinfo($f1upload_folder . $f1name_of_coverpic_file,PATHINFO_EXTENSION);
//get file size
$f1size_of_coverpic_file = $_FILES[“f1coverpic”][“size”]/1024;//size in KBs
//check max size
if($f1size_of_coverpic_file > $f1max_allowed_file_size )
{
$f1coverfile = 0;
$f1uploaderror .= “\n” . $f1name_of_coverpic_file . ” is to large to be loaded.”;
}
//check file is image
$f1checkcover = getimagesize($_FILES[‘f1coverpic’][‘tmp_name’]);
if($f1checkcover !== false) {

} else {
$f1uploaderror .= “\n File ” . $f1coverpicFileType . ” is not an image.”;
$f1coverfile = 0;
}
// Check if file already exists
//if (file_exists($f1upload_folder . $f1name_of_coverpic_file)) {
// echo “\n Sorry, ” . $f1name_of_coverpic_file . ” file already exists.”;
// $f1coverfile = 0;
//}
// Allow certain file formats
if($f1coverpicFileType != “JPG” && $f1coverpicFileType != “png” && $f1coverpicFileType != “jpeg”
&& $f1coverpicFileType != “gif” && $f1coverpicFileType != “bmp”) {
$f1uploaderror .= “\n ” . $f1name_of_coverpic_file .” is not a support file type, only JPG, JPEG, PNG | GIF files are allowed.”;
$f1coverfile = 0;
}
//upload files to ftp site
if ($f1coverfile == 1)
{
if (ftp_put($f1conn_id, $f1upload_folder . $f1name_of_coverpic_file, $_FILES[‘f1coverpic’][‘tmp_name’], FTP_BINARY)) {

} else {
$f1uploaderror .= “\n Sorry, there was an error uploading your file ” . $f1name_of_coverpic_file . “.”;

}
}
}

if ($f1noaddpic1==1)
{
//Get the uploaded file information
$f1name_of_addpic1_file = strtoupper(basename($_FILES[‘f1addpic1’][‘name’]));
//get the file extension of the file
$f1addpic1picFileType = pathinfo($f1upload_folder . $f1name_of_addpic1_file,PATHINFO_EXTENSION);
//get file size
$f1size_of_addpic1_file = $_FILES[“f1addpic1”][“size”]/1024;//size in KBs
//check max size
if($f1size_of_addpic1_file > $f1max_allowed_file_size )
{
$f1add1file = 0;
$f1uploaderror .= “\n” . $f1name_of_addpic1_file . ” is to large to be loaded.”;
}
//check file is image
$f1checkadd1 = getimagesize($_FILES[‘f1addpic1’][‘tmp_name’]);
if($f1checkadd1 !== false) {

} else {
$f1uploaderror .= “\n File ” . $f1addpic1picFileType . ” is not an image.”;
$f1add1file = 0;
}
// Check if file already exists
//if (file_exists($f1upload_folder . $f1name_of_addpic1_file)) {
// echo “\n Sorry, ” . $f1name_of_addpic1_file . ” file already exists.”;
// $f1add1file = 0;
//}
// Allow certain file formats
if($f1addpic1picFileType != “JPG” && $f1addpic1picFileType != “PNG” && $f1addpic1picFileType != “JPEG”
&& $f1addpic1picFileType != “GIF” && $f1addpic1picFileType != “BMP”) {
$f1uploaderror .= “\n ” . $f1name_of_addpic1_file .” is not a support file type, only JPG, JPEG, PNG | GIF files are allowed.”;
$f1add1file = 0;
}
//upload to FTP
if ($f1add1file == 1)
{
if (ftp_put($f1conn_id, $f1upload_folder . $f1name_of_addpic1_file,$_FILES[‘f1addpic1’][‘tmp_name’], FTP_BINARY)) {

} else {
$f1uploaderror .= “\n Sorry, there was an error uploading your file ” . $f1name_of_addpic1_file . “.”;

}
}
}
if ($f1noaddpic2==1)
{
//Get the uploaded file information
$f1name_of_addpic2_file = strtoupper(basename($_FILES[‘f1addpic2’][‘name’]));
//get the file extension of the file
$f1addpic2picFileType = pathinfo($f1upload_folder . $f1name_of_addpic2_file,PATHINFO_EXTENSION);
//get file size
$f1size_of_addpic2_file = $_FILES[“f1addpic2”][“size”]/1024;//size in KBs
//check max size
if($f1size_of_addpic2_file > $f1max_allowed_file_size )
{
$f1add2file = 0;
$f1uploaderror .= “\n” . $f1name_of_addpic2_file . ” is to large to be loaded.”;
}
//check file is image
$f1checkadd2 = getimagesize($_FILES[‘f1addpic2’][‘tmp_name’]);
if($f1checkadd2 !== false) {

} else {
$f1uploaderror .= “\n File ” . $f1addpic2picFileType . ” is not an image.”;
$f1add2file = 0;
}
// Check if file already exists
//if (file_exists($f1upload_folder . $f1name_of_addpic2_file)) {
// echo “\n Sorry, ” . $f1name_of_addpic2_file . ” file already exists.”;
// $f1add2file = 0;
//}
// Allow certain file formats
if($f1addpic2picFileType != “JPG” && $f1addpic2picFileType != “PNG” && $f1addpic2picFileType != “JPEG”
&& $f1addpic2picFileType != “GIF” && $f1addpic2picFileType != “BMP”) {
$f1uploaderror .= “\n ” .$f1name_of_addpic2_file .” is not a support file type, only JPG, JPEG, PNG | GIF files are allowed.”;
$f1add2file = 0;
}
//upload to FTP
if ($f1add2file == 1)
{
if (ftp_put($f1conn_id,$f1upload_folder . $f1name_of_addpic2_file, $_FILES[‘f1addpic2’][‘tmp_name’], FTP_BINARY)) {

} else {
$f1uploaderror .= “\n Sorry, there was an error uploading your file ” . $f1name_of_addpic2_file . “.”;

}
}
}
if ($f1noaddpic3==1)
{
//Get the uploaded file information
$f1name_of_addpic3_file = strtoupper(basename($_FILES[‘f1addpic3’][‘name’]));
//get the file extension of the file
$f1addpic3picFileType = pathinfo($f1upload_folder . $f1name_of_addpic3_file,PATHINFO_EXTENSION);
//get file size
$f1size_of_addpic3_file = $_FILES[“f1addpic3”][“size”]/1024;//size in KBs
//check max size
if($f1size_of_addpic3_file > $f1max_allowed_file_size )
{
$f1add3file = 0;
$f1uploaderror .= “\n” . $f1name_of_addpic3_file . ” is to large to be loaded.”;
}
//check file is image
$f1checkadd3 = getimagesize($_FILES[‘f1addpic3’][‘tmp_name’]);
if($f1checkadd3 !== false) {

} else {
$f1uploaderror .= “\n File ” . $f1addpic3picFileType . ” is not an image.”;
$f1add3file = 0;
}
// Check if file already exists
//if (file_exists($f1upload_folder . $f1name_of_addpic3_file)) {
// echo “\n Sorry, ” . $f1name_of_addpic3_file . ” file already exists.”;
// $f1add3file = 0;
//}
// Allow certain file formats
if($f1addpic3picFileType != “JPG” && $f1addpic3picFileType != “PNG” && $f1addpic3picFileType != “JPEG”
&& $f1addpic3picFileType != “GIF” && $f1addpic3picFileType != “BMP”) {
$f1uploaderror .= “\n ” . $f1name_of_addpic3_file .” is not a support file type, only JPG, JPEG, PNG | GIF files are allowed.”;
$f1add3file = 0;
}
//upload to FTP
if ($f1add3file == 1)
{
if (ftp_put($f1conn_id, $f1upload_folder . $f1name_of_addpic3_file, $_FILES[‘f1addpic3’][‘tmp_name’], FTP_BINARY)) {

} else {
$f1uploaderror .= “\n Sorry, there was an error uploading your file ” . $f1name_of_addpic3_file . “.”;

}
}
}
if ($f1noaddpic4==1)
{
//Get the uploaded file information
$f1name_of_addpic4_file = strtoupper(basename($_FILES[‘f1addpic4’][‘name’]));
//get the file extension of the file
$f1addpic4picFileType = pathinfo($f1upload_folder . $f1name_of_addpic4_file,PATHINFO_EXTENSION);
//get file size
$f1size_of_addpic4_file = $_FILES[“f1addpic4”][“size”]/1024;//size in KBs
//check max size
if($f1size_of_addpic4_file > $f1max_allowed_file_size )
{
$f1add4file = 0;
$f1uploaderror .= “\n” . $f1name_of_addpic4_file . ” is to large to be loaded.”;
}
//check file is image
$f1checkadd4 = getimagesize($_FILES[‘f1addpic4’][‘tmp_name’]);
if($f1checkadd4 !== false) {

} else {
$f1uploaderror .= “\n File ” . $f1addpic4picFileType . ” is not an image.”;
$f1add4file = 0;
}

// Check if file already exists
//if (file_exists($f1upload_folder . $f1name_of_addpic4_file)) {
// echo “\n Sorry, ” . $f1name_of_addpic4_file . ” file already exists.”;
// $f1add4file = 0;
//}
// Allow certain file formats
if($f1addpic4picFileType != “JPG” && $f1addpic4picFileType != “PNG” && $f1addpic4picFileType != “JPEG”
&& $f1addpic4picFileType != “GIF” && $f1addpic4picFileType != “BMP”) {
$f1uploaderror .= “\n ” . $f1name_of_addpic4_file .” is not a support file type, only JPG, JPEG, PNG | GIF files are allowed.”;
$f1add4file = 0;
}
//upload to FTP
if ($f1add4file == 1)
{
if (ftp_put($f1conn_id, $f1upload_folder . $f1name_of_addpic4_file, $_FILES[‘f1addpic4’][‘tmp_name’], FTP_BINARY)) {

} else {
$f1uploaderror .= “\n Sorry, there was an error uploading your file ” . $f1name_of_addpic4_file . “.”;

}
}

}

ftp_close($f1conn_id);

//send email
$f1mailsend=’Y’;
if ($f1mailsend ==”Y”) {
$f1to = “adoptaflx@flxibleowners.org”;
$f1noreply = “noreply@flxibleowners.org”;
$f1from = $f1cemail;
$f1mailfirst_name = $f1listname;
$f1subject = “New Flxible Bus Listing”;
$f1messagecopy1 = $f1mailfirst_name . ” would like to list the following bus for sale:” . “\n\n” . “Contact Name: ” . $f1contact . “\n\n” . “Phone: ” . $f1phone . “\n\n” . “Email: ” . $f1cemail . “\n\n” . “City: ” . $f1city . “\n\n” . “State: ” . $f1state . “\n\n” . “Zip Code: ” . $f1zip . “\n\n” . “Country: ” .$f1country . “\n\n” . “Bus Model: ” . $f1model . “\n\n” . “Bus Birth Year: ” . $f1busyear . “\n\n” . “Bus Description: ” . $f1busdescription . “\n\n” . “Asking Price: ” . “$” . $f1price . “\n\n” . “If any pictures were uploaded, they will be in the listing_images folder for the FTP user listing@flxibleowners.org.” . “\n” . “File names are: ” . “\n” . “Cover Picture: ” . $f1name_of_coverpic_file . “\n” . $f1name_of_addpic1_file . “\n” . $f1name_of_addpic2_file . “\n” . $f1name_of_addpic3_file . “\n” . $f1name_of_addpic4_file;

$f1messagecopy = “Thanks for contacting us. We will be working on getting your bus listed shortly. If you have any questions or need to change any of the information below, please contact us at adoptaflx@flxibleowners.org.” . “\n\n” . “Contact Name: ” . $f1contact . “\n\n” . “Phone: ” . $f1phone . “\n\n” . “Email: ” . $f1cemail . “\n\n” . “City: ” . $f1city . “\n\n” . “State: ” . $f1state . “\n\n” . “Zip Code: ” . $f1zip . “\n\n” . “Country: ” .$f1country . “\n\n” . “Bus Model: ” . $f1model . “\n\n” . “Bus Birth Year: ” . $f1busyear . “\n\n” . “Bus Description: ” . $f1busdescription . “\n\n” . “Asking Price: ” . “$” . $f1price . “\n\nThanks\nAdopt-A-Flx\nhttp://www.flxibleowners.org”;

$f1headers = “From:” . $f1from;
$f1headers2 = “From:” . $f1noreply;
mail($f1to,$f1subject,$f1messagecopy1,$f1headers);
mail($f1from,$f1subject,$f1messagecopy,$f1headers2); }
$f1successful = ”

Thanks for listing your bus with us. We will get your bus listed shortly, you will receive a confirmation email from us as well.

” . $f1uploaderror . “

” . “\n”;
} else {
//print_r ($f1responses);
$f1successful = ”

Submit Failed, Please confirm you are not a robot.

” . “\n”;
}
echo $f1successful;

}
[/insert_php]

Flxible Bus Listing

To create a listing for your bus, please fill out the information below and wee will add the information to our Adopt-a-Flx page.

Your Name:*
Name of Contact Person (Leave empty if same as above):
Contact Phone Number:*
Contact Email Address:*
Address:
Street Address (Not Displayed in Listing)*

City*

State / Province / Region*

Postal/ Zip Code*

Country / Region*
Check box to confirm Bus is located at the address listed above:*
Bus Model:*
Bus Birth Year:*
Please describe the bus, and give a clear indication of the
condition it’s in. Be as detailed and honest as possible.
Include whether it has an interior, and if it’s a seated coach
or a motorhome conversion. List as many specs as you know:*
Asking Price:*

All pictures uploaded of the bus are required to be one of the following extensions and under 10MBs: (jpg, jpeg, gif, bmp, png). All other extensions will not be uploaded.

Upload Cover Picture:
Additional Pic 1:
Additional Pic 2:
Additional Pic 3:
Additional Pic 4:

 

* Indicates all required fields.