public function Addphoto($dataForm, $photoId = '') { global $mySession; $db = new Db(); if ($dataForm['photo_path2'] != "") { $photoname = explode('.', $dataForm['photo_path2']); $len = count($photoname); $extension = $photoname[$len - 1]; $datetime = date(d . m . y_h . i . s); $new_name = $datetime . '.' . $extension; rename(SITE_ROOT . 'photo/' . $dataForm['photo_path2'], SITE_ROOT . 'photo/' . $new_name); $data_update['photo_path'] = $new_name; } $data_update['photo_title'] = $dataForm['photo_title']; $data_update['photo_description'] = $dataForm['photo_description']; $data_update['photo_status'] = $dataForm['photo_status']; $data_update['website_id'] = $mySession->WebsiteId; if ($photoId != "") { $condition = 'photo_id=' . $photoId; $result = $db->modify(PHOTO, $data_update, $condition); } else { $result = $db->save(PHOTO, $data_update); } return 1; }
public function saveReview($dataForm) { global $mySession; $db = new Db(); $data_update = array(); $chckArr = $db->runQuery("select * from " . PROPERTY . " where propertycode = '" . trim($dataForm['ppty_no']) . "' and status = '3'"); if (count($chckArr) > 0 && $chckArr != "") { $data_update['guest_name'] = $dataForm['full_name']; $data_update['location'] = $dataForm['location']; $check_in = explode("/", $dataForm['check_in']); $data_update['check_in'] = date('Y-m-d', strtotime($check_in[2] . "-" . $check_in[1] . "-" . $check_in[0])); $data_update['rating'] = $dataForm['rating']; $data_update['user_id'] = $mySession->LoggedUserId; $data_update['headline'] = $dataForm['headline']; $data_update['comment'] = $dataForm['comment']; $data_update['review'] = $dataForm['review']; $data_update['uType'] = $mySession->LoggedUserType == '1' ? "1" : "0"; $data_update['review_date'] = date("Y-m-d"); $data_update["property_id"] = $chckArr[0]['id']; $data_update['guest_image'] = $mySession->LoggedUser['image']; copy(SITE_ROOT . "images/" . $mySession->LoggedUser['image'], SITE_ROOT . "images/profile/" . $mySession->LoggedUser['image']); $db->save(OWNER_REVIEW, $data_update); $review_id = $db->lastInsertId(); //====== code to enter new latest review properties =============== //two cases are there //1. if already an entry is there within latest reviews //2. first entry is made for specific property $reviewPptyArr = $db->runQuery("select * from " . LATEST_REVIEW . " where r_property_id = '" . $chckArr[0]['id'] . "' "); //case 1 if (count($reviewPptyArr) > 0 && $reviewPptyArr != "") { $db->delete(LATEST_REVIEW, "r_id = " . $reviewPptyArr[0]['r_id']); $updateData = array(); $updateData['r_order'] = new Zend_Db_Expr('r_order-1'); $db->modify(LATEST_REVIEW, $updateData, "r_order > " . $reviewPptyArr[0]['r_order']); } else { $updateData = array(); $updateData['r_order'] = new Zend_Db_Expr('r_order+1'); $db->modify(LATEST_REVIEW, $updateData); $saveData = array(); $saveData['r_property_id'] = $chckArr[0]['id']; $saveData['r_order'] = '1'; //$saveData['r_review_id'] = $review_id; $saveData['r_status'] = '1'; $db->save(LATEST_REVIEW, $saveData); } //----------------------------------------------------------------- return 1; } else { return 0; } }
public function Savesubcategory($dataForm) { //echo 'hello'; exit(); global $mySession; $db = new Db(); $dataForm = SetupMagicQuotes($dataForm); // echo $sql="select * from ".SERVICE_CATEGORIES." where cat_id='".$dataForm['category']."'";exit(); // $catedata=$db->runQuery($sql); //$cateid=$catedata[0]['cat_id']; // echo "select * from ".SUBCATE." where subcate_name='".$dataForm['subcate_name']."' and cat_id=".$dataForm['category'];exit(); $chkQry = $db->runQuery("select * from " . SUBCATE . " where subcate_name='" . $dataForm['subcate_name'] . "' and cat_id=" . $dataForm['category']); if ($chkQry != "" and count($chkQry) > 0) { return 0; } else { if ($dataForm['subcate_image'] != "") { $SubCatImage = time() . "_" . $dataForm['subcate_image']; @rename(SITE_ROOT . 'images/Subcate/' . $dataForm['subcate_image'], SITE_ROOT . 'images/Subcate/' . $SubCatImage); $dataInsert['subcate_img_path'] = $SubCatImage; } $dataInsert['subcate_name'] = $dataForm['subcate_name']; $dataInsert['cat_id'] = $dataForm['category']; $dataInsert['subcate_status'] = '0'; // prd($dataInsert); $db->save(SUBCATE, $dataInsert); return 1; } }
public function saveAttribute($dataForm, $attributeId = "") { global $mySession; $db = new Db(); $dataForm = SetupMagicQuotesTrim($dataForm); if ($attributeId == "") { $chkQry = $db->runQuery("select * from " . ATTRIBUTE . " where attribute_name like '%" . mysql_escape_string(trim($dataForm['attribute_name'])) . "' "); if ($chkQry != "" and count($chkQry) > 0) { //if Same Question exists than return false / 0 // No Data Inserted return 0; } else { $data = array(); $data['attribute_name'] = $dataForm['attribute_name']; $data['attribute_status'] = $dataForm['attribute_status']; $db->save(ATTRIBUTE, $data); $latestId = $db->lastInsertId(); return 1; } } else { $chkQry = $db->runQuery("select * from " . ATTRIBUTE . " where attribute_name like '%" . mysql_escape_string(trim($dataForm['attribute_name'])) . "' and attribute_id != '" . $attributeId . "' "); if ($chkQry != "" and count($chkQry) > 0) { //if Same Question exists than return false / 0 // No Data Inserted return 0; } else { $data = array(); $data['attribute_name'] = $dataForm['attribute_name']; $data['attribute_status'] = $dataForm['attribute_status']; $condition = "attribute_id = " . $attributeId; $db->modify(ATTRIBUTE, $data, $condition); return 1; } } }
public function SaveThread($dataForm) { global $mySession; $db = new Db(); $db->save(FORUM_THREADS, $dataForm); return 1; }
public function Addvideo($dataForm, $videoId = '') { global $mySession; $db = new Db(); $data_update['video_type'] = $dataForm['video_type']; if ($dataForm['video_path1'] != "") { $data_update['video_path'] = $dataForm['video_path1']; } else { if ($dataForm['video_path2'] != "") { $videoname = explode('.', $dataForm['video_path2']); $len = count($videoname); $extension = $videoname[$len - 1]; $datetime = date(d . m . y_h . i . s); $new_name = $datetime . '.' . $extension; rename(SITE_ROOT . 'video/' . $dataForm['video_path2'], SITE_ROOT . 'video/' . $new_name); $data_update['video_path'] = $new_name; } } $data_update['video_title'] = $dataForm['video_title']; $data_update['video_description'] = $dataForm['video_description']; $data_update['video_status'] = $dataForm['video_status']; $data_update['featured_status'] = $dataForm['featured_status']; $data_update['website_id'] = $mySession->WebsiteId; if ($videoId != "") { //print_r($data_update);die; $condition = 'video_id=' . $videoId; $result = $db->modify(VIDEO, $data_update, $condition); } else { $result = $db->save(VIDEO, $data_update); } return 1; }
public function saveSpeccat($dataForm, $cId = "") { global $mySession; $db = new Db(); if ($cId == "") { $chkQry = $db->runQuery("select * from " . PROPERTY_SPEC_CAT . " where cat_name = '" . mysql_escape_string(trim($dataForm['category'])) . "' "); if ($chkQry != "" and count($chkQry) > 0) { return 0; } else { $data_update['cat_name'] = $dataForm['category']; $data_update['cat_status'] = $dataForm['status']; $db->save(PROPERTY_SPEC_CAT, $data_update); return 1; } } else { $chkQry = $db->runQuery("select * from " . PROPERTY_SPEC_CAT . " where cat_name = '" . mysql_escape_string(trim($dataForm['category'])) . "' and cat_id != '" . $cId . "'"); if ($chkQry != "" and count($chkQry) > 0) { //if Property Type Name is exists than return false / 0 // No Data Inserted return 0; } else { $data_update['cat_name'] = $dataForm['category']; $data_update['cat_status'] = $dataForm['status']; $condition = " cat_id = " . $cId; $result = $db->modify(PROPERTY_SPEC_CAT, $data_update, $condition); return 1; } } }
public function Saveclassified($dataForm) { global $mySession; $db = new Db(); $dataForm = SetupMagicQuotes($dataForm); $chkQry = $db->runQuery("select * from " . CLASSIFIED . " where c_name='" . $dataForm['c_name'] . "' and cat_id=" . $dataForm['cat_id']); if ($chkQry != "" and count($chkQry) > 0) { return 0; } else { $date1 = date('Y-m-d'); $dataInsert['c_name'] = $dataForm['c_name']; $dataInsert['cat_id'] = $dataForm['cat_id']; $dataInsert['price'] = $dataForm['price']; $dataInsert['location'] = $dataForm['location']; $dataInsert['description'] = $dataForm['description']; $dataInsert['zipcode'] = $dataForm['zipcode']; $dataInsert['date_posted'] = $date1; if ($mySession->LoggedUserId == 0 && $mySession->LoggedUserId == "") { $dataInsert['user_id'] = 0; } // prd($dataInsert); $db->save(CLASSIFIED, $dataInsert); return 1; } }
public function savereview($dataForm, $ptyleId = "") { global $mySession; $db = new Db(); if ($ptyleId == "") { $data_update['review'] = $dataForm['review']; $data_update['comment'] = $dataForm['comment']; $data_update['review_status'] = $dataForm['status']; $db->save(OWNER_REVIEW, $data_update); return 1; } else { $data_update = array(); $data_update['guest_name'] = $dataForm['full_name']; $data_update['location'] = $dataForm['location']; // $data_update['review_date'] = $dataForm['check_in']; $data_update['check_in'] = $dataForm['check_in']; $data_update['review'] = $dataForm['review']; $data_update['rating'] = $dataForm['rating']; $data_update['headline'] = $dataForm['headline']; $data_update['comment'] = $dataForm['comment']; $data_update['review_status'] = $dataForm['status']; $condition = " review_id = '" . $ptyleId . "' "; $result = $db->modify(OWNER_REVIEW, $data_update, $condition); return 1; } }
public function saveProtype($dataForm, $ptyleId = "") { global $mySession; $db = new Db(); $data_update['ptyle_name'] = $dataForm['ptyle_name']; if ($ptyleId == "") { $chkQry = $db->runQuery("select * from " . PROPERTYTYPE . " where ptyle_name='" . mysql_escape_string(trim($dataForm['ptyle_name'])) . "'"); if ($chkQry != "" and count($chkQry) > 0) { //if Property Type Name is exists than return false / 0 // No Data Inserted return 0; } else { # If Property Type Name Not Already Exista. # Insert New Record Into Database $db->save(PROPERTYTYPE, $data_update); return 1; } } else { $chkQry = $db->runQuery("select * from " . PROPERTYTYPE . " where ptyle_name='" . mysql_escape_string(trim($dataForm['ptyle_name'])) . "' and ptyle_id!=" . $ptyleId); if ($chkQry != "" and count($chkQry) > 0) { return 0; } else { $condition = 'ptyle_id=' . $ptyleId; $result = $db->modify(PROPERTYTYPE, $data_update, $condition); return 1; } } }
public function SaveThread($dataForm, $thread_userId) { global $mySession; $db = new Db(); $Datainsert['topic_id'] = $dataForm['topic_id']; $Datainsert['thread_id'] = $dataForm['thread_id']; $Datainsert['replyof'] = $dataForm['replyof']; $Datainsert['user_id'] = $dataForm['user_id']; $Datainsert['date_posted'] = $dataForm['date_added']; $Datainsert['post_text'] = $dataForm['post_text']; $db->save(FORUM_POSTS, $Datainsert); $threadcommentuser = $db->runQuery("select * from " . FORUM_POSTS . " AS TP inner join " . USERS . " AS U \n\t\t\t\t\t\t\t\tON TP.user_id=U.user_id where TP.user_id=" . $dataForm['user_id'] . ""); $comment_user = $threadcommentuser[0]['first_name'] . $threadcommentuser[0]['last_name']; $userData = $db->runQuery("select * from " . FORUM_THREADS . " AS T inner join " . USERS . " AS U \n\t\t\t\t\t\t\t\tON T.user_id=U.user_id where T.thread_id=" . $dataForm['thread_id'] . ""); $fullName = $userData[0]['first_name'] . $userData[0]['last_name']; $commentuser = $comment_user; $useremail = $userData[0]['email_address']; $threadtitle = $userData[0]['thread_text']; $templateData = $db->runQuery("select * from " . EMAIL_TEMPLATES . " where template_id='5'"); $messageText = $templateData[0]['email_body']; $subject = $templateData[0]['email_subject']; $messageText = str_replace("[USERNAME]", $fullName, $messageText); $messageText = str_replace("[THREADTITLE]", $threadtitle, $messageText); $messageText = str_replace("[COMMENTUSERNAME]", $commentuser, $messageText); $messageText = str_replace("[SITENAME]", SITE_NAME, $messageText); SendEmail($useremail, $subject, $messageText); return 1; }
public function saveCurrency($dataForm, $currencyId = "") { global $mySession; $db = new Db(); $data_update['currency_name'] = trim($dataForm['currency_name']); $data_update['currency_code'] = strtoupper(trim($dataForm['currency_code'])); $data_update['exchange_rate'] = $dataForm['exchange_rate']; $maxquery = $db->runQuery("select max(currency_order) as MAX from " . CURRENCY . " "); if ($currencyId == "") { $currencyId = 0; } $chkQry2 = $db->runQuery("select * from " . CURRENCY . " where currency_code='" . mysql_escape_string(trim($data_update['currency_code'])) . "' and currency_id!=" . $currencyId); if ($chkQry != "" and count($chkQry) > 0) { return 0; } else { if ($currencyId > 0) { $condition = 'currency_id=' . $currencyId; $db->modify(CURRENCY, $data_update, $condition); return 1; } else { $data_update['currency_order'] = $maxquery[0]['MAX'] + 1; $db->save(CURRENCY, $data_update); return 1; } } }
public function SavePost($dataForm) { //echo "hello"; exit(); global $mySession; $db = new Db(); prd($dataForm); $db->save(BLOG_POST, $dataForm); return 1; }
public function SaveThread($dataForm) { global $mySession; $db = new Db(); //print_r($dataForm);die; $Datainsert['topic_id'] = $dataForm['topic_id']; $Datainsert['user_id'] = $dataForm['user_id']; $Datainsert['date_added'] = $dataForm['date_added']; $Datainsert['thread_text'] = $dataForm['thread_text']; $db->save(FORUM_THREADS, $Datainsert); return 1; }
public function SavePackage($dataForm) { global $mySession; $db = new Db(); $dataInsert['plan_name'] = $dataForm['plan_name']; $dataInsert['plan_type'] = $dataForm['option']; $dataInsert['plan_duration'] = $dataForm['plan_duration']; $dataInsert['plan_price'] = $dataForm['plan_price']; $dataInsert['plan_status'] = $dataForm['plan_status']; $dataInsert['package_date'] = date('Y-m-d H:i:s'); $db->save(PACKAGES, $dataInsert); return 1; }
public function SaveCategory($dataForm) { global $mySession; $db = new Db(); $chkQry = $db->runQuery("select * from " . PAGE_CAT . " where category_name='" . $dataForm['cat_name'] . "'"); if ($chkQry != "" and count($chkQry) > 0) { return 0; } else { $dataInsert['category_name'] = $dataForm['cat_name']; $db->save(PAGE_CAT, $dataInsert); return 1; } }
public function SavePhoto($dataForm) { global $mySession; $db = new Db(); $imageNewName = time() . "_" . $dataForm['photo_path']; @rename(SITE_ROOT . 'images/photos/' . $dataForm['photo_path'], SITE_ROOT . 'images/photos/' . $imageNewName); $dataInsert['user_id'] = $mySession->LoggedUserId; $dataInsert['photo_title'] = $dataForm['photo_title']; $dataInsert['photo_path'] = $imageNewName; //$dataInsert['date_uploaded']=date('Y-m-d H:i:s'); //$dataInsert['photo_status']='1'; $db->save(PHOTOGALLERY1, $dataInsert); return true; }
public function SaveGenre($dataForm) { global $mySession; $db = new Db(); $chkQry = $db->runQuery("select * from " . GENRE . " where genre_name='" . $dataForm['genrename'] . "'"); if ($chkQry != "" and count($chkQry) > 0) { return 0; } else { $dataInsert['genre_name'] = $dataForm['genrename']; $dataInsert['genre_status'] = $dataForm['genrestatus']; $db->save(GENRE, $dataInsert); return 1; } }
public function SaveTopic($dataForm) { global $mySession; $db = new Db(); $chkQry = $db->runQuery("select * from " . FORUM_TOPICS . " where topic_title='" . $dataForm['topic_title'] . "'"); if ($chkQry != "" and count($chkQry) > 0) { return 0; } else { $dataInsert['topic_title'] = $dataForm['topic_title']; $dataInsert['topic_description'] = $dataForm['topic_description']; $dataInsert['topic_status'] = $dataForm['topic_status']; $db->save(FORUM_TOPICS, $dataInsert); return 1; } }
public function saveSize($dataForm, $sno = 0) { global $mySession; $db = new Db(); $dataUpdate['size'] = $dataForm['sizes']; $dataUpdate['size_inch'] = $dataForm['ininches']; $res = false; if ($sno && (int) $sno > 0) { $condition = "sizeid='" . (int) $sno . "'"; $res = $db->modify(TSHIRT_SIZE, $dataUpdate, $condition); } else { $res = $db->save(TSHIRT_SIZE, $dataUpdate); } return $res; }
public function SaveImage($dataForm) { //echo "dafds"; die; global $mySession; $db = new Db(); $sql = "select * from " . ADMINPOST . " where image='" . $dataForm['image'] . "'"; $chkQry = $db->runQuery($sql); if ($chkQry != "" and count($chkQry) > 0) { return 0; } else { $dataInsert['image'] = $dataForm['image']; $db->save(ADMINPOST, $dataInsert); return 1; } }
public function SaveColor($dataForm) { global $mySession; $db = new Db(); $chkQry = $db->runQuery("select * from " . COLOR . " where color_code='" . $dataForm['color_code'] . "'"); if ($chkQry != "" and count($chkQry) > 0) { return 0; } else { $dataInsert['color_name'] = $dataForm['colorname']; $dataInsert['color_code'] = $dataForm['colorcode']; $dataInsert['color_status'] = $dataForm['colorstatus']; $db->save(COLOR, $dataInsert); return 1; } }
public function SaveBlog($dataForm) { global $mySession; $db = new Db(); $dataInsert['post_image'] = $dataForm['image']; $dataInsert['look_name'] = $dataForm['lookname']; $dataInsert['look_desc'] = $dataForm['look_description']; $dataInsert['color_image'] = $dataForm['colorcode']; $dataInsert['user_id'] = '0'; $dataInsert['date'] = date('Y-m-d H:i:s'); //$dataInsert['date']=date('d:m:y'); $dataInsert['look_status'] = $dataForm['color_status']; $db->save(POSTS, $dataInsert); return 1; }
public function SaveNews($dataForm) { global $mySession; $db = new Db(); // $dataInsert['posted_on']=date('Y-m-d',strtotime($dataForm['posted_on'])); $dataInsert['posted_on'] = date('Y-m-d'); $dataInsert['subject'] = $dataForm['subject']; $dataInsert['news_update'] = $dataForm['news']; $chkQry = $db->runQuery("select * from " . NEWS . " where posted_on='" . $dataInsert['posted_on'] . "'"); if ($chkQry != "" and count($chkQry) > 0) { return 0; } else { $db->save(NEWS, $dataInsert); return 1; } }
public function SaveIcons($dataForm) { global $mySession; $db = new Db(); $profileImage = $dataForm['image']; if ($dataForm['image'] != "") { $profileImage = time() . "_" . $profileImage; @rename(SITE_ROOT . 'images/tshirt-icons/' . $dataForm['image'], SITE_ROOT . 'images/tshirt-icons/' . $profileImage); } $dataInsert['icon'] = $profileImage; $dataInsert['title'] = $dataForm['title']; $dataInsert['status'] = 1; $dataInsert['date_added'] = date('y-m-d'); //prd($dataInsert); $db->save(TSHIRT_ICONS, $dataInsert); return 1; }
public function saveSubscription($dataForm, $subscriptionId = "") { global $mySession; $db = new Db(); $dataForm = SetupMagicQuotesTrim($dataForm); if (empty($subscriptionId)) { $data = array(); //code for inserting order $db->save("subscriber", $dataForm); $latestId = $db->lastInsertId(); return 1; } else { $condition = "subscriber_id = " . $subscriptionId; $db->modify("subscriber", $dataForm, $condition); return 2; } }
public function SaveBlog($dataForm) { global $mySession; $db = new Db(); $sql = "select * from " . BLOGPOST . " where blog_image='" . $dataForm['image'] . "'"; $chkQry = $db->runQuery($sql); if ($chkQry != "" and count($chkQry) > 0) { return 0; } else { $dataInsert['blog_image'] = $dataForm['image']; } $dataInsert['blog_title'] = $dataForm['blogtitle']; $dataInsert['blog_desc'] = $dataForm['blog_description']; $dataInsert['blog_status'] = $dataForm['blog_status']; $dataInsert['blog_date'] = date('Y-m-d H:i:s'); $db->save(BLOGPOST, $dataInsert); return 1; }
public function SaveSub($dataForm) { global $mySession; $db = new Db(); $value = $_POST['plan']; $dataForm = SetupMagicQuotes($dataForm); $chkQry = $db->runQuery("select * from " . SUBSCRIPTION . " where email_address='" . $dataForm['email_address'] . "'"); if ($chkQry != "" and count($chkQry) > 0) { return 0; } else { $dataInsert['first_name'] = $dataForm['first_name']; $dataInsert['last_name'] = $dataForm['last_name']; $dataInsert['email_address'] = $dataForm['email_address']; $dataInsert['username'] = $dataForm['username']; $dataInsert['password'] = md5($dataForm['password_o']); $dataInsert['address'] = $dataForm['address']; $dataInsert['country_id'] = $dataForm['country_id']; //$dataInsert['state_id']=$dataForm['state_id']; //$dataInsert['city_id']=$dataForm['city_id']; $dataInsert['zipcode'] = $dataForm['zipcode']; $dataInsert['phone_number'] = $dataForm['phone_number']; $dataInsert['mobile_number'] = $dataForm['mobile_number']; $dataInsert['id'] = $value; $dataInsert['date_joined'] = date('Y-m-d H:i:s'); $dataInsert['user_status'] = '1'; $dataInsert['user_type'] = $dataForm['signup_type']; $db->save(USERS, $dataInsert); $UserId = $db->lastInsertId(); //code to send registration email $fullName = $dataForm['first_name'] . ' ' . $dataForm['last_name']; $Url = '<a href="' . APPLICATION_URL . '">' . APPLICATION_URL . '</a>'; $templateData = $db->runQuery("select * from " . EMAIL_TEMPLATES . " where template_id='2'"); $messageText = $templateData[0]['email_body']; $subject = $templateData[0]['email_subject']; $messageText = str_replace("[NAME]", "<strong>" . $fullName . "</strong>", $messageText); $messageText = str_replace("[SITENAME]", "<strong>" . SITE_NAME . "</strong>", $messageText); $messageText = str_replace("[LOGINNAME]", "<strong>" . $dataForm['username'] . "</strong>", $messageText); $messageText = str_replace("[PASSWORD]", "<strong>" . $dataForm['password_o'] . "</strong>", $messageText); $messageText = str_replace("[SITEURL]", "<strong>" . $Url . "</strong>", $messageText); SendEmail($dataForm['email_address'], $subject, $messageText); //code to send registration email return $UserId; } }
public function SaveCategory($dataForm) { global $mySession; $db = new Db(); $chkQry = $db->runQuery("select * from " . CATEGORIES . " where perent_id=" . $dataForm['perent_id'] . " and category_name='" . $dataForm['category_name'] . "'"); if ($chkQry != "" and count($chkQry) > 0) { return 0; } else { if (trim($dataForm['photo_path']) !== "") { $Arrpath = explode(".", $dataForm['photo_path']); $imageNewName = time() . "_cat." . $Arrpath[1]; rename(SITE_ROOT . 'images/category/' . $dataForm['photo_path'], SITE_ROOT . 'images/category/' . $imageNewName); $dataForm['cat_image'] = $imageNewName; } unset($dataForm['photo_path']); $db->save(CATEGORIES, $dataForm); return 1; } }
public function SaveVideo($dataForm) { global $mySession; $db = new Db(); if ($dataForm['path_type'] == '1') { $myVideoName = time() . "_" . $dataForm['video_path']; @rename(SITE_ROOT . 'images/videos/' . $dataForm['video_path'], SITE_ROOT . 'images/videos/' . $myVideoName); } else { $myVideoName = $dataForm['you_tube_url']; } $dataInsert['user_id'] = $mySession->LoggedUserId; $dataInsert['video_title'] = $dataForm['video_title']; $dataInsert['path_type'] = $dataForm['path_type']; $dataInsert['video_path'] = $myVideoName; $dataInsert['date_uploaded'] = date('Y-m-d H:i:s'); $dataInsert['video_status'] = '1'; $db->save(VIDEOGALLERY, $dataInsert); return true; }