コード例 #1
0
 public function signupAction()
 {
     //global $testvar;
     global $mySession;
     $db = new Db();
     $testvar = 'abctestvar';
     $this->view->testing = $testvar;
     $myform = new Form_Logindesigned();
     $this->view->myform = $myform;
     $this->_helper->layout()->setLayout('simplecontent');
     if ($this->getRequest()->isPost()) {
         $request = $this->getRequest();
         $myformsignup = new Form_Signupdesigned();
         if ($myformsignup->isValid($request->getPost())) {
             $dataForm = $myformsignup->getValues();
             $pass = $dataForm['signuppass'];
             $cnfrm = $dataForm['signupcnfrmpass'];
             if ($pass == $cnfrm) {
                 $myObj = new Myaccountdb();
                 // call to model
                 $data = $myObj->signupdb($dataForm);
                 if ($data == 0) {
                     $mySession->errorMsg = "Email already Exisis. Enter Valid Email Address";
                     $this->view->myformsignup = $myformsignup;
                     $this->render('index');
                 } else {
                     //$mySession->errorMsg="login successfull";
                     $mySession->errorMsg = "A Registration Link sent to your Email";
                     $this->_redirect('logindesigned/index');
                     //$this->_redirect('myaccount/activecampaign');
                 }
             } else {
                 $mySession->errorMsg = "password not same";
                 $this->view->myformsignup = $myformsignup;
                 $this->render('index');
             }
         } else {
             $this->view->myformsignup = $myformsignup;
             $this->render('index');
         }
     } else {
         $this->_redirect('launchcampaign/index');
     }
 }
コード例 #2
0
 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);
             }
         }
     }
 }
コード例 #3
0
 public function updateuserAction()
 {
     global $mySession;
     $db = new Db();
     $this->_helper->layout->setLayout('myaccount');
     if ($this->getRequest()->isPost()) {
         $request = $this->getRequest();
         $myform = new Form_Profile();
         //error_log('MyaccountController->updateuserAction request: '.print_r($request, true));
         if ($myform->isValid($request->getPost())) {
             $dataForm = $myform->getValues();
             //error_log('MyaccountController->updateuserAction form valid, dataForm: '.print_r($dataForm, true));
             $myObj = new Myaccountdb();
             $data = $myObj->updateuser($dataForm);
             if ($data == 1) {
                 $mySession->errorMsg = "Profile Updated Successfully";
                 $this->_redirect('myaccount/profile');
             } else {
                 $mySession->errorMsg = "User Already Exist With This Email !!!";
                 $this->render('profile');
             }
         } else {
             //$mySession->errorMsg="not successfull ====>";
             $this->view->myform = $myform;
             $this->render('profile');
         }
     } else {
         //echo "else of request is post"; die;
         $this->_redirect('myaccount/profile');
     }
 }
コード例 #4
0
ファイル: LoginController.php プロジェクト: Alexeykolobov/php
 public function signupedAction()
 {
     //global $testvar;
     global $mySession;
     $launch = $this->getRequest()->getParam('l');
     $this->view->l = $launch;
     $this->_helper->layout->setLayout('myaccount');
     $db = new Db();
     $testvar = 'abctestvar';
     $this->view->testing = $testvar;
     $myform = new Form_Login();
     $this->view->myform = $myform;
     if ($this->getRequest()->isPost()) {
         $request = $this->getRequest();
         $myformsignup = new Form_Signup();
         if ($myformsignup->isValid($request->getPost())) {
             $dataForm = $myformsignup->getValues();
             $pass = $dataForm['signuppass'];
             $cnfrm = $dataForm['signupcnfrmpass'];
             if ($pass == $cnfrm) {
                 $myObj = new Myaccountdb();
                 // call to model
                 $data = $myObj->signupdb($dataForm);
                 if ($data == 0) {
                     $mySession->errorMsg = "Email already Exisis. Enter Valid Email Address";
                     $this->view->myformsignup = $myformsignup;
                     $this->render('index');
                 } else {
                     $mySession->errorMsg = "An Activation link sent to your email address. Please follow the link in the email to verify your email address and activate your account.";
                     //if($launch!="")
                     //							{
                     //								$this->_redirect('login/index/l/launch');
                     //							}
                     $this->_redirect('login/index');
                     //$this->_redirect('myaccount/activecampaign');
                 }
             } else {
                 $mySession->errorMsg = "Password not identical";
                 $this->view->myformsignup = $myformsignup;
                 $this->render('index');
             }
         } else {
             $this->view->myformsignup = $myformsignup;
             $this->render('index');
         }
     } else {
         $this->_redirect('login/index');
     }
 }