decid($trid):''; if($trid==''){ echo ""; exit; } $tr_info = $db->singlerec("select * from trade_shows where status='1' and id='$trid' LIMIT 1"); $country = $db->singlerec("select nicename,iso from countries where id='".$tr_info['country']."' LIMIT 1"); $upd = isset($upd)?$upd:''; $submit = isset($submit)?$submit:''; $id = isSet($id) ? $id : '' ; $act = isSet($act) ? $act : '' ; $page = isSet($page) ? $page : '' ; $Message = isSet($Message) ? $Message : '' ; $title = isSet($title) ? $title : '' ; $rate = isSet($rate) ? $rate : '' ; $review_details = isSet($review_details) ? $review_details : '' ; $crctdate = isSet($crctdate) ? $crctdate : '' ; $img = isSet($img) ? $img : '' ; $ImgExt = isSet($ImgExt) ? $ImgExt : '' ; $UsrImg = isSet($UsrImg) ? $UsrImg : '' ; if($submit) { $crcdt = time(); $user_name= trim(addslashes($user_name)); $title = trim(addslashes($title)); $rate = trim(addslashes($rate)); $review_details = trim(addslashes($review_details)); $checkStatus = $db->check1column("reviews","title",$title); if($upd == 2) $checkStatus = 0; if($_FILES['UsrImg']['tmp_name'] != "" && $_FILES['UsrImg']['tmp_name'] != "null") { $fpath = $_FILES['UsrImg']['tmp_name'] ; $fname = $_FILES['UsrImg']['name'] ; $getext = substr(strrchr($fname, '.'), 1); $ImgExt = strtolower($getext); } if($ImgExt=="jpg" || $ImgExt == "jpeg" || $ImgExt == "gif" || $ImgExt == "png" || $ImgExt == ''){ if($checkStatus == 0){ $set = "title = '$title'"; $set .= ",rate = '$rate'"; $set .=",reviewername = '$user_name'"; $set .= ",review_details = '$review_details'"; $set .= ",item_id = '$trid'"; $set .= ",type = '2'"; $set .= ",crctdate = NOW()"; $set .= ",active_status = '0'"; $idvalue = $db->insertid("insert into reviews set $set"); if($_FILES['UsrImg']['tmp_name'] != "" && $_FILES['UsrImg']['tmp_name'] != "null") { $fpath = $_FILES['UsrImg']['tmp_name'] ; $fname = $_FILES['UsrImg']['name'] ; $getext = substr(strrchr($fname, '.'), 1); $ext = strtolower($getext); $NgImg= $idvalue.".".$ext; $set_img = "img = '$NgImg'" ; $des = "uploads/reviews/$NgImg"; move_uploaded_file($fpath,$des) ; $iimg=$db->insertrec("select img from reviews where id='$idvalue'"); $db->insertrec("update reviews set $set_img where id='$idvalue'"); } echo ""; @header("location:review?act=save"); exit; } else { $id = $idvalue; $Message = "$title Already Exists"; } } else{ $id = $idvalue; $Message = "kindly upload jpg,gif,png image format only"; } } ?>