Permalink
Browse files

Merge branch 'master' of https://github.com/rianrainey/Short-List

Conflicts:
	www/cakephp/app/controllers/users_controller.php
  • Loading branch information...
winklerj committed Oct 9, 2011
2 parents b8ae1ae + c228a5e commit 4946c7f4b3ffe8f9404c019d740d15605c38b17e
View
@@ -75,7 +75,7 @@ CREATE TABLE `roles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
+) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -84,10 +84,36 @@ CREATE TABLE `roles` (
LOCK TABLES `roles` WRITE;
/*!40000 ALTER TABLE `roles` DISABLE KEYS */;
-INSERT INTO `roles` VALUES (1,'Employee');
+INSERT INTO `roles` VALUES (1,'Employee'),(2,'Employer');
/*!40000 ALTER TABLE `roles` ENABLE KEYS */;
UNLOCK TABLES;
+--
+-- Table structure for table `scores`
+--
+
+DROP TABLE IF EXISTS `scores`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `scores` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `value` float DEFAULT NULL,
+ `trait_id` int(11) DEFAULT NULL,
+ `user_id` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `scores`
+--
+
+LOCK TABLES `scores` WRITE;
+/*!40000 ALTER TABLE `scores` DISABLE KEYS */;
+INSERT INTO `scores` VALUES (1,10,1,1),(2,9,2,1),(3,8,3,1),(4,7,1,1),(5,3,4,2),(6,4,1,2);
+/*!40000 ALTER TABLE `scores` ENABLE KEYS */;
+UNLOCK TABLES;
+
--
-- Table structure for table `traits`
--
@@ -126,7 +152,7 @@ CREATE TABLE `users` (
`email` varchar(50) NOT NULL,
`role_id` int(10) DEFAULT NULL,
PRIMARY KEY (`id`)
-) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
+) ENGINE=MyISAM AUTO_INCREMENT=25 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -135,7 +161,7 @@ CREATE TABLE `users` (
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
-INSERT INTO `users` VALUES (1,'Rian','RaineyRasdfasDFSDFSFDS','rian@rianrainey.com',NULL);
+INSERT INTO `users` VALUES (1,'Rian','Rainey','rian@rianrainey.com',1),(2,'John','Smith','josh@john.com',2),(3,'Steven','Brown','nostra.per@malesuadamalesuadaInteger.edu',1),(4,'Josh','Kulp','nascetur.ridiculus.mus@pharetraNamac.edu',2),(5,'Erik','Osmono','Aenean.eget.magna@Phasellusdolor.ca',1),(6,'Mark','Stansbury','risus.Morbi@Proinsed.com',2),(7,'Mary','Smith','Vestibulum.ut@at.com',1),(8,'Chris','Balzer','et.magna.Praesent@augueid.ca',2),(9,'Dave','Gillespi','magna.Praesent@auctor.edu',1),(10,'Dan','Rockwell','Pellentesque.ultricies@purussapiengravida.edu',2),(11,'Andrew','Jones','mi.eleifend.egestas@dictumplacerataugue.edu',1),(12,'Mike','Kroptavich','Donec.consectetuer@aliquetsem.edu',2),(13,'Vince','Smigiel','lorem.sit.amet@Fuscefermentumfermentum.com',1),(14,'Eric','Hurr','nunc@euduiCum.edu',2),(15,'Hillary','Corna','metus.sit.amet@vulputaterisusa.com',1),(16,'Steven','Gacha','facilisi.Sed.neque@pretiumaliquetmetus.edu',2),(17,'Matt ','Hill','ultricies.ligula.Nullam@malesuada.ca',1),(18,'Imanuel','Austiv','dui@lacusvarius.com',2),(19,'Carrie','Phillips','a.nunc@Nullam.edu',1),(20,'Phil','Jones','magna@sitametlorem.edu',2),(21,'Zach','Boerger','commodo@nibhlacinia.ca',1),(22,'Luiz','Nevas','mus.Proin.vel@nisl.edu',2),(23,'Suzy','Bureau','est@gravidanuncsed.edu',1),(24,'John','Bord','metus.urna@etcommodo.org',2);
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -148,4 +174,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2011-10-08 16:27:23
+-- Dump completed on 2011-10-09 16:51:49
@@ -33,7 +33,7 @@
* In production mode, flash messages redirect after a time interval.
* In development mode, you need to click the flash message to continue.
*/
- Configure::write('debug', 2);
+ Configure::write('debug', 0);
/**
* CakePHP Log Level:
@@ -7,7 +7,9 @@ class UsersController extends AppController {
//var $helpers = array('Html','Javascript');
function index() {
- $this->User->recursive = 0;
+ $users = $this->User->find('all');
+
+ //$this->User->recursive = 0;
$this->set('users', $this->paginate());
}
@@ -105,13 +107,25 @@ function search ($id = null) {
if (!empty($this->data)) {
// We have arranged traits, so let's query the db
- debug($this->data);
+ //debug($this->data);
+
+ $a = array();
+ foreach ($this->data as $v) {
+ $a[] = $v;
+ }
+ //debug($a);
+
+
+
+ // debug($this->data);
//$this->loadModel('Trait');
- $scores = $this->Score->find('all');
+ //$scores = $this->Score->find('all');
+ //debug($scores);
//$this->Trait->Behaviors->attach('Containable'); // give me only Trait object
+
//$traits = $this->Trait->find('all', array(
// ));
@@ -124,21 +138,23 @@ function search ($id = null) {
//debug($sTraits);
- $users = $this->User->find('all', array(
- 'conditions' => array(
- 'User.role_id' => 2,
- ),
- 'order' => array(
- $sTraits
- //'User.id DESC',
+ //$score = $this->Score->findAllByTrait('1');
+
+ $users = $this->Score->find('all', array(
+ 'conditions' => array(
+ 'Score.trait_id' => $a[0],
),
- ));
- }
- else {
- $users = $this->User->find('all');
+ // 'order' => array($a[0], $a[1], $a[2], $a[3] ),
+ ));
+
+ //debug($users);
+
}
+ // else {
+ // $users = $this->User->find('all');
+ // }
//$this->set('users', $this->paginate());
- debug($users);
+ //debug($score);
$this->set(compact('users'));
}
@@ -1,15 +1,20 @@
<?php
+// debug($traits);
//debug($traits);
?>
<?php $html->script(array('jquery'), array('inline' => false)); ?>
<?php $html->script(array('jquery-ui-min.js'), array('inline' => false)); ?>
<?php $html->script(array('script.js'), array('inline' => false)); ?>
+<p id="traitListHeading"> Please rank the following traits as most important(#1) to least important(#4). </p>
+<div class="traits index noLeftB">
+ <ol id="sortable">
-<div class="traits index">
+<div class="traits index noLeftB">
<?php echo $this->Form->create('User', array('action' => 'search')); ?>
<ol id="sortable">
+
<?php foreach ($traits as $trait):
$i = 0;
$class = null;
@@ -1,4 +1,4 @@
-<div class="users index">
+<?php debug($users); ?><div class="users index">
<h2><?php __('Users');?></h2>
<table cellpadding="0" cellspacing="0">
<tr>
@@ -1,10 +1,9 @@
<?php
+// debug($users);
//debug($users);
-?>
-
-<div class="users index">
- <h2><?php __('Users');?></h2>
- <ol>
+?><div class="users index">
+ <h2><?php echo 'Qualified Applicants for' . ' ' . $users[0]['Trait']['name'];?></h2>
+ <table cellpadding="0" cellspacing="0">
<?php
$i = 0;
foreach ($users as $user):
@@ -13,9 +12,12 @@
$class = ' class="altrow"';
}
?>
- <li><?php echo $user['User']['first_name'] . ' ' . $user['User']['last_name']; ?></li>
-
-
+ <tr<?php echo $class;?>>
+ <td><?php echo $user['User']['first_name']; ?>&nbsp;</td>
+ <td><?php echo $user['User']['last_name']; ?>&nbsp;</td>
+ <td><?php echo $user['User']['email']; ?>&nbsp;</td>
+
+ </tr>
<?php endforeach; ?>
- </ol>
-</div>
+ </table>
+</div>
@@ -543,9 +543,34 @@ div.code-coverage-results span.result-good {
display: none;
}
-/*********** Custom CSS ***************/
+
+/* ************** Added by Curtis *************** */
+
+p#traitListHeading {
+ margin-left: 340px;
+ font-size: 1.25em;
+ font-style: bold;
+}
+
+ol#sortable li{
+ margin-top: 1.3em;
+ margin-bottom: 1.3em;
+}
+
+div.noLeftB{
+ border-left: none;
+}
+
+
+
+
+
+
+
+/*********** Custom CSS ***************/
div.radio input[type=radio] {
display: inline;
float: none;
}
+
@@ -49,12 +49,6 @@
</div>
<div id="footer">
- <?php echo $this->Html->link(
- $this->Html->image('cake.power.gif', array('alt'=> __('CakePHP: the rapid development php framework', true), 'border' => '0')),
- 'http://www.cakephp.org/',
- array('target' => '_blank', 'escape' => false)
- );
- ?>
</div>
</div>
<?php echo $this->Js->writeBuffer(); // Write cached scripts ?>

0 comments on commit 4946c7f

Please sign in to comment.