Skip to content

Commit

Permalink
user profile
Browse files Browse the repository at this point in the history
  • Loading branch information
Shemona Singh authored and Shemona Singh committed Dec 6, 2017
1 parent 5061312 commit 7fe0ebf
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion www/application/controllers/Login.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
ini_set('error_reporting', ~E_NOTICE);

class Login extends CI_Controller {
function __Construct(){
parent::__Construct();
$this->load->database(); // load database
$this->load->model('User_Info_Model'); // load model
session_start();
$this->output->enable_profiler(TRUE);
}

public function index(){
Expand Down
1 change: 0 additions & 1 deletion www/application/controllers/User_Tweets.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ function __Construct(){
parent::__Construct();
$this->load->database(); // load database
$this->load->model('User_Tweets_Model'); // load model
//$this->output->enable_profiler(TRUE);
}

public function index() {
Expand Down
2 changes: 1 addition & 1 deletion www/application/models/User_Tweets_Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function addTweet(){
$this->load->helper('url');
$data = array(
'tweet' => $this->input->post('tweet'),
'user_id' => 2 // UPDATE THIS WITH SESSION DATA
'user_id' => $this->session->userdata('id') // UPDATE THIS WITH SESSION DATA
);

return $this->db->insert('Tweets', $data);
Expand Down
7 changes: 0 additions & 7 deletions www/application/views/login.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<?php
$this->load->library('form_validation');
<<<<<<< HEAD
echo validation_errors();
echo form_open('login'); ?>
<?php
var_dump($username); //var_dump($sesh);
=======
echo form_open('login');
>>>>>>> a024e265e94e8addb4b7953ae90dbdb94e25e7af
?>
<div class="login container">
<img class="icon" src="../img/twitter.png" alt="Twitter">
Expand Down
20 changes: 14 additions & 6 deletions www/application/views/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@
<h1>My Tweets</h1>

<?php $this->load->library('form_validation'); ?>
<?php echo form_open('user_tweets/create'); ?>

<div class="form-group">
<textarea class="form-control" rows="3" name="tweet" value="<?php echo set_value('tweet'); ?>" placeholder="What's on your mind?"></textarea>
<?php echo form_error('tweet'); ?>
<div class="row">
<div class="col-md-4 user-content">
<?php echo "<h3>" . $this->session->userdata('first_name') . " " . $this->session->userdata('last_name') . "</h3>"; ?>
</div>
<button class="btn btn-primary" type="submit">Tweet</button>
</form>
<div class="col-md-8">
<?php echo form_open('user_tweets/create'); ?>

<div class="form-group">
<textarea class="form-control" rows="3" name="tweet" value="<?php echo set_value('tweet'); ?>" placeholder="What's on your mind?"></textarea>
<?php echo form_error('tweet'); ?>
</div>
<button class="btn btn-primary" type="submit">Tweet</button>
</form>
</div>
</div>

<?php foreach($posts as $post){ ?>
<div class="tweet-container">
Expand Down
8 changes: 7 additions & 1 deletion www/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@ img.icon.reg {
margin:0 auto;
}

.tweet-container{
.user-content{
background-color:#ffffff;
border-radius: 50px;
border:1px solid #eeeeee;
}

.tweet-container{

margin-bottom:15px;
margin-top: 15px;
max-width:100%;
Expand Down

0 comments on commit 7fe0ebf

Please sign in to comment.