if ($ack != 'SUCCESS' && $ack != 'SUCCESSWITHWARNING') {
    $_SESSION['reshash'] = $resArray;
    $location = "APIError.php";
    header("Location: {$location}");
} else {
    //print_r($_SESSION);
    $orderid = $_SESSION['form']['orderid'];
    $sql = "SELECT * FROM " . ORDERS_TABLE . " WHERE id=" . $_SESSION['form']['orderid'];
    //exit;
    $orderdetails = $databaseobject->fetch_array($sql);
    extract($orderdetails[0]);
    $where = "id=" . $_SESSION['form']['orderid'];
    $AddArray = array('status' => 'shipped', 'paymentmode' => 'PayPal');
    $databaseobject->update_record(ORDERS_TABLE, $AddArray, $where, '', $query_echo = '');
    $sqladmin = "SELECT order_email from sitesetting";
    $orderemail = $databaseobject->get_name_using_id($sqladmin);
    //extract($orderdetails[0]);
    $from = $orderemail;
    //'Savostore.com';//$content['email'];
    $to = $orderemail;
    //'*****@*****.**';// $orderemail;//'*****@*****.**';//$orderemail;//'*****@*****.**';////$toemail;
    $headers = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $headers .= "From:" . $from;
    $mail_format = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Ejemplo n.º 2
0
 $access_token = $twitteroauth->getAccessToken($_GET['oauth_verifier']);
 // Save it in a session var
 $_SESSION['access_token'] = $access_token;
 // Let's get the user's info
 $user_info = $twitteroauth->get('account/verify_credentials');
 print_r($_SESSION);
 echo "<pre>";
 print_r($user_info);
 echo "</pre>";
 if (isset($user_info->error)) {
     header('Location: login-twitter.php');
 } else {
     $uid = $user_info->id;
     $username = $user_info->name;
     $sql = "Select email from " . USERS_TABLE . " where email ='" . $uid . "' AND sitelogin='******' AND del_status='1'";
     $uemail = $databaseobject->get_name_using_id($sql);
     if (trim($uemail) == '') {
         $AddArray = array("firstname" => $username, "email" => $uid, "created" => date("Y-m-d H:i:s"), "sitelogin" => 'twitter', "del_status" => '1');
         $_SESSION[session_id() . 'useremail'] = $user_profile['id'];
         $uname = ucfirst($user_profile['first_name']) . ' ' . ucfirst($user_profile['last_name']);
         $_SESSION[session_id() . 'username'] = $uname;
         $userid = $databaseobject->insert_record(USERS_TABLE, $AddArray, 'Registration successfuly', $query_echo = '');
         $userid1 = mysql_insert_id();
         $_SESSION[session_id() . 'userid'] = $userid1;
         $_SESSION[session_id() . 'sitelogin'] = '******';
         if (isset($_SESSION['placeorder']) && $_SESSION['placeorder'] != '') {
             $databaseobject->redirect(HREF_LINK . "placeorder/", " ");
         } else {
             $databaseobject->redirect(HREF_LINK, " ");
         }
     } else {
Ejemplo n.º 3
0
$view_path = $dir_path . 'Views/';
include $dir_path . 'includes/config.php';
$databaseobject = new DBclass();
require_once 'CallerService.php';
session_start();
if (isset($_POST['submit']) || isset($_POST['submit_x'])) {
    //print_r($_POST);
    if ($_POST['paynow'] == 'mpesa') {
        $where = "id=" . $_POST['orderid'];
        $orderid = $_POST['orderid'];
        $AddArray = array('paymentmode' => 'mpesa');
        $databaseobject->update_record(ORDERS_TABLE, $AddArray, $where, '', $query_echo = '');
        $sql = "select * from " . ORDERS_TABLE . " where id='" . $_POST['orderid'] . "'";
        $orderdetails = $databaseobject->fetch_array($sql);
        $sqladmin = "SELECT order_email from sitesetting";
        $orderemail = $databaseobject->get_name_using_id($sqladmin);
        extract($orderdetails[0]);
        $mailsql = "SELECT  *  FROM mailtemplate WHERE id='4'";
        $mailarr = $databaseobject->fetch_array($mailsql);
        $from = $mailarr[0]['fromemail'];
        //$from = 'Savostore.com';//$content['email'];
        $to = $orderemail;
        ////$orderemail;//'*****@*****.**';////$toemail;
        $headers = "MIME-Version: 1.0\r\n";
        $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
        $headers .= "From:" . $from;
        $subject = "Customer selected  M-pesa payment Method on Savostore.com";
        include 'mpesamail.php';
        //echo $mail_format;
        mail($to, $subject, $mail_format, $headers);
        $subject1 = $mailarr[0]['subject'];