Exemplo n.º 1
0
 function bookModeUser($mode, $userID)
 {
     $al = new adlink("");
     $Vs = array();
     $Vs = $al->backVideoList($mode, $userID);
     $this->VBars = array();
     foreach ($Vs as $v) {
         $vb = new videobar("VBar" . $this->_fullname . count($this->VBars));
         $vb->bookInfo($v);
         $vb->bookMode($mode);
         $this->VBars[] = $vb;
     }
 }
Exemplo n.º 2
0
 function onAddVideo($info)
 {
     $of = $this->offer->backInfo();
     $t = new transaction("");
     $balance = $t->backBalance(osBackUserID());
     $e = "";
     if (strpos($info['link'], "www.youtube.com/watch?v=") === FALSE && strpos($info['link'], "youtu.be/") === FALSE) {
         $e .= "Enter a valid link<br>";
     }
     if ($info['AOPV'] < $of['minAOPV']) {
         $e .= "Minimum Offer should be " . $of['minAOPV'] . "<br>";
     }
     if ($info['NOV'] < $of['minNOV']) {
         $e .= "Minimum Number of Views should be " . $of['minNOV'] . "<br>";
     }
     if ($info['NOV'] * $info['AOPV'] != $info['total']) {
         $e .= "Invalid total value<br>";
     }
     if (strlen($info['title']) < 2) {
         $e .= "Invalid Title<br>";
     }
     if ($info['total'] > $balance) {
         $e .= "Insuffient balance<br>";
     }
     if (strlen($e) < 2) {
         // NO ERROR
         $al = new adlink("");
         $data = array();
         $data['advertisor'] = osBackUserID();
         $data['running'] = 1;
         $data['lastDate'] = "";
         $data['startDate'] = date("Y/m/d");
         $data['link'] = $info['link'];
         $data['title'] = $info['title'];
         $data['maxViews'] = $info['NOV'];
         $data['AOPV'] = $info['AOPV'];
         $data['paid'] = 0;
         $data['APRate'] = $of['APRatio'];
         $data['minLifeTime'] = $of['minLifeTime'];
         $data['minCancelTime'] = $of['minCancelTime'];
         $data['country'] = $info['country'];
         $data['paid'] = $info['total'];
         $al->bookLink($data);
         $emb = $al->backYEmbed($data['link']);
         $e = "Added Successfully<br>{$emb}";
         $t = new transaction("");
         $t->bookAdPay($info['AOPV'] * $info['NOV'], "Ad video - title: " . $info['title']);
         $this->_bookframe("frmSuccess");
     } else {
         // HAS ERROR
         $e = "ERROR: <br>" . $e;
         $this->_bookframe("frm");
     }
     $this->errMessage = $e;
 }
Exemplo n.º 3
0
 function onStopBtn($info)
 {
     $al = new adlink("");
     $u = new user("");
     if ($u->changePass($info['password'])) {
         if ($al->stop($this->data['adUID'])) {
             $this->data = $al->backLinkByID($this->data['adUID']);
         }
     }
     $this->_bookframe($this->_curFrame);
 }
Exemplo n.º 4
0
 function init()
 {
     $this->links = array();
     $al = new adlink("");
     $all = $al->backAllLink();
     $user = new user("");
     $i = 0;
     foreach ($all as $LData) {
         $u = $user->backUserData($LData['advertisor']);
         $LData['userName'] = $u['userName'];
         $l = new linkviewer($this->_fullname . $i++);
         $l->bookData($LData);
         $this->links[] = $l;
     }
 }