コード例 #1
1
ファイル: Photo.php プロジェクト: ankuradhey/dealtrip
 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;
 }
コード例 #2
0
ファイル: Review.php プロジェクト: ankuradhey/dealtrip
 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;
     }
 }
コード例 #3
0
ファイル: Subscription.php プロジェクト: ankuradhey/dealtrip
 public function UpdateSub($dataForm, $userId)
 {
     global $mySession;
     $db = new Db();
     $dataForm = SetupMagicQuotes($dataForm);
     $chkQry = $db->runQuery("select * from " . SUBSCRIPTION . " where mobile_number='" . $dataForm['mobile_number'] . "' and user_id!='" . $userId . "'");
     if ($chkQry != "" and count($chkQry) > 0) {
         return 0;
     } else {
         $dataUpdate['first_name'] = $dataForm['first_name'];
         $dataUpdate['last_name'] = $dataForm['last_name'];
         $dataUpdate['email_address'] = $dataForm['email_address'];
         $dataUpdate['username'] = $dataForm['username'];
         $dataUpdate['address'] = $dataForm['address'];
         $dataUpdate['country_id'] = $dataForm['country_id'];
         $dataUpdate['state_id'] = $dataForm['state_id'];
         $dataUpdate['city_id'] = $dataForm['city_id'];
         $dataUpdate['zipcode'] = $dataForm['zipcode'];
         $dataUpdate['phone_number'] = $dataForm['phone_number'];
         $dataUpdate['mobile_number'] = $dataForm['mobile_number'];
         $dataUpdate['newsletter_subscribe'] = $dataForm['subscribe'];
         $conditionUpdate = "user_id='" . $userId . "'";
         $db->modify(USERS, $dataUpdate, $conditionUpdate);
         return $userId;
     }
 }
コード例 #4
0
ファイル: Video.php プロジェクト: ankuradhey/dealtrip
 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;
 }
コード例 #5
0
ファイル: Currencies.php プロジェクト: ankuradhey/dealtrip
 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;
         }
     }
 }
コード例 #6
0
ファイル: Post.php プロジェクト: Alexeykolobov/php
 public function UpdateBlog($dataForm, $postid)
 {
     global $mySession;
     $db = new Db();
     //echo $postid; die;
     if ($dataForm['image'] != "" && $dataForm['old_image'] != "") {
         unlink(SITE_ROOT . 'images/postimg/' . $dataForm['old_image']);
     }
     $postimage = $dataForm['old_image'];
     if ($dataForm['image'] != "") {
         $postimage = time() . "_" . $dataForm['image'];
         @rename(SITE_ROOT . 'images/postimg/' . $dataForm['image'], SITE_ROOT . 'images/postimg/' . $postimage);
     }
     $dataUpdate['post_image'] = $postimage;
     $dataUpdate['look_name'] = $dataForm['lookname'];
     $dataUpdate['look_desc'] = $dataForm['look_description'];
     $dataUpdate['color_image'] = $dataForm['colorcode'];
     //$dataUpdate['user_id']='0';
     $dataUpdate['date'] = date('d:m:y');
     $dataUpdate['look_status'] = $dataForm['color_status'];
     $conditionUpdate = "post_id='" . $postid . "'";
     //prd($dataUpdate);
     $db->modify(POSTS, $dataUpdate, $conditionUpdate);
     return 1;
 }
コード例 #7
0
ファイル: Speccat.php プロジェクト: ankuradhey/dealtrip
 public function statusSpeccat($status, $cId)
 {
     global $mySession;
     $db = new Db();
     $data_update['cat_status'] = $status;
     $condition = "cat_id='" . $cId . "'";
     $db->modify(PROPERTY_SPEC_CAT, $data_update, $condition);
 }
コード例 #8
0
ファイル: Message.php プロジェクト: ankuradhey/dealtrip
 public function statusAmenity($status, $ptyleId)
 {
     global $mySession;
     $db = new Db();
     $data_update['amenity_status'] = $status;
     $condition = "amenity_id='" . $ptyleId . "'";
     $db->modify(AMENITY, $data_update, $condition);
 }
コード例 #9
0
ファイル: Spcloffer.php プロジェクト: ankuradhey/dealtrip
 public function statusOffer($status, $sId)
 {
     global $mySession;
     $db = new Db();
     $data_update['status'] = $status;
     $condition = "id='" . $sId . "'";
     $db->modify(SPCL_OFFER_TYPES, $data_update, $condition);
 }
コード例 #10
0
ファイル: Review.php プロジェクト: ankuradhey/dealtrip
 public function statusreview($status, $ptyleId)
 {
     global $mySession;
     $db = new Db();
     $data_update['review_status'] = $status;
     $condition = "review_id='" . $ptyleId . "'";
     $db->modify(OWNER_REVIEW, $data_update, $condition);
 }
コード例 #11
0
ファイル: Attribute.php プロジェクト: ankuradhey/dealtrip
 public function statusAttribute($status, $specId)
 {
     global $mySession;
     $db = new Db();
     $data_update['attribute_status'] = $status;
     $condition = "attribute_id='" . $specId . "'";
     $db->modify(ATTRIBUTE, $data_update, $condition);
 }
コード例 #12
0
ファイル: News.php プロジェクト: ankuradhey/dealtrip
 public function statusNews($status, $ptyleId)
 {
     global $mySession;
     $db = new Db();
     $data_update['status'] = $status;
     $condition = "news_id='" . $ptyleId . "'";
     $db->modify(NEWS, $data_update, $condition);
 }
コード例 #13
0
ファイル: Protype.php プロジェクト: ankuradhey/dealtrip
 public function statusProtype($status, $ptyleId)
 {
     global $mySession;
     $db = new Db();
     $data_update['ptyle_status'] = $status;
     $condition = PROPERTYTYPE . ".ptyle_id='" . $ptyleId . "'";
     $db->modify(PROPERTYTYPE, $data_update, $condition);
 }
コード例 #14
0
ファイル: Subscription.php プロジェクト: ankuradhey/dealtrip
 public function statusSpecification($status, $subscriptionId)
 {
     global $mySession;
     $db = new Db();
     $data_update['status'] = $status;
     $condition = "spec_id='" . $subscriptionId . "'";
     $db->modify(SPECIFICATION, $data_update, $condition);
 }
コード例 #15
0
ファイル: Sitedesc.php プロジェクト: Alexeykolobov/php
 public function Updatedesc($dataForm, $desc_id)
 {
     global $mySession;
     $db = new Db();
     $dataUpdate['site_desc'] = $dataForm['site_desc'];
     $conditionUpdate = "desc_id='" . $desc_id . "'";
     $db->modify(SITE_DESC, $dataUpdate, $conditionUpdate);
     return 1;
 }
コード例 #16
0
ファイル: Myaccountdb.php プロジェクト: Alexeykolobov/php
 public function changepass($dataForm)
 {
     global $mySession;
     $db = new Db();
     $data_update['password'] = md5($dataForm['newpass']);
     $condition = "user_id='" . $mySession->TeeLoggedID . "'";
     $db->modify(USERS, $data_update, $condition);
     return 1;
 }
コード例 #17
0
ファイル: Amenitypage.php プロジェクト: ankuradhey/dealtrip
 public function UpdatePage($dataForm)
 {
     global $mySession;
     $db = new Db();
     //$dataPage['page_cat_id']=$dataForm['page_cat_id'];
     $dataPage['page_title'] = $dataForm['page_title'];
     $dataPage['content'] = $dataForm['page_content'];
     $condition = " id = 1 ";
     $db->modify(AMENITY_PAGE, $dataPage, $condition);
     return 1;
 }
コード例 #18
0
ファイル: Threads.php プロジェクト: ankuradhey/dealtrip
 public function UpdateThread($dataForm, $thread_id)
 {
     global $mySession;
     $db = new Db();
     $chkQry = $db->runQuery("select * from " . FORUM_THREADS . " where thread_id=" . $thread_id . " ");
     if ($chkQry != "" and count($chkQry) > 0) {
         $dataUpdate['thread_text'] = $dataForm['thread_text'];
         $updateCondition = "thread_id='" . $thread_id . "'";
         $db->modify(FORUM_THREADS, $dataUpdate, $updateCondition);
         return 1;
     } else {
         return 0;
     }
 }
コード例 #19
0
ファイル: Package.php プロジェクト: artyomvolodyev/php
 public function UpdatePackage($dataForm, $packageid)
 {
     global $mySession;
     $db = new Db();
     $dataUpdate['plan_name'] = $dataForm['plan_name'];
     $dataUpdate['plan_type'] = $dataForm['option'];
     $dataUpdate['plan_duration'] = $dataForm['plan_duration'];
     $dataUpdate['plan_price'] = $dataForm['plan_price'];
     $dataUpdate['plan_status'] = $dataForm['plan_status'];
     $conditionUpdate = "package_id='" . $packageid . "'";
     //prd($dataUpdate);
     $db->modify(PACKAGES, $dataUpdate, $conditionUpdate);
     return 1;
 }
コード例 #20
0
ファイル: Users.php プロジェクト: Alexeykolobov/php
 public function ResetNewPassword($dataForm, $requestId)
 {
     global $mySession;
     $db = new Db();
     $chkData = $db->runQuery("select * from " . USERS . " where pass_reset='" . $requestId . "'");
     if ($chkData != "" and count($chkData) > 0) {
         $dataUpdate['password'] = md5($dataForm['newpassword']);
         $dataUpdate['pass_reset'] = "";
         $conditionUpdate = "user_id='" . $chkData[0]['user_id'] . "'";
         //prd($dataUpdate);
         $db->modify(USERS, $dataUpdate, $conditionUpdate);
     }
     return 1;
 }
コード例 #21
0
 public function viewmsgsAction()
 {
     $db = new Db();
     $id = $this->getRequest()->getParam('msgsId');
     $qry = "SELECT * , ( SELECT concat( first_name, ' ', last_name )\n\t\tFROM " . USERS . "\n\t\tWHERE user_id = myMsg.sender_id\n\t\t) AS sender_name, (\n\t\tSELECT admin_username\n\t\tFROM " . ADMINISTRATOR . "\n\t\tWHERE user_id = myMsg.receiver_id\n\t\t) AS receiver_name\n\t\tFROM " . MESSAGES . " AS myMsg where myMsg.message_id= " . $id;
     $result = $db->runQuery("{$qry}");
     if ($result[0]['read'] == '0') {
         $data_update['read'] = '1';
         $condition = "message_id ='" . $id . "'";
         $db->modify(MESSAGES, $data_update, $condition);
     }
     $this->view->result = $result;
     $this->view->pageHeading = "View Message";
 }
コード例 #22
0
ファイル: Pages.php プロジェクト: ankuradhey/dealtrip
 public function UpdateCategory($dataForm, $categoryId)
 {
     global $mySession;
     $db = new Db();
     $chkQry = $db->runQuery("select * from " . PAGE_CAT . " where category_name='" . $dataForm['cat_name'] . "' and cat_id!='" . $categoryId . "'");
     if ($chkQry != "" and count($chkQry) > 0) {
         return 0;
     } else {
         $dataUpdate['category_name'] = $dataForm['cat_name'];
         $conditionUpdate = "cat_id='" . $categoryId . "'";
         $db->modify(PAGE_CAT, $dataUpdate, $conditionUpdate);
         return 1;
     }
 }
コード例 #23
0
ファイル: Pages.php プロジェクト: Alexeykolobov/php
 public function UpdateQuestion($dataForm, $quesId)
 {
     global $mySession;
     $db = new Db();
     $chkQry = $db->runQuery("select * from " . QUESTIONS . " where question='" . $dataForm['question'] . "' and ques_id!='" . $quesId . "'");
     if ($chkQry != "" and count($chkQry) > 0) {
         return 0;
     } else {
         $dataUpdate['question'] = $dataForm['question'];
         $dataUpdate['answer'] = $dataForm['answer'];
         $conditionUpdate = "ques_id='" . $quesId . "'";
         $db->modify(QUESTIONS, $dataUpdate, $conditionUpdate);
         return 1;
     }
 }
コード例 #24
0
ファイル: Size.php プロジェクト: Alexeykolobov/php
 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;
 }
コード例 #25
0
ファイル: Forums.php プロジェクト: ankuradhey/dealtrip
 public function UpdateTopic($dataForm, $topicId)
 {
     global $mySession;
     $db = new Db();
     $chkQry = $db->runQuery("select * from " . FORUM_TOPICS . " where topic_title='" . $dataForm['topic_title'] . "' and topic_id!='" . $topicId . "'");
     if ($chkQry != "" and count($chkQry) > 0) {
         return 0;
     } else {
         $dataUpdate['topic_title'] = $dataForm['topic_title'];
         $dataUpdate['topic_description'] = $dataForm['topic_description'];
         $dataUpdate['topic_status'] = $dataForm['topic_status'];
         $update_condition = "topic_id='" . $topicId . "'";
         $db->modify(FORUM_TOPICS, $dataUpdate, $update_condition);
         return 1;
     }
 }
コード例 #26
0
ファイル: Price.php プロジェクト: Alexeykolobov/php
 public function Updatenewicon($dataForm, $id)
 {
     global $mySession;
     $db = new Db();
     if ($dataForm['image'] != "" && $dataForm['oldicon'] != "") {
         unlink(SITE_ROOT . 'images/tshirt-icons/' . $dataForm['oldicon']);
     }
     $profileImage = $dataForm['oldicon'];
     if ($dataForm['image'] != "") {
         $profileImage = time() . "_" . $dataForm['image'];
         @rename(SITE_ROOT . 'images/tshirt-icons/' . $dataForm['image'], SITE_ROOT . 'images/tshirt-icons/' . $profileImage);
     }
     $dataInsert['icon'] = $profileImage;
     $dataInsert['title'] = $dataForm['title'];
     $dataInsert['colorcode'] = $dataForm['colorcode'];
     $conditionUpdate = "id='" . $id . "'";
     $db->modify(TSHIRT_ICONS, $dataInsert, $conditionUpdate);
     return 1;
 }
コード例 #27
0
ファイル: Comments.php プロジェクト: Alexeykolobov/php
 public function UpdateBlog($dataForm, $blogid)
 {
     global $mySession;
     $db = new Db();
     $chkQry = $db->runQuery("select * from " . BLOGS . " where blog_title='" . $dataForm['blog_title'] . "' and blog_id!='" . $blogid . "'");
     if ($chkQry != "" and count($chkQry) > 0) {
         return 0;
     } else {
         $dataUpdate['blog_title'] = $dataForm['blog_title'];
         $dataUpdate['blog_description'] = $dataForm['blog_description'];
         //$dataUpdate['user_id']='0';
         $dataUpdate['added_date'] = date('d:m:y');
         $dataUpdate['blog_status'] = $dataForm['blog_status'];
         $conditionUpdate = "blog_id='" . $blogid . "'";
         //prd($dataUpdate);
         $db->modify(BLOGS, $dataUpdate, $conditionUpdate);
         return 1;
     }
 }
コード例 #28
0
 public function indexAction()
 {
     global $mySession;
     $this->view->pageHeading = "Social Media Configurations";
     $db = new Db();
     $sql = "select * from social_media";
     $result = $db->runQuery($sql);
     $form = new Form_Socialmedia();
     $form->setAction("");
     if (!empty($result)) {
         $form->populate($result[0]);
     }
     $this->view->form = $form;
     if ($this->getRequest()->isPost()) {
         $arr = $this->getRequest()->getPost();
         $db->modify("social_media", $arr, "1");
         $this->_redirect("social");
     }
 }
コード例 #29
0
ファイル: Event.php プロジェクト: ankuradhey/dealtrip
 public function UpdateEvent($dataForm, $eventId)
 {
     global $mySession;
     $db = new Db();
     $chkQry = $db->runQuery("select * from " . EVENTS . " where event_title='" . mysql_escape_string($dataForm['event_title']) . "' and event_id!='" . $eventId . "'");
     if ($chkQry != "" and count($chkQry) > 0) {
         return 0;
     } else {
         $EventImagesPath = "";
         for ($counter = 1; $counter <= 10; $counter++) {
             $eventImage = $dataForm['event_image_Path' . $counter];
             if ($dataForm['event_image' . $counter] != "") {
                 if ($eventImage != "" && file_exists(SITE_ROOT . 'images/events/' . $eventImage)) {
                     unlink(SITE_ROOT . 'images/events/' . $eventImage);
                 }
                 $eventImage = time() . "_" . $dataForm['event_image' . $counter];
                 @rename(SITE_ROOT . 'images/events/' . $dataForm['event_image' . $counter], SITE_ROOT . 'images/events/' . $eventImage);
             }
             if ($eventImage != "") {
                 $EventImagesPath .= $eventImage . ",";
             }
         }
         if ($EventImagesPath != "") {
             $EventImagesPath = substr($EventImagesPath, 0, strlen($EventImagesPath) - 1);
         }
         $dataUpdate['event_title'] = $dataForm['event_title'];
         $dataUpdate['event_description'] = $dataForm['event_description'];
         $dataUpdate['event_date'] = changeDate($dataForm['event_date'], 0);
         $dataUpdate['event_time_from'] = $dataForm['hour_from'] . "::" . $dataForm['minute_from'] . "::" . $dataForm['ampm_from'];
         $dataUpdate['event_time_to'] = $dataForm['hour_to'] . "::" . $dataForm['minute_to'] . "::" . $dataForm['ampm_to'];
         $dataUpdate['event_image'] = $EventImagesPath;
         $dataUpdate['event_venue'] = $dataForm['event_venue'];
         $dataUpdate['event_location'] = $dataForm['address'];
         $dataUpdate['event_status'] = '1';
         $dataUpdate['event_lat'] = $dataForm['latitude'];
         $dataUpdate['event_long'] = $dataForm['longitude'];
         $updateCondition = "event_id='" . $eventId . "'";
         //user_id='".$mySession->LoggedUserId."' and
         $db->modify(EVENTS, $dataUpdate, $updateCondition);
         return 1;
     }
 }
コード例 #30
0
ファイル: Categories.php プロジェクト: ankuradhey/dealtrip
 public function UpdateCategory($dataForm, $category_id)
 {
     global $mySession;
     $db = new Db();
     $chkQry = $db->runQuery("select * from " . CATEGORIES . " where category_id!=" . $category_id . " and 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']);
         $update_condition = "category_id='" . $category_id . "'";
         $db->modify(CATEGORIES, $dataForm, $update_condition);
         return 1;
     }
 }