Skip to content

Commit

Permalink
fixed merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Shemona Singh authored and Shemona Singh committed Dec 4, 2017
2 parents eac8bea + 149688a commit 41b5a2f
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 19 deletions.
2 changes: 1 addition & 1 deletion db/lamp_2017-12-03.sql
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ LOCK TABLES `Users` WRITE;
INSERT INTO `Users` (`id`, `first_name`, `last_name`, `username`, `password`, `email`, `url`, `location`)
VALUES
(1,'shemona','singh','mona','pass','shemona.singh@uconn.edu',NULL,'milford'),
(2,'christopher','stumper','chris','pass2','chris.stumper@uconn.edu',NULL,'simsbury');
(2,'chris','stumper','chris','pass2','chris.stumper@uconn.edu',NULL,'simsbury');

/*!40000 ALTER TABLE `Users` ENABLE KEYS */;
UNLOCK TABLES;
Expand Down
31 changes: 14 additions & 17 deletions www/application/controllers/User_Tweets.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class User_Tweets extends CI_Controller {

function __Construct(){
parent::__Construct ();
$this->load->database(); // load database
$this->load->model('User_Tweets_Model'); // load model
$this->output->enable_profiler(TRUE);
<?php defined('BASEPATH') OR exit('No direct script access allowed');
class User_Tweets extends CI_Controller {
function __Construct(){
parent::__Construct ();

$this->load->database();
$this->load->model('User_Tweets_Model');
$this->output->enable_profiler(TRUE);
}

public function index(){
$this->data['posts'] = $this->Users_Tweets_Model2->getPosts();
$this->load->view('user', $this->data);
}
}

public function index() {
$this->data['posts'] = $this->User_Tweets_Model->getPosts(); // calling Post model method getPosts()
$this->load->view('user', $this->data); // load the view file , we are passing $data array to view file
}

}
1 change: 0 additions & 1 deletion www/application/models/User_Tweets_Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ function getPosts(){


}
?>
17 changes: 17 additions & 0 deletions www/application/views/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@
<body>

<h1>Tweets Feed</h1>
<?php
$this->load->library('form_validation');
echo validation_errors();
echo form_open('user_tweets'); ?>

<div class="container">
<div class="row">
<div class="col-md-2 col-md-offset-5">
<h5>Tweet</h5>
<input type="text" name="tweet" value="<?php echo set_value('tweet'); ?>" size="50" />
<?php echo form_error('tweet'); ?>
<input type="hidden" name="user_id" value="<?php echo 'id' // USER ID HERE for tweet creation ?>">
<div><input class="btn" type="submit" value="Submit"/></div>
</form>



<div class="container">
<div class="row">
<?php foreach($posts as $post){?>
Expand Down

0 comments on commit 41b5a2f

Please sign in to comment.