public function init() { global $mySession; $db = new Db(); $emailid_val = ""; $qur = $db->runquery("SELECT * FROM " . USERS . " WHERE user_id='" . $mySession->TeeLoggedID . "' "); //$qur=$db->runquery("select * from ".ADDRESS." join ".STATE." on ".STATE.".state_id=".ADDRESS.".state where user_id='".$mySession->TeeLoggedID."' "); if ($qur != "" and count($qur) > 0) { $emailid_val = $qur[0]['emailid']; } # FORM ELEMENT:public name # TYPE : text $emailid = new Zend_Form_Element_Text('emailid'); $emailid->setRequired(true)->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changeaddress')->setAttrib('readonly', 'readonly')->setAttrib("style", "width:300px; height:30px;")->setValue($emailid_val); # FORM ELEMENT:address # TYPE : text $friendsemailid = new Zend_Form_Element_Text('friendsemailid'); $friendsemailid->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'One id is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib("style", "width:300px; height:30px;")->setAttrib('class', 'changepasstextbox'); //if(@$_REQUEST['friendsemailid']!="") // { // $friendsemailid-> addValidator('EmailAddress', true) // ->addDecorator('Errors', array('class'=>'errmsg')) // ->addErrorMessage('Please enter a valid email address'); // } // # FORM ELEMENT:city # TYPE : text $url = new Zend_Form_Element_Text('url'); $url->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'URL is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changeaddress')->setAttrib("style", "width:100px; height:30px;"); $this->addElements(array($emailid, $friendsemailid, $url)); }
public function init($name = "") { global $mySession; $db = new Db(); //echo "url .... : ".$name; die; $emailid_val = ""; $emailfrnz_val = ""; $quremailid = $db->runquery("SELECT emailid FROM " . ORDER_RECORD . " WHERE teeurl='" . $name . "'"); //prd($quremailid); if ($quremailid != "" and count($quremailid) > 0) { for ($i = 0; $i < count($quremailid); $i++) { if ($i == 0) { $emailfrnz[$i] = $quremailid[$i]['emailid']; } else { if (!in_array($quremailid[$i]['emailid'], $emailfrnz)) { $emailfrnz[$i] = $quremailid[$i]['emailid']; } } } // prd($emailfrnz); $emailfrnz_val = implode(",", $emailfrnz); } $qur1 = $db->runquery("SELECT * FROM " . LAUNCHCAMPAIGN . " WHERE url='" . $name . "' "); $qur = $db->runquery("SELECT * FROM " . USERS . " WHERE user_id='" . $qur1[0]['user_id'] . "'"); //$qur=$db->runquery("select * from ".ADDRESS." join ".STATE." on ".STATE.".state_id=".ADDRESS.".state where user_id='".$mySession->TeeLoggedID."' "); if ($qur != "" and count($qur) > 0) { $emailid_val = $qur[0]['emailid']; } # FORM ELEMENT:public name # TYPE : text $emailid = new Zend_Form_Element_Text('emailid'); $emailid->setRequired(true)->addDecorator('Errors', array('class' => 'error'))->setAttrib('class', 'changeaddress')->setAttrib("style", "width:300px; height:30px;")->setValue($emailid_val); if (@$_REQUEST['emailid'] != "") { $emailid->addValidator('EmailAddress', true)->addDecorator('Errors', array('class' => 'error'))->addErrorMessage('Please enter a valid email address'); } # FORM ELEMENT:address # TYPE : text //$friendsemailid= new Zend_Form_Element_Text('friendsemailid'); // $friendsemailid->setRequired(true) // ->addValidator('NotEmpty',true,array('messages' =>'One id is required')) // ->addDecorator('Errors', array('class'=>'errmsg')) // ->setAttrib("style","width:300px; height:30px;") // ->setAttrib('class','changepasstextbox') // ->setValue($emailfrnz_val); $friendsemailid = new Zend_Form_Element_Hidden('friendsemailid'); $friendsemailid->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'One id is required'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("style", "width:300px; height:30px;")->setAttrib('class', 'changepasstextbox')->setValue($emailfrnz_val); # FORM ELEMENT:city # TYPE : text $subject = new Zend_Form_Element_Text('subject'); $subject->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Subject is required'))->addDecorator('Errors', array('class' => 'error'))->setAttrib('class', 'changeaddress')->setAttrib("style", "width:300px; height:30px;"); $content = new Zend_Form_Element_Textarea('content'); $content->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Content is required'))->addDecorator('Errors', array('class' => 'error'))->setAttrib('class', 'changeaddress')->setAttrib("style", "width:300px; height:150px;"); $this->addElements(array($emailid, $friendsemailid, $subject, $content)); }
public function init($campid) { global $mySession; $db = new Db(); $title_val = ""; $baseprice_val = ""; $goal_val = ""; $sold_val = ""; $sellingprice_val = ""; $description_val = ""; $camplength_val = ""; $url_val = ""; $launchdate_val = ""; if ($campid != "") { $qur = $db->runquery("SELECT * FROM " . LAUNCHCAMPAIGN . " WHERE campaign_id='" . $campid . "'"); if ($qur != "" and count($qur) > 0) { //prd($qur); $title_val = $qur[0]['title']; $baseprice_val = $qur[0]['base_price']; $goal_val = $qur[0]['goal']; $sold_val = $qur[0]['sold']; $sellingprice_val = $qur[0]['selling_price']; $description_val = $qur[0]['description']; $camplength_val = $qur[0]['campaign_length']; $url_val = $qur[0]['url']; $launchdate_val = $qur[0]['launch_date']; } } # FORM ELEMENT:no of tee # TYPE : text $baseprice = new Zend_Form_Element_Text('baseprice'); $baseprice->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:50px; height:20px;")->setvalue($baseprice_val); $sellingprice = new Zend_Form_Element_Text('sellingprice'); $sellingprice->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:50px; height:20px;")->setvalue($sellingprice_val); # FORM ELEMENT:camptitle # TYPE : text $camptitle = new Zend_Form_Element_Text('camptitle'); $camptitle->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:250px; height:30px;")->setvalue($title_val); # FORM ELEMENT:description # TYPE : text $description = new Zend_Form_Element_Textarea('description'); $description->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:450px; height:120px;")->setvalue($description_val); $goal = new Zend_Form_Element_Text('goal'); $goal->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:50px; height:20px;")->setvalue($goal_val); $sold = new Zend_Form_Element_Text('sold'); $sold->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:50px; height:20px;")->setvalue($sold_val); # FORM ELEMENT:url # TYPE : text $url = new Zend_Form_Element_Text('url'); $url->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:60px; height:20px;")->setvalue($url_val); # FORM ELEMENT:url # TYPE : text $camplength = new Zend_Form_Element_Text('camplength'); $camplength->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:50px; height:20px;")->setvalue($camplength_val); # FORM ELEMENT:url # TYPE : text $launchdate = new Zend_Form_Element_Text('launchdate'); $launchdate->setRequired(true)->setAttrib("class", "mws-textinput required")->setAttrib("readonly", "readonly")->setAttrib("style", "width:70px; height:20px;")->setvalue($launchdate_val); $this->addElements(array($sellingprice, $baseprice, $camptitle, $camplength, $launchdate, $url, $description, $sold, $goal)); }
public function myInit() { global $mySession; $db = new Db(); $public_name = ""; $emailid_val = ""; $bio_value = ''; $old_profile_image_value = ''; $qur = $db->runquery("SELECT * FROM " . USERS . " WHERE user_id='" . $mySession->TeeLoggedID . "' "); if ($qur != "" and count($qur) > 0) { $public_name = $qur[0]['public_name']; $emailid_val = $qur[0]['emailid']; $bio_value = $qur[0]['bio']; $old_profile_image_value = $qur[0]['profile_image']; } $publicname = new Zend_Form_Element_Text('publicname'); $publicname->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Public name is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changepasstextbox')->setValue($public_name); $bio = new Zend_Form_Element_Textarea('bio'); $bio->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Bio is required.'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib("class", "changepasstextarea")->setAttrib("style", "height:150px;width:354px;")->setAttrib("maxlength", "300")->setAttrib("placeholder", "Max 300 Characters")->setValue($bio_value); $profile_image = new Zend_Form_Element_File('profile_image'); $profile_image->setDestination(SITE_ROOT . 'images/profileimages/')->addValidator('Extension', false, 'jpg,jpeg,png,gif')->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib("class", "textInput")->setAttrib("style", "width:325px"); $old_profile_image = new Zend_Form_Element_Hidden('old_profile_image'); $old_profile_image->setValue($old_profile_image_value); $emailid = new Zend_Form_Element_Text('emailid'); $emailid->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Email Id is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changepasstextbox')->setValue($emailid_val); $this->addElements(array($publicname, $emailid, $bio, $profile_image, $old_profile_image)); }
public function viewnewsletterAction() { global $mySession; $db = new Db(); $this->view->pageHeading = "Manage Newsletter"; $qry = $db->runquery("select * from " . NEWSLETTER . " "); $this->view->sql = $qry; }
public function indexAction() { global $mySession; $db = new Db(); $this->view->pageHeading = "Manage Subscriptions Plans"; $qry = $db->runquery("select * from " . SUBSCRIPTIONS . ""); $this->view->sql = $qry; }
public function indexAction() { global $mySession; $db = new Db(); $this->view->pageHeading = "Sub Administrator"; $Obj = new Subadmin(); $sql = $db->runquery("select * from " . SUBADMIN . " "); $this->view->sql = $sql; }
public function indexAction() { global $mySession; $db = new Db(); $this->view->pageHeading = "Manage Pages"; $qry = "select * from " . PAGES . " WHERE page_id<>'17' && page_id<>'18' "; $sql = $db->runquery($qry); $this->view->sql = $sql; }
public function indexAction() { global $mySession; $db = new Db(); $this->_helper->layout->setLayout('myaccount'); $page = $this->getRequest()->getParam('page'); $this->view->page = $page; $qry = "select * from " . PAGES . " WHERE page='" . $page . "'"; $sql = $db->runquery($qry); //prd($sql); $this->view->sql = $sql; }
public function init($sno) { global $mySession; $db = new Db(); $tee_value = ""; $disc_val = ""; //echo "serial no. : ".$sno; die; $qur = $db->runquery("SELECT * FROM " . TSHIRT_DISCOUNT . " where sno=" . $sno . ""); //$qur=$db->runquery("select * from ".ADDRESS." join ".STATE." on ".STATE.".state_id=".ADDRESS.".state where user_id='".$mySession->TeeLoggedID."' "); if ($qur != "" and count($qur) > 0) { $tee_value = $qur[0]['no_of_tee']; $disc_val = $qur[0]['discount_per']; } $nooftee = new Zend_Form_Element_Text('nooftee'); $nooftee->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Number of Tee is required.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required")->setValue($tee_value); $per_discount = new Zend_Form_Element_Text('per_discount'); $per_discount->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Discount % is required.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required")->setValue($disc_val); $this->addElements(array($nooftee, $per_discount)); }
public function myInit($sno) { global $mySession; $db = new Db(); $size_value = ""; $inch_val = ""; if ($sno && $sno > 0) { $qur = $db->runquery("SELECT * FROM " . TSHIRT_SIZE . " where sizeid=" . $sno . ""); if ($qur != "" and count($qur) > 0) { $size_value = $qur[0]['size']; $inch_val = $qur[0]['size_inch']; } } $sizes = new Zend_Form_Element_Text('sizes'); $sizes->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Size is required.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required")->setValue($size_value); $ininches = new Zend_Form_Element_Text('ininches'); $ininches->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Size in inches is required.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required")->setValue($inch_val); $this->addElements(array($sizes, $ininches)); }
public function loginAction() { global $mySession; $db = new Db(); $this->_helper->layout()->setLayout('simplecontent'); $myformsignup = new Form_Signupdesigned(); $this->view->myformsignup = $myformsignup; if ($this->getRequest()->isPost()) { //$abc=$this->getRequest()->getParam('abc'); $request = $this->getRequest(); $myform = new Form_Login(); if ($myform->isValid($request->getPost())) { $dataForm = $myform->getValues(); $qury = $db->runquery("Select * from " . USERS . " where emailid='" . $dataForm['emailid'] . "' AND password='******'pass'] . "'"); if ($qury != "" and count($qury) > 0) { if ($qury[0]['user_status'] == 1) { $mySession->TeeLoggedID = $qury[0]['user_id']; //$this->_redirect('launchcampaign/index'); echo "<script>parent.top.location='" . APPLICATION_URL . "launchcampaign/index';</script>"; exit; } else { $mySession->errorMsg = "Your Account is inactivated by admin"; $this->_redirect('logindesigned/index'); } } else { $mySession->errorMsg = "invalid Email Address & Password"; $this->_redirect('logindesigned/index'); } } else { //$mySession->errorMsg="form not valid"; $this->view->myform = $myform; $this->render('index'); } } else { //$mySession->errorMsg="check out"; $this->_redirect('logindesigned/index'); } }
public function init($sno) { global $mySession; $db = new Db(); $basepric_value = ""; $shhpng_val = ""; //echo "serial no. : ".$sno; die; $qur = $db->runquery("SELECT * FROM " . TSHIRT_PRICE . " where sno=" . $sno . ""); if ($qur != "" and count($qur) > 0) { $basepric_value = $qur[0]['base_price']; $shhpng_val = $qur[0]['shipping_price']; } $base_price = new Zend_Form_Element_Text('base_price'); $base_price->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Base price is required.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required")->setValue($basepric_value); /*$per_profit= new Zend_Form_Element_Text('per_profit'); $per_profit->setRequired(true) ->addValidator('NotEmpty',true,array('messages' =>'Profit % is required.')) ->addDecorator('Errors', array('class'=>'errormsg')) ->setAttrib("class","mws-textinput required");*/ $shippingprice = new Zend_Form_Element_Text('shippingprice'); $shippingprice->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Shipping Rate is required.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required")->setValue($shhpng_val); $this->addElements(array($base_price, $shippingprice)); }
public function init($Id) { global $mySession; $db = new Db(); if ($Id != "") { $adminData = $db->runQuery("select * from " . TSHIRT_PRODUCTS . " where t_cat_id='" . $Id . "'"); $qur = $db->runquery("SELECT * FROM " . TSHIRT_PRICE . " where campagin_id=" . $Id . ""); $title_value = $adminData[0]['name']; $oldicon_value = $adminData[0]['image']; $backoldicon_value = $adminData[0]['backimage']; $oldfrontShadow_value = $adminData[0]['frontShadow']; $oldfrontHeigh_value = $adminData[0]['frontHeigh']; $oldbackShadow_value = $adminData[0]['backShadow']; $oldbacktHeigh_value = $adminData[0]['backHeigh']; $basepric_value = $qur[0]['base_price']; $colorcode_value = $adminData[0]['colorcode']; $shhpng_val = $qur[0]['shipping_price']; } $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); $title = new Zend_Form_Element_Text('title'); $title->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Category Name is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($title_value); $this->addElement($title); if ($Id == "") { $image = new Zend_Form_Element_File('image'); $image->setDestination(SITE_ROOT . 'images/tshirtdesigns/front')->setRequired(true)->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/tshirtdesigns/front')->addValidator('Extension', false, 'jpg,jpeg,png,gif')->setAttrib("class", "textbox"); } $this->addElement($image); $frontHeigh = new Zend_Form_Element_File('frontHeigh'); $frontHeigh->setDestination(SITE_ROOT . 'images/tshirtdesigns/front')->addValidator('Extension', false, 'jpg,jpeg,png,gif')->setAttrib("class", "textbox"); $this->addElement($frontHeigh); $oldfrontHeigh = new Zend_Form_Element_Hidden('oldfrontHeigh'); $oldfrontHeigh->setValue($oldfrontHeigh_value); $this->addElement($oldfrontHeigh); $frontShadow = new Zend_Form_Element_File('frontShadow'); $frontShadow->setDestination(SITE_ROOT . 'images/tshirtdesigns/front')->addValidator('Extension', false, 'jpg,jpeg,png,gif')->setAttrib("class", "textbox"); $this->addElement($frontShadow); $oldfrontShadow = new Zend_Form_Element_Hidden('oldfrontShadow'); $oldfrontShadow->setValue($oldfrontShadow_value); $this->addElement($oldfrontShadow); // back $backHeigh = new Zend_Form_Element_File('backHeigh'); $backHeigh->setDestination(SITE_ROOT . 'images/tshirtdesigns/back')->addValidator('Extension', false, 'jpg,jpeg,png,gif')->setAttrib("class", "textbox"); $this->addElement($backHeigh); $oldbackHeigh = new Zend_Form_Element_Hidden('oldbackHeigh'); $oldbackHeigh->setValue($oldbacktHeigh_value); $this->addElement($oldbackHeigh); $backShadow = new Zend_Form_Element_File('backShadow'); $backShadow->setDestination(SITE_ROOT . 'images/tshirtdesigns/back')->addValidator('Extension', false, 'jpg,jpeg,png,gif')->setAttrib("class", "textbox"); $this->addElement($backShadow); $oldbackShadow = new Zend_Form_Element_Hidden('oldbackShadow'); $oldbackShadow->setValue($oldbackShadow_value); $this->addElement($oldbackShadow); if ($Id != "") { $oldicon = new Zend_Form_Element_Hidden('oldicon'); $oldicon->setValue($oldicon_value); $this->addElement($oldicon); $backoldicon = new Zend_Form_Element_Hidden('backoldicon'); $backoldicon->setValue($backoldicon_value); $this->addElement($backoldicon); } $backimage = new Zend_Form_Element_File('backimage'); $backimage->setDestination(SITE_ROOT . 'images/tshirtdesigns/back')->addValidator('Extension', false, 'jpg,jpeg,png,gif')->setAttrib("class", "textbox"); $this->addElement($backimage); $base_price = new Zend_Form_Element_Text('base_price'); $base_price->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Base price is required.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required")->setValue($basepric_value); $this->addElement($base_price); $shippingprice = new Zend_Form_Element_Text('shippingprice'); $shippingprice->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Shipping Rate is required.'))->addDecorator('Errors', array('class' => 'errormsg'))->setAttrib("class", "mws-textinput required")->setValue($shhpng_val); $this->addElement($shippingprice); }
public function initMyForm($cid, $cidresume) { global $mySession; $db = new Db(); $title_val = ""; $description_val = ""; $url_val = ""; $camplength_val = ""; $campaign_category_val = ''; if ($mySession->TeeLoggedID != "") { if ($mySession->camptitl != "" && $mySession->showurl != "") { //echo "in form with session values"; die; $title_val = $mySession->camptitl; $description_val = $mySession->descrip; $url_val = $mySession->showurl; $camplength_val = $mySession->camplength; $campaign_category_val = $mySession->campaign_category; } } if ($cid != "") { $qur = $db->runquery("SELECT * FROM " . LAUNCHCAMPAIGN . " WHERE campaign_id='" . $cid . "'"); if ($qur != "" and count($qur) > 0) { //prd($qur); $title_val = $qur[0]['title']; $description_val = $qur[0]['description']; $url_val = $qur[0]['url']; $camplength_val = $qur[0]['campaign_length']; $campaign_category_val = $qur[0]['campaign_category']; } } # FORM ELEMENT:camptitle # TYPE : text $camptitle = new Zend_Form_Element_Text('camptitle'); $camptitle->setRequired(true)->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'setgoaltxt')->setAttrib("style", "width:450px; height:30px;")->setvalue($title_val); # FORM ELEMENT:description # TYPE : text $description = new Zend_Form_Element_Textarea('description'); $description->setRequired(true)->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'setgoaltxt')->setAttrib("style", "width:450px; height:120px;")->setvalue($description_val); $daysArr = array(); $daysArr[1]['key'] = "3"; $daysArr[1]['value'] = "3 Days"; $daysArr[2]['key'] = "7"; $daysArr[2]['value'] = "7 Days"; $daysArr[3]['key'] = "10"; $daysArr[3]['value'] = "10 Days"; $daysArr[4]['key'] = "14"; $daysArr[4]['value'] = "14 Days"; $daysArr[5]['key'] = "21"; $daysArr[5]['value'] = "21 Days"; $no_ofdays = new Zend_Form_Element_Select('no_ofdays'); $no_ofdays->addMultiOptions($daysArr)->setAttrib('class', 'setgoaltxt')->setAttrib("style", "width:150px; height:30px;")->setvalue($camplength_val); # FORM ELEMENT:url # TYPE : text if ($cid != "" || $cid != 0) { $url = new Zend_Form_Element_Text('url'); $url->setRequired(true)->setAttrib('class', 'setgoaltxt')->setAttrib("readonly", "readonly")->setAttrib("style", "width:100px; height:30px;")->setvalue($url_val); } else { /*$url= new Zend_Form_Element_Text('url'); $url->setRequired(true) ->addDecorator('Errors', array('class'=>'errmsg')) ->setAttrib('class','setgoaltxt') ->setAttrib("onkeypress","return checkspecchar(event)") ->setAttrib('onkeyup','uniqueurl(this.value)') ->setAttrib("style","width:100px; height:30px;") ->setvalue($url_val);*/ $url = new Zend_Form_Element_Text('url'); $url->setRequired(true)->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'setgoaltxt')->setAttrib('onblur', 'uniqueurl(this.value)')->setAttrib("style", "width:100px; height:30px;")->setvalue($url_val); } # FORM ELEMENT:check # TYPE : text $add_checkbox = new Zend_Form_Element_Checkbox('add_checkbox'); $add_checkbox->setAttrib('onclick', 'opendiv(this.id);'); $newcheckbx = new Zend_Form_Element_Checkbox('newcheckbx'); $newcheckbx->setAttrib('onclick', 'newdivaddr(this.id);'); $firstname = new Zend_Form_Element_Text('firstname'); $firstname->addValidator('NotEmpty', true, array('messages' => 'First name is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib("onkeypress", "return checkcharonly(event);")->setAttrib('class', 'changeaddress'); if (array_key_exists('newcheckbx', $_REQUEST) && $_REQUEST['newcheckbx'] == 1) { $firstname->setRequired(true); } $firstname->setAttrib("style", "width:180px; height:30px;"); $this->addElement($firstname); # FORM ELEMENT:last name # TYPE : text $lastname = new Zend_Form_Element_Text('lastname'); $lastname->addValidator('NotEmpty', true, array('messages' => 'Last name is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib("onkeypress", "return checkcharonly(event);")->setAttrib('class', 'changeaddress'); if (array_key_exists('newcheckbx', $_REQUEST) && $_REQUEST['newcheckbx'] == 1) { $lastname->setRequired(true); } $lastname->setAttrib("style", "width:180px; height:30px;"); //if(@$_REQUEST['lastname']!="") // { // $lastname-> addValidator('Alpha', true) // ->addDecorator('Errors', array('class'=>'errmsg')) // ->addErrorMessage('Enter only characters'); // } $this->addElement($lastname); # FORM ELEMENT:address # TYPE : text $newaddress = new Zend_Form_Element_Text('newaddress'); $newaddress->addValidator('NotEmpty', true, array('messages' => 'Address is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changepasstextbox'); if (array_key_exists('newcheckbx', $_REQUEST) && $_REQUEST['newcheckbx'] == 1) { $newaddress->setRequired(true); } $this->addElement($newaddress); # FORM ELEMENT:city # TYPE : text $newcity = new Zend_Form_Element_Text('newcity'); $newcity->addValidator('NotEmpty', true, array('messages' => 'City is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib("onkeypress", "return checkcharonly(event);")->setAttrib('class', 'changeaddress'); if (array_key_exists('newcheckbx', $_REQUEST) && $_REQUEST['newcheckbx'] == 1) { $newcity->setRequired(true); } $newcity->setAttrib("style", "width:100px; height:30px;"); //if(@$_REQUEST['newcity']!="") // { // $newcity-> addValidator('Alpha', true) // ->addDecorator('Errors', array('class'=>'errmsg')) // ->addErrorMessage('Enter only characters'); // } $this->addElement($newcity); # FORM ELEMENT:state # TYPE : text $StateArr = array(); $StateArr[0]['key'] = ""; $StateArr[0]['value'] = "- - Select State- -"; $StateData = $db->runQuery("select * from " . STATE . " 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++; } } $newstate = new Zend_Form_Element_Select('newstate'); $newstate->addMultiOptions($StateArr)->addValidator('NotEmpty', true, array('messages' => 'State is required.'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changeaddress'); if (array_key_exists('newcheckbx', $_REQUEST) && $_REQUEST['newcheckbx'] == 1) { $newstate->setRequired(true); } $newstate->setAttrib("style", "width:100px; height:33px;")->setAttrib("onchange", "getneighborhoodcities(this.value);"); $this->addElement($newstate); # FORM ELEMENT:zipcode # TYPE : text $newzipcode = new Zend_Form_Element_Text('newzipcode'); $newzipcode->addValidator('NotEmpty', true, array('messages' => 'zip code is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changeaddress')->setAttrib("onkeypress", "return checknummsp(event);"); if (array_key_exists('newcheckbx', $_REQUEST) && $_REQUEST['newcheckbx'] == 1) { $newzipcode->setRequired(true); } $newzipcode->setAttrib("style", "width:100px; height:30px;"); //if(@$_REQUEST['newzipcode']!="") // { // $newzipcode-> addValidator('Digits', true) // ->addDecorator('Errors', array('class'=>'errmsg')) // ->addErrorMessage('Please enter only numbers'); // } // $this->addElement($newzipcode); # FORM ELEMENT:instruction # TYPE : text $instruction = new Zend_Form_Element_Textarea('instruction'); $instruction->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'setgoaltxt'); if (array_key_exists('newcheckbx', $_REQUEST) && $_REQUEST['newcheckbx'] == 1) { $instruction->setRequired(true); } $instruction->setAttrib("style", "width:450px; height:120px;"); $this->addElement($instruction); $address_val = ""; $val1 = ""; $val2 = ""; $city_val = ""; $state_val = ""; $zip_val = ""; $qur = $db->runquery("SELECT * FROM " . ADDRESS . " WHERE user_id='" . $mySession->TeeLoggedID . "' "); //$qur=$db->runquery("select * from ".ADDRESS." join ".STATE." on ".STATE.".state_id=".ADDRESS.".state where user_id='".$mySession->TeeLoggedID."' "); if ($qur != "" and count($qur) > 0) { $public_name = $qur[0]['public_name']; $address_val = explode("||", $qur[0]['address']); //prd($address_val); //prd($address_val); $val1 = $address_val[0]; $val2 = $address_val[1]; $city_val = $qur[0]['city']; $state_val = $qur[0]['state']; $zip_val = $qur[0]['zipcode']; } # FORM ELEMENT:first name # TYPE : text // $firstname= new Zend_Form_Element_Text('firstname'); // $firstname // ->addValidator('NotEmpty',true,array('messages' =>'First name is required')) // ->addDecorator('Errors', array('class'=>'errmsg')) // ->setAttrib('class','changeaddress'); // // if($_REQUEST['add_checkbox']==1) // { // $instruction->setRequired(true); // } // $firstname->setAttrib("style","width:180px; height:30px;"); // $this->addElement($firstname); // // // # FORM ELEMENT:last name // # TYPE : text // // $lastname= new Zend_Form_Element_Text('lastname'); // $lastname // ->addValidator('NotEmpty',true,array('messages' =>'Last name is required')) // ->addDecorator('Errors', array('class'=>'errmsg')) // ->setAttrib('class','changeaddress'); // if($_REQUEST['add_checkbox']==1) // { // $instruction->setRequired(true); // } // $lastname->setAttrib("style","width:180px; height:30px;"); // $this->addElement($lastname); // # FORM ELEMENT:address # TYPE : text $address = new Zend_Form_Element_Text('address'); $address->addValidator('NotEmpty', true, array('messages' => 'Address is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changepasstextbox')->setAttrib("readonly", "readonly")->setValue($val1); // if($_REQUEST['add_checkbox']==1) // { // $instruction->setRequired(true); // } $this->addElement($address); $address1 = new Zend_Form_Element_Text('address1'); $address1->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changepasstextbox')->setAttrib("readonly", "readonly")->setValue($val2); $this->addElement($address1); # FORM ELEMENT:city # TYPE : text $city = new Zend_Form_Element_Text('city'); $city->addValidator('NotEmpty', true, array('messages' => 'City is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changeaddress')->setAttrib("readonly", "readonly")->setValue($city_val); //if($_REQUEST['add_checkbox']==1) // { // $instruction->setRequired(true); // } $city->setAttrib("style", "width:100px; height:30px;"); $this->addElement($city); # FORM ELEMENT:state # TYPE : text $StateArr = array(); $StateArr[0]['key'] = ""; $StateArr[0]['value'] = "- - Select State- -"; $StateData = $db->runQuery("select * from " . STATE . " 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 = new Zend_Form_Element_Select('state'); $state->addMultiOptions($StateArr)->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changeaddress')->setValue($state_val); //if($_REQUEST['add_checkbox']==1) // { // $instruction->setRequired(true); // } $state->setAttrib("style", "width:100px; height:33px;")->setAttrib("onchange", "getneighborhoodcities(this.value);"); $this->addElement($state); # FORM ELEMENT:zipcode # TYPE : text $zipcode = new Zend_Form_Element_Text('zipcode'); $zipcode->addValidator('NotEmpty', true, array('messages' => 'zip code is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changeaddress')->setAttrib("readonly", "readonly")->setValue($zip_val); //if($_REQUEST['add_checkbox']==1) // { // $instruction->setRequired(true); // } $zipcode->setAttrib("style", "width:100px; height:30px;"); $this->addElement($zipcode); // Campaign category $CampaignCaArr = array(); $CampaignCaArr[1]['key'] = "1"; $CampaignCaArr[1]['value'] = "Discover"; $CampaignCaArr[2]['key'] = "2"; $CampaignCaArr[2]['value'] = "Support"; $campaign_category = new Zend_Form_Element_Select('campaign_category'); $campaign_category->addMultiOptions($CampaignCaArr)->setAttrib('class', 'setgoaltxt')->setAttrib("style", "width:150px; height:30px;")->setvalue($campaign_category_val); $this->addElements(array($camptitle, $description, $no_ofdays, $url, $newcheckbx, $add_checkbox, $campaign_category)); }
public function showcampaignAction() { global $mySession; $db = new Db(); $this->_helper->layout->setLayout('myaccount'); $name = $this->getRequest()->getParam('name'); $show = $this->getRequest()->getParam('show'); $myform1 = new Form_Buy(); $this->view->myform1 = $myform1; if ($mySession->TeeLoggedID != "" && $show == "") { $sql = $db->runquery("select * from " . LAUNCHCAMPAIGN . " where user_id='" . $mySession->TeeLoggedID . "' and url='" . $name . "'"); } else { $sql = $db->runquery("select * from " . LAUNCHCAMPAIGN . " where url='" . $name . "'"); } $this->view->sql = $sql; }
public function signupdb($dataForm) { $db = new Db(); global $mySession; $chckuname = $db->runquery("Select emailid from users where emailid='" . $dataForm['signupemailid'] . "'"); if (count($chckuname) > 0 && $chckuname != "") { return 0; } else { $data_insert['public_name'] = $dataForm['publicname']; $data_insert['emailid'] = $dataForm['signupemailid']; $data_insert['password'] = md5($dataForm['signuppass']); $data_insert['user_status'] = 0; $data_insert['active_status'] = 0; $db->save(USERS, $data_insert); $userid = $db->lastInsertId(); // only at insert tym $emailid = $dataForm['signupemailid']; $ActivationLink = '<a href="' . APPLICATION_URL . 'login/activate/Id/' . md5($userid) . '">' . APPLICATION_URL . 'login/activate/Id/' . md5($userid) . '</a>'; $templateData = $db->runQuery("select * from " . EMAIL_TEMPLATES . " where template_id='2'"); $messageText = $templateData[0]['email_body']; $subject = $templateData[0]['email_subject']; $messageText = str_replace("[NAME]", $emailid, $messageText); $messageText = str_replace("[SITENAME]", SITE_NAME, $messageText); $messageText = str_replace("[LOGINNAME]", $dataForm['signupemailid'], $messageText); $messageText = str_replace("[PASSWORD]", $dataForm['signuppass'], $messageText); $messageText = str_replace("[SITEURL]", APPLICATION_URL, $messageText); $messageText = str_replace("[ACTIVATIONLINK]", $ActivationLink, $messageText); SendEmail($dataForm['signupemailid'], $subject, $messageText); return 1; } }
public function init() { global $mySession; $db = new Db(); $public_name = ""; $address_val = ""; $val1 = ""; $val2 = ""; $city_val = ""; $state_val = ""; $zip_val = ""; $qur = $db->runquery("SELECT * FROM " . ADDRESS . " WHERE user_id='" . $mySession->TeeLoggedID . "' "); //$qur=$db->runquery("select * from ".ADDRESS." join ".STATE." on ".STATE.".state_id=".ADDRESS.".state where user_id='".$mySession->TeeLoggedID."' "); if ($qur != "" and count($qur) > 0) { $public_name = $qur[0]['public_name']; $address_val = explode("||", $qur[0]['address']); //prd($address_val); //prd($address_val); $val1 = $address_val[0]; $val2 = $address_val[1]; $city_val = $qur[0]['city']; $state_val = $qur[0]['state']; $zip_val = $qur[0]['zipcode']; } # FORM ELEMENT:public name # TYPE : text $publicname = new Zend_Form_Element_Text('publicname'); $publicname->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Public name is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changeaddress')->setAttrib("style", "width:200px; height:30px;")->setValue($public_name); //->setvalue # FORM ELEMENT:address # TYPE : text $address = new Zend_Form_Element_Text('address'); $address->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Address is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changepasstextbox')->setValue($val1); $address1 = new Zend_Form_Element_Text('address1'); //$address1->setRequired(true) $address1->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changepasstextbox')->setValue($val2); # FORM ELEMENT:city # TYPE : text $city = new Zend_Form_Element_Text('city'); $city->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'City is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changeaddress')->setAttrib("style", "width:100px; height:30px;")->setValue($city_val); if (@$_REQUEST['city'] != "") { $city->addValidator('Alpha', true)->addDecorator('Errors', array('class' => 'errmsg'))->addErrorMessage('Enter only characters'); } # FORM ELEMENT:state # TYPE : text $StateArr = array(); $StateArr[0]['key'] = ""; $StateArr[0]['value'] = "- - Select State- -"; $StateData = $db->runQuery("select * from " . STATE . " 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']; //if($state_val==$StateArr[$i]['key']) // // { // $state_val=$StateArr[$i]['value']; // } $i++; } } $state = new Zend_Form_Element_Select('state'); $state->setRequired(true)->addMultiOptions($StateArr)->addValidator('NotEmpty', true, array('messages' => 'State is required.'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changeaddress')->setAttrib("style", "width:100px; height:33px;")->setAttrib("onchange", "getneighborhoodcities(this.value);")->setValue($state_val); # FORM ELEMENT:zipcode # TYPE : text $zipcode = new Zend_Form_Element_Text('zipcode'); $zipcode->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'zip code is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changeaddress')->setAttrib("style", "width:100px; height:30px;")->setValue($zip_val); if (@$_REQUEST['zipcode'] != "") { $zipcode->addValidator('Digits', true)->addDecorator('Errors', array('class' => 'errmsg'))->addErrorMessage('Please enter only numbers'); } $this->addElements(array($publicname, $address, $address1, $city, $state, $zipcode)); }
public function discountAction() { global $mySession; $db = new Db(); $this->view->pageHeading = "Manage Discount"; $qry = "select * from " . TSHIRT_DISCOUNT . ""; $sql = $db->runquery($qry); $this->view->sql = $sql; }
public function loginedAction() { global $mySession; $db = new Db(); $this->_helper->layout->setLayout('myaccount'); $launch = $this->getRequest()->getParam('l'); $this->view->l = $launch; //echo "from launch : ".$launch; die; $myformsignup = new Form_Signup(); $this->view->myformsignup = $myformsignup; if ($this->getRequest()->isPost()) { //$abc=$this->getRequest()->getParam('abc'); $request = $this->getRequest(); $myform = new Form_Login(); if ($myform->isValid($request->getPost())) { $dataForm = $myform->getValues(); $qury = $db->runquery("Select * from " . USERS . " where emailid='" . $dataForm['emailid'] . "' AND password='******'pass']) . "'"); //echo "Select * from ".USERS." where emailid='".$dataForm['emailid']."' AND password='******'pass']."'"; die; if ($qury != "" and count($qury) > 0) { if ($qury[0]['user_status'] == 1) { if ($qury[0]['active_status'] == 1) { if ($mySession->camptitl != "" && $mySession->showurl != "") { //$mySession->errorMsg ="Login First to launch your campaign"; //echo "from launch"; die; $mySession->TeeLoggedID = $qury[0]['user_id']; $this->_redirect('launchcampaign/adddescription/login/login'); } elseif ($mySession->save_login_url != '') { //echo "normal login"; die; $mySession->TeeLoggedID = $qury[0]['user_id']; $this->_redirect($mySession->save_login_url); } else { //echo "normal login"; die; $mySession->TeeLoggedID = $qury[0]['user_id']; $this->_redirect('myaccount/profile'); } } else { $mySession->errorMsg = "Activate your account by clicking on the link sent to your mail"; $this->_redirect('login/index'); } } else { $mySession->errorMsg = "Your Account is inactivated by admin"; $this->_redirect('login/index'); } } else { $mySession->errorMsg = "Invalid Email Address & Password"; $this->_redirect('login/index'); } } else { //$mySession->errorMsg="form not valid"; $this->view->myform = $myform; $this->render('index'); } } else { //$mySession->errorMsg="check out"; $this->_redirect('login/index'); } }
public function orderrecordsAction() { global $mySession; $db = new Db(); $name = $this->getRequest()->getParam('name'); //echo "select * from ".ORDER_RECORD." where teeurl='".$name."'"; die; $qry = "select * from " . ORDER_RECORD . " where teeurl='" . $name . "'"; $sql = $db->runquery($qry); $this->view->sql = $sql; //$campid=$this->getRequest()->getParam('campid'); //$this->view->campid=$campid; }
public function updatechangepasswordAction() { global $mySession; $db = new Db(); $this->_helper->layout->setLayout('myaccount'); $myform = new Form_Changepassword(); $this->view->myform = $myform; if ($this->getRequest()->isPost()) { $request = $this->getRequest(); $myform = new Form_Changepassword(); if ($myform->isValid($request->getPost())) { $dataForm = $myform->getValues(); $qury = $db->runquery("Select * from " . USERS . ""); //$password=$qury[0]['password']; if ($dataForm['currentpass'] == $qury[0]['password']) { $pass = $dataForm['newpass']; $cnfrm = $dataForm['cnfrmnewpass']; if ($pass == $cnfrm) { $myObj = new Myaccountdb(); // call to model $data = $myObj->changepass($dataForm); if ($data == 1) { $mySession->errorMsg = "Password updated successfully"; $this->_redirect('myaccount/changepassword'); } } else { $mySession->errorMsg = "password is not same"; $this->render('changepassword'); } } else { $mySession->errorMsg = "Your Current Password does not match"; $this->render('changepassword'); } } else { $this->view->myform = $myform; $this->render('changepassword'); } } else { $this->_redirect('myaccount/changepassword'); } }
public function myInit($cid) { global $mySession; $db = new Db(); $public_name = ""; $description_val = ""; $shippingaddr = ""; $firstname_val = ""; $lastname_val = ""; $address_val = ""; $city_val = ""; $state_val = ""; $zipcode_val = ""; $url_val = ""; $instruction_val = ''; $qur = $db->runquery("SELECT * FROM " . LAUNCHCAMPAIGN . " WHERE campaign_id='" . $cid . "' "); if ($qur != "" and count($qur) > 0) { $public_name = $qur[0]['title']; $url_val = $qur[0]['url']; $description_val = $qur[0]['description']; $shippingaddr_val = $qur[0]['new_address']; } $url = new Zend_Form_Element_Hidden('url'); $url->setValue($url_val); $this->addElement($url); # FORM ELEMENT:camptitle # TYPE : text $camptitle = new Zend_Form_Element_Text('camptitle'); $camptitle->setRequired(true)->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'setgoaltxt')->setAttrib("style", "width:450px; height:30px;")->setValue($public_name); # FORM ELEMENT:description # TYPE : text $description = new Zend_Form_Element_Textarea('description'); $description->setRequired(true)->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'setgoaltxt')->setAttrib("style", "width:450px; height:120px;")->setValue($description_val); # FORM ELEMENT:check # TYPE : text $shippingaddr = new Zend_Form_Element_Checkbox('shippingaddr'); $shippingaddr->setAttrib('onclick', 'opendiv(this.id);'); if ($shippingaddr_val == 1) { $qur1 = $db->runquery("SELECT * FROM " . SHIPPING_ADDRESS . " WHERE url='" . $url_val . "' "); //prd($qur1); if ($qur1 != "" and count($qur1) > 0) { $firstname_val = $qur1[0]['fname']; $lastname_val = $qur1[0]['lname']; $address_val = $qur1[0]['address']; $city_val = $qur1[0]['city']; $state_val = $qur1[0]['state']; $instruction_val = $qur1[0]['instruction']; $zipcode_val = $qur1[0]['zipcode']; } } $firstname = new Zend_Form_Element_Text('firstname'); $firstname->addValidator('NotEmpty', true, array('messages' => 'First name is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib("onkeypress", "return checkcharonly(event);")->setAttrib('class', 'changeaddress'); if (array_key_exists('shippingaddr', $_REQUEST) && $_REQUEST['shippingaddr'] == 1) { $firstname->setRequired(true); } $firstname->setAttrib("style", "width:180px; height:30px;")->setValue($firstname_val); $this->addElement($firstname); # FORM ELEMENT:last name # TYPE : text $lastname = new Zend_Form_Element_Text('lastname'); $lastname->addValidator('NotEmpty', true, array('messages' => 'Last name is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib("onkeypress", "return checkcharonly(event);")->setAttrib('class', 'changeaddress'); if (array_key_exists('shippingaddr', $_REQUEST) && $_REQUEST['shippingaddr'] == 1) { $lastname->setRequired(true); } $lastname->setAttrib("style", "width:180px; height:30px;")->setValue($lastname_val); $this->addElement($lastname); # FORM ELEMENT:address # TYPE : text $newaddress = new Zend_Form_Element_Text('newaddress'); $newaddress->addValidator('NotEmpty', true, array('messages' => 'Address is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changepasstextbox')->setValue($address_val); if (array_key_exists('shippingaddr', $_REQUEST) && $_REQUEST['shippingaddr'] == 1) { $newaddress->setRequired(true); } $this->addElement($newaddress); # FORM ELEMENT:city # TYPE : text $newcity = new Zend_Form_Element_Text('newcity'); $newcity->addValidator('NotEmpty', true, array('messages' => 'City is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib("onkeypress", "return checkcharonly(event);")->setAttrib('class', 'changeaddress')->setValue($city_val); if (array_key_exists('shippingaddr', $_REQUEST) && $_REQUEST['shippingaddr'] == 1) { $newcity->setRequired(true); } $newcity->setAttrib("style", "width:100px; height:30px;"); $this->addElement($newcity); # FORM ELEMENT:state # TYPE : text $StateArr = array(); $StateArr[0]['key'] = ""; $StateArr[0]['value'] = "- - Select State- -"; $StateData = $db->runQuery("select * from " . STATE . " 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++; } } $newstate = new Zend_Form_Element_Select('newstate'); $newstate->addMultiOptions($StateArr)->addValidator('NotEmpty', true, array('messages' => 'State is required.'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changeaddress')->setValue($state_val); if (array_key_exists('shippingaddr', $_REQUEST) && $_REQUEST['shippingaddr'] == 1) { $newstate->setRequired(true); } $newstate->setAttrib("style", "width:100px; height:33px;")->setAttrib("onchange", "getneighborhoodcities(this.value);"); $this->addElement($newstate); # FORM ELEMENT:zipcode # TYPE : text $newzipcode = new Zend_Form_Element_Text('newzipcode'); $newzipcode->addValidator('NotEmpty', true, array('messages' => 'zip code is required'))->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'changeaddress')->setAttrib("onkeypress", "return checknummsp(event);")->setValue($zipcode_val); if (array_key_exists('shippingaddr', $_REQUEST) && $_REQUEST['shippingaddr'] == 1) { $newzipcode->setRequired(true); } $newzipcode->setAttrib("style", "width:100px; height:30px;"); $this->addElement($newzipcode); # FORM ELEMENT:instruction # TYPE : text $instruction = new Zend_Form_Element_Textarea('instruction'); $instruction->addDecorator('Errors', array('class' => 'errmsg'))->setAttrib('class', 'setgoaltxt')->setValue($instruction_val); if (array_key_exists('shippingaddr', $_REQUEST) && $_REQUEST['shippingaddr'] == 1) { $instruction->setRequired(true); } $instruction->setAttrib("style", "width:450px; height:120px;"); $this->addElement($instruction); $this->addElements(array($camptitle, $description, $shippingaddr)); }
public function resumecampaign($dataForm, $cidresume) { global $mySession; $db = new Db(); $data_update['title'] = $dataForm['camptitle']; $data_update['description'] = $dataForm['description']; $data_update['campaign_length'] = $dataForm['no_ofdays']; if ($mySession->selectedIdValueKM != '' && isset($mySession->selectedIdValueKM)) { $data_update['SelectedProduct'] = $mySession->selectedIdValueKM; } $data_update['url'] = $dataForm['url']; $data_update['launch_date'] = date('Y-m-d H:i:s'); $data_update['campaign_length'] = $dataForm['no_ofdays']; $data_update['campaign_status'] = 1; $data_update['draft_status'] = 1; /* if(isset($mySession->setFrontImageIcon) && $mySession->setFrontImageIcon!="") $data_update['tee_image']=$mySession->setFrontImageIcon; if(isset($mySession->setBackImageIcon) && $mySession->setBackImageIcon!="") $data_update['tee_back_image']=$mySession->setBackImageIcon;*/ if (isset($mySession->recreation_product) && $mySession->recreation_product != "") { $data_update['normalImageData'] = $mySession->recreation_product; } if (isset($mySession->dataURLDbFront) && $mySession->dataURLDbFront != "") { $data_update['dataURLDbFront'] = urlencode($mySession->dataURLDbFront); } if (isset($mySession->dataURLDbBack) && $mySession->dataURLDbBack != "") { $data_update['dataURLDbBack'] = urlencode($mySession->dataURLDbBack); } $qryImage = "select * from " . MANAGEIMAGENAME . " "; $image = $db->runquery($qryImage); // foreach($qryImage1 as $image) if ($image[0]['frontimage'] != '') { $data_update['tee_image'] = $image[0]['frontimage']; } if ($image[0]['backimage'] != '') { $data_update['tee_back_image'] = $image[0]['backimage']; } $data_update['campaign_category'] = $dataForm['campaign_category']; $condition = "campaign_id='" . $cidresume . "'"; $data_Update['resume_status'] = 1; $condition_Upp = "campaign_id='" . $cidresume . "'"; /* echo "model resume "; pr($condition_Upp); prd($data_update);*/ //if($_REQUEST['newcheckbx']=='1') // { // $chkQry=$db->runQuery("select * from ".SHIPPING_ADDRESS." where url='".$dataForm['url']."'"); // // if($chkQry!="" and count($chkQry)>0) // { // //echo "address exists"; die; // $data_update['shipping_option']=1; // $data_update['new_address']=1; // $dataUpdate['user_id']=$mySession->TeeLoggedID; // $dataUpdate['url']=$dataForm['url']; // $dataUpdate['fname']=$dataForm['firstname']; // $dataUpdate['lname']=$dataForm['lastname']; // $dataUpdate['address']=$dataForm['newaddress']; // $dataUpdate['city']=$dataForm['newcity']; // $dataUpdate['state']=$dataForm['newstate']; // $dataUpdate['zipcode']=$dataForm['newzipcode']; // $dataUpdate['instruction']=$dataForm['instruction']; // // $conditionUp="url='".$dataForm['url']."'"; // //pr($dataUpdate); // //pr($conditionUp); // // $db->modify(SHIPPING_ADDRESS,$dataUpdate,$conditionUp); // } // else // { // $data_update['shipping_option']=1; // $data_update['new_address']=1; // $dataInsert['user_id']=$mySession->TeeLoggedID; // $dataInsert['url']=$dataForm['url']; // $dataInsert['fname']=$dataForm['firstname']; // $dataInsert['lname']=$dataForm['lastname']; // $dataInsert['address']=$dataForm['newaddress']; // $dataInsert['city']=$dataForm['newcity']; // $dataInsert['state']=$dataForm['newstate']; // $dataInsert['zipcode']=$dataForm['newzipcode']; // $dataInsert['instruction']=$dataForm['instruction']; // // $db->save(SHIPPING_ADDRESS,$dataInsert); // } // // } //pr($dataUpdate); //prd($conditionUp); $db->modify(LAUNCHCAMPAIGN, $data_update, $condition); $db->delete(MANAGEIMAGENAME); $db->modify(DRAFTS, $data_Update, $condition_Upp); return 1; }
public function paythroughcreditAction() { global $mySession; $db = new Db(); $this->_helper->layout->setLayout('myaccount'); $url = $this->getRequest()->getParam('url'); if ($this->getRequest()->isPost()) { $userId = $mySession->TeeLoggedID; $request = $this->getRequest(); $myform = new Form_Indexpayement(); //$myform=new Form_Indexpayement($url); if ($myform->isValid($request->getPost())) { $dataForm = $myform->getValues(); //$packageId=$this->getRequest()->getParam('packageId'); $Data = $db->runQuery("select * from " . LAUNCHCAMPAIGN . " WHERE url='" . $url . "'"); //$getamount=$mySession->price; require_once "paypal_pro.inc.php"; $emai_id = $dataForm['emailid']; //require_once("includes/config.php"); $firstName = urlencode($dataForm['fname']); $lastName = urlencode($dataForm['lname']); $creditCardType = urlencode($dataForm['creditcardtype']); $creditCardNumber = urlencode($dataForm['creditcardno']); $expDateMonth = urlencode($dataForm['exprymonth']); $padDateMonth = str_pad($expDateMonth, 2, '0', STR_PAD_LEFT); $expDateYear = urlencode($dataForm['expryyear']); $cvv2Number = urlencode($dataForm['cvvno']); $address1 = urlencode($dataForm['address']); //$address2 = urlencode($_POST['address2']); $city = urlencode($dataForm['city']); $state = urlencode($dataForm['state']); $zip = urlencode($dataForm['zipcode']); $amount = $mySession->totalamt; $currencyCode = "USD"; $paymentAction = urlencode("Sale"); if ($_POST['recurring'] == 1) { $profileStartDate = urlencode(date('Y-m-d h:i:s')); $billingPeriod = urlencode($_POST['billingPeriod']); // or "Day", "Week", "SemiMonth", "Year" $billingFreq = urlencode($_POST['billingFreq']); // combination of this and billingPeriod must be at most a year $initAmt = $amount; $failedInitAmtAction = urlencode("ContinueOnFailure"); $desc = urlencode("Recurring \$" . $amount); $autoBillAmt = urlencode("AddToNextBilling"); $profileReference = urlencode("Anonymous"); $methodToCall = 'CreateRecurringPaymentsProfile'; $nvpRecurring = '&BILLINGPERIOD=' . $billingPeriod . '&BILLINGFREQUENCY=' . $billingFreq . '&PROFILESTARTDATE=' . $profileStartDate . '&INITAMT=' . $initAmt . '&FAILEDINITAMTACTION=' . $failedInitAmtAction . '&DESC=' . $desc . '&AUTOBILLAMT=' . $autoBillAmt . '&PROFILEREFERENCE=' . $profileReference; } else { $nvpRecurring = ''; $methodToCall = 'doDirectPayment'; } $nvpstr = '&PAYMENTACTION=' . $paymentAction . '&AMT=' . $amount . '&CREDITCARDTYPE=' . $creditCardType . '&ACCT=' . $creditCardNumber . '&EXPDATE=' . $padDateMonth . $expDateYear . '&CVV2=' . $cvv2Number . '&FIRSTNAME=' . $firstName . '&LASTNAME=' . $lastName . '&STREET=' . $address1 . '&CITY=' . $city . '&STATE=' . $state . '&ZIP=' . $zip . '&COUNTRYCODE=US&CURRENCYCODE=' . $currencyCode . $nvpRecurring; /*$paypalPro = new paypal_pro('sdk-three_api1.sdk.com', 'QFZCWN5HZM8VBG7Q', 'A.d9eRKfd1yVkRrtmMfCFLTqa6M9AyodL0SJkhYztxUi8W9pCXF6.4NI', '', '', TRUE, FALSE ); */ $paypalPro = new paypal_pro('8ndra_api1.seznam.cz', 'J3K2SD2RXGG3ZTUY', 'AFcWxV21C7fd0v3bYYYRCpSSRl31A1bWIW8aO685Dq4z21-5wttwtLoY', '', '', TRUE, FALSE); $resArray = $paypalPro->hash_call($methodToCall, $nvpstr); $ack = strtoupper($resArray["ACK"]); if ($ack != "SUCCESS") { echo '<table border="0" cellspacing="4" cellpadding="4" align="center" style="padding-top:40px; padding-bottom:80px;">'; //echo "if"; echo '<tr>'; echo '<td colspan="2" style="font-weight:bold; font-size:20px; color:Green" align="center">Error! Please check that u will provide all information correctly :(</td>'; echo '</tr>'; echo '<tr>'; echo '<td align="left" style="font-size:18px;"> TIMESTAMP:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray["TIMESTAMP"] . '</td>'; echo '</tr>'; echo '<tr>'; echo '<td align="left" style="font-size:18px;"> Correlation ID:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray['CORRELATIONID'] . '</td>'; echo '</tr>'; echo '<tr>'; echo '<td align="left" style="font-size:18px;">ACK:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray['ACK'] . '</td>'; echo '</tr>'; echo '<td align="left" style="font-size:18px;"> VERSION:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray["VERSION"] . '</td>'; echo '</tr>'; echo '<tr>'; echo '<td align="left" style="font-size:18px;"> BUILD:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray["BUILD"] . '</td>'; echo '</tr>'; echo '<tr>'; echo '<td align="left" style="font-size:18px;"> L_ERRORCODE0:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray["L_ERRORCODE0"] . '</td>'; echo '</tr>'; echo '<td align="left" style="font-size:18px;"> L_SHORTMESSAGE0:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray["L_SHORTMESSAGE0"] . '</td>'; echo '</tr>'; echo '<td align="left" style="font-size:18px;"> L_LONGMESSAGE0:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray["L_LONGMESSAGE0"] . '</td>'; echo '</tr>'; echo '<td align="left" style="font-size:18px;"> L_SEVERITYCODE0:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray["L_SEVERITYCODE0"] . '</td>'; echo '</tr>'; echo '</tr>'; echo '<td align="left" style="font-size:18px;"> L_SEVERITYCODE0:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray["L_SEVERITYCODE0"] . '</td>'; echo '</tr>'; echo '<tr>'; echo '<td align="left" style="font-size:18px;"> AMT:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray["AMT"] . '</td>'; echo '</tr>'; echo '</table>'; } else { echo '<table border="0" cellspacing="4" cellpadding="4" align="center" style="padding-top:40px; padding-bottom:80px;">'; //echo "success"; echo '<tr>'; echo '<td colspan="2" style="font-weight:bold; font-size:20px; color:Green" align="center">Thank You For Your Payment :)</td>'; echo '</tr>'; echo '<tr>'; echo '<td align="left" style="font-size:18px;"> Transaction ID:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $resArray["TRANSACTIONID"] . '</td>'; echo '</tr>'; echo '<tr>'; echo '<td align="left" style="font-size:18px;"> Amount:</td>'; echo '<td style="font-size:18px; color:#006633;">' . $currencyCode . $resArray['AMT'] . '</td>'; echo '</tr>'; echo '</table>'; $qty = $mySession->totalquantity; $Data = $db->runQuery("select * from " . LAUNCHCAMPAIGN . " WHERE url='" . $url . "'"); //echo "select * from ".LAUNCHCAMPAIGN." WHERE url='".$url."'"; die; $no_ofsold = $Data[0]['sold']; $no_ofsold = $no_ofsold + $qty; //echo "No. Of T sold :".$no_ofsold; die; $data_update['sold'] = $no_ofsold; $condition = "url='" . $url . "'"; $addrs = $dataForm['address'] . " , " . $dataForm['city'] . " , " . $dataForm['state']; //echo "address: ".$addrs; die; //prd($condition); $db->modify(LAUNCHCAMPAIGN, $data_update, $condition); $idqry = $db->runquery("select * from " . LAUNCHCAMPAIGN . " where url='" . $url . "'"); $userid = $idqry[0]['user_id']; $useremail = $db->runquery("select * from " . USERS . " where user_id='" . $userid . "'"); $emailidcreator = $useremail[0]['emailid']; //echo "after payment mail to : ".$emailidcreator; die; $templateData = $db->runQuery("select * from " . EMAIL_TEMPLATES . " where template_id='14'"); $messageText = $templateData[0]['email_body']; $subject = $templateData[0]['email_subject']; $messageText = str_replace("[NAME]", $emailidcreator, $messageText); $messageText = str_replace("[SITENAME]", SITE_NAME, $messageText); //$messageText=str_replace("[ORDERNO]",$orderno,$messageText); //echo "msg text".$messageText; SendEmail($emailidcreator, $subject, $messageText); $dataInsert['name'] = $dataForm['fname'] . " " . $dataForm['lname']; $dataInsert['total_quantity'] = $mySession->totalquantity; $dataInsert['emailid'] = $dataForm['emailid']; $dataInsert['teeurl'] = $url; $dataInsert['size'] = $mySession->sizes; $dataInsert['t_image'] = 'designtee.png'; //$dataInsert['quantity']=$mySession->seeqty; $dataInsert['totalamt'] = $mySession->totalamt; $dataInsert['amount'] = $mySession->amount; $dataInsert['shipping_address'] = $addrs; $dataInsert['order_date'] = date('Y-m-d H:i:s'); // prd($dataInsert); $db->save(ORDER_RECORD, $dataInsert); $id = $db->lastInsertId(); $orderno = '000D' . $id; //echo "Your Order No. is: ".$orderno; $myObj = new Myaccountdb(); $data = $myObj->emailorder($orderno, $dataForm['emailid']); //$mySession->errorMsg="Your Order No. is: ".$orderno; if ($data == 1) { $mySession->errorMsg = "Order Placed. Order Number Mailed to you"; } $mySession->sizes = ""; unset($mySession->sizes); $mySession->totalquantity = ""; unset($mySession->totalquantity); $mySession->amount = ""; unset($mySession->amount); $mySession->totalamt = ""; unset($mySession->totalamt); } } } }
public function folowuserAction() { global $mySession; $db = new Db(); $id = $_REQUEST['id']; $chk = $db->runquery("select * from " . FOLLOW . " where follower_id='" . $mySession->TeeLoggedID . "' and following_id='" . $id . "' "); if ($chk != "" && count($chk) > 0) { $mySession->errorMsg = "You are already Following This user"; } else { $dataInsert['follower_id'] = $mySession->TeeLoggedID; $dataInsert['following_id'] = $id; $dataInsert['date_followed'] = new Zend_Db_Expr('NOW()'); $db->Save(FOLLOW, $dataInsert); } $mySession->errorMsg = "User Followed Successfully"; exit; }