예제 #1
0
 public function controlChangePassword($id)
 {
     unset($_SESSION['error']);
     if ($_POST) {
         if (\isIsset($_POST)) {
             $password = $_POST['password'];
             $passwordRepeat = $_POST['passwordRepeat'];
             if (preg_match("#^[a-zA-Z0-9]{8,12}#", $password)) {
                 if ($password == $passwordRepeat) {
                     $usermanager = new \Manager\UserManager();
                     $usermanager->update(['token' => '', 'token_timestamp' => 0, 'password' => password_hash($password, PASSWORD_DEFAULT)], $id);
                     $_SESSION['error']['controlChangePassword'] = "******";
                     $this->redirectToRoute('home');
                 } else {
                     $_SESSION['error']['controlChangePassword'] = "******";
                 }
             } else {
                 $_SESSION['error']['controlChangePassword'] = "******";
             }
         } else {
             $_SESSION['error']['controlChangePassword'] = "******";
         }
     }
 }
예제 #2
0
         }
     }
     $resto_cuisine = !empty($resto_cuisine) ? substr($resto_cuisine, 0, -2) : '';
 }
 if (array_key_exists($re_info['country_code'], (array) $country_list)) {
     $country_name = $country_list[$re_info['country_code']];
 } else {
     $country_name = $re_info['country_code'];
 }
 $minimum_order = Yii::app()->functions->getOption("merchant_minimum_order", $re_info['merchant_id']);
 $delivery_fee = Yii::app()->functions->getOption("merchant_delivery_charges", $re_info['merchant_id']);
 $merchant_map_latitude = Yii::app()->functions->getOption("merchant_latitude", $re_info['merchant_id']);
 $merchant_map_longtitude = Yii::app()->functions->getOption("merchant_longtitude", $re_info['merchant_id']);
 echo CHtml::hiddenField('merchant_map_latitude', $merchant_map_latitude);
 echo CHtml::hiddenField('merchant_map_longtitude', $merchant_map_longtitude);
 echo CHtml::hiddenField('map_title', isIsset($re_info['restaurant_name']));
 echo CHtml::hiddenField('web_session_id', session_id());
 $ratings = Yii::app()->functions->getRatings($re_info['merchant_id']);
 $rating_meanings = '';
 if ($ratings['ratings'] >= 1) {
     $rating_meaning = Yii::app()->functions->getRatingsMeaning($ratings['ratings']);
     $rating_meanings = ucwords($rating_meaning['meaning']);
 }
 $initial_rating = '';
 $client_id = Yii::app()->functions->getClientId();
 if ($your_ratings = Yii::app()->functions->isClientRatingExist($merchant_id, $client_id)) {
     $initial_rating = $your_ratings['ratings'];
 }
 echo CHtml::hiddenField('initial_rating', $initial_rating);
 $has_reviews = false;
 if ($reviews = Yii::app()->functions->getReviews($client_id, $merchant_id)) {
예제 #3
0
    public function PaymentOption()
    {
        $client_info = '';
        $client_info = Yii::app()->functions->getClientInfo(Yii::app()->functions->getClientId());
        if (isset($s['kr_search_address'])) {
            $temp = explode(",", $s['kr_search_address']);
            if (is_array($temp) && count($temp) >= 2) {
                $street = isset($temp[0]) ? $temp[0] : '';
                $city = isset($temp[1]) ? $temp[1] : '';
                $state = isset($temp[2]) ? $temp[2] : '';
            }
            if (isset($client_info['street'])) {
                if (empty($client_info['street'])) {
                    $client_info['street'] = $street;
                }
            }
            if (isset($client_info['city'])) {
                if (empty($client_info['city'])) {
                    $client_info['city'] = $city;
                }
            }
            if (isset($client_info['state'])) {
                if (empty($client_info['state'])) {
                    $client_info['state'] = $state;
                }
            }
        }
        $merchant_address = '';
        if ($merchant_info = Yii::app()->functions->getMerchant($this->data['mtid'])) {
            $merchant_address = $merchant_info['street'] . " " . $merchant_info['city'] . " " . $merchant_info['state'];
            $merchant_address .= " " . $merchant_info['post_code'];
        }
        ?>
    
     	
        <div class="payment-option-wrap">

     	<form id="frm-delivery" class="frm-delivery uk-form" method="POST" onsubmit="return false;">
        
        <?php 
        echo CHtml::hiddenField('action', 'placeOrder');
        ?>
        <?php 
        echo CHtml::hiddenField('country_code', $merchant_info['country_code']);
        ?>
        <?php 
        echo CHtml::hiddenField('currentController', 'store');
        ?>
        <?php 
        echo CHtml::hiddenField('mtid', $this->data['mtid']);
        ?>
        
        <?php 
        if ($s['kr_delivery_options']['delivery_type'] == "pickup") {
            ?>
        
        <h3><?php 
            echo Yii::t("default", "Pickup information");
            ?>
</h3>
        <p class="uk-text-bold"><?php 
            echo $merchant_address;
            ?>
</p>
        <?php 
        } else {
            ?>
        
        <h3><?php 
            echo Yii::t("default", "Delivery information");
            ?>
</h3>
        
        <p>
        <?php 
            echo ucwords($merchant_info['restaurant_name']);
            ?>
 <?php 
            echo Yii::t("default", "Restaurant");
            ?>
 
        <?php 
            echo "<span class='uk-text-bold'>" . Yii::t("default", ucwords($s['kr_delivery_options']['delivery_type'])) . "</span> ";
            if ($s['kr_delivery_options']['delivery_asap'] == 1) {
                $s['kr_delivery_options']['delivery_date'] . " " . Yii::t("default", "ASAP");
            } else {
                echo '<span class="uk-text-bold">' . date("M d Y", strtotime($s['kr_delivery_options']['delivery_date'])) . " at " . " " . $s['kr_delivery_options']['delivery_time'] . "</span> to ";
            }
            ?>
        </p>
        
        <div class="uk-panel uk-panel-box">                                                              
            <div class="uk-form-row">
              <?php 
            echo CHtml::textField('street', isIsset($client_info['street']), array('class' => 'uk-width-1-1', 'placeholder' => Yii::t("default", "Street"), 'data-validation' => "required"));
            ?>
             </div>
             <div class="uk-form-row">
              <?php 
            echo CHtml::textField('city', isIsset($client_info['city']), array('class' => 'uk-width-1-1', 'placeholder' => Yii::t("default", "City"), 'data-validation' => "required"));
            ?>
             </div>
             <div class="uk-form-row">
              <?php 
            echo CHtml::textField('state', isIsset($client_info['state']), array('class' => 'uk-width-1-1', 'placeholder' => Yii::t("default", "State"), 'data-validation' => "required"));
            ?>
             </div>
             <div class="uk-form-row">
              <?php 
            echo CHtml::textField('zipcode', isIsset($client_info['zipcode']), array('class' => 'uk-width-1-1', 'placeholder' => Yii::t("default", "Zip code")));
            ?>
             </div>             
             
                          
             <div class="uk-form-row">
              <?php 
            echo CHtml::textField('location_name', isIsset($client_info['location_name']), array('class' => 'uk-width-1-1', 'placeholder' => Yii::t("default", "Apartment suite, unit number, or company name")));
            ?>
             </div>             
             <div class="uk-form-row">
              <?php 
            echo CHtml::textField('contact_phone', isIsset($client_info['contact_phone']), array('class' => 'uk-width-1-1', 'placeholder' => Yii::t("default", "Mobile Number"), 'data-validation' => "required"));
            ?>
             </div>             
             <div class="uk-form-row">
              <?php 
            echo CHtml::textField('delivery_instruction', '', array('class' => 'uk-width-1-1', 'placeholder' => Yii::t("default", "Delivery instructions")));
            ?>
             </div>                                                                    
        
        </div> <!--uk-panel--> 
        <?php 
        }
        ?>
        
        <h3><?php 
        echo Yii::t("default", "Payment Information");
        ?>
</h3>
        
        <?php 
        $enabled_paypal = Yii::app()->functions->getOption('enabled_paypal', $merchant_id);
        $enabled_stripe = Yii::app()->functions->getOption('stripe_enabled', $merchant_id);
        $merchant_mercado_enabled = Yii::app()->functions->getOption('merchant_mercado_enabled', $merchant_id);
        $merchant_disabled_cod = Yii::app()->functions->getOption('merchant_disabled_cod', $merchant_id);
        $merchant_disabled_ccr = Yii::app()->functions->getOption('merchant_disabled_ccr', $merchant_id);
        $merchant_payline_enabled = Yii::app()->functions->getOption('merchant_payline_enabled', $merchant_id);
        $merchant_sisow_enabled = Yii::app()->functions->getOption('merchant_sisow_enabled', $merchant_id);
        $merchant_payu_enabled = Yii::app()->functions->getOption('merchant_payu_enabled', $merchant_id);
        $enabled_stripe = '';
        ?>
         
         <div class="uk-panel uk-panel-box">
         
         <?php 
        if ($merchant_disabled_cod != "yes") {
            ?>
         <div class="uk-form-row">
         <?php 
            echo CHtml::radioButton('payment_opt', false, array('class' => "icheck payment_option", 'value' => 'cod'));
            ?>
 <?php 
            echo Yii::t("default", "Cash On delivery");
            ?>
         </div>
         <?php 
        }
        ?>
                
         
         <?php 
        if ($enabled_stripe == "yes") {
            ?>
         <div class="uk-form-row">
         <?php 
            echo CHtml::radioButton('payment_opt', false, array('class' => "icheck payment_option", 'value' => 'stp'));
            ?>
 <?php 
            echo Yii::t("default", "Stripe");
            ?>
         </div>
         <?php 
        }
        ?>
         
        
         
         </div> <!--uk-panel-->         
         
         <div class="spacer2"></div>
          <a href="javascript:;" class="uk-button uk-button-success place_order"><?php 
        echo Yii::t("default", "Place Order");
        ?>
</a>
         
        </form>     	        
        </div>
     	<?php 
        die;
    }
예제 #4
0
       <?php 
 echo CHtml::textField('zipcode', isIsset($client_info['zipcode']), array('class' => 'uk-width-1-1', 'placeholder' => Yii::t("default", "Zip code")));
 ?>
      </div>             
      
                   
      <div class="uk-form-row">
       <?php 
 echo CHtml::textField('location_name', isIsset($client_info['location_name']), array('class' => 'uk-width-1-1', 'placeholder' => Yii::t("default", "Apartment suite, unit number, or company name")));
 ?>
      </div>       
    </div> 
            
      <div class="uk-form-row">
       <?php 
 echo CHtml::textField('contact_phone', isIsset($client_info['contact_phone']), array('class' => 'uk-width-1-1 mobile_inputs', 'placeholder' => Yii::t("default", "Mobile Number"), 'data-validation' => "required"));
 ?>
      </div>             
      <div class="uk-form-row">
       <?php 
 echo CHtml::textField('delivery_instruction', '', array('class' => 'uk-width-1-1', 'placeholder' => Yii::t("default", "Delivery instructions")));
 ?>
      </div>                                                                    
      
      <div class="uk-form-row saved_address_block">
       <?php 
 echo CHtml::checkBox('saved_address', false, array('class' => "icheck", 'value' => 2));
 echo " " . t("Save to my address book");
 ?>
      </div>                                                                    
      
예제 #5
0
	         <div class="clear"></div>
	       </div>
	       
	       <?php 
        if ($data['payment_type'] == "pyp") {
            ?>
	       <?php 
            $paypal_info = Yii::app()->functions->getPaypalOrderPayment($data['order_id']);
            ?>
	       <div class="input-block">
	         <div class="label"><?php 
            echo Yii::t("default", "Paypal Transaction ID");
            ?>
 :</div>
	         <div class="value"><?php 
            echo isIsset($paypal_info['TRANSACTIONID']);
            ?>
</div>
	         <div class="clear"></div>
	       </div>
	       <?php 
        }
        ?>
	       
	       <div class="input-block">
	         <div class="label"><?php 
        echo Yii::t("default", "Reference #");
        ?>
 :</div>
	         <div class="value"><?php 
        echo Yii::app()->functions->formatOrderNumber($data['order_id']);
예제 #6
0
 public function forgetpassword()
 {
     unset($_SESSION['error']);
     if ($_POST) {
         if (\isIsset($_POST)) {
             $emailPasswordRecovery = $_POST['emailPasswordRecovery'];
             if (filter_var($emailPasswordRecovery, FILTER_VALIDATE_EMAIL)) {
                 $usermanager = new \Manager\UserManager();
                 if ($usermanager->emailExists($emailPasswordRecovery)) {
                     $user = $usermanager->getUserByUsernameOrEmail($emailPasswordRecovery);
                     if (\isComfirmedAccount($user['id'])) {
                         //On ne peut pas réinitialiser son password si le compte n'est pas confirmé
                         $token = \W\Security\StringUtils::randomString(32);
                         $tokentime = time() + 20 * 60;
                         $usermanager->update(['token' => password_hash($token, PASSWORD_DEFAULT), 'token_timestamp' => $tokentime], $user['id']);
                         $lien = '<a href="' . $this->generateUrl('mailPassword', ['token' => $token, 'id' => $user['id']], true) . '">http://www.mudeo.com/verif/u675CXIV9YOLHbYIjhgc8O7UNM</a>';
                         $lien_img = "od972.free.fr/logo.png";
                         $msg = "<img src='" . $lien_img . "' style='width:100px;height:100px'/> <h2>Mudéo </h2>";
                         $msg .= "<h4>MFF Corp.</h4><br/><br/>";
                         $msg .= "Pour pouvoir changer votre mot de passe <span style='font-weight:bold;'>" . strtoupper($user['username']) . "</span>. Veuillez cliquer sur le lien suivant qui vous redirigera vers notre site<br/><br/>" . $lien;
                         require_once 'assets/inc/mailer.php';
                         smtpmailer('*****@*****.**', '*****@*****.**', 'Admin', 'Vérification de la création de compte Mudéo', $msg);
                         if (isset($errorMail)) {
                             $_SESSION['error']['forgetpassword'] = $error;
                         } else {
                             $_SESSION['error']['forgetpassword'] = "******";
                         }
                     } else {
                         $_SESSION['error']['forgetpassword'] = "******" . $user['email'] . " avant de pouvoir utiliser cette fonctionalité";
                     }
                 } else {
                     $_SESSION['error']['forgetpassword'] = "******";
                 }
             } else {
                 $_SESSION['error']['forgetpassword'] = "******";
             }
         } else {
             $_SESSION['error']['forgetpassword'] = "******";
         }
     }
     $this->show('Default/home');
 }
예제 #7
0
            if (!empty($card_fee) && $card_fee >= 0.1) {
                $x++;
                $params['L_NAME' . $x] = t("Card Fee");
                $params['L_DESC' . $x] = t("Card Fee");
                $params['L_AMT' . $x] = normalPrettyPrice($card_fee);
                $params['L_QTY' . $x] = 1;
                $params['AMT'] = $params['AMT'] + $card_fee;
            }
            /*dump($params);
              die();*/
            $paypal = new Paypal($paypal_con);
            $paypal->params = $params;
            $paypal->debug = false;
            if ($resp = $paypal->setExpressCheckout()) {
                $insert['token'] = $resp['token'];
                $insert['order_id'] = isIsset($_GET['id']);
                $insert['date_created'] = date('c');
                $insert['ip_address'] = $_SERVER['REMOTE_PORT'];
                $insert['paypal_request'] = json_encode($paypal->params);
                $insert['paypal_response'] = json_encode($resp['resp']);
                Yii::app()->functions->paypalSavedToken($insert);
                header('Location: ' . $resp['url']);
            } else {
                $error = $paypal->getError();
            }
        }
    } else {
        $error = Yii::t("default", "Merchant Paypal Credential not yet been set.");
    }
}
?>