当前位置: 首页>>代码示例>>PHP>>正文


PHP Db::modify方法代码示例

本文整理汇总了PHP中Db::modify方法的典型用法代码示例。如果您正苦于以下问题:PHP Db::modify方法的具体用法?PHP Db::modify怎么用?PHP Db::modify使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Db的用法示例。


在下文中一共展示了Db::modify方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Addphoto

 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;
 }
开发者ID:ankuradhey,项目名称:dealtrip,代码行数:25,代码来源:Photo.php

示例2: saveReview

 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;
     }
 }
开发者ID:ankuradhey,项目名称:dealtrip,代码行数:51,代码来源:Review.php

示例3: UpdateSub

 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;
     }
 }
开发者ID:ankuradhey,项目名称:dealtrip,代码行数:26,代码来源:Subscription.php

示例4: Addvideo

 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;
 }
开发者ID:ankuradhey,项目名称:dealtrip,代码行数:32,代码来源:Video.php

示例5: saveCurrency

 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;
         }
     }
 }
开发者ID:ankuradhey,项目名称:dealtrip,代码行数:26,代码来源:Currencies.php

示例6: UpdateBlog

 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;
 }
开发者ID:Alexeykolobov,项目名称:php,代码行数:25,代码来源:Post.php

示例7: statusSpeccat

 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);
 }
开发者ID:ankuradhey,项目名称:dealtrip,代码行数:8,代码来源:Speccat.php

示例8: statusAmenity

 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);
 }
开发者ID:ankuradhey,项目名称:dealtrip,代码行数:8,代码来源:Message.php

示例9: statusOffer

 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);
 }
开发者ID:ankuradhey,项目名称:dealtrip,代码行数:8,代码来源:Spcloffer.php

示例10: statusreview

 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);
 }
开发者ID:ankuradhey,项目名称:dealtrip,代码行数:8,代码来源:Review.php

示例11: statusAttribute

 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);
 }
开发者ID:ankuradhey,项目名称:dealtrip,代码行数:8,代码来源:Attribute.php

示例12: statusNews

 public function statusNews($status, $ptyleId)
 {
     global $mySession;
     $db = new Db();
     $data_update['status'] = $status;
     $condition = "news_id='" . $ptyleId . "'";
     $db->modify(NEWS, $data_update, $condition);
 }
开发者ID:ankuradhey,项目名称:dealtrip,代码行数:8,代码来源:News.php

示例13: statusProtype

 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);
 }
开发者ID:ankuradhey,项目名称:dealtrip,代码行数:8,代码来源:Protype.php

示例14: statusSpecification

 public function statusSpecification($status, $subscriptionId)
 {
     global $mySession;
     $db = new Db();
     $data_update['status'] = $status;
     $condition = "spec_id='" . $subscriptionId . "'";
     $db->modify(SPECIFICATION, $data_update, $condition);
 }
开发者ID:ankuradhey,项目名称:dealtrip,代码行数:8,代码来源:Subscription.php

示例15: Updatedesc

 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;
 }
开发者ID:Alexeykolobov,项目名称:php,代码行数:9,代码来源:Sitedesc.php


注:本文中的Db::modify方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。