Success !! "; } if($action == 'save') { $startdate = $_POST['sdate']; $date_format = explode('-',$startdate); $sdate = $date_format[2].'-'.$date_format[0].'-'.$date_format[1]; $enddate = $_POST['edate']; $date_format1 = explode('-',$enddate); $edate = $date_format1[2].'-'.$date_format1[0].'-'.$date_format1[1]; $website = $_POST['selWebSite']; $phone = $_POST['selPhone']; $classId = $_POST['boat_class_id']; $boatLength = $_POST['txtBoatLength']; $boatBeam = $_POST['txtBoatBeam']; $maxLoad = $_POST['txtBoatMaxLoad']; $boatLoad = $_POST['txtBoatLoad']; $yearBuilt = $_POST['txtBoatYearBuilt']; $landId = $_POST['landing_id']; $boatBunks = $_POST['txtBoatBunks']; $hotGalley = $_POST['txtHotGalley']; $captains = $_POST['captains']; $owners = $_POST['owners']; $boatMfr = $_POST['selMfr']; $uscg = $_POST['txtUSCG']; if($_FILES['uploadme'] && $_FILES['uploadme']['name'] != "") { $uploadDirectory = "../../../www.sportfishingreport.com/web/content/media/boats/"; system("chmod 777 $uploadDirectory"); $imageFile = $_FILES['uploadme']['name']; $imageFile = str_replace(' ','_',$imageFile); //echo $imageFile; $ori_file_name_upload = $imageFile; $file_name_upload= $uploadDirectory.$imageFile; $copy = move_uploaded_file($_FILES['uploadme']['tmp_name'],$file_name_upload); $dest_image1 = $file_name_upload; $cmd2 = "/usr/bin/convert -resize 250 ". $dest_image1." ". $dest_image1; $result1 = system($cmd2); // echo $file_name_upload; } if($imageFile!='') { $strBoat = "update boats set small_image='$imageFile' where boat_id='$id'"; mysql_query($strBoat); } else { $strBoat="update boats set maxload='$maxLoad', boat_load='$boatLoad', bunks='".$boatBunks."', hot_galley='".$hotGalley."', manufacturer='".$boatMfr."', captains = '".$captains."', owners = '".$owners."', website = '$website', email = '".$_POST[selEmailId]."', phone = '$_POST[selPhone]', start_date = '$sdate', expiration_date = '$edate', sponsor = '$_POST[sponsor]', link_sponsor = '$_POST[sponsor_link]', reports = '$_POST[reports]', counts = '$_POST[count_lan]', scab = '$_POST[scab]', SAC = '$_POST[SAC]', landing_ids = '$_POST[landing_ids]' where boat_id='$id'"; // echo $strBoat; mysql_query($strBoat); } echo "Success !! "; } if($action=='edit') { $id = $_REQUEST[id]; $query = mysql_query("select *,DATE_FORMAT(start_date,'%m-%d-%Y') as sdate, DATE_FORMAT(expiration_date,'%m-%d-%Y') as edate from boats where boat_id=$id"); $rows = mysql_fetch_array($query); $small_image = $rows['small_image']; $large_image = $rows['large_image']; //echo "--->".$small_image; ?>
Edit Boat Details
Name:
Manufacturer:
Year Built:
Length:
Beam:
Landing: ".$rec2['landing'].""; ?>
Maximum Load:
Load:
Bunks:
Hot Galley:
Charter:
Trip Type:
USCG:
Image:  
Long Range:
Owner Name(s):
Captain Name(s):
Email :
Web Site:
Phone:
Sponsor: Yes No Yes No
Link Sponsor: Yes No Yes No
Counts: Yes No Yes No
Reports: Yes No Yes No
Scab: Yes No Yes No
SAC: Yes No Yes No
Start Date:  (mm-dd-YYYY)Format
End Date:  (mm-dd-YYYY)Format
LandingIds: Add More Landings
Boats Listing
Edit Boat Name Length Maxload Captains