korsygfhrtzangaiide
Elepffwdsff
/
home3
/
nmslyumy
/
www
/
odishaexpress
/
oe-admin
/
model
/
Upload FileeE
HOME
<?php //save organization if(isset($_POST["save"])) { $its_service=mysqli_escape_string($conn,$_POST["ser"]); $its_city=mysqli_escape_string($conn,$_POST["city"]); $its_name=mysqli_escape_string($conn,$_POST["orgname"]); $its_profimg=$_FILES["pimg"]["name"]; $its_email=mysqli_escape_string($conn,$_POST["email"]); $its_contact1=mysqli_escape_string($conn,$_POST["phno"]); $its_contact2=mysqli_escape_string($conn,$_POST["phno2"]); $its_url=mysqli_escape_string($conn,$_POST["url"]); $its_bimg1=$_FILES["img1"]["name"]; $its_bimg2=$_FILES["img2"]["name"]; $its_bimg3=$_FILES["img3"]["name"]; $its_bimg4=$_FILES["img4"]["name"]; $its_video1=mysqli_escape_string($conn,$_POST["v1"]); $its_video2=mysqli_escape_string($conn,$_POST["v2"]); $its_abt=mysqli_escape_string($conn,$_POST["abt"]); $its_addr=mysqli_escape_string($conn,$_POST["addr"]); $its_map=mysqli_escape_string($conn,$_POST["map"]); $its_date=date("Y-m-d"); $its_mt=mysqli_escape_string($conn,$_POST["mt"]); $its_mk=mysqli_escape_string($conn,$_POST["mk"]); $its_md=mysqli_escape_string($conn,$_POST["md"]); $its_status=mysqli_escape_string($conn,$_POST["st"]); $its_fb=mysqli_escape_string($conn,$_POST["fb"]); $its_tw=mysqli_escape_string($conn,$_POST["tw"]); $its_yt=mysqli_escape_string($conn,$_POST["yt"]); $its_wb=mysqli_escape_string($conn,$_POST["wb"]); $sql="insert into its_org (its_service, its_city, its_name, its_profimg, its_email, its_contact1, its_contact2, its_url, its_bimg1, its_bimg2, its_bimg3, its_bimg4, its_video1, its_video2, its_abt, its_addr, its_date, its_map, its_mt, its_mk, its_md, its_status, its_fb, its_tw, its_yt, its_wb) values ('$its_service', '$its_city', '$its_name', '$its_profimg', '$its_email', '$its_contact1', '$its_contact2', '$its_url', '$its_bimg1', '$its_bimg2', '$its_bimg3', '$its_bimg4', '$its_video1', '$its_video2', '$its_abt', '$its_addr', '$its_date', '$its_map', '$its_mt', '$its_mk', '$its_md', '$its_status', '$its_fb', '$its_tw', '$its_yt', '$its_wb')"; $in=$conn->query($sql); move_uploaded_file($_FILES["pimg"]["tmp_name"],"@upload_img/@organization@/".$_FILES["pimg"]["name"]); move_uploaded_file($_FILES["img1"]["tmp_name"],"@upload_img/@organization@/".$_FILES["img1"]["name"]); move_uploaded_file($_FILES["img2"]["tmp_name"],"@upload_img/@organization@/".$_FILES["img2"]["name"]); move_uploaded_file($_FILES["img3"]["tmp_name"],"@upload_img/@organization@/".$_FILES["img3"]["name"]); move_uploaded_file($_FILES["img4"]["tmp_name"],"@upload_img/@organization@/".$_FILES["img4"]["name"]); if($in){header("Location:home.php?page=org-dt&msg=mtrue");}else{header("Location:home.php?page=org-dt&msg=mfalse");} } //get all data if(!empty($_GET["eid"])){ $ed=$conn->query("SELECT * FROM its_org WHERE its_oid='".$_GET["eid"]."'"); $edt=$ed->fetch_array(); } //update organization if(isset($_POST["update"])) { $its_service=mysqli_escape_string($conn,$_POST["ser"]); $its_city=mysqli_escape_string($conn,$_POST["city"]); $its_name=mysqli_escape_string($conn,$_POST["orgname"]); if(!empty($_FILES["pimg"]["name"])){ $its_profimg=$_FILES["pimg"]["name"]; } else{ $its_profimg=$edt["its_profimg"]; } $its_email=$_POST["email"]; $its_contact1=mysqli_escape_string($conn,$_POST["phno"]); $its_contact2=mysqli_escape_string($conn,$_POST["phno2"]); $its_url=mysqli_escape_string($conn,$_POST["url"]); if(!empty($_FILES["img1"]["name"])){ $its_bimg1=$_FILES["img1"]["name"];}else{$its_bimg1=$edt["its_bimg1"];} if(!empty($_FILES["img2"]["name"])){ $its_bimg2=$_FILES["img2"]["name"];}else{$its_bimg2=$edt["its_bimg2"];} if(!empty($_FILES["img3"]["name"])){ $its_bimg3=$_FILES["img3"]["name"];}else{$its_bimg3=$edt["its_bimg3"];} if(!empty($_FILES["img4"]["name"])){ $its_bimg4=$_FILES["img4"]["name"];}else{$its_bimg4=$edt["its_bimg4"];} $its_video1=mysqli_escape_string($conn,$_POST["v1"]); $its_video2=mysqli_escape_string($conn,$_POST["v2"]); $its_abt=mysqli_escape_string($conn,$_POST["abt"]); $its_addr=mysqli_escape_string($conn,$_POST["addr"]); $its_map=mysqli_escape_string($conn,$_POST["map"]); $its_date=date("Y-m-d"); $its_mt=mysqli_escape_string($conn,$_POST["mt"]); $its_mk=mysqli_escape_string($conn,$_POST["mk"]); $its_md=mysqli_escape_string($conn,$_POST["md"]); $its_status=mysqli_escape_string($conn,$_POST["st"]); $its_fb=mysqli_escape_string($conn,$_POST["fb"]); $its_tw=mysqli_escape_string($conn,$_POST["tw"]); $its_yt=mysqli_escape_string($conn,$_POST["yt"]); $its_wb=mysqli_escape_string($conn,$_POST["wb"]); $sql="update its_org set its_service='$its_service', its_city='$its_city', its_name='$its_name', its_profimg='$its_profimg', its_email='$its_email', its_contact1='$its_contact1', its_contact2='$its_contact2', its_url='$its_url', its_bimg1='$its_bimg1', its_bimg2='$its_bimg2', its_bimg3='$its_bimg3', its_bimg4='$its_bimg4', its_video1='$its_video1', its_video2='$its_video2', its_abt='$its_abt', its_addr='$its_addr', its_map='$its_map', its_mt='$its_mt', its_mk='$its_mk', its_md='$its_md', its_status='$its_status', its_fb='$its_fb', its_tw='$its_tw', its_yt='$its_yt', its_wb='$its_wb' WHERE its_oid='".$_GET["eid"]."'"; $in=$conn->query($sql); move_uploaded_file($_FILES["pimg"]["tmp_name"],"@upload_img/@organization@/".$_FILES["pimg"]["name"]); move_uploaded_file($_FILES["img1"]["tmp_name"],"@upload_img/@organization@/".$_FILES["img1"]["name"]); move_uploaded_file($_FILES["img2"]["tmp_name"],"@upload_img/@organization@/".$_FILES["img2"]["name"]); move_uploaded_file($_FILES["img3"]["tmp_name"],"@upload_img/@organization@/".$_FILES["img3"]["name"]); move_uploaded_file($_FILES["img4"]["tmp_name"],"@upload_img/@organization@/".$_FILES["img4"]["name"]); if($in){header("Location:home.php?page=org-dt&msg=mtrue");}else{header("Location:home.php?page=org-dt&msg=mfalse");} } if(!empty($_GET["did"])) { $in=$conn->query("DELETE FROM its_org WHERE its_oid='".$_GET["did"]."'"); if($in){header("Location:home.php?page=org-dt&msg=mtrue");}else{header("Location:home.php?page=org-dt&msg=mfalse");} } ?>