Ejemplo n.º 1
0
\t\t\t<script type="text/javascript">
\t\t\t\t\$(document).ready(function(){
JQUERY;
    $msgMode = false;
    $_SESSION['silentmode'] = false;
    if (isset($_POST['_message'])) {
        if ($_POST['_target'] == "_broadcast") {
            osBroadcast($_POST['_message'], $_POST);
        } else {
            osMessage($_POST['_target'], $_POST['_message'], $_POST);
        }
        $msgMode = true;
    } else {
        if (isset($_GET['p'])) {
            $emptyar = array();
            osBroadcast("page_" . $_GET['p'], $emptyar);
        } elseif (count($_GET) > 0) {
            $_SESSION['osLink'] = $_GET;
            unset($_SESSION['osLink']['kill']);
            $_SESSION['silentmode'] = true;
            if (isset($_SESSION['osLink'])) {
                if (is_array($_SESSION['osLink'])) {
                    foreach ($_SESSION['osLink'] as $a => $b) {
                        $p = osParse($b);
                        osMessage($a, "client_" . $p[0], $p[1]);
                    }
                }
            }
            $_SESSION['silentmode'] = false;
        }
        if (isset($bizbank)) {
Ejemplo n.º 2
0
 function backUserSummary($UID)
 {
     $ret = array("Balance" => 0, "Charge" => 0, "Earn" => 0, "Reimburse" => 0, "Withdraw" => 0, "adPay" => 0);
     query("SELECT SUM(PPV * totalView) as earned FROM publink_info WHERE publisher=" . $UID);
     if ($row = fetch()) {
         $ret['Earn'] = sprintf("%.2f", $row['earned']);
     }
     query("SELECT SUM(amount) as total FROM transaction_history WHERE UID=" . $UID . " AND type='Charge'");
     if ($row = fetch()) {
         $ret['Charge'] = sprintf("%.2f", $row['total']);
     }
     query("SELECT SUM(amount) as total FROM transaction_history WHERE UID=" . $UID . " AND type='adPay'");
     if ($row = fetch()) {
         $ret['adPay'] = sprintf("%.2f", $row['total']);
     }
     query("SELECT SUM(amount) as total FROM transaction_history WHERE UID=" . $UID . " AND type='Withdraw'");
     if ($row = fetch()) {
         $ret['Withdraw'] = sprintf("%.2f", $row['total']);
     }
     query("SELECT SUM(amount) as total FROM transaction_history WHERE UID=" . $UID . " AND type='Reimburse'");
     if ($row = fetch()) {
         $ret['Reimburse'] = sprintf("%.2f", $row['total']);
     }
     $ret['Balance'] = $ret['Earn'] + $ret['Charge'] + $ret['adPay'] + $ret['Withdraw'] + $ret['Reimburse'];
     osBroadcast("transaction_update", array("balance" => $ret['Balance']));
     return $ret;
 }
Ejemplo n.º 3
0
     $_SESSION['user'] = array();
     $_SESSION['user']['UID'] = -1;
     $_SESSION['user']['Email'] = '';
     $_SESSION['user']['Name'] = '';
 }
 if (!isset($_SESSION['osNodes'])) {
     $_SESSION['osNodes'] = array();
 }
 if (!isset($_POST['_message'])) {
     $bizbank = new bizbank("B");
 }
 $msgMode = false;
 $_SESSION['silentmode'] = false;
 if (isset($_POST['_message'])) {
     if ($_POST['_target'] == "_broadcast") {
         osBroadcast($_POST['_message'], $_POST);
     } else {
         osMessage($_POST['_target'], $_POST['_message'], $_POST);
     }
     $msgMode = true;
 } else {
     if (count($_GET) > 0) {
         $_SESSION['osLink'] = $_GET;
         unset($_SESSION['osLink']['kill']);
         $_SESSION['silentmode'] = true;
         foreach ($_SESSION['osLink'] as $a => $b) {
             $p = osParse($b);
             osMessage($a, "client_" . $p[0], $p[1]);
         }
         $_SESSION['silentmode'] = false;
     }
Ejemplo n.º 4
0
 function onMyaccBtn($info)
 {
     if ($info['Page'] == "show") {
         $data = array();
         osBroadcast("user_showMyAccount", $data);
     }
 }
Ejemplo n.º 5
0
 function bookSelected($selected)
 {
     if ($this->selected == $selected) {
         return;
     }
     $this->selected = $selected;
     if ($selected) {
         osBroadcast("tab_tabselected", array("UID" => $this->UID));
         $this->_bookframe("selectedfrm");
     } else {
         $this->_bookframe("notselectedfrm");
     }
 }
Ejemplo n.º 6
0
 function login($email, $password)
 {
     //First check if the email even exists in the database...
     query("SELECT * FROM user_info WHERE email='" . $email . "' AND biznessUID= '" . osBackBizness() . "';");
     $row = fetch();
     //Didn't exist...
     if (count($row) == 1) {
         $this->loggedIn = -2;
         return -2;
     } else {
         $hashPassword = $this->sha1Hash($email, $password);
         $s = "SELECT * FROM user_info WHERE email='" . $email . "' AND password='******'  AND biznessUID= '" . osBackBizness() . "';";
         query($s);
         if ($row = fetch()) {
             $this->email = $email;
             $this->userUID = $row["userUID"];
             $this->userName = $row["userName"];
             if ($row["verificationCode"] == '0') {
                 // login succefull
                 $this->loggedIn = 1;
                 // let bizes know we're logged in!
                 osBookUser(array("email" => $this->email, "UID" => $this->userUID, "Address" => $row["Address"], "userName" => $row["UserName"], "BDate" => $this->addSlash2BDate($row["BDate"])));
                 osBroadcast("user_login", array());
                 return 1;
             } else {
                 //login succefull but need to validation
                 $this->loggedIn = 2;
                 return 2;
             }
         } else {
             //login failed
             $this->loggedIn = -1;
             return -1;
         }
     }
 }
Ejemplo n.º 7
0
 function onStickIt($info)
 {
     $ep = new epost("temp");
     $ep->addpost(array("title" => $info['title'], "content" => $info['content'], "ownerbiz" => $this->ownerName, "ownerbizUID" => $this->ownerUID));
     osBroadcast("epost_newPostAdded", array());
 }
Ejemplo n.º 8
0
 function onShowMyAccount($info)
 {
     $data = array();
     osBroadcast("user_showMyAccount", $data);
 }
Ejemplo n.º 9
0
 function onClickBtn()
 {
     osBroadcast("eboard_eBoardSelected", array("UID" => $this->UID));
     //_bookrame("frm");
 }
Ejemplo n.º 10
0
 function onUserTabChanged($info)
 {
     $this->curTab = $info['name'];
     osBroadcast("usertab_usertabChanged", array("tabName" => $this->curTab));
     $this->_bookframe("frm");
 }
Ejemplo n.º 11
0
 function bookSelected($sel)
 {
     $this->curTabName = $sel;
     osBroadcast("tab_tabChanged", array("tabName" => $sel));
 }