Esempio n. 1
0
 public function gettweetsAdmin($verify)
 {
     $dbh = new dbHandler();
     $sim = new simulator();
     $twts = $dbh->returnTweets($verify);
     $sim->showTweets($twts);
 }
Esempio n. 2
0
 public function showProfile($verify)
 {
     $sim = new simulator();
     $this->prr = file_get_contents($verify . "profile", FILE_USE_INCLUDE_PATH);
     echo $this->prr;
     $handle = fopen("php://stdin", "r");
     $extra = fgets($handle);
     $sim->followUp($verify);
 }
Esempio n. 3
0
 function addFollowers($verify)
 {
     $obj = new simulator();
     $dbh1 = new dbHandler();
     $obj->returnUsersF($verify);
     $follow = $obj->getFollowersInfo();
     $following = array();
     array_push($following, $follow);
     $obj->afterFollowing($following, $verify, $follow);
 }
Esempio n. 4
0
 function readMessage($verify)
 {
     $file = file_get_contents($verify . "message", FILE_USE_INCLUDE_PATH);
     if (trim($file) == false) {
         echo "NO MESSAGES";
     } else {
         echo $file;
     }
     $sim = new simulator();
     $sim->followUp($verify);
 }
Esempio n. 5
0
 public function AdminLogin($username, $password)
 {
     $ojb = new dbHandler();
     $sim = new simulator();
     $verify = $ojb->checkAdmin($username, $password);
     if ($verify) {
         $sim->afterAdminLogin($verify);
     } else {
         echo "Re-Enter Your Credentials Please";
         $sim->adminLoginInfo();
     }
 }
Esempio n. 6
0
 function addToList($list_name, $verify)
 {
     $db = new dbHandler();
     $sim = new simulator();
     $handle = fopen("php://stdin", "r");
     echo "Press 1 to add people in {$list_name}";
     $db->allUsersF($verify);
     echo "========Press the ID Number of the User to Add it to the list===========\n";
     $b = fgets($handle);
     $member = $db->returnUser($b);
     array_push($list_name, $member);
     $sim->afterList($list_name, $verify);
 }
Esempio n. 7
0
 function addUser()
 {
     $sim = new simulator();
     $handle = fopen("php://stdin", "r");
     echo "Enter Email\n";
     $email = fgets($handle);
     echo "Enter Username";
     $username = fgets($handle);
     echo "Enter Password";
     $password = fgets($handle);
     $id = sizeof($this->users) + 1;
     $newUser = array("id" => $id, "email" => $email, "username" => $username, "password" => $password);
     array_push($this->users, $newUser);
     $sim->followUp($username);
 }
Esempio n. 8
0
<?php

include_once "Api/user.php";
include_once "Api/tweet.php";
include_once "Api/dbhandle.php";
include_once "Api/profile.php";
include_once "Api/list.php";
include_once "Api/message.php";
include_once "Api/admin.php";
$obj = new simulator();
$obj->welcome();
class simulator
{
    public function __construct()
    {
        //  $this->setting();
        $twt = new tweet();
    }
    public function wrongLogin()
    {
        echo "Please Re-Enter Your Credentials\n";
        $this->loginInfo();
    }
    function tweetInput($verify)
    {
        $pic = new photo();
        $twt = new tweet();
        $dbh = new dbHandler();
        $handle = fopen("php://stdin", "r");
        echo "Write your Tweet\n ";
        $tweet = fgets($handle);