예제 #1
0
 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;
     }
 }
예제 #2
0
 public function Updatesubcate($dataForm, $subcateid)
 {
     global $mySession;
     $db = new Db();
     $dataForm = SetupMagicQuotes($dataForm);
     //	echo "select * from ".SUBCATE." where subcate_name='".$dataForm['subcate_name']."' and subcate_id=".$dataForm['category']." cat_id!='".$subcateid."'"; exit();
     $chkQry = $db->runQuery("select * from " . SUBCATE . " where subcate_name='" . $dataForm['subcate_name'] . "' and subcate_id=" . $dataForm['category']);
     //	prd($chkQry);
     if ($chkQry != "" and count($chkQry) > 0) {
         return 0;
     } else {
         if ($dataForm['subcate_image'] != "") {
             if ($dataForm['old_subcat_image'] != "" && file_exists(SITE_ROOT . 'images/Subcate/' . $dataForm['old_subcat_image'])) {
                 unlink(categories . 'images/Subcate/' . $dataForm['old_subcate_image']);
             }
             $CatImage = time() . "_" . $dataForm['subcate_image'];
             @rename(SITE_ROOT . 'images/Subcate/' . $dataForm['subcate_image'], SITE_ROOT . 'images/Subcate/' . $CatImage);
             $dataUpdate['subcate_img_path'] = $CatImage;
         }
         $dataUpdate['subcate_name'] = $dataForm['subcate_name'];
         $dataUpdate['cat_id'] = $dataForm['category'];
         $conditionUpdate = "subcate_id='" . $subcateid . "'";
         //		prd($dataUpdate);
         $db->modify(SUBCATE, $dataUpdate, $conditionUpdate);
         return 1;
     }
 }
예제 #3
0
 public function Updateclassified($dataForm, $c_id)
 {
     global $mySession;
     $db = new Db();
     $dataForm = SetupMagicQuotes($dataForm);
     $chkQry = $db->runQuery("select * from " . CLASSIFIED . " where c_name='" . $dataForm['c_name'] . "' and c_id=" . $dataForm['cat_id']);
     if ($chkQry != "" and count($chkQry) > 0) {
         return 0;
     } else {
         $dataUpdate['c_name'] = $dataForm['c_name'];
         $dataUpdate['cat_id'] = $dataForm['cat_id'];
         $dataUpdate['price'] = $dataForm['price'];
         $dataUpdate['location'] = $dataForm['location'];
         $dataUpdate['description'] = $dataForm['description'];
         $dataUpdate['zipcode'] = $dataForm['zipcode'];
         $conditionUpdate = "c_id='" . $c_id . "'";
         $db->modify(CLASSIFIED, $dataUpdate, $conditionUpdate);
         return 1;
     }
 }
예제 #4
0
 public function ownercontactus($dataForm)
 {
     global $mySession;
     $db = new Db();
     $adminArr = $db->runQuery("select * from " . ADMINISTRATOR . " ");
     //code to send password reset email
     $dataForm = SetupMagicQuotes($dataForm);
     $fullName = $dataForm['full_name'];
     $subject = "Dealatrip:" . $dataForm['subject'];
     $messageText = "Full Name : " . $dataForm['full_name'] . "<br>";
     $messageText .= "Email : " . $dataForm['email_address'] . "<br>";
     $messageText .= "Phone : " . $dataForm['phone'] . "<br>";
     if ($dataForm['property_no'] != "") {
         $messageText .= "Property Number : " . $dataForm['property_no'] . "<br>";
     }
     $messageText .= "Message : " . $dataForm['question'];
     //$messageText .= "Enquiry : ".$dataForm['comment'];
     SendEmail($adminArr[0]['admin_email'], $subject, $messageText, $dataForm['email_address']);
     SendEmail("*****@*****.**", $subject, $messageText, $dataForm['email_address']);
     //return $chkQry[0]['user_id'];
 }