Example #1
1
 public function getlastThread($topic_id)
 {
     global $mySession;
     $db = new Db();
     $forumThread = $db->runQuery("select * from " . FORUM_THREADS . " inner join " . USERS . " on " . USERS . ".user_id = " . FORUM_THREADS . ".user_id where topic_id=" . $topic_id . " order by thread_id desc limit 1");
     return $forumThread;
 }
Example #2
1
 public function init()
 {
     global $mySession;
     $db = new Db();
     $ConfigData = $db->runQuery("select * from " . ADMINISTRATOR . " where admin_id='1'");
     $SiteTitle = $ConfigData[0]['site_title'];
     $MetaDescription = $ConfigData[0]['site_description'];
     $MetaKeyword = $ConfigData[0]['site_keyword'];
     $AdminEmail = $ConfigData[0]['admin_email'];
     $PaypalEmail = $ConfigData[0]['paypal_email'];
     $welcomemessageC = $ConfigData[0]['welcomemessage'];
     $admin_name_value = $ConfigData[0]['admin_fullname'];
     $site_title = new Zend_Form_Element_Text('site_title');
     $site_title->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Site title is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($SiteTitle);
     $admin_name = new Zend_Form_Element_Text('admin_name');
     $admin_name->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Admin name is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($admin_name_value);
     $site_description = new Zend_Form_Element_Text('site_description');
     $site_description->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Site description is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($MetaDescription);
     $site_keyword = new Zend_Form_Element_Text('site_keyword');
     $site_keyword->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Site keyword is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($MetaKeyword);
     $admin_email = new Zend_Form_Element_Text('admin_email');
     $admin_email->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Administrator email is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required email")->setValue($AdminEmail);
     $paypal_email = new Zend_Form_Element_Text('paypal_email');
     $paypal_email->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Paypal email address is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required email")->setValue($PaypalEmail);
     /*$currency_symbol= new Zend_Form_Element_Text('currency_symbol');
     		$currency_symbol->setRequired(true)
     		->addValidator('NotEmpty',true,array('messages' =>'Currency symbol is required.'))
     		->addDecorator('Errors', array('class'=>'error'))
     		->setAttrib("class","required")
     		->setValue($CurrencySymbol);*/
     $welcomemessage = new Zend_Form_Element_Textarea('welcomemessage');
     $welcomemessage->setAttrib("id", "elrte")->setAttrib("cols", "auto")->setAttrib("rows", "auto")->setValue($welcomemessageC);
     $this->addElements(array($site_title, $admin_name, $site_description, $site_keyword, $admin_email, $paypal_email, $welcomemessage));
 }
Example #3
0
 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;
         }
     }
 }
Example #4
0
 public function init($stateId)
 {
     global $mySession;
     $db = new Db();
     $CountryId = "";
     $StateName = "";
     if ($stateId != "") {
         $PageData = $db->runQuery("select * from " . STATE . " where state_id='" . $stateId . "'");
         $CountryId = $PageData[0]['country_id'];
         $StateName = $PageData[0]['state_name'];
     }
     $CounyryArr = array();
     $CounyryArr[0]['key'] = "";
     $CounyryArr[0]['value'] = "- - Country - -";
     $CounyryData = $db->runQuery("select * from " . COUNTRIES . " order by country_name");
     if ($CounyryData != "" and count($CounyryData) > 0) {
         $i = 1;
         foreach ($CounyryData as $key => $CounyryValues) {
             $CounyryArr[$i]['key'] = $CounyryValues['country_id'];
             $CounyryArr[$i]['value'] = $CounyryValues['country_name'];
             $i++;
         }
     }
     $country_id = new Zend_Form_Element_Select('country_id');
     $country_id->setRequired(true)->addMultiOptions($CounyryArr)->addValidator('NotEmpty', true, array('messages' => 'Country is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "required")->setValue($CountryId);
     $state_name = new Zend_Form_Element_Text('state_name');
     $state_name->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'State Name is required.'))->addValidator('regex', true, array('pattern' => '/^[a-zA-Z\\-]+$/', 'messages' => array('regexNotMatch' => 'Please enter proper name and without space')))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($StateName);
     $this->addElements(array($country_id, $state_name));
 }
Example #5
0
 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;
         }
     }
 }
Example #6
0
 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;
         }
     }
 }
Example #7
0
 public function init()
 {
     global $mySession;
     $db = new Db();
     $myControllerName = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
     $myActionName = Zend_Controller_Front::getInstance()->getRequest()->getActionName();
     $this->view->myControllerName = $myControllerName;
     $this->view->myActionName = $myActionName;
     $defineData = $db->runQuery("select * from " . ADMINISTRATOR . " where admin_id='1'");
     if (isset($mySession->LoggedUserId) and @$mySession->LoggedUserId != "") {
         $userData = $db->runQuery("select * from " . USERS . " where user_id='" . $mySession->LoggedUserId . "'");
         $this->view->userData = $userData;
     }
     if (!defined("ADMIN_EMAIL")) {
         define("ADMIN_EMAIL", array_key_exists('admin_email', $defineData[0]) ? $defineData[0]['admin_email'] : '');
     }
     if (!defined("PAYPAL_TOKEN")) {
         define("PAYPAL_TOKEN", array_key_exists('paypal_token', $defineData[0]) ? $defineData[0]['paypal_token'] : '');
     }
     if (!defined("PAYPAL_EMAIL")) {
         define("PAYPAL_EMAIL", array_key_exists('paypal_email', $defineData[0]) ? $defineData[0]['paypal_email'] : '');
     }
     if (!defined("SITE_NAME")) {
         define("SITE_NAME", array_key_exists('site_title', $defineData[0]) ? $defineData[0]['site_title'] : 'TeeshirtSCRIPT');
     }
     //define("PRICE_SYMBOL",$defineData[0]['currency_symbol']);
     $Explode = explode("/", $_SERVER['REQUEST_URI']);
     $SName = $Explode[count($Explode) - 1];
     $ChkCampaign = $db->runQuery("select * from " . LAUNCHCAMPAIGN . " where trim(url)='" . urldecode($SName) . "' ");
     if ($ChkCampaign != "" and count($ChkCampaign) > 0 && $myControllerName == "error" && $myActionName == "error") {
         // Routing did not came up with a page, no problem as the URL is related to a campaign URL
         $myform1 = new Form_Buy();
         //$this->view->myform1=$myform1;
         $sizes = $db->runQuery("select * from " . TSHIRT_SIZE);
         $this->view->sizes = $sizes;
         $this->view->CampaignData = $ChkCampaign;
         include "application/layouts/scripts/campaign.phtml";
         // Load Campaign view!
         exit;
     }
     if (isset($mySession->TeeLoggedID) and @$mySession->TeeLoggedID != "") {
         if ($myControllerName == "signup" || $myControllerName == "login" || $myControllerName == "forgotpassword") {
             $this->_redirect(APPLICATION_URL . 'myaccount/profile');
         }
     } else {
         if ($myControllerName == "myaccount" || $myControllerName == "launchcampaign" && $myActionName == "edit") {
             $this->_redirect(APPLICATION_URL . 'index/index');
         }
     }
     if ($myControllerName == "launchcampaign") {
         if (stripslashes(array_key_exists('recreation_product', $_POST) ? $_POST['recreation_product'] : '') != '') {
             $mySession->recreation_product = stripslashes($_POST['recreation_product']);
         }
         if (stripslashes(array_key_exists('priceValueKM', $_POST) ? $_REQUEST['priceValueKM'] != '' : '') && stripslashes(array_key_exists('idValueKM', $_POST) ? $_REQUEST['idValueKM'] != '' : '')) {
             $mySession->priceValueKM = $_REQUEST['priceValueKM'];
             $mySession->selectedIdValueKM = $_REQUEST['idValueKM'];
         }
     }
     $this->_helper->layout->setLayout('main');
 }
Example #8
0
 public function init($review_id)
 {
     global $mySession;
     $db = new Db();
     $airport1_value = "";
     $review_date_value = "";
     $property_value = "";
     $status_value = "";
     $review_value = "";
     $description_value = "";
     $amenityArr = $db->runQuery("select * from " . OWNER_REVIEW . " where review_status = '1' ");
     if ($review_id != "") {
         $pptyData = $db->runQuery("select guest_name, property_title, review_date, location, review_status, check_in, review,  \n\t\t\t\t\t\t\t\t\t   " . OWNER_REVIEW . ".rating as rating, headline, comment from " . OWNER_REVIEW . " \n\t\t\t\t\t\t\t\t\t   inner join " . PROPERTY . " on " . PROPERTY . ".id = " . OWNER_REVIEW . ".property_id \n\t\t\t\t\t\t\t\t\t   where review_id = '" . $review_id . "' ");
         $user_value = $pptyData[0]['guest_name'];
         $property_value = $pptyData[0]['property_title'];
         $review_date_value = date('d-m-Y', strtotime($pptyData[0]['review_date']));
         $location_value = $pptyData[0]['location'];
         $status_value = $pptyData[0]['review_status'];
         $check_in_value = date('d-m-Y', strtotime($pptyData[0]['check_in']));
         $rating_value = $pptyData[0]['rating'];
         $review_value = $pptyData[0]['review'];
         $headline_value = $pptyData[0]['headline'];
         $comment_value = $pptyData[0]['comment'];
     }
     $i = 0;
     $full_name = new Zend_Form_Element_Text('full_name');
     $full_name->setRequired(true)->addValidator('NotEmpty', true, array('messages' => "Please enter Full Name"))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setAttrib("maxlength", "50")->setValue($user_value);
     $location = new Zend_Form_Element_Text('location');
     $location->setRequired(true)->addValidator('NotEmpty', true, array('messages' => "enter email address"))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setAttrib("maxlength", "50")->setValue($location_value);
     $check_in = new Zend_Form_Element_Text('check_in');
     $check_in->setRequired(true)->addValidator('NotEmpty', true, array('messages' => "Please enter phone number"))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput mws-datepicker required ")->setValue($check_in_value);
     $ratingArr = array();
     $ratingArr[0]['key'] = "";
     $ratingArr[0]['value'] = "- - Select - -";
     for ($i = 1; $i <= 10; $i++) {
         $ratingArr[$i]['key'] = $i;
         $ratingArr[$i]['value'] = $i;
     }
     $rating = new Zend_Form_Element_Select('rating');
     $rating->setRequired(true)->addMultiOptions($ratingArr)->addValidator('NotEmpty', true, array('messages' => "Enter Rating"))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($rating_value);
     $headline = new Zend_Form_Element_Text('headline');
     $headline->setRequired(true)->addValidator('NotEmpty', true, array('messages' => "Enter Review Headline"))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required reviewHeadline")->setAttrib("maxlength", "100")->setValue($headline_value);
     $comment = new Zend_Form_Element_Textarea('comment');
     $comment->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "required")->setAttrib("rows", "4")->setAttrib("cols", "30")->setAttrib("maxlength", "300")->setValue($comment_value);
     $review = new Zend_Form_Element_Textarea('review');
     $review->setRequired(true)->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "required")->setAttrib("rows", "4")->setAttrib("cols", "30")->setAttrib("maxlength", "1000")->addValidator('NotEmpty', true, array('messages' => "Enter Review"))->setValue($review_value);
     $statusArr[0]['key'] = "";
     $statusArr[0]['value'] = "- - Select - ";
     $statusArr[1]['key'] = "0";
     $statusArr[1]['value'] = "Disable";
     $statusArr[2]['key'] = "1";
     $statusArr[2]['value'] = "Enable";
     $status = new Zend_Form_Element_Select('status');
     $status->setRequired(true)->addMultiOptions($statusArr)->setValue($status_value);
     $this->addElements(array($full_name, $location, $check_in, $rating, $headline, $comment, $review, $status));
 }
Example #9
0
 public function init($cityId)
 {
     global $mySession;
     $db = new Db();
     $CountryId = "";
     $StateId = "";
     $CityName = "";
     if ($cityId != "") {
         $PageData = $db->runQuery("select * from " . CITIES . " where city_id='" . $cityId . "'");
         $CountryId = $PageData[0]['country_id'];
         $StateId = $PageData[0]['state_id'];
         $CityName = $PageData[0]['city_name'];
     }
     $CountryArr = array();
     $CountryArr[0]['key'] = "";
     $CountryArr[0]['value'] = "- - Country - -";
     $CountryData = $db->runQuery("select * from " . COUNTRIES . " order by country_name");
     if ($CountryData != "" and count($CountryData) > 0) {
         $i = 1;
         foreach ($CountryData as $key => $CountryValues) {
             $CountryArr[$i]['key'] = $CountryValues['country_id'];
             $CountryArr[$i]['value'] = $CountryValues['country_name'];
             $i++;
         }
     }
     $country_id = new Zend_Form_Element_Select('country_id');
     $country_id->setRequired(true)->addMultiOptions($CountryArr)->addValidator('NotEmpty', true, array('messages' => 'Country is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("style", "width:250px;")->setAttrib("onchange", "getCountryState(this.value);")->setValue($CountryId);
     $StateArr = array();
     $StateArr[0]['key'] = "";
     $StateArr[0]['value'] = "- - State - -";
     $chkCountryId = $CountryId;
     if (isset($_REQUEST['country_id']) && $_REQUEST['country_id'] != "") {
         $chkCountryId = $_REQUEST['country_id'];
     }
     if ($chkCountryId != "") {
         $StateData = $db->runQuery("select * from " . STATE . " where country_id='" . $chkCountryId . "' order by state_name");
         if ($StateData != "" and count($StateData) > 0) {
             $i = 1;
             foreach ($StateData as $key => $StateValues) {
                 $StateArr[$i]['key'] = $StateValues['state_id'];
                 $StateArr[$i]['value'] = $StateValues['state_name'];
                 $i++;
             }
         }
     }
     $state_id = new Zend_Form_Element_Select('state_id');
     $state_id->setRequired(true)->addMultiOptions($StateArr)->addValidator('NotEmpty', true, array('messages' => 'State is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("style", "width:250px;")->setValue($StateId);
     $city_name = new Zend_Form_Element_Text('city_name');
     $city_name->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'City Name is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setAttrib("style", "width:250px;")->setValue($CityName);
     $this->addElements(array($country_id, $state_id, $city_name));
 }
Example #10
0
 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 pagesAction()
 {
     global $mySession;
     $db = new Db();
     $slug = $this->getRequest()->getParam("slug");
     $userArr = $db->runQuery("select * from " . USERS . " where user_id = '" . $mySession->LoggedUserId . "' ");
     $sql = "select * from " . PAGES1 . " where synonyms = '{$slug}'";
     $staticArr = $db->runQuery($sql);
     $strContent = str_replace("[SITEURL]", APPLICATION_URL, $staticArr[0]['page_content']);
     $strContent = str_replace("[FULLNAME]", $userArr[0]['email_address'], $strContent);
     if (!isLogged()) {
         $strContent = str_replace("[LOGINMSG]", "<a href='" . APPLICATION_URL . "/signin'>click here</a> to Login", $strContent);
     } else {
         $strContent = str_replace("[LOGINMSG]", "", $strContent);
     }
     $this->view->pageContent = $strContent;
     $this->view->pageTitle = $staticArr[0]['page_title'];
     $this->view->page_id = $staticArr[0]['page_id'];
     if ($staticArr[0]['page_id'] == '12' || $staticArr[0]['page_id'] == '63') {
         $myform = new Form_Contact();
         $this->view->myform = $myform;
     }
     if ($staticArr[0]['page_id'] == '80') {
         $myform = new Form_Ocontact();
         $this->view->myform = $myform;
     }
     $varsuccess = 0;
     if ($this->getRequest()->isPost()) {
         $request = $this->getRequest();
         $dataForm = $myform->getValues();
         if ($myform->isValid($request->getPost())) {
             $dataForm = $myform->getValues();
             //prd($dataForm);
             if ($dataForm['captcha'] == $_SESSION['captcha']) {
                 $myObj = new Users();
                 if ($staticArr[0]['page_id'] == '80') {
                     $Result = $myObj->ownercontactus($dataForm);
                 } else {
                     $Result = $myObj->contactus($dataForm);
                 }
                 $mySession->sucessMsg = "Thank you, You will soon be contacted";
                 $varsuccess = 1;
             } else {
                 $mySession->errorMsg = "Human Verification code is wrong";
             }
         }
     }
     $this->view->myform = $myform;
     $this->view->varsuccess = $varsuccess;
 }
Example #12
0
 public function init($userType, $userId)
 {
     global $mySession;
     $db = new Db();
     $receiver_id_value = "";
     $message_subject_value = "";
     $message_text_value = "";
     if ($userType == '1') {
         $ReceiverArr = array();
         $ReceiverArr[0]['key'] = "0";
         $ReceiverArr[0]['value'] = "ADMIN";
     } else {
         $ReceiverArr = array();
         if ($userId != "") {
             $ReceiverData = $db->runQuery("select " . USERS . ".user_id,concat(first_name,' ',last_name) as ReceiverName,\n\t\t\t\t\t\t\t\t\t\t email_address, uType from " . USERS . " where " . USERS . ".user_id != '" . $userId . "'  \n\t\t\t\t\t\t\t\t\t\t and " . USERS . ".user_status = '1'\n\t\t\t\t\t\t\t\t\t\t ");
         } else {
             $ReceiverData = $db->runQuery("select " . USERS . ".user_id,concat(first_name,' ',last_name) as ReceiverName,\n\t\t\t\t\t\t\t\t\t\t email_address, uType from " . USERS . " where " . USERS . ".user_status = '1' ");
         }
     }
     if ($ReceiverData != "" and count($ReceiverData) > 0) {
         $i = 1;
         foreach ($ReceiverData as $key => $ReceiverValues) {
             $usertype = $ReceiverValues['uType'] == '2' ? "Owner" : "Customer";
             $ReceiverArr[$i]['key'] = $ReceiverValues['user_id'];
             $ReceiverArr[$i]['value'] = $ReceiverValues['email_address'] . " [" . $usertype . "]";
             $i++;
         }
     }
     $box1View = new Zend_Form_Element_Select('box1View');
     $box1View->addMultiOptions($ReceiverArr)->setAttrib("multiple", "multiple")->setRegisterInArrayValidator(false)->setAttrib("style", "width:100%;height:250px;")->setValue($receiver_id_value);
     $this->addElement($box1View);
     $box2View = new Zend_Form_Element_Select('box2View');
     $box2View->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Reciever is required'))->setRegisterInArrayValidator(false)->setAttrib("multiple", "multiple")->setAttrib("style", "width:100%;height:250px;");
     $this->addElement($box2View);
     if ($userId != "") {
         $ReceiverData = $db->runQuery("select " . USERS . ".user_id,concat(first_name,' ',last_name) as ReceiverName,\n\t\t\t\t\t\t\t\t\t\t\t email_address, uType from " . USERS . " where " . USERS . ".user_id = '" . $userId . "'  ");
         $ReceiverArr = array();
         $usertype = $ReceiverValues['uType'] == '2' ? "Owner" : "Customer";
         $ReceiverArr[0]['key'] = $ReceiverData[0]['user_id'];
         $ReceiverArr[0]['value'] = $ReceiverData[0]['email_address'] . " [" . $usertype . "]";
         $box2View->addMultiOptions($ReceiverArr);
     }
     $message_subject = new Zend_Form_Element_Text('message_subject');
     $message_subject->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Message subject is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($message_subject_value);
     $this->addElement($message_subject);
     $message_text = new Zend_Form_Element_Textarea('message_text');
     $message_text->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Message is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($message_text_value);
     $this->addElement($message_text);
 }
Example #13
0
 public function myInit($Id)
 {
     global $mySession;
     $db = new Db();
     if ($Id != "") {
         $adminData = $db->runQuery("select * from " . TSHIRT_ICONS . " where id='" . $Id . "'");
         $title_value = $adminData[0]['title'];
         $oldicon_value = $adminData[0]['icon'];
         $colorcode_value = $adminData[0]['colorcode'];
     } else {
         $title_value = '';
         $oldicon_value = '';
         $colorcode_value = '';
     }
     $title = new Zend_Form_Element_Text('title');
     $title->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'First Name is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($title_value);
     $colorcode = new Zend_Form_Element_Text('colorcode');
     $colorcode->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Please enter color code.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "Expandable mws-textinput required")->setAttrib("onkeypress", "return checknummspK(event)")->setValue($colorcode_value);
     $this->addElement($colorcode);
     $this->addElement($title);
     if ($Id == "") {
         $image = new Zend_Form_Element_File('image');
         $image->setDestination(SITE_ROOT . 'images/tshirt-icons/')->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Please select an icon.'))->addValidator('Extension', false, 'jpg,jpeg,png,gif')->setAttrib("class", "textbox")->addDecorator('Errors', array('class' => 'error'));
     } else {
         $image = new Zend_Form_Element_File('image');
         $image->setDestination(SITE_ROOT . 'images/tshirt-icons/')->addValidator('Extension', false, 'jpg,jpeg,png,gif')->setAttrib("class", "textbox");
     }
     $this->addElement($image);
     if ($Id != "") {
         $oldicon = new Zend_Form_Element_Hidden('oldicon');
         $oldicon->setValue($oldicon_value);
         $this->addElement($oldicon);
         $this->addElement("hidden", "foo", array("decorators" => array(array(array("img" => "HtmlTag"), array("tag" => "img", "openOnly" => true, "src" => IMAGES_URL . 'tshirt-icons/' . $oldicon_value, "align" => "middle", "class" => "myClass", "style" => "max-width:200px;max-height:200px;")), array("ViewHelper"), array(array("span" => "HtmlTag"), array("tag" => "span", "class" => "myElement", "style" => "text-align:center;display:block;")))));
     }
 }
Example #14
0
 public function init($blogId)
 {
     //  echo "hello ".$blogId; exit();
     global $mySession;
     $db = new Db();
     $title_value = "";
     $description_value = "";
     $status_value = "1";
     if ($blogId != "") {
         $blogData = $db->runQuery("select * from " . BLOG_POST . " where blog_post_id='" . $blogId . "'");
         $title_value = $blogData[0]['title'];
         $description_value = $blogData[0]['description'];
         $status_value = $blogData[0]['status'];
     }
     $StatusArr = array();
     $StatusArr[0]['key'] = "1";
     $StatusArr[0]['value'] = "Enable";
     $status = new Zend_Form_Element_Select('status');
     $status->addMultiOptions($StatusArr)->setAttrib("class", "textInput")->setValue($status_value);
     $title = new Zend_Form_Element_Text('title');
     $title->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'blog title is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setValue($title_value);
     $description = new Zend_Form_Element_Textarea('description');
     $description->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'blog description is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setAttrib("rows", "3")->setAttrib("style", "height:100px;")->setValue($description_value);
     $this->addElements(array($status, $title, $description));
 }
Example #15
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;
     }
 }
Example #16
0
 public function init($topicId)
 {
     global $mySession;
     $db = new Db();
     $topicTitle = "";
     $topicDescription = "";
     $topicStatus = "1";
     if ($topicId != "") {
         $topicData = $db->runQuery("select * from " . FORUM_TOPICS . " where topic_id='" . $topicId . "'");
         $topicTitle = $topicData[0]['topic_title'];
         $topicDescription = $topicData[0]['topic_description'];
         $topicStatus = $topicData[0]['topic_status'];
     }
     $StatusArr = array();
     $StatusArr[0]['key'] = "1";
     $StatusArr[0]['value'] = "Enable";
     $StatusArr[1]['key'] = "0";
     $StatusArr[1]['value'] = "Disable";
     $topic_status = new Zend_Form_Element_Select('topic_status');
     $topic_status->addMultiOptions($StatusArr)->setAttrib("class", "textInput")->setValue($topicStatus);
     $topic_title = new Zend_Form_Element_Text('topic_title');
     $topic_title->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Topic title is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setValue($topicTitle);
     $topic_description = new Zend_Form_Element_Textarea('topic_description');
     $topic_description->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Topic description is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setAttrib("rows", "3")->setAttrib("style", "height:100px;")->setValue($topicDescription);
     $this->addElements(array($topic_status, $topic_title, $topic_description));
 }
Example #17
0
 public function init($pageId)
 {
     global $mySession;
     $db = new Db();
     $PageTitle = "";
     $PageContent = "";
     //$pageposition_value="";
     if ($pageId != "") {
         $PageData = $db->runQuery("select * from " . PAGES . " where page_id='" . $pageId . "'");
         $PageTitle = $PageData[0]['page_title'];
         $PageContent = $PageData[0]['page_content'];
         //$pageposition_value=$PageData[0]['page_position'];
     }
     $page_title = new Zend_Form_Element_Text('page_title');
     $page_title->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Page title is required.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required")->setValue($PageTitle);
     $page_content = new Zend_Form_Element_Textarea('page_content');
     $page_content->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Page content is required.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required")->setAttrib("id", "elrte")->setAttrib("cols", "auto")->setAttrib("style", "width:90%;")->setValue($PageContent);
     /*	$pagepositionArr=array();
     		$pagepositionArr[0]['key']="0";
     		$pagepositionArr[0]['value']="Top";
     		$pagepositionArr[1]['key']="1";
     		$pagepositionArr[1]['value']="Bottom";
     		$pageposition= new Zend_Form_Element_Radio('pageposition');
     		$pageposition->addMultiOptions($pagepositionArr)
     		->setValue($pageposition_value);
     */
     $this->addElements(array($page_title, $page_content));
 }
Example #18
0
 public function init($categoryId)
 {
     global $mySession;
     $db = new Db();
     $CategoryName = "";
     $cattitle = "";
     $catdesc = "";
     $catimage = "";
     $rssurl = "";
     if ($categoryId != "") {
         //category_id, category_name, perent_id, cat_position, cat_title, cat_desc, cat_image, category_status, created_by, created_date
         $PageData = $db->runQuery("select * from " . CATEGORIES . " where category_id='" . $categoryId . "'");
         $CategoryName = $PageData[0]['category_name'];
         $catposition = $PageData[0]['cat_position'];
         $cattitle = $PageData[0]['cat_title'];
         $catdesc = $PageData[0]['cat_desc'];
         $catimage = $PageData[0]['cat_image'];
         $rssurl = $PageData[0]['rss_url'];
     }
     $cat_position = new Zend_Form_Element_Hidden('cat_position');
     $cat_position->setValue($catposition);
     $cat_image_file = new Zend_Form_Element_Hidden('cat_image_file');
     $cat_image_file->setValue($catimage);
     $cat_desc = new Zend_Form_Element_Textarea('cat_desc');
     $cat_desc->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Category Title is required.'))->setAttrib("style", "width:350px;height:150px")->setValue($catdesc);
     $category_name = new Zend_Form_Element_Text('category_name');
     $category_name->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Category Name is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setAttrib("style", "width:350px;")->setValue($CategoryName);
     $cat_title = new Zend_Form_Element_Text('cat_title');
     $cat_title->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Category Title is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setAttrib("style", "width:350px;")->setValue($cattitle);
     $rss_url = new Zend_Form_Element_Text('rss_url');
     $rss_url->setAttrib("class", "textInput")->setAttrib("style", "width:350px;")->setValue($rssurl);
     $photo_path = new Zend_Form_Element_File('photo_path');
     $photo_path->setDestination(SITE_ROOT . 'images/category/')->addValidator('Extension', false, 'jpg,jpeg,png,gif')->setRequired(false)->addDecorator('Errors', array('class' => 'error'));
     $this->addElements(array($category_name, $cat_title, $cat_desc, $cat_image_file, $rss_url, $cat_position, $photo_path));
 }
Example #19
0
 public function init()
 {
     global $mySession;
     $db = new Db();
     $myControllerName = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
     $myActionName = Zend_Controller_Front::getInstance()->getRequest()->getActionName();
     $defineData = $db->runQuery("select * from " . ADMINISTRATOR . " where admin_id='1'");
     define("ADMIN_EMAIL", array_key_exists('admin_email', $defineData[0]) ? $defineData[0]['admin_email'] : '');
     define("SITE_NAME", array_key_exists('site_title', $defineData[0]) ? $defineData[0]['site_title'] : 'TeeshirtSCRIPT');
     define("SITE_KEYWORD", array_key_exists('site_keyword', $defineData[0]) ? $defineData[0]['site_keyword'] : '');
     define("PRICE_SYMBOL", array_key_exists('currency_symbol', $defineData[0]) ? $defineData[0]['currency_symbol'] : '$');
     define("DEFAULT_BUSINESS_IMAGE", array_key_exists('default_business_image', $defineData[0]) ? $defineData[0]['default_business_image'] : 'my_default_business_image.png');
     define("DEFAULT_EVENT_IMAGE", array_key_exists('default_event_image', $defineData[0]) ? $defineData[0]['default_event_image'] : 'my_default_event_image.png');
     define("DEFAULT_MALE_USER_IMAGE", array_key_exists('default_male_image', $defineData[0]) ? $defineData[0]['default_male_image'] : 'my_default_male_image.png');
     define("DEFAULT_FEMALE_USER_IMAGE", array_key_exists('default_female_image', $defineData[0]) ? $defineData[0]['default_female_image'] : 'my_default_female_image.png');
     define("DEFAULT_USER_IMAGE", array_key_exists('default_both_image', $defineData[0]) ? $defineData[0]['default_both_image'] : 'my_default_both_image.png');
     if ($mySession->adminId == "" && $myControllerName != 'index') {
         $mySession->errorMsg = "Please login now to access administrator control panel.";
         $this->_redirect('index');
     }
     if ($mySession->adminId != "" && ($myControllerName == 'index' && $myActionName == 'index')) {
         $this->_redirect('dashboard');
     }
     $this->_helper->layout->setLayout('main');
 }
Example #20
0
 public function loginAction()
 {
     global $mySession;
     $db = new Db();
     $this->view->pageHeading = "Login";
     $this->_helper->layout->setLayout('login');
     if ($this->getRequest()->isPost()) {
         $request = $this->getRequest();
         $myform = new Form_Login();
         if ($myform->isValid($request->getPost())) {
             $dataForm = $myform->getValues();
             $chkLogin = $db->runQuery("select * from " . ADMINISTRATOR . " where admin_username='******'admin_username']) . "' and admin_password='******'admin_password'])) . "'");
             if ($chkLogin != "" and count($chkLogin) > 0) {
                 $mySession->adminId = $chkLogin[0]['admin_id'];
                 $this->_redirect('dashboard');
             } else {
                 $mySession->errorMsg = "Invalid username or password.";
                 $this->view->myform = $myform;
                 $this->render('index');
             }
         } else {
             $this->view->myform = $myform;
             $this->render('index');
         }
     } else {
         $this->_redirect('index');
     }
 }
Example #21
0
 public function ChildPost($post_id, $thread_id)
 {
     global $mySession;
     $db = new Db();
     $forumPostlist = $db->runQuery("select * from \n\t\t\t" . FORUM_POSTS . " inner join " . FORUM_THREADS . " on " . FORUM_POSTS . ".thread_id=" . FORUM_THREADS . ".thread_id \n\t\t\tinner join " . FORUM_TOPICS . " on " . FORUM_TOPICS . ".topic_id = " . FORUM_THREADS . ".topic_id  \n\t\t\t\tinner join " . USERS . " on " . USERS . ".user_id = " . FORUM_POSTS . ".user_id\n\t\t\t where topic_status='1' and " . FORUM_POSTS . ".replyof=" . $post_id . " and " . FORUM_THREADS . ".thread_id = " . $thread_id . " order by " . FORUM_POSTS . ".post_id desc");
     return $forumPostlist;
 }
Example #22
0
 public function init($catId)
 {
     global $mySession;
     $db = new Db();
     $catname = "";
     $catdescription = "";
     if ($catId != "") {
         $Data = $db->runQuery("select * from " . CATEGORY . " where cat_id='" . $catId . "'");
         $catname = $Data[0]['cat_name'];
         $catdescription = $Data[0]['cat_description'];
     }
     $cat_name = new Zend_Form_Element_Text('cat_name');
     $cat_name->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Category name is required.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required")->setValue($catname);
     $cat_description = new Zend_Form_Element_Textarea('cat_description');
     $cat_description->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Category description is required.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required")->setValue($catdescription);
     /*	$pagepositionArr=array();
     		$pagepositionArr[0]['key']="0";
     		$pagepositionArr[0]['value']="Top";
     		$pagepositionArr[1]['key']="1";
     		$pagepositionArr[1]['value']="Bottom";
     		$pageposition= new Zend_Form_Element_Radio('pageposition');
     		$pageposition->addMultiOptions($pagepositionArr)
     		->setValue($pageposition_value);
     */
     $this->addElements(array($cat_name, $cat_description));
 }
 public function updateplanAction()
 {
     global $mySession;
     $db = new Db();
     $planId = $this->getRequest()->getParam('planId');
     $this->view->planId = $planId;
     $planData = $db->runQuery("select * from " . SUBSCRIPTIONS . " where plan_id='" . $planId . "'");
     $this->view->planImage = $planData[0]['plan_image'];
     $this->view->pageHeading = "Edit Subscription Plan";
     if ($this->getRequest()->isPost()) {
         $request = $this->getRequest();
         $myform = new Form_Subscription($planId);
         if ($myform->isValid($request->getPost())) {
             $dataForm = $myform->getValues();
             $myObj = new System();
             $Result = $myObj->UpdatePlan($dataForm, $planId);
             if ($Result == 1) {
                 $mySession->errorMsg = "Subscription plan updated successfully.";
                 $this->_redirect('subscription/index');
             } else {
                 $mySession->errorMsg = "Subscription plan name you entered is already exists.";
                 $this->view->myform = $myform;
                 $this->render('editplan');
             }
         } else {
             $this->view->myform = $myform;
             $this->render('editplan');
         }
     } else {
         $this->_redirect('subscription/editplan/planId/' . $planId);
     }
 }
Example #24
0
 public function indexAction()
 {
     global $mySession;
     $this->view->pageHeading = "Manage Pages";
     $db = new Db();
     $this->view->ResData = $db->runQuery("select * from " . PAGES1);
 }
Example #25
0
 public function init($pageId)
 {
     global $mySession;
     $db = new Db();
     $PageTitle = "";
     $PageContent = "";
     $PageMetaKeyword = "";
     $PageMetaDescription = "";
     if ($pageId != "") {
         $PageData = $db->runQuery("select * from " . PAGES1 . " where page_id='" . $pageId . "'");
         //                prd($PageData);
         $PageTitle = $PageData[0]['page_title'];
         $PageContent = $PageData[0]['page_content'];
         $PageMetaKeyword = $PageData[0]['meta_keywords'];
         $PageMetaDescription = $PageData[0]['meta_description'];
         $PageSynonyms = $PageData[0]['synonyms'];
     }
     $page_title = new Zend_Form_Element_Text('page_title');
     $page_title->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Page title is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($PageTitle);
     $page_content = new Zend_Form_Element_Textarea('page_content');
     $page_content->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Page content is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("id", "elrte")->setAttrib("cols", "auto")->setAttrib("rows", "auto")->setValue($PageContent);
     $meta_keywords = new Zend_Form_Element_Text('meta_keywords');
     $meta_keywords->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Keywords are required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($PageMetaKeyword);
     $meta_description = new Zend_Form_Element_Text('meta_description');
     $meta_description->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Description is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($PageMetaDescription);
     $synonyms = new Zend_Form_Element_Text('synonyms');
     $synonyms->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'URL is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($PageSynonyms);
     $this->addElements(array($page_title, $page_content, $meta_keywords, $meta_description, $synonyms));
 }
Example #26
0
 public function init($cid)
 {
     global $mySession;
     $db = new Db();
     $full_name_value = "";
     $phone_value = "";
     $email_value = "";
     $comment_value = "";
     $captcha_value = "";
     $subject_value = "";
     if ($cid != "") {
         $adminData = $db->runQuery("select * from " . user . " where id='" . $cid . "'");
         $full_name_value = $adminData[0]['fname'] . " " . $adminData[0]['lname'];
         $phone_value = $adminData[0]['phone'];
         $email_value = $adminData[0]['email'];
         $comment_value = $adminData[0]['comment'];
     }
     $full_name = new Zend_Form_Element_Text('full_name');
     $full_name->setRequired(true)->addValidator('NotEmpty', true, array('messages' => "Please enter Full Name"))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($full_name_value);
     /*$phone = new Zend_Form_Element_Text('phone');
     		$phone->setRequired(true)
     		->addValidator('NotEmpty',true,array('messages' =>"Please enter phone number"))
     		->addDecorator('Errors', array('class'=>'error'))
     		->setAttrib("onkeypress","return checknummsp(event);")
     		->setAttrib("class","mws-textinput required")
     		->addValidator('Digits',true,array('messages' =>"enter proper phone number"))
     		->setValue($phone_value);*/
     if (isset($_REQUEST['phone'])) {
         $stringLength = new Zend_Validate_StringLength($_POST['phone']);
         $stringLength->setMin(10);
         $stringLength->setMax(10);
         $phone->addValidator($stringLength);
     }
     $email_address = new Zend_Form_Element_Text('email_address');
     $email_address->setRequired(true)->addValidator('NotEmpty', true, array('messages' => "enter email address"))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required email")->setValue($email_value);
     $cemail_address = new Zend_Form_Element_Text('cemail_address');
     $cemail_address->setRequired(true)->addValidator('NotEmpty', true, array('messages' => "enter email address"))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required email")->setAttrib("equalTo", "#email_address")->setValue($email_value);
     $subject = new Zend_Form_Element_Text('subject');
     $subject->setRequired(true)->addValidator('NotEmpty', true, array('messages' => "enter email address"))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($subject_value);
     /*		$comment= new Zend_Form_Element_Textarea('comment');
     		$comment->setRequired(true)
     		->addDecorator('Errors', array('class'=>'error'))
     		->setAttrib("class","required")
     		->setAttrib("rows","4")
     		->setAttrib("cols","30")
     		->addValidator('NotEmpty',true,array('messages' =>"Enter message"));*/
     $enquiry = new Zend_Form_Element_Textarea('enquiry');
     $enquiry->setRequired(true)->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "required")->setAttrib("rows", "4")->setAttrib("cols", "30")->addValidator('NotEmpty', true, array('messages' => "Enter message"));
     /*$captcha  = new Zend_Form_Element_Text('captcha');
     		$captcha->setRequired(true)
     		->addDecorator('Errors', array('class'=>'error'))
     		->setAttrib("class","mws-textinput required")
     
     		->addValidator('NotEmpty',true,array('messages' =>"Enter captcha"));*/
     /*$check = new Zend_Form_Element_Hidden('check');
     		$check->setRequired(true)
     		->setValue($text);*/
     $this->addElements(array($full_name, $email_address, $cemail_address, $subject, $enquiry));
 }
Example #27
0
 public function descindexAction()
 {
     global $mySession;
     $db = new Db();
     $this->view->pageTitle = "Site Description";
     $Data = $db->runQuery("select * from " . SITE_DESC . " where desc_id='1'");
     $this->view->Data = $Data;
 }
Example #28
0
 public function Getblogs()
 {
     global $mySession;
     $db = new Db();
     $str = "Select *,\n\t(SELECT count(`comment_id`) s FROM " . BLOG_COMMENTS . "\n\t\tINNER JOIN " . USERS . " ON " . USERS . ".user_id = " . BLOG_COMMENTS . ".user_id\n\t\t WHERE " . BLOG_COMMENTS . ".blog_id= " . BLOGS . ".blog_id) as commentcount\n\t, CONCAT(first_name,' ',last_name) as username from " . BLOGS . " left join " . USERS . " on " . USERS . ".user_id= " . BLOGS . ".user_id order by blog_id DESC";
     $blogdata = $db->runQuery($str);
     return $blogdata;
 }
 public function indexAction()
 {
     global $mySession;
     $this->view->pageHeading = "Manage Currency";
     $db = new Db();
     $qry = "select * from " . CURRENCY;
     $this->view->ResData = $db->runQuery("{$qry}");
 }
Example #30
0
 public function ShowBlogComment($blog_id)
 {
     global $mySession;
     $db = new Db();
     $Blogcommentdata = $db->runQuery("SELECT * FROM \n                        " . BLOG_POST . " inner join  " . BLOG_COMMENTS . " on " . BLOG_POST . ".blog_post_id=" . BLOG_COMMENTS . ".`blog_post_id`  \n                        inner join  `users` on " . BLOG_COMMENTS . ".post_by=`users`.`user_id` where status=1 and " . BLOG_POST . ".blog_post_id=" . $blog_id . " order by " . BLOG_COMMENTS . ".comment_id desc");
     //
     return $Blogcommentdata;
 }