Skip to content

Commit

Permalink
styles galore
Browse files Browse the repository at this point in the history
  • Loading branch information
cws13003 committed Dec 5, 2017
1 parent ff4ff6e commit 9a5406a
Show file tree
Hide file tree
Showing 16 changed files with 182 additions and 122 deletions.
5 changes: 5 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

$startDate = "2015-05-12 15:49:06.821289";
$start = new DateTime($startDate);
echo $start->format('m/d/y'); ?>
6 changes: 4 additions & 2 deletions www/application/controllers/All_Tweets.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ 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('templates/nav', 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);
}
Expand All @@ -22,9 +23,10 @@ function search_keyword(){
$keyword = $this->input->post('keyword');
$data['results'] = $this->All_Tweets_Model->search($keyword);

$this->load->view('templates/header');
$this->load->view('templates/header', NULL);
$this->load->view('templates/nav', NULL);
$this->load->view('home', $data); // load the view file , we are passing $data array to view file
$this->load->view('templates/footer');
$this->load->view('templates/footer', NULL);
}

}
14 changes: 11 additions & 3 deletions www/application/controllers/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function __Construct(){
parent::__Construct();
$this->load->database(); // load database
$this->load->model('User_Info_Model'); // load model
$this->output->enable_profiler(TRUE);
//$this->output->enable_profiler(TRUE);
}

public function index(){
Expand All @@ -15,8 +15,12 @@ public function index(){
$this->form_validation->set_rules('username', 'Username', 'required');
$this->form_validation->set_rules('password', 'Password', 'required');

if ($this->form_validation->run() == FALSE)
if ($this->form_validation->run() == FALSE){
$this->load->view('templates/header');
$this->load->view('login');
$this->load->view('templates/footer');
}


// load the homepage if login successful
// https://www.codeigniter.com/user_guide/libraries/form_validation.html#callbacks-your-own-validation-methods
Expand All @@ -30,7 +34,11 @@ public function index(){
redirect('/all_tweets');
}
// if no, refresh login
else $this->load->view('login', $data);
else {
$this->load->view('templates/header');
$this->load->view('login', $data);
$this->load->view('templates/footer');
}

}
}
Expand Down
7 changes: 5 additions & 2 deletions www/application/controllers/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ public function index(){
array('required' => 'You must provide a %s.'));
$this->form_validation->set_rules('email', 'Email', 'required|valid_email');

if ($this->form_validation->run() == FALSE)
$this->load->view('register');
if ($this->form_validation->run() == FALSE){
$this->load->view('templates/header');
$this->load->view('register');
$this->load->view('templates/footer');
}

// load the homepage once properly submitted
// https://www.codeigniter.com/user_guide/libraries/form_validation.html#callbacks-your-own-validation-methods
Expand Down
29 changes: 0 additions & 29 deletions www/application/controllers/Tweet.php

This file was deleted.

2 changes: 2 additions & 0 deletions www/application/controllers/User_Tweets.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function __Construct(){
public function index() {
$this->data['posts'] = $this->User_Tweets_Model->getPosts(); // calling Post model method getPosts()
$this->load->view('templates/header', NULL);
$this->load->view('templates/nav', NULL);
$this->load->view('user', $this->data); // load the view file , we are passing $data array to view file
$this->load->view('templates/footer', NULL);
}
Expand All @@ -27,6 +28,7 @@ public function create(){
{
$this->data['posts'] = $this->User_Tweets_Model->getPosts(); // calling Post model method getPosts()
$this->load->view('templates/header', NULL);
$this->load->view('templates/nav');
$this->load->view('user', $this->data); // load the view file , we are passing $data array to view file
$this->load->view('templates/footer', NULL);
}
Expand Down
28 changes: 19 additions & 9 deletions www/application/views/home.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,27 @@

<?php $this->load->library('form_validation'); ?>
<?php echo validation_errors(); ?>
<?php echo form_open('all_tweets/search_keyword'); ?>
<input type="text" name = "keyword" />
<input type="submit" value = "Search" />
<?php //echo form_open('all_tweets/search_keyword'); ?>
<form class="form" action="all_tweets/search_keyword" method="post">
<div class="form-group">
<input type="text" name="keyword" class="form-control" placeholder="What would you like to find?">
</div>
<button class="btn btn-primary" type="submit" value="Search">Search</button>
</form>

<?php foreach($results as $row){ ?>
<div class="tweet-container">
<div class="row">
<div class="col-md-6">
<?php echo "<h3>" . $row['first_name'] . " " . $row['last_name'] . "</h3>"; ?>
<?php echo "<h4>" . "@" . $row['username'] . "</h4>";?>
<?php echo "<h3>" . $row['first_name'] . " " . $row['last_name'] . " " . "<span class=\"handle\">" . "@" . $row['username'] . "</span>" . "</h3>"; ?>

</div>
<div class="col-md-3 date">
<?php echo $row['date_time'];?>
<?php
$startDate = $row['date_time'];
$start = new DateTime($startDate);
echo $start->format('m/d/y h:s A');
?>
</div>
</div>
<div class="row tweet italic">
Expand All @@ -42,11 +49,14 @@
<div class="tweet-container">
<div class="row">
<div class="col-md-6">
<?php echo "<h3>" . $post['first_name'] . " " . $post['last_name'] . "</h3>"; ?>
<?php echo "<h4>" . "@" . $post['username'] . "</h4>";?>
<?php echo "<h3>" . $post['first_name'] . " " . $post['last_name'] . " " . "<span class=\"handle\">" . "@" . $post['username'] . "</span>" . "</h3>"; ?>
</div>
<div class="col-md-3 date">
<?php echo $post['date_time'];?>
<?php
$startDate = $post['date_time'];
$start = new DateTime($startDate);
echo $start->format('m/d/y h:s A');
?>
</div>
</div>
<div class="row tweet italic">
Expand Down
30 changes: 15 additions & 15 deletions www/application/views/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
$this->load->library('form_validation');
echo validation_errors();
echo form_open('login'); ?>
<?php
var_dump($user);
?>
<div class="login container">
<img class="icon" src="../img/twitter.png" alt="Twitter">
<div class="form-group">
<label for="username">Username</label>
<input class="form-control" type="text" name="username" value="<?php echo set_value('username'); ?>" placeholder="Enter username"/>
<?php echo form_error('username'); ?>
</div>
<div class="form-group">
<label for="password">Password</label>
<input class="form-control" type="password" name="password" value="<?php echo set_value('password'); ?>" placeholder="Enter password"/>
<?php echo form_error('password'); ?>
</div>
<button type="submit" class="btn btn-primary">Submit</button><span> or <a href="register">Create an account</a></span>

<h1>Twitter</h1>
<!--<img src="../img/twitter.png" alt="Twitter icon.">-->
<h5>Username</h5>
<input type="text" name="username" value="<?php echo set_value('username'); ?>" size="50" />
<?php echo form_error('username'); ?>
</form>

<h5>Password</h5>
<input type="password" name="password" value="<?php echo set_value('password'); ?>" size="50" />
<?php echo form_error('password'); ?>

<br><br>
<div><input type="submit" value="Submit"/></div>
</form>
</div>
63 changes: 35 additions & 28 deletions www/application/views/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,39 @@
$this->load->library('form_validation');
echo validation_errors();
echo form_open('register'); ?>
<h1>Register</h1>
<h5>First Name</h5>
<input type="text" name="firstname" value="<?php echo set_value('firstname'); ?>" size="50" />
<?php echo form_error('firstname'); ?>

<h5>Last Name</h5>
<input type="text" name="lastname" value="<?php echo set_value('lastname'); ?>" size="50" />
<?php echo form_error('lastname'); ?>

<h5>Email Address</h5>
<input type="text" name="email" value="<?php echo set_value('email'); ?>" size="50" />
<?php echo form_error('email'); ?>

<h5>Location</h5>
<input type="text" name="location" value="<?php echo set_value('location'); ?>" size="50" />
<?php echo form_error('location'); ?>

<h5>Username</h5>
<input type="text" name="username" value="<?php echo set_value('username'); ?>" size="50" />
<?php echo form_error('username'); ?>

<h5>Password</h5>
<input type="password" name="password" value="<?php echo set_value('password'); ?>" size="50" />
<?php echo form_error('password'); ?>

<br><br>
<div><input type="submit" value="Submit"/></div>

<div class="login register container">
<img class="icon reg" src="../img/twitter.png" alt="Twitter">
<h1>Register</h1>
<div class="form-group">
<label for="firstname">First Name</label>
<input class="form-control" type="text" name="firstname" value="<?php echo set_value('firstname'); ?>"/>
<?php echo form_error('firstname'); ?>
</div>
<div class="form-group">
<label for="lastname">Last Name</label>
<input class="form-control" type="text" name="lastname" value="<?php echo set_value('lastname'); ?>"/>
<?php echo form_error('lastname'); ?>
</div>
<div class="form-group">
<label for="email">Email</label>
<input class="form-control" type="email" name="email" value="<?php echo set_value('email'); ?>"/>
<?php echo form_error('email'); ?>
</div>
<div class="form-group">
<label for="location">Location</label>
<input class="form-control" type="text" name="location" value="<?php echo set_value('location'); ?>"/>
<?php echo form_error('location'); ?>
</div>
<div class="form-group">
<label for="username">Username</label>
<input class="form-control" type="text" name="username" value="<?php echo set_value('username'); ?>"/>
<?php echo form_error('username'); ?>
</div>
<div class="form-group">
<label for="password">Password</label>
<input class="form-control" type="password" name="password" value="<?php echo set_value('password'); ?>"/>
<?php echo form_error('password'); ?>
</div>
<button type="submit" class="btn btn-primary">Sign Up</button>
</form>
</div>
2 changes: 1 addition & 1 deletion www/application/views/templates/footer.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<em>&copy; 2017 Singh and Stumper Studios</em>
<em class="footer">&copy; 2017 Stingh Design</em>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</body>
Expand Down
1 change: 1 addition & 0 deletions www/application/views/templates/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
<link rel="stylesheet" type="text/css" href="/css/styles.css">
<meta charset="utf-8">
</head>
<body>
12 changes: 12 additions & 0 deletions www/application/views/templates/nav.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="all_tweets">
<img class="home-icon" alt="Brand" src="../../img/twitter.png">
</a>
</div>
<ul class="nav navbar-nav">
<li><a href="all_tweets">Home</a></li>
<li><a href="user_tweets">Profile</a></li>
</div>
</nav>
9 changes: 0 additions & 9 deletions www/application/views/tweet.php

This file was deleted.

15 changes: 10 additions & 5 deletions www/application/views/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,27 @@
<?php $this->load->library('form_validation'); ?>
<?php echo validation_errors(); ?>
<?php echo form_open('user_tweets/create'); ?>
<input type="text" name="tweet" value="<?php echo set_value('tweet'); ?>" size="50"/>
<div class="form-group">
<input class="form-control" type="text" name="tweet" value="<?php echo set_value('tweet'); ?>" placeholder="What's on your mind?"/>
<?php echo form_error('tweet'); ?>
</div>
<button class="btn btn-primary" type="submit">Tweet</button>
<!--<input type="hidden" name="user_id" value="<?php echo 'id' // USER ID HERE for tweet creation ?>"/>-->
<div><input type="submit" value="Tweet"/></div>
</form>


<?php foreach($posts as $post){ ?>
<div class="tweet-container">
<div class="row">
<div class="col-md-6">
<?php echo "<h3>" . $post['first_name'] . " " . $post['last_name'] . "</h3>"; ?>
<?php echo "<h4>" . "@" . $post['username'] . "</h4>";?>
<?php echo "<h3>" . $post['first_name'] . " " . $post['last_name'] . " " . "<span class=\"handle\">" . "@" . $post['username'] . "</span>" . "</h3>"; ?>
</div>
<div class="col-md-3 date">
<?php echo $post['date_time'];?>
<?php
$startDate = $post['date_time'];
$start = new DateTime($startDate);
echo $start->format('m/d/y h:s A');
?>
</div>
</div>
<div class="row tweet italic">
Expand Down
4 changes: 2 additions & 2 deletions www/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Hard way The best way to contribute is to "clone" your fork of CodeIgniter to yo
2. Go to the CodeIgniter repo
3. Fork it
4. Clone your CodeIgniter repo: git@github.com:<your-name>/CodeIgniter.git
5. Checkout the "develop" branch At this point you are ready to start making changes.
5. Checkout the "develop" branch At this point you are ready to start making changes.
6. Fix existing bugs on the Issue tracker after taking a look to see nobody else is working on them.
7. Commit the files
8. Push your develop branch to your fork
Expand All @@ -92,4 +92,4 @@ If you are using command-line you can do the following:
2. `git pull codeigniter develop`
3. `git push origin develop`

Now your fork is up to date. This should be done regularly, or before you send a pull request at least.
Now your fork is up to date. This should be done regularly, or before you send a pull request at least.
Loading

0 comments on commit 9a5406a

Please sign in to comment.