Changeset 1133
- Timestamp:
- Sep 3, 2008 3:13:53 PM (5 years ago)
- Location:
- trunk/jpdd
- Files:
-
- 2 edited
-
class.jpdd.category.php (modified) (1 diff)
-
class.jpdd.organization.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/jpdd/class.jpdd.category.php
r1132 r1133 17 17 } 18 18 19 function getInterestCategoryDropdown($name, $emptyfield = NULL, $selected = NULL, $extras = '') { 19 function getInterestIDs() { 20 global $jpdd; 21 return $jpdd->getValuesFromSQL('SELECT id FROM interest', 'id'); 22 } 23 24 function getInterestDropdown($name, $emptyfield = NULL, $selected = NULL, $extras = '') { 20 25 global $jpdd; 21 26 $ret = '<select name="'.$name.'" '.$extras.'>'."\n"; -
trunk/jpdd/class.jpdd.organization.php
r1131 r1133 4 4 5 5 require_once('class.dkg.person.php'); 6 require_once('class.jpdd.category.php'); 6 7 7 8 if (!class_exists('JPDD_Organization')) { … … 201 202 $ret .= '<table class="liaisonui"><tbody><tr><td>'; 202 203 203 // hide the dropdown initially. 204 // hide the dropdown initially. It will be showed if the liaison clicks the "attending this workshop" checkbox. 204 205 $dropdown = '<div id="newassign" style="display: none; padding-left: 1em;"><select name="newassign">'."\n<option>choose a workshop subject</option>\n"; 205 206 reset($requirements); … … 249 250 <label>Last name:<br/><input type="text" name="last_name" value=""/></label><br/> 250 251 <label>E-mail Address:<br/><input type="text" name="email" value=""/></label><br/> 252 '.JPDD_Category::getInterestDropdown('primaryinterest', "Primary Focus?").'<br/> 251 253 <label>Attending this workshop?<input type="checkbox" name="isattending" onchange="if (this.checked) { $(\'#newassign\').show() } else {$(\'#newassign\').hide();};" value="yes" /></label><br/> 252 254 '.$dropdown.'<br/> … … 299 301 $jpdd->arrayKeyIsNotEmpty('last_name', $_POST) || 300 302 $jpdd->arrayKeyIsNotEmpty('email', $_POST)) { 303 304 $acceptableinterests = JPDD_Category::getInterestIDs(); 305 301 306 // FIXME: if the person fields are present, check if person 302 307 // already exists, as affiliated with the school. … … 318 323 $newp->getID().', '.(int)$_POST['newassign'].')'); 319 324 } 325 if ($jpdd->arrayKeyIsNotEmpty('primaryinterest', $_POST) && in_array((int)$_POST['primaryinterest'], $acceptableinterests)) { 326 $sql = 'INSERT INTO person_interest (person_id, category_id) VALUES ('. 327 $newp->getID().', '.(int)$_POST['primaryinterest'].')'; 328 $jpdd->executeSQL($sql); 329 } 320 330 } 321 331 }
Note: See TracChangeset
for help on using the changeset viewer.

