function delivery_start_msg($pi, $user_id)
{
    $ot_info_data = mysql_get_rows('messages', array('where' => "payment_id = '{$pi}' AND msg_type = 1"), 1);
    $insert_data = array('message' => '<div class="start-order-box"><div class="icon-order-start mb10"></div>Order is started. And it will deliver within ' . $ot_info_data['days'] . ' days.</div>', 'receiver_id' => $user_id, 'msg_type' => 0, 'payment_id' => $pi);
    insertDB($insert_data, 'messages');
    $insert_data['sender_id'] = NULL;
    return $insert_data;
}
Example #2
0
 $custom = explode('||', $ipn_post_data['custom']);
 $ipn_encode = json_encode($ipn_post_data);
 $insert_data = array('user_id' => $agent_id, 'client_id' => $ipn_post_data['option_selection2'], 'item_name' => '', 'quantity' => $ipn_post_data['quantity'], 'amount' => $ipn_post_data['mc_gross'], 'txn_id' => $ipn_post_data['txn_id'], 'date' => date('Y-m-d H:i:s', strtotime($ipn_post_data['payment_date'])), 'payment_status' => $ipn_post_data['payment_status'], 'info_updated' => 1, 'package' => $ipn_post_data['item_name'], 'test_ipn' => $ipn_post_data['test_ipn'], 'unique_key' => $custom[0], 'post_data' => $ipn_encode, 'job_status' => 1, 'bkid' => $outsource_data['id']);
 $msg_insert_data = array('receiver_id' => $agent_id, 'msg_type' => 1, 'message' => '', 'deliverable' => '', 'days' => '');
 // check dmexpert id available from basekit
 $dmid = '';
 if (is_array($def_data) && !is_null($def_data['dmid'])) {
     $sp_temp_data = mysql_get_rows('service_packages', array('where' => "id = '{$def_data['dmid']}'"), 1);
     if ($sp_temp_data) {
         $package_data = $sp_temp_data;
         $dmid = $def_data['dmid'];
     }
 }
 // dmexpert id available
 if ($dmid) {
     $service_data = mysql_get_rows('services', array('where' => "id = '{$package_data['service_id']}'"), 1);
     if (!is_array($service_data)) {
         $service_data = array();
     }
     $insert_data['item_name'] = count($service_data) > 0 ? $service_data['name'] : '';
     $insert_data['package'] = $package_data['job'];
     $insert_data['package_id'] = $dmid;
     $msg_insert_data['message'] = secure_data($package_data['required_data']);
     $msg_insert_data['deliverable'] = secure_data($package_data['deliverable']);
     $msg_insert_data['days'] = secure_data($package_data['days_to_complete']);
 } else {
     if (is_array($def_data)) {
         $msg_insert_data['message'] = secure_data($def_data['required_data']);
         $msg_insert_data['deliverable'] = secure_data($def_data['deliverable']);
         $msg_insert_data['days'] = secure_data($def_data['days_to_complete']);
     } else {
<?php

include 'config.php';
$allowed_domains = array('localhost', 'basekit-staging.digibuzz24.net');
$settings = json_decode(file_get_contents('admin/data/settings.txt'));
$email = secure_data($_GET['e']);
//echo "<pre>"; print_r($_SERVER); exit;
$ref_domain = '';
$referrer = @$_SERVER['HTTP_REFERER'];
if ($referrer) {
    $parse = parse_url($referrer);
    $ref_domain = preg_replace('#^www\\.(.+\\.)#i', '$1', $parse['host']);
}
if ($email && filter_var($email, FILTER_VALIDATE_EMAIL) && $ref_domain && in_array($ref_domain, $allowed_domains)) {
    $user_data = mysql_get_rows('users', array('where' => 'email = "' . $email . '"'), 1);
    if (!$user_data) {
        $email_arr = explode('@', $email);
        $username = $email_arr[0];
        $insert_data = array('email' => $email, 'username' => $username, 'password' => md5(rand(5, 6)), 'type' => 2, 'status' => 1, 'created_at' => date('Y-m-d H:i:s'));
        $id = insertDB($insert_data, 'users');
    } else {
        $id = $user_data['id'];
    }
    $_SESSION['agent'] = $id;
    header("Location: dashboard.php");
    exit;
} else {
    header("Location: login.php");
    exit;
}
<?php

include 'config.php';
checkAjax();
$return_data = array('status' => 0);
$section_id = secure_data($_POST['sectionId']);
$step_id = secure_data($_POST['stepId']);
$enable = secure_data($_POST['changeEnable']);
$user_id = $_SESSION['agent'];
// Check if record exists or not
$is_exists = mysql_get_rows('user_completed_couse', array('where' => "section_id='{$section_id}' AND user_id='{$user_id}'"), 1);
if ($is_exists === '') {
    $section_data = mysql_get_rows('course_sections', array('where' => "id='{$section_id}'"), 1);
    $insert_values = array('user_id' => $user_id, 'course_id' => $section_data['course_id'], 'section_id' => $section_id);
    $id = insertDB($insert_values, 'user_completed_couse');
    $completed = array();
} else {
    $id = $is_exists['id'];
    if (trim($is_exists['completed']) === '') {
        $completed = array();
    } else {
        $completed = explode(',', trim($is_exists['completed']));
    }
}
if ($enable == 1) {
    $completed[] = $step_id;
    array_unique($completed);
    $str_completed = implode(',', $completed);
    updateDB("completed = '{$str_completed}'", "WHERE id='{$id}'", 'user_completed_couse');
    $return_data['status'] = 1;
    $return_data['enable'] = 1;
<?php

set_time_limit(0);
include '../config.php';
$data = json_decode(file_get_contents('../admin/data/home.txt'));
$bkid = secure_data($_GET['id']);
$dmuk = secure_data($_GET['dmuk']);
if ($bkid !== '' && $dmuk !== '') {
    $properties = array('where' => "md5(bkid) = '{$bkid}' AND md5(unique_key) = '{$dmuk}'");
    $payment_data = mysql_get_rows('payments', $properties, 1);
    if ($payment_data && !is_null($payment_data['user_id'])) {
        $user_data = mysql_get_rows('users', array('where' => "id = '{$payment_data['user_id']}'"), 1);
        $_SESSION['agent'] = $user_data['id'];
        $url = SITE_URL . "updateinfo.php?uk=" . md5($payment_data['unique_key']) . "&id=" . md5($payment_data['id']);
        header("Location: " . $url);
        exit;
    } else {
        header("Location: " . SITE_URL);
        die;
    }
} else {
    header("Location: " . SITE_URL);
    die;
}
<?php

include 'config.php';
include 'includes/paypalconfig.php';
$settings = json_decode(file_get_contents('admin/data/settings.txt'));
$custom = explode('||', secure_data($_POST['custom']));
$payment_data = mysql_get_rows('payments', array('where' => "unique_key = '{$custom['0']}' AND user_id = '{$custom['1']}'"), 1);
if ($payment_data) {
    header("Location: " . SITE_URL . 'updateinfo.php?uk=' . md5($custom[0]) . '&id=' . md5($payment_data['id']));
} else {
    header("Location: " . SITE_URL);
}
require_once 'config.php';
$id = secure_data($_GET['id']);
$uk = secure_data($_GET['uk']);
$payment_data = mysql_get_rows('payments', array('where' => "md5(id)='{$id}' AND md5(unique_key)='{$uk}'"), 1);
if (!$payment_data) {
    header("Location: " . SITE_URL . "admin/");
    die;
}
$user_data = mysql_get_rows('users', array('where' => "id='{$payment_data['user_id']}'"), 1);
$messages = array();
$overdue = 0;
if ($payment_data['info_updated'] == 1) {
    $msg_types = implode(',', array(0, 1, 2, 3, 4, 5, 6));
    $info_data = mysql_get_rows('messages', array('where' => "payment_id='{$payment_data['id']}' AND msg_type='1'"), 1);
    $messages = mysql_get_rows('messages', array('where' => "payment_id='{$payment_data['id']}' AND msg_type IN ({$msg_types})"));
    $time = time();
    $deliver_time = strtotime($payment_data['order_start_date']) + $info_data['days'] * 86400;
    if (in_array($payment_data['job_status'], array(2, 4)) && $time > $deliver_time) {
        $overdue = 1;
    }
}
if (!is_array($messages)) {
    $messages = array();
}
?>
			<div id="page-wrapper">
				<div class="loader-parent clearfix mb20">
					<h1 class="page-header">Outsource Info</h1>
					<div class="well well-msg clearfix">
						<div class="message-box-container text-left"><div class="message-container"></div></div>
$data = json_decode(file_get_contents('../admin/data/home.txt'));
$return_data = array('status' => 0, 'message' => 'An error occured');
$post_data = $_POST;
$bkodata = $post_data['post_data'];
$allowed_domains = array('localhost', 'basekit-staging.digibuzz24.net');
$ref_domain = '';
$referrer = @$_SERVER['HTTP_REFERER'];
if ($referrer) {
    $parse = parse_url($referrer);
    $ref_domain = preg_replace('#^www\\.(.+\\.)#i', '$1', $parse['host']);
}
if ($ref_domain && in_array($ref_domain, $allowed_domains) && $post_data['access'] === md5('basekit-to-dmexpert-api')) {
    $job_type = isset($bkodata['ostatus']) && $bkodata['ostatus'] ? $bkodata['ostatus'] : '';
    $user_data = mysql_get_rows('users', array('where' => "email = '{$post_data['email']}'"), 1);
    if ($user_data) {
        $payment_data = mysql_get_rows('payments', array('where' => "bkid = '{$bkodata['pi']}' AND user_id = '{$user_data['id']}'"), 1);
        if ($payment_data) {
            $v = new Validator($bkodata, array(), 'en', DOC_ORG_ROOT . 'lang/');
            if (!in_array($job_type, array(5, 6))) {
                $v->rule('required', ['message']);
            }
            if ($v->validate()) {
                $msg_type = 0;
                if ($job_type !== '') {
                    if ($job_type == 2 && $payment_data['order_started'] == 0) {
                        $msg_type = 2;
                    } elseif ($job_type == 4 && in_array($payment_data['job_status'], array(3))) {
                        $msg_type = 4;
                    } elseif ($job_type == 5 && in_array($payment_data['job_status'], array(3))) {
                        $msg_type = 5;
                    } elseif ($job_type == 6) {
<?php

include '../config.php';
include '../includes/validation.php';
$data = json_decode(file_get_contents('../admin/data/home.txt'));
$return_data = array('status' => 0);
$v = new Validator($_POST, array(), 'en', DOC_ORG_ROOT . 'lang/');
$v->rule('required', ['username', 'email', 'password']);
$v->rule('email', 'email');
if ($v->validate()) {
    $email = secure_data($_POST['email']);
    $is_exists = mysql_get_rows('users', array('where' => "email = '{$email}'"), 1);
    if (!$is_exists) {
        $username = secure_data($_POST['username']);
        $password = secure_data($_POST['password']);
        // Password must be in md5
        $insert_data = array('username' => $username, 'email' => $email, 'password' => $password, 'type' => 2, 'status' => 1, 'created_at' => date('Y-m-d H:i:s'));
        insertDB($insert_data, 'users');
    }
    $return_data['status'] = 1;
}
echo json_encode($return_data);
         $insert_data[1] = delivery_start_msg($pi, $user_id);
         $info_data = mysql_get_rows('messages', array('where' => "payment_id='{$payment_data['id']}' AND msg_type='1'"), 1);
         $return_data['od'] = $order_date;
         $return_data['dd'] = 'Before ' . date('Y-m-d H:i:s', strtotime($order_date) + $info_data['days'] * 86400);
     } elseif ($job_type == 4 && in_array($payment_data['job_status'], array(3))) {
         updateDB("job_status = 4", "WHERE id = '{$pi}'", 'payments');
         $info_data = mysql_get_rows('messages', array('where' => "payment_id='{$payment_data['id']}' AND msg_type='1'"), 1);
         $return_data['dd'] = 'Before ' . date('Y-m-d H:i:s', strtotime($payment_data['order_start_date']) + $info_data['days'] * 86400);
     } elseif ($job_type == 5 && in_array($payment_data['job_status'], array(3))) {
         updateDB("job_status = 5", "WHERE id = '{$pi}'", 'payments');
     } elseif ($job_type == 6) {
         updateDB("job_status = 6", "WHERE id = '{$pi}'", 'payments');
         $return_data['dd'] = '-';
     }
     if (in_array($job_type, array(2, 4, 5, 6)) && !is_null($payment_data['bkid']) && $payment_data['bkid'] !== '') {
         $user_data = mysql_get_rows('users', array('where' => "id='{$user_id}'"), 1);
         $curl_pay_data = $payment_data;
         unlink($curl_pay_data['post_data']);
         $curl_data = array('job_type' => $job_type, 'time' => $time, 'bkid' => $payment_data['bkid'], 'email' => $user_data['email'], 'payment_data' => $curl_pay_data, 'access' => md5('dmexpert-to-basekit-api'));
         $extra_data = array(CURLOPT_REFERER => 'http://www.dmexpert.net');
         $url = BK_URL . 'agent/dashboard/updatemessage';
         run_curl($url, $curl_data, $extra_data);
     }
 }
 ob_start();
 include "msg_display.php";
 $html = ob_get_contents();
 ob_end_clean();
 $return_data['html'] = $html;
 $return_data['rtype'] = $rtype;
 $return_data['status'] = 1;
Example #11
0
<?php

include 'config.php';
if (isset($_POST)) {
    $data = json_decode(file_get_contents("admin/data/settings.txt"));
    if (isset($_POST['username']) && $_POST['username'] !== "" && isset($_POST['password']) && $_POST['password'] !== "") {
        $email = secure_data($_POST['username']);
        $password = secure_data($_POST['password']);
        $properties = array('where' => '`email`="' . $email . '" AND `password`="' . md5($password) . '"');
        $user_data = mysql_get_rows('users', $properties, 1);
        if ($user_data) {
            $_SESSION['agent'] = $user_data['id'];
            header("Location: dashboard.php");
            exit;
        }
        //$_SESSION['admin'] = 'true';
        //header("Location: index.php");
    }
}
$settings = json_decode(file_get_contents('admin/data/settings.txt'));
include 'includes/header_guest.php';
?>

<div class="container" style="margin: 0 auto; text-align: center; width: 400px;">
	
	<div class="clearfix" style="padding: 10px;">
		<form action="" method="post" role="form" class="form-signin">
			<h2 class="form-signin-heading">Please sign in</h2>
			<input type="text" autofocus="" required="" placeholder="Email" name="username" style="margin: 10px 0; width: 100%;" class="form-control">
			<input type="password" required="" placeholder="Password" name="password" style="margin: 10px 0; width: 100%;" class="form-control">
			<button type="submit" class="btn btn-lg btn-primary btn-block" style="margin-top: 10px;">Sign in</button>