function showWelcome() { //important to add the div thingy here so that the ajax knows what to update :) $formName = $this->_fullname . "logout"; $u = osBackUser(); $html = <<<PHTMLCODE \t\t\t\t\t\t<h2>Welcome {$u['userName']}!</h2> \t\t\t\t\t\t<form name="{$formName}" method="post" style="display:inline;"> \t\t\t\t\t\t\t<input type="hidden" name="_message" value="frame_logoutBtn" /><input type = "hidden" name="_target" value="{$this->_fullname}" /> \t\t\t\t\t\t\t<input value ="Logout" type = "button" onclick = 'JavaScript:sndmsg("{$formName}")' class="press" style="margin-top: 0px;"> \t\t\t\t\t\t</form> \t\t\t\t\t PHTMLCODE; return $html; }
function frmWelcome() { $u = osBackUser(); $name = strlen($u['userName']) > 1 ? $u['userName'] : $u['email']; $lgoutFrm = $this->_fullname . "lgout"; $d = array(); $link = osBackPageLink("Myacc"); return <<<PHTMLCODE <div id="pers_info"> Welcome <span id="user_name">{$name}</span>! <div id="balance_div">Balance: <span id="balance_span">{$this->balance} \$</span></div> </div> \t\t\t<ul> \t\t\t\t<li> \t\t\t\t\t<a id="signup-link" href="{$link}" >My Account</a> \t\t\t\t</li> \t\t\t\t<li> \t\t\t\t\t<form id="{$lgoutFrm}" style="display:inline;"> \t\t\t\t\t\t<input type="hidden" name="_message" value="frame_logoutBtn" /><input type = "hidden" name="_target" value="{$this->_fullname}" /> \t\t\t\t\t\t<a id="login-link" href="#logout" onclick="JavaScript:sndmsg('{$lgoutFrm}')">Log out</a> \t\t\t\t\t</form> \t\t\t\t</li> \t\t\t</ul> \t\t PHTMLCODE; }
function initTabbar($def) { $tab = array("Main", "Previous"); if (osIsAdmin()) { $tab[] = "CPanel"; } $user = osBackUser(); if ($user['UID'] != -1) { $tab[] = "MyAcc"; } $tab[] = "How"; $this->tabbar->bookContent($tab); $this->tabbar->bookSelected($def); }
function onUpdateInfo($info) { $curU = osBackUser(); $info['email'] = $curU['email']; if (isset($curU['userName'])) { if (strlen($curU['userName']) > 1) { $info['userName'] = $curU['userName']; } } if (isset($curU['BDate'])) { if (strlen($curU['BDate']) > 1) { $info['BDate'] = $curU['BDate']; } } $u = new user(""); $ret = $u->bookInfo($info); if ($ret == 1) { $this->personalinfomsg = "<center><b><font color=green>Update Successfully!</font></b></center>"; } else { $this->personalinfomsg = "<center><b><font color=red>{$ret}</font></b></center>"; } $this->_bookframe("frm"); }
function frmView() { $html = ''; $uUID = osBackUser(); if ($uUID == -1) { $html = <<<PHTMLCODE \t\t\t\tUser not loggedin. \t\t\t PHTMLCODE; } else { $u = new user(""); $uName = $u->backName(); $uMail = $u->backEmail(); $uAddress = $u->backAddress(); $uBDate = $u->backBDate(); $html = <<<PHTMLCODE \t\t\t\tName: {$uName}<br> \t\t\t\temail: {$uMail}<br> \t\t\t\tAddress: {$uAddress}<br> \t\t\t\tBirth Date: {$uBDate}<br> \t\t\t\t<FORM name="{$this->_fullname}" method="post"> \t\t\t\t\t<input type="hidden" name="_message" value="frame_editInfo" /><input type = "hidden" name="_target" value="{$this->_fullname}" /> \t\t\t\t\t<input value ="Edit" type = "button" onclick = 'JavaScript:sndmsg("{$this->_fullname}")' class="press" style="margin-top: 10px; margin-right: 50px;" /> \t\t\t\t</FORM> \t\t\t PHTMLCODE; } return $html; }
function backBDate() { $n = '{no b-date}'; $u = osBackUser(); if (isset($u['BDate'])) { $n = $u['BDate']; } return $n; }
function addpost($data) { //return boolean as successfullness // NOTE: $data=> (title,content,ownerbiz,ownerbizUID) // backUser (from os) $user = osBackUser(); if (!$user) { return false; } // insert post in epost $q = 'insert into epost_epost'; $q .= '(title,author_UID,author_name,owner_biz,owner_bizUID,latestEditionNo,numberOfComments) '; $q .= 'values("' . $data['title'] . '","' . $user['UID'] . '","' . $user['name'] . '","' . $data['ownerbiz'] . '",' . $data['ownerbizUID'] . ',1,0)'; query($q); $UID = mysql_insert_id(); // insert a row in category (if needed) if ($data['ownerbiz'] == "category") { $cat = new category("temp"); $cat->addcontent(array("catUID" => $data['ownerbizUID'], "bizname" => "epost", "bizUID" => $UID, "extra" => "")); } // insert a row in comments (if needed) if ($data['ownerbiz'] == "epost") { $q = 'insert into epost_comments'; $q .= '(epostUID,commentUID) '; $q .= 'values("' . $data['ownerbizUID'] . '","' . $UID . '")'; query($q); } // insert content $q = 'insert into epost_content'; $q .= '(epostUID,content,editionNo,timestamp) '; $q .= 'values("' . $UID . '","' . $data['content'] . '",1,"' . date(YmdHis) . '")'; $q .= ''; query($q); // update numberOfComments by sending this UID $this->increaseNumberOfComments($UID); return true; }
private function sendPaymentEmail($amount) { $mailheader1 = 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/html; charset=iso-8859-1' . "\r\n" . 'From: paypa!@RocketViews.com' . "\r\n" . 'Reply-To: kian.gb@gmail.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $mailheader2 = 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/html; charset=iso-8859-1' . "\r\n" . 'From: paypa!@RocketViews.com' . "\r\n" . 'Reply-To: reza2mussavi@hotmail.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $paypalemail = osBackUserPaypalEmail(); $userID = osBackUserID(); $t = new transaction(""); $trans = $t->backAll(); $u = osBackUser(); $name = strlen($u['userName']) > 0 ? $u['userName'] : "******"; $email = $u['email']; $msg = <<<PHTMLCODE \t\t\tHi,<br /> \t\t\tUserName: <b>{$name}</b> <br /> \t\t\tEmail: <b>{$email}</b> <br /> \t\t\tPaypal Email: <b>{$paypalemail}</b> <br /><br /> \t\t\tAmount: {$amount} \$ <br /> \t\t\t<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business={$paypalemail}&item_name=Withdraw_RocketViews&item_number={$userID}&amount={$amount}¤cy_code=USD"> \t\t\t\tClick Here to Pay \t\t\t</a> <br /><br /> \t\t\t{$trans}<br /><br /> \t\t\tRegards<br /> \t\t\tRocketViews<br /> \t\t\tWithdraw System<br /> \t\t PHTMLCODE; mail("*****@*****.**", "Paypal Withdraw RocketViews", $msg, $mailheader1); mail("*****@*****.**", "Paypal Withdraw RocketViews", $msg, $mailheader2); }