diff --git a/db/lamp_2017-12-03.sql b/db/lamp_2017-12-03.sql new file mode 100644 index 0000000..782af71 --- /dev/null +++ b/db/lamp_2017-12-03.sql @@ -0,0 +1,83 @@ +# ************************************************************ +# Sequel Pro SQL dump +# Version 4541 +# +# http://www.sequelpro.com/ +# https://github.com/sequelpro/sequelpro +# +# Host: 127.0.0.1 (MySQL 5.7.20) +# Database: lamp +# Generation Time: 2017-12-03 19:18:51 +0000 +# ************************************************************ + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + + +# Dump of table Tweets +# ------------------------------------------------------------ + +DROP TABLE IF EXISTS `Tweets`; + +CREATE TABLE `Tweets` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `tweet` char(140) DEFAULT NULL, + `date_time` datetime DEFAULT NULL, + `user_id` int(11) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +LOCK TABLES `Tweets` WRITE; +/*!40000 ALTER TABLE `Tweets` DISABLE KEYS */; + +INSERT INTO `Tweets` (`id`, `tweet`, `date_time`, `user_id`) +VALUES + (1,'testing tweet! one two three','1000-01-01 00:00:00',1), + (2,'testing tweet again! four five six','1000-01-01 00:00:00',2); + +/*!40000 ALTER TABLE `Tweets` ENABLE KEYS */; +UNLOCK TABLES; + + +# Dump of table Users +# ------------------------------------------------------------ + +DROP TABLE IF EXISTS `Users`; + +CREATE TABLE `Users` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `first_name` text, + `last_name` text, + `username` char(20) DEFAULT '', + `password` text, + `email` text, + `url` text, + `location` text, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +LOCK TABLES `Users` WRITE; +/*!40000 ALTER TABLE `Users` DISABLE KEYS */; + +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,'chris','stumper','chris','pass2','chris.stumper@uconn.edu',NULL,'simsbury'); + +/*!40000 ALTER TABLE `Users` ENABLE KEYS */; +UNLOCK TABLES; + + + +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/www/application/controllers/All_Tweets.php b/www/application/controllers/All_Tweets.php index d5bcca1..8816ca7 100644 --- a/www/application/controllers/All_Tweets.php +++ b/www/application/controllers/All_Tweets.php @@ -12,7 +12,9 @@ function __Construct(){ public function index() { $this->data['posts'] = $this->All_Tweets_Model->getPosts(); // calling Post model method getPosts() + $this->load->view('templates/header', NULL); $this->load->view('home', $this->data); // load the view file , we are passing $data array to view file + $this->load->view('templates/footer', NULL); } } diff --git a/www/application/controllers/User_Tweets.php b/www/application/controllers/User_Tweets.php index ed37b45..870d5f8 100644 --- a/www/application/controllers/User_Tweets.php +++ b/www/application/controllers/User_Tweets.php @@ -5,13 +5,17 @@ class User_Tweets extends CI_Controller { function __Construct(){ parent::__Construct (); +<<<<<<< HEAD //$this->load->library('session'); +======= +>>>>>>> f4837a582f4adec40ee0abbdbcab7529d12c3238 $this->load->database(); // load database - $this->load->model('Users_Tweets_Model'); // load model + $this->load->model('User_Tweets_Model'); // load model $this->output->enable_profiler(TRUE); } public function index() { +<<<<<<< HEAD // load form to tweet $this->load->helper(array('form', 'url')); $this->load->library('form_validation'); @@ -28,6 +32,9 @@ public function index() { $this->data['posts'] = $this->Users_Tweets_Model->getPosts(); // calling Post model method getPosts() +======= + $this->data['posts'] = $this->User_Tweets_Model->getPosts(); // calling Post model method getPosts() +>>>>>>> f4837a582f4adec40ee0abbdbcab7529d12c3238 $this->load->view('user', $this->data); // load the view file , we are passing $data array to view file } diff --git a/www/application/models/Users_Tweets_Model.php b/www/application/models/User_Tweets_Model.php similarity index 78% rename from www/application/models/Users_Tweets_Model.php rename to www/application/models/User_Tweets_Model.php index 4b6be20..f7211f3 100644 --- a/www/application/models/Users_Tweets_Model.php +++ b/www/application/models/User_Tweets_Model.php @@ -6,8 +6,11 @@ public function __construct() $this->load->database(); } function getPosts(){ +<<<<<<< HEAD:www/application/models/Users_Tweets_Model.php //$_SESSION['user_id'] = $id; +======= +>>>>>>> f4837a582f4adec40ee0abbdbcab7529d12c3238:www/application/models/User_Tweets_Model.php $this->db->select("first_name, last_name, username, tweet, date_time"); diff --git a/www/application/views/home.php b/www/application/views/home.php index 7540c13..bf2eaeb 100644 --- a/www/application/views/home.php +++ b/www/application/views/home.php @@ -19,7 +19,7 @@ - +
diff --git a/www/application/views/templates/header.php b/www/application/views/templates/header.php index e5c37b2..2b3ef00 100644 --- a/www/application/views/templates/header.php +++ b/www/application/views/templates/header.php @@ -6,3 +6,4 @@

+

Hello

diff --git a/www/application/views/user.php b/www/application/views/user.php index 3f0bcee..d8f59ca 100644 --- a/www/application/views/user.php +++ b/www/application/views/user.php @@ -33,7 +33,6 @@
-
diff --git a/www/tmp/ci_session27ff9b439dbea0a593e5a60be5666916b5b2a907 b/www/tmp/ci_session27ff9b439dbea0a593e5a60be5666916b5b2a907 new file mode 100644 index 0000000..0c7fc03 --- /dev/null +++ b/www/tmp/ci_session27ff9b439dbea0a593e5a60be5666916b5b2a907 @@ -0,0 +1 @@ +__ci_last_regenerate|i:1512329390; \ No newline at end of file