Changeset 105
- Timestamp:
- 11/07/06 14:24:46 (2 years ago)
- Files:
-
- branches/com_mls_events/barcodes/admin.mls_events.html.php (modified) (1 diff)
- branches/com_mls_events/barcodes/admin.mls_events.php (modified) (2 diffs)
- branches/com_mls_events/barcodes/install/comupgrade.xml (modified) (2 diffs)
- branches/com_mls_events/barcodes/lang/english.php (modified) (2 diffs)
- branches/com_mls_events/barcodes/mls_events.class.php (modified) (1 diff)
- branches/com_mls_events/barcodes/mls_events.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/com_mls_events/barcodes/admin.mls_events.html.php
r36 r105 945 945 } 946 946 }; 947 948 /** Barcodes **/ 949 class HTML_MLS_events_barcodes { 950 function showBarcodes( $rows, $option ) { 951 global $l; 952 $l->setBlock("barcodes"); 953 ?> 954 <form action="index2.php" method="post" name="adminForm"> 955 <table class="adminheading"> 956 <tr> 957 <th>myLANsite Events: <?=$l->m("barcodes"); ?></th> 958 <td><?=$l->m("user"); ?>:</td> 959 <td> <?php echo $user_select; ?> </td> 960 <td><?=$l->m("search","general"); ?>:</td> 961 <td><input type="text" name="search" value="<?php echo $search;?>" class="text_area" onChange="document.adminForm.submit();" /></td> 962 </tr> 963 </table> 964 <table class="adminlist"> 965 <tr> 966 <th width="5">#</th> 967 <th class="title"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($rows); ?>);" /></th> 968 <th class="title"><?php echo $l->m("name"); ?></th> 969 <th class="title"><?php echo $l->m("username"); ?></th> 970 <th class="title"><?php echo $l->m("code"); ?></th> 971 <th align="center" width="40"><?=$l->m("status"); ?></th> 972 <th class="title" width="110"><?=$l->m("lastupdate"); ?></th> 973 </tr> 974 <?php 975 $k = 0; 976 for ($i=0, $n=count($rows); $i < $n; $i++) { 977 $row = $rows[$i]; 978 $img_status = $row->status ? 'tick.png' : 'publish_x.png'; 979 $task_status = $row->status ? 'disable' : 'enable'; 980 $row->lastupdate = $row->lastupdate > 0 ? $row->lastupdate : ""; 981 ?> 982 <tr class="<?php echo "row$k"; ?>"> 983 <td align="center"><?php echo $i+1+$pageNav->limitstart; ?></td> 984 <td><input type="checkbox" id="cb<?php echo $i;?>" name="cid[]" value="<?php echo $row->id; ?>" onclick="isChecked(this.checked);" /></td> 985 <td><a href="#edit" onclick="return listItemTask('cb<?php echo $i;?>','edit')"><?php echo $row->eventname; ?></a></td> 986 <td><?php echo $row->name; ?></td> 987 <td><?php echo $row->username; ?></td> 988 <td><?php echo $row->code; ?></td> 989 <td align="center"><a href="javascript: void(0);" onClick="return listItemTask('cb<?php echo $i;?>','<?php echo $task_status;?>')"><img src="images/<?php echo $img_status;?>" width="12" height="12" border="0" alt="" /></a></td> 990 <td><?php echo $row->lastupdate; ?></td> 991 </tr> 992 <?php 993 $k = 1 - $k; 994 } 995 ?> 996 </table> 997 <?php echo $pageNav->getListFooter(); ?> 998 <input type="hidden" name="option" value="<?php echo $option; ?>" /> 999 <input type="hidden" name="act" value="<?php echo $act; ?>" /> 1000 <input type="hidden" name="task" value="" /> 1001 <input type="hidden" name="boxchecked" value="0" /> 1002 </form> 1003 <?php 1004 HTML_MLS::printFooter($option); 1005 } 1006 } 1007 947 1008 /** Configuration **/ 948 1009 class HTML_MLS_events_config { branches/com_mls_events/barcodes/admin.mls_events.php
r36 r105 185 185 } 186 186 break; 187 case "barcodes": 188 switch($task) { 189 case "checkout": 190 checkoutformMLS_events_barcodes( $option, $act ); 191 break; 192 case "checkin": 193 checkinformMLS_events_barcodes( $option, $act ); 194 break; 195 case "enable": 196 changeMLS_events_barcodes( $cid[0], 1, $option, $act ); 197 break; 198 case "disable": 199 changeMLS_events_barcodes( $cid[0], 0, $option, $act ); 200 break; 201 default: 202 showMLS_events_barcodes( $option, $act ); 203 break; 204 } 187 205 default: 188 206 switch($task) { … … 241 259 } 242 260 261 /** Barcodes **/ 262 function showMLS_events_barcodes( $option, $act ) { 263 global $database, $l; 264 265 $database->setQuery( "SELECT u.name, u.username, u.email, c.* FROM `#__mls_events_barcodes` AS `c`" 266 ."\n INNER JOIN `#__users` AS `u` ON u.id=c.userid" 267 ."\n ORDER BY u.username ASC" ); 268 $rows = $database->loadObjectList(); 269 HTML_MLS_events_barcodes::showBarcodes( $rows, $option ); 270 271 } 272 273 function changeMLS_events_barcodes( $cid, $status, $option, $act ) { 274 global $database, $mosConfig_offset; 275 $time = date( "Y-m-d H:i:s", time()+$mosConfig_offset*60*60 ); 276 $query = "UPDATE `#__mls_events_barcodes` SET `status`='".$status."' AND `lastupdate`='".$time."' WHERE `id` = '".$cid."'"; 277 $database->setQuery($query); 278 $database->query(); 279 280 mosRedirect( "index2.php?option=$option&mosmsg=".urlencode($l->m("msg_status_changed","general")) ); 281 } 282 283 function checkinformMLS_events_barcodes( $option ) { 284 global $database; 285 } 286 287 function checkoutformMLS_events_barcodes( $option ) { 288 global $database; 289 } 290 291 /** Events **/ 243 292 function showMLS_events($option) { 244 293 global $database,$mainframe; branches/com_mls_events/barcodes/install/comupgrade.xml
r104 r105 64 64 `checkout_time` datetime NOT NULL default '0000-00-00 00:00:00', 65 65 `comments` MEDIUMTEXT NOT NULL, 66 `barcode` smallint(12) unsigned zerofill NOT NULL default '000000000000',67 66 PRIMARY KEY (`id`) 68 67 ) TYPE=MyISAM;</query> 68 <query>DROP TABLE IF EXISTS `#__mls_events_barcodes`</query> 69 <query>CREATE TABLE `#__mls_events_barcodes` ( 70 `id` INT( 11 ) NOT NULL AUTO_INCREMENT , 71 `code` SMALLINT( 12 ) UNSIGNED ZEROFILL NOT NULL , 72 `userid` MEDIUMINT( 11 ) NOT NULL , 73 `status` TINYINT( 1 ) DEFAULT '1' NOT NULL , 74 `lastupdate` DATETIME NOT NULL , 75 PRIMARY KEY ( `id` ) 76 ) TYPE = MYISAM;</query> 69 77 <query>DROP TABLE IF EXISTS `#__mls_events_reviews`</query> 70 78 <query>CREATE TABLE `#__mls_events_reviews` ( … … 147 155 <version number="0.1.4" date="20060911" /> 148 156 <version number="0.1.4-barcodes-RC1" date="20061107"> 149 <query>ALTER TABLE `#__mls_events_participants` ADD `barcode` smallint(12) unsigned zerofill NOT NULL default '000000000000'</query> 157 <query>CREATE TABLE `#__mls_events_barcodes` ( 158 `id` INT( 11 ) NOT NULL AUTO_INCREMENT , 159 `code` SMALLINT( 12 ) UNSIGNED ZEROFILL NOT NULL , 160 `userid` MEDIUMINT( 11 ) NOT NULL , 161 `status` TINYINT( 1 ) DEFAULT '1' NOT NULL , 162 `lastupdate` DATETIME NOT NULL , 163 PRIMARY KEY ( `id` ) 164 ) TYPE = MYISAM;</query> 150 165 </version> 151 166 </upgrade> branches/com_mls_events/barcodes/lang/english.php
r36 r105 45 45 "err_coupon_pending" => "This coupon is not yet active. Please try again later!", 46 46 "details" => "Details", 47 "parameters" => "Parameters"); 47 "parameters" => "Parameters", 48 "msg_status_changed" => "Status changed"); 48 49 49 50 $lang_data["events"] = array( … … 230 231 "back_to_details" => "Back to Event Details"); 231 232 233 $lang_data["barcodes"] = array( 234 "barcodes" => "Barcodes", 235 "user" => "User", 236 "search" => "Search", 237 "name" => "Name", 238 "username" => "Username", 239 "email" => "Email", 240 "code" => "Code", 241 "status" => "Status", 242 "lastupdate" => "Last Update"); 243 232 244 ?> branches/com_mls_events/barcodes/mls_events.class.php
r36 r105 324 324 } 325 325 }; 326 327 /** 328 * MLS Event Times table class 329 */ 330 class mosMLS_events_barcode extends mosDBTable { 331 /** @var int Primary key */ 332 var $id=null; 333 /** @var int */ 334 var $code=null; 335 /** @var int */ 336 var $userid=null; 337 /** @var int */ 338 var $status=null; 339 /** @var date */ 340 var $lastupdate=null; 341 342 /** 343 * @param database A database connector object 344 */ 345 function mosMLS_events_barcode( &$db ) { 346 $this->mosDBTable( '#__mls_events_barcodes', 'id', $db ); 347 } 326 348 ?> branches/com_mls_events/barcodes/mls_events.xml
r104 r105 29 29 <menu act="times">Times</menu> 30 30 <menu act="coupons">Coupons</menu> 31 <menu act="barcodes">Barcodes</menu> 31 32 <menu act="configuration">Configuration</menu> 32 33 </submenu>