getimgById($id); $id = safe($_GET['id']); $filePath = PROFILE_IMG_PATH_IMAGE; $filePdf = PROFILE_IMG_PATH_PDF; $fileAudio = PROFILE_IMG_PATH_AUDIO; $btnTxt = (empty($id))? "Add" : "Save"; $userid = $_SESSION['useradmin']['userid']; $request = http_build_query($_POST); //echo $request; $sized = strlen($request); //echo "the size ".$sized; if(!isset($industy_id)) { $industrylist = $comobj->getHtmlListControlData( "industry", "name", "indus_id", "name", "ASC" ); // Get list from database to popul select option } if($_POST['user_add_post']) { /* $rs = $_POST; $title = trim($_POST['title']); $intro_text = trim($_POST['intro_text']); $detail = trim($_POST['detail']); $industry = trim($_POST['industy_id']); $cap1 = trim($_POST['image_caption1']); $cap2 = trim($_POST['image_caption2']); $cap3 = trim($_POST['image_caption3']); $rel_date = $_POST['example1']; // realease date $_POST['pressimage1'] = $profileImage; $_POST['pressimage2'] = $_FILES['press_image2']['name']; $_POST['pressimage3'] = $_FILES['press_image3']['name']; $_POST['userid'] = $userid; */ if($_FILES) { $filepath = $_FILES['press_image1']['tmp_name']; $filepath2 = $_FILES['press_image2']['tmp_name']; $filepath3 = $_FILES['press_image3']['tmp_name']; $filepath4 = $_FILES['audiofile']['tmp_name']; $filepath5 = $_FILES['pdffile']['tmp_name']; //=============================================================================== $filename = $_FILES['press_image1']['name']; $filename2 = $_FILES['press_image2']['name']; $filename3 = $_FILES['press_image3']['name']; $filename4 = $_FILES['audiofile']['name']; $filename5 = $_FILES['pdffile']['name']; //global $profileImage4; $profileImage = $comobj->uploadFile( $filename, $filepath, $filePath, array('jpeg', 'jpg', 'gif') ); $profileImage2 = $comobj->uploadFile( $filename2, $filepath2, $filePath, array('jpeg', 'jpg', 'gif') ); $profileImage3 = $comobj->uploadFile( $filename3, $filepath3, $filePath, array('jpeg', 'jpg', 'gif') ); $profileImage4 = $comobj->uploadFile( $filename4, $filepath4, $fileAudio, array('wma', 'mp3') ); // AUDIO FILE $profileImage5 = $comobj->uploadFile( $filename5, $filepath5, $filePdf , array('pdf') ); // PDF FILE if(!empty($profileImage)) { $img['image'] = $profileImage; @$tn1 = new thumbNail( $img, $filePath, $filePath, 500 ); @$tn2 = new thumbNail( $img, $filePath, $filePath, 250 ); @unlink($filePath.$profileImage); } if(!empty($profileImage2)) { $img['image'] = $profileImage2; @$tn1 = new thumbNail( $img, $filePath, $filePath, 500 ); @$tn2 = new thumbNail( $img, $filePath, $filePath, 250 ); @unlink($filePath.$profileImage2); } if(!empty($profileImage3)) { $img['image'] = $profileImage3; @$tn1 = new thumbNail( $img, $filePath, $filePath, 500 ); @$tn2 = new thumbNail( $img, $filePath, $filePath, 250 ); @unlink($filePath.$profileImage3); } //$_POST['news_image'] = $profileImage; } $error = ""; /* if(empty($title)) { $error .= "Title is required.
"; unset($_POST); } if(empty($intro_text)) { $error .= "Intro text is required.
"; unset($_POST); } if(empty($detail)) { $error .= "Press Release detail is required.
"; unset($_POST); } */ /*if(empty($_POST['news_image'])) { $error .= "News image is required.
"; unset($_POST); }*/ echo "
$error
"; } if($_POST['user_add_post']) { if(empty($id)) { $rs = $_POST; $title = safe(trim($_POST['title'])); $intro_text = safe(trim($_POST['intro_text'])); $detail = safe(trim($_POST['detail'])); $industry = trim($_POST['industy_id']); $cap1 = trim($_POST['image_caption1']); $cap2 = trim($_POST['image_caption2']); $cap3 = trim($_POST['image_caption3']); $_POST['pressimage1'] = $_FILES['press_image1']['name']; $_POST['pressimage2'] = $_FILES['press_image2']['name']; $_POST['pressimage3'] = $_FILES['press_image3']['name']; $_POST['userid'] = $userid; $rel_date = trim($_POST['example1']); // realease date $date_added = date("Y-m-d G:i:s"); // date addedd $video_link = trim($_POST['video_link']); $website_link = trim($_POST['website_link']); $flag = 3; // set back th e flag to pending $flag = 3; // set back th e flag to pending $error = ""; if(empty($title)) { $error .= "You need to Enter a title .
"; unset($_POST['user_add_post']); unset ($rs); } if(empty($intro_text)) { $error .= " You Need To enter an Intro text .
"; unset($_POST['user_add_post']); unset ($rs); } if(empty($rel_date)) { $error .= "Please select a Release Date .
"; unset($_POST['user_add_post']); unset ($rs); } if (isset($_POST['user_add_post'])) { $sql = "INSERT INTO article (userid, title, teaser, details, date, release_date, video, website, articleallow ) VALUES(\"$userid \", \"$title\", \"$intro_text\", \"$detail\", \"$date_added\", \"$rel_date\", \"$video_link\", \"$website_link\", \"$flag\" )"; $result = mysql_query($sql, $con); $artid = mysql_insert_id(); } //echo "ID of last inserted record is: " . mysql_insert_id(); // echo $filepath; //echo $artid; // if (isset($_POST['user_add_post'])) { if ($artid == 0){$notcomp = 1;}else{$notcomp = 0;} // check if the data was saved to the database //} //=========================================INSERTING IMAGES 1 2 3 +++++++++++++++++++++++++++++++++++++++++++++++++++++ if (isset($_POST['user_add_post'])) { if (isset($profileImage)) { $sql2 = "INSERT INTO images ( articleid ,image, caption ) VALUES(\"$artid\", \"$profileImage\", \"$cap1\")"; $result2 = mysql_query($sql2, $con); } if (isset($profileImage2)) { $sql2 = "INSERT INTO images ( articleid ,image, caption ) VALUES(\"$artid\", \"$profileImage2\", \"$cap2\" )"; $result2 = mysql_query($sql2, $con); } if (isset($profileImage3)) { $sql2 = "INSERT INTO images ( articleid ,image, caption) VALUES(\"$artid\", \"$profileImage3\", \"$cap3\" )"; $result2 = mysql_query($sql2, $con); } if (isset($profileImage4)) { $sql2 = "INSERT INTO audio ( articleid ,audiofile) VALUES(\"$artid\", \"$profileImage4\" )"; $result2 = mysql_query($sql2, $con); } if (isset ($profileImage5)) { $sql2 = "INSERT INTO pdf ( articleid , pdffile) VALUES(\"$artid\", \"$profileImage5\" )"; $result2 = mysql_query($sql2, $con); } } } //echo "the art id ".$artid; } if (isset($_POST['user_add_post'])) { $sql_email = "SELECT email FROM user WHERE userid = '$userid' "; $result_email = mysql_query($sql_email, $con); $result_email= mysql_query("SELECT email FROM user WHERE userid = '$userid' "); // get Audio name ffrom database while ($row = mysql_fetch_assoc($result_email)) { $email_user = $row['email']; //========================================================================== $message ="We have received your release. As soon as the release has been reviewed, you will be notified via email. "; $subject = "We have received your release"; //mail( $email_user , "$subject",$message, " From:Releases To Go " . $email); } } $errornotcomp ="Your release was not added, please check your text to ensure that no
improper characters are included in your post, if you are copying and pasting you could paste it directly in the window and the editor will assist you "; include('tpl_addpress.html'); ?>