Exemple #1
0
 public function adminForgotPass()
 {
     if (isset($this->data['email_address'])) {
         if ($res = yii::app()->functions->isAdminExist($this->data['email_address'])) {
             $new_pass = yii::app()->functions->generateCode();
             $params = array('lost_password_code' => $new_pass, 'password' => md5($new_pass));
             if ($this->updateData("{{admin_user}}", $params, 'admin_id', $res[0]['admin_id'])) {
                 $this->code = 1;
                 $this->msg = Yii::t("default", "An email address was sent to your.");
                 $tpl = EmailTPL::adminForgotPassword($new_pass);
                 $sender = Yii::app()->functions->getOptionAdmin('website_contact_email');
                 $to = $res[0]['email_address'];
                 if (!sendEmail($to, $sender, t("Admin Forgot Password"), $tpl)) {
                     $this->details = "failed {$new_pass}";
                 } else {
                     $this->details = "ok mail {$new_pass}";
                 }
             } else {
                 $this->msg = Yii::t("default", "ERROR: Cannot update.");
             }
         } else {
             $this->msg = Yii::t("default", "Sorry but we cannot find your email address.");
         }
     } else {
         $this->msg = Yii::t("default", "Email address is required");
     }
 }
Exemple #2
0
     <?php 
    $order_ok = false;
    ?>
     <?php 
}
?>
     </div>
    </div> <!--main-->
</div> <!--page-->

<?php 
$data_raw = Yii::app()->functions->details['raw'];
$receipt = EmailTPL::salesReceipt($print, Yii::app()->functions->details['raw']);
$tpl = Yii::app()->functions->getOption("receipt_content", $merchant_id);
if (empty($tpl)) {
    $tpl = EmailTPL::receiptTPL();
}
$tpl = Yii::app()->functions->smarty('receipt', $receipt, $tpl);
$tpl = Yii::app()->functions->smarty('customer-name', $data['full_name'], $tpl);
$tpl = Yii::app()->functions->smarty('receipt-number', Yii::app()->functions->formatOrderNumber($data['order_id']), $tpl);
$receipt_sender = Yii::app()->functions->getOption("receipt_sender", $merchant_id);
$receipt_subject = Yii::app()->functions->getOption("receipt_subject", $merchant_id);
if (empty($receipt_subject)) {
    $receipt_subject = "Your Karenderia order is confirmed";
}
if (empty($receipt_sender)) {
    $receipt_sender = 'no-reply@' . $_SERVER['HTTP_HOST'];
}
$to = isset($data['email_address']) ? $data['email_address'] : '';
if (!in_array($data['order_id'], (array) $_SESSION['kr_receipt'])) {
    if ($order_ok == false) {
Exemple #3
0
<form class="uk-form uk-form-horizontal admin-settings-page forms" id="forms">
<?php 
echo CHtml::hiddenField('action', 'emailTplSettings');
?>

<?php 
$email_tpl_activation = Yii::app()->functions->getOptionAdmin('email_tpl_activation');
if (empty($email_tpl_activation)) {
    $email_tpl_activation = EmailTPL::merchantActivationCodePlain();
}
$email_tpl_forgot = Yii::app()->functions->getOptionAdmin('email_tpl_forgot');
if (empty($email_tpl_forgot)) {
    $email_tpl_forgot = EmailTPL::merchantForgotPassPlain();
}
?>

<div class="uk-form-row">
  <h3><?php 
echo t("merchant activation email template");
?>
</h3>
  <?php 
echo CHtml::textArea('email_tpl_activation', $email_tpl_activation, array('class' => "big-textarea"));
?>
 
</div>

<p style="margin:0;"><?php 
echo t("Available Tags");
?>
:</p>
<form class="uk-form uk-form-horizontal forms" id="forms">
<?php 
echo CHtml::hiddenField('action', 'withdrawalSettings');
?>

<?php 
$payoutRequest = EmailTPL::payoutRequest();
$payoutProcess = EmailTPL::payoutProcess();
$paymode = yii::app()->functions->getOptionAdmin('wd_paypal_mode');
$wd_template_payout_subject = yii::app()->functions->getOptionAdmin('wd_template_payout_subject');
$wd_template_process_subject = yii::app()->functions->getOptionAdmin('wd_template_process_subject');
if (empty($wd_template_payout_subject)) {
    $wd_template_payout_subject = t("Your Request for Withdrawal was Received");
}
if (empty($wd_template_process_subject)) {
    $wd_template_process_subject = t("Your Request for Withdrawal has been Processed");
}
?>


<h3><?php 
echo t("Settings");
?>
</h3>

<div class="uk-form-row">
<label class="uk-form-label"><?php 
echo t("Disabled Withdrawal from merchant");
?>
:</label>  
<?php 
Exemple #5
0
 public function faxSendNotification($merchant_info = '', $package_id = '', $payment_method = '', $price)
 {
     $fax_email_notification = Yii::app()->functions->getOptionAdmin("fax_email_notification");
     /*dump($merchant_info);
      	dump($package_id);
      	dump($payment_method);*/
     $package_info = $this->getFaxPackagesById($package_id);
     if (!empty($fax_email_notification) && is_array($package_info) && count($package_info) >= 1) {
         $tpl = EmailTPL::faxNotification();
         $tpl = smarty('merchant-name', $merchant_info['restaurant_name'], $tpl);
         $tpl = smarty('amount', displayPrice(getCurrencyCode(), prettyFormat($price)), $tpl);
         $tpl = smarty('payment-method', $payment_method, $tpl);
         $tpl = smarty('package-name', $package_info['title'], $tpl);
         sendEmail($fax_email_notification, '', "New Fax Payment Has been receive", $tpl);
     }
 }
    public function receipt()
    {
        $data = '';
        $ok = false;
        if ($data = Yii::app()->functions->getOrder2($_GET['id'])) {
            $merchant_id = $data['merchant_id'];
            $json_details = !empty($data['json_details']) ? json_decode($data['json_details'], true) : false;
            if ($json_details != false) {
                Yii::app()->functions->displayOrderHTML(array('merchant_id' => $data['merchant_id']), $json_details, true);
                if (Yii::app()->functions->code == 1) {
                    $ok = true;
                }
            }
        }
        unset($_SESSION['kr_item']);
        unset($_SESSION['kr_merchant_id']);
        unset($_SESSION['voucher_code']);
        unset($_SESSION['less_voucher']);
        $print = '';
        ?>
<div class="page">
	<div class="main"> 
	<div class="inner">
     <?php 
        if ($ok == TRUE) {
            ?>
         <div class="receipt-main-wrap">
         <h3><?php 
            echo Yii::t("default", "Thank You");
            ?>
</h3>
         <p><?php 
            echo Yii::t("default", "Your order has been placed.");
            ?>
</p>
         
	     <div class="receipt-wrap order-list-wrap">
	       <h4><?php 
            echo Yii::t("default", "Order Details");
            ?>
</h4>
	       <div class="input-block">
	         <div class="label"><?php 
            echo Yii::t("default", "Name");
            ?>
 :</div>
	         <div class="value"><?php 
            echo $data['full_name'];
            ?>
</div>
	         <div class="clear"></div>
	       </div>
	       
	       <?php 
            $print[] = array('label' => Yii::t("default", "Name"), 'value' => $data['full_name']);
            ?>
	       
	       <div class="input-block">
	         <div class="label"><?php 
            echo Yii::t("default", "Merchant Name");
            ?>
 :</div>
	         <div class="value"><?php 
            echo $data['merchant_name'];
            ?>
</div>
	         <div class="clear"></div>
	       </div>
	       
	       <?php 
            $print[] = array('label' => Yii::t("default", "Merchant Name"), 'value' => $data['merchant_name']);
            ?>
	       
	       <div class="input-block">
	         <div class="label"><?php 
            echo Yii::t("default", "TRN Type");
            ?>
 :</div>
	         <div class="value"><?php 
            echo Yii::t("default", $data['trans_type']);
            ?>
</div>
	         <div class="clear"></div>
	       </div>
	       
	       <?php 
            $print[] = array('label' => Yii::t("default", "TRN Type"), 'value' => $data['trans_type']);
            ?>
	       
	       <div class="input-block">
	         <div class="label"><?php 
            echo Yii::t("default", "Payment Type");
            ?>
 :</div>
	         <div class="value"><?php 
            echo strtoupper(Yii::t("default", $data['payment_type']));
            ?>
</div>
	         <div class="clear"></div>
	       </div>
	       <?php 
            $print[] = array('label' => Yii::t("default", "Payment Type"), 'value' => strtoupper($data['payment_type']));
            ?>
	       	       
	       <?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 isset($paypal_info['TRANSACTIONID']) ? $paypal_info['TRANSACTIONID'] : '';
                ?>
</div>
	         <div class="clear"></div>
	       </div>
	       <?php 
                $print[] = array('label' => Yii::t("default", "Paypal Transaction ID"), 'value' => isset($paypal_info['TRANSACTIONID']) ? $paypal_info['TRANSACTIONID'] : '');
                ?>
	       <?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']);
            ?>
</div>
	         <div class="clear"></div>
	       </div>
	       <?php 
            $print[] = array('label' => Yii::t("default", "Reference #"), 'value' => Yii::app()->functions->formatOrderNumber($data['order_id']));
            ?>
	       
	       <?php 
            if (!empty($data['payment_reference'])) {
                ?>
	       <div class="input-block">
	         <div class="label"><?php 
                echo Yii::t("default", "Payment Ref");
                ?>
 :</div>
	         <div class="value"><?php 
                echo $data['payment_reference'];
                ?>
</div>
	         <div class="clear"></div>
	       </div>
	       <?php 
                $print[] = array('label' => Yii::t("default", "Payment Ref"), 'value' => Yii::app()->functions->formatOrderNumber($data['order_id']));
                ?>
	       <?php 
            }
            ?>
	       	       
	       <?php 
            if ($data['payment_type'] == "ccr") {
                ?>
	       <div class="input-block">
	         <div class="label"><?php 
                echo Yii::t("default", "Card #");
                ?>
 :</div>
	         <div class="value"><?php 
                echo $card = Yii::app()->functions->maskCardnumber($data['credit_card_number']);
                ?>
</div>
	         <div class="clear"></div>
	       </div>
	       <?php 
                $print[] = array('label' => Yii::t("default", "Card #"), 'value' => $card);
                ?>
	       <?php 
            }
            ?>
	       
	       <div class="input-block">
	         <div class="label"><?php 
            echo Yii::t("default", "TRN Date");
            ?>
 :</div>
	         <div class="value"><?php 
            $trn_date = date('M d,Y G:i:s', strtotime($data['date_created']));
            echo Yii::app()->functions->translateDate($trn_date);
            ?>
</div>
	         <div class="clear"></div>
	       </div>
	       <?php 
            $print[] = array('label' => Yii::t("default", "TRN Date"), 'value' => $trn_date);
            ?>
	       
	       <?php 
            if ($data['trans_type'] == "delivery") {
                ?>
		       	       
		       <?php 
                if (isset($_SESSION['kr_delivery_options']['delivery_date'])) {
                    ?>
		       <div class="input-block">
		         <div class="label"><?php 
                    echo Yii::t("default", "Delivery Date");
                    ?>
 :</div>
		         <div class="value"><?php 
                    $deliver_date = prettyDate($_SESSION['kr_delivery_options']['delivery_date']);
                    echo Yii::app()->functions->translateDate($deliver_date);
                    ?>
</div>
		         <div class="clear"></div>
		       </div>
		       <?php 
                    $print[] = array('label' => Yii::t("default", "Delivery Date"), 'value' => $deliver_date);
                    ?>
		       <?php 
                }
                ?>
		       
		       <?php 
                if (isset($_SESSION['kr_delivery_options']['delivery_time'])) {
                    ?>
		       <?php 
                    if (!empty($_SESSION['kr_delivery_options']['delivery_time'])) {
                        ?>
		       <div class="input-block">
		         <div class="label"><?php 
                        echo Yii::t("default", "Delivery Time");
                        ?>
 :</div>
		         <div class="value"><?php 
                        echo $_SESSION['kr_delivery_options']['delivery_time'];
                        ?>
</div>
		         <div class="clear"></div>
		       </div>
		       <?php 
                    }
                    ?>
		       <?php 
                }
                ?>
		       
		       <?php 
                if (isset($_SESSION['kr_delivery_options']['delivery_asap'])) {
                    ?>
		       <?php 
                    if (!empty($_SESSION['kr_delivery_options']['delivery_asap'])) {
                        ?>
		       <div class="input-block">
		         <div class="label"><?php 
                        echo Yii::t("default", "Deliver ASAP");
                        ?>
 :</div>
		         <div class="value"><?php 
                        echo $delivery_asap = $_SESSION['kr_delivery_options']['delivery_asap'] == 1 ? "Yes" : '';
                        ?>
</div>
		         <div class="clear"></div>
		       </div>
			   <?php 
                        $print[] = array('label' => Yii::t("default", "Deliver ASAP"), 'value' => $delivery_asap);
                        ?>
		       <?php 
                    }
                    ?>
		       <?php 
                }
                ?>
		       
		       <div class="input-block">
		         <div class="label"><?php 
                echo Yii::t("default", "Deliver to");
                ?>
 :</div>
		         <div class="value"><?php 
                echo $data['full_address'];
                ?>
</div>
		         <div class="clear"></div>
		       </div>
				<?php 
                $print[] = array('label' => Yii::t("default", "Deliver to"), 'value' => $data['full_address']);
                ?>
		       
		       <div class="input-block">
		         <div class="label"><?php 
                echo Yii::t("default", "Delivery Instruction");
                ?>
 :</div>
		         <div class="value"><?php 
                echo $data['delivery_instruction'];
                ?>
</div>
		         <div class="clear"></div>
		       </div>
		       <?php 
                $print[] = array('label' => Yii::t("default", "Delivery Instruction"), 'value' => $data['delivery_instruction']);
                ?>
		       
		       <div class="input-block">
		         <div class="label"><?php 
                echo Yii::t("default", "Location Name");
                ?>
 :</div>
		         <div class="value"><?php 
                echo $data['location_name'];
                ?>
</div>
		         <div class="clear"></div>
		       </div>
		       <?php 
                $print[] = array('label' => Yii::t("default", "Location Name"), 'value' => $data['location_name']);
                ?>
				
		   <?php 
            } else {
                ?>
   
		   
		      <?php 
                if (isset($_SESSION['kr_delivery_options']['delivery_date'])) {
                    ?>
		       <div class="input-block">
		         <div class="label"><?php 
                    echo Yii::t("default", "Pickup Date");
                    ?>
 :</div>
		         <div class="value"><?php 
                    echo $_SESSION['kr_delivery_options']['delivery_date'];
                    ?>
</div>
		         <div class="clear"></div>
		       </div>
		       <?php 
                    $print[] = array('label' => Yii::t("default", "Pickup Date"), 'value' => $_SESSION['kr_delivery_options']['delivery_date']);
                    ?>
		       <?php 
                }
                ?>
		       
		       <?php 
                if (isset($_SESSION['kr_delivery_options']['delivery_time'])) {
                    ?>
		       <?php 
                    if (!empty($_SESSION['kr_delivery_options']['delivery_time'])) {
                        ?>
		       <div class="input-block">
		         <div class="label"><?php 
                        echo Yii::t("default", "Pickup Time");
                        ?>
 :</div>
		         <div class="value"><?php 
                        echo $_SESSION['kr_delivery_options']['delivery_time'];
                        ?>
</div>
		         <div class="clear"></div>
		       </div>
		       <?php 
                        $print[] = array('label' => Yii::t("default", "Pickup Time"), 'value' => $_SESSION['kr_delivery_options']['delivery_time']);
                        ?>
		       <?php 
                    }
                    ?>
		       <?php 
                }
                ?>
	       
	       <?php 
            }
            ?>
	       
	       <div class="spacer-small"></div>
	       
	       <?php 
            echo $item_details = Yii::app()->functions->details['html'];
            ?>
	     </div> <!--receipt-wrap-->
	     
	     <div class="print_wrap">
          <a class="print_element left" href="javascript:;"><i class="fa fa-print"></i> <?php 
            echo Yii::t("default", "Click here to print");
            ?>
</a>       
          <div class="clear"></div>
        </div>	    
        
        </div>
     <?php 
        } else {
            ?>
     <p class="uk-alert uk-alert-warning"><?php 
            echo Yii::t("default", "Sorry but we cannot find what you are looking for.");
            ?>
</p>
     <?php 
        }
        ?>
     </div>
    </div> <!--main-->
</div> <!--page-->

<?php 
        $receipt = EmailTPL::salesReceipt($print, Yii::app()->functions->details['raw']);
        $tpl = Yii::app()->functions->getOption("receipt_content", $merchant_id);
        if (empty($tpl)) {
            $tpl = EmailTPL::receiptTPL();
        }
        $tpl = Yii::app()->functions->smarty('receipt', $receipt, $tpl);
        $tpl = Yii::app()->functions->smarty('customer-name', $data['full_name'], $tpl);
        $tpl = Yii::app()->functions->smarty('receipt-number', Yii::app()->functions->formatOrderNumber($data['order_id']), $tpl);
        $receipt_sender = Yii::app()->functions->getOption("receipt_sender", $merchant_id);
        $receipt_subject = Yii::app()->functions->getOption("receipt_subject", $merchant_id);
        if (empty($receipt_subject)) {
            $receipt_subject = "Your Karenderia order is confirmed";
        }
        if (empty($receipt_sender)) {
            $receipt_sender = 'no-reply@' . $_SERVER['HTTP_HOST'];
        }
        $to = isset($data['email_address']) ? $data['email_address'] : '';
        if (!in_array($data['order_id'], (array) $_SESSION['kr_receipt'])) {
            sendEmail($to, $receipt_sender, $receipt_subject, $tpl);
            /*send email to merchant address*/
            $merchant_notify_email = Yii::app()->functions->getOption("merchant_notify_email", $merchant_id);
            $enabled_alert_notification = Yii::app()->functions->getOption("enabled_alert_notification", $merchant_id);
            /*dump($merchant_notify_email);
              dump($enabled_alert_notification);   */
            if ($enabled_alert_notification == "") {
                sendEmail($merchant_notify_email, $receipt_sender, Yii::t("default", "New Order From ") . $data['full_name'], $tpl);
            }
            // send SMS
            Yii::app()->functions->SMSnotificationMerchant($merchant_id, $data);
        }
        $_SESSION['kr_receipt'] = array($data['order_id']);
        die;
    }
$merchant_id = Yii::app()->functions->getMerchantID();
$merchant_booking_alert = Yii::app()->functions->getOption("merchant_booking_alert", $merchant_id);
$tp1 = Yii::app()->functions->getOption("merchant_booking_approved_tpl", $merchant_id);
$tp2 = Yii::app()->functions->getOption("merchant_booking_denied_tpl", $merchant_id);
if (empty($tp1)) {
    $tp1 = EmailTPL::bookingApproved();
}
if (empty($tp2)) {
    $tp2 = EmailTPL::bookingDenied();
}
$subject = Yii::app()->functions->getOption("merchant_booking_subject", $merchant_id);
$sender = Yii::app()->functions->getOption("merchant_booking_sender", $merchant_id);
$merchant_booking_receiver = Yii::app()->functions->getOption("merchant_booking_receiver", $merchant_id);
$merchant_booking_tpl = Yii::app()->functions->getOption("merchant_booking_tpl", $merchant_id);
if (empty($merchant_booking_tpl)) {
    $merchant_booking_tpl = EmailTPL::bookingTPL();
}
$merchant_booking_receive_subject = Yii::app()->functions->getOption("merchant_booking_receive_subject", $merchant_id);
$days = Yii::app()->functions->getDays();
$max_booked = Yii::app()->functions->getOption("max_booked", $merchant_id);
if (!empty($max_booked)) {
    $max_booked = json_decode($max_booked, true);
}
$fully_booked_msg = Yii::app()->functions->getOption("fully_booked_msg", $merchant_id);
?>

<form class="uk-form uk-form-horizontal forms" id="forms">
<?php 
echo CHtml::hiddenField('action', 'bookingAlertSettings');
?>
	
Exemple #8
0
<?php

$data = $_GET;
//dump($data);
$email_content = EmailTPL::merchantChangeStatus();
?>

<Div style="width:550px;padding:2px 20px;padding-bottom:20px;">

<form class="uk-form uk-form-horizontal frm-sent-sms" id="frm-sent-sms">
<?php 
echo CHtml::hiddenField('action', 'SendTestSMS');
?>

<h2><?php 
echo t("Send Test SMS");
?>
</h2>

<div class="uk-form-row">
  <label class="uk-form-label"><?php 
echo Yii::t("default", "Mobile Number");
?>
</label>
  <?php 
echo CHtml::textField('mobile', '', array('class' => "uk-form-width-large", 'data-validation' => "required"));
?>
</div>
<p style="margin:0;" class="uk-text-small uk-text-muted"><?php 
echo t("Include mobile country code eg +1");
?>
Exemple #9
0
<?php

$merchant_id = Yii::app()->functions->getMerchantID();
$enabled = Yii::app()->functions->getOption('merchant_bankdeposit_enabled', $merchant_id);
$deposit_instructions = Yii::app()->functions->getOption('merchant_deposit_instructions', $merchant_id);
if (empty($deposit_instructions)) {
    $deposit_instructions = EmailTPL::bankDepositTPL();
}
?>

<div id="error-message-wrapper"></div>

<form class="uk-form uk-form-horizontal forms" id="forms">
<?php 
echo CHtml::hiddenField('action', 'merchantBankDeposit');
?>

<div class="uk-form-row">
  <label class="uk-form-label"><?php 
echo Yii::t("default", "Enabled Offline Bank Deposit");
?>
?</label>
  <?php 
echo CHtml::checkBox('merchant_bankdeposit_enabled', $enabled == "yes" ? true : false, array('value' => "yes", 'class' => "icheck"));
?>
 
</div>

<div class="uk-form-row">
  <label class="uk-form-label"><?php 
echo Yii::t("default", "Email Sender");
Exemple #10
0
 public function getMerchantReceiptTemplate($merchant_id = '')
 {
     $tpl2 = Yii::app()->functions->getOption("merchant_receipt_content", $merchant_id);
     if (empty($tpl2)) {
         $tpl2 = EmailTPL::receiptMerchantTPL();
     }
     return $tpl2;
 }
Exemple #11
0
 public function ItemBankDepositVerification()
 {
     if ($res = Yii::app()->functions->getOrderInfo($this->data['ref'])) {
         $params = array('merchant_id' => $res['merchant_id'], 'branch_code' => $this->data['branch_code'], 'date_of_deposit' => $this->data['date_of_deposit'], 'time_of_deposit' => $this->data['time_of_deposit'], 'amount' => $this->data['amount'], 'scanphoto' => isset($this->data['photo']) ? $this->data['photo'] : '', 'date_created' => date('c'), 'ip_address' => $_SERVER['REMOTE_ADDR'], 'transaction_type' => "item_purchase", 'client_id' => $res['client_id'], 'order_id' => $this->data['ref']);
         if ($this->insertData("{{bank_deposit}}", $params)) {
             $this->code = 1;
             $this->msg = Yii::t("default", "Thank you. Your information has been receive please wait 1 or 2 days to verify your payment.");
             /*send email to admin owner*/
             if ($merchant_info = Yii::app()->functions->getMerchant($res['merchant_id'])) {
                 $to = $merchant_info['contact_email'];
             } else {
                 $to = '';
             }
             $from = 'no-reply@' . $_SERVER['HTTP_HOST'];
             $subject = Yii::t("default", "New Bank Deposit");
             $tpl = EmailTPL::bankDepositedReceiveMerchant();
             if (!empty($to)) {
                 Yii::app()->functions->sendEmail($to, $from, $subject, $tpl);
             }
         } else {
             $this->msg = t("Something went wrong during processing your request. Please try again later.");
         }
     } else {
         $this->msg = t("ERROR: Something went wrong");
     }
 }