Changeset 112
- Timestamp:
- 11/09/06 14:54:22 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/com_mls_events/barcodes/admin.mls_events.html.php
r111 r112 1186 1186 } 1187 1187 1188 function checkoutForm( $user, $event, $ lists, $option, $act ) {1188 function checkoutForm( $user, $event, $barcodes, $lists, $option, $act ) { 1189 1189 global $l; 1190 1190 $l->setBlock("checkin"); 1191 1191 ?> 1192 <script language="JavaScript"> 1193 var barcodes = new Array(<?php echo count($barcodes); ?>); 1194 <?php 1195 for($i = 0; $i < count($barcodes); $i++) { 1196 echo "barcodes[".$i."] = '".$barcodes[$i]->code."';\n"; 1197 } 1198 ?> 1199 1200 function verifyCode(varCode) { 1201 var codeExists; 1202 codeExists = 0; 1203 for (var i = 0; i < barcodes.length; i++) { 1204 if(barcodes[i] == varCode) { 1205 codeExists = 1; 1206 } 1207 } 1208 if(codeExists == 0) { 1209 alert('<?php echo $l->m("msg_code_wrong", "general"); ?>'); 1210 } 1211 } 1212 </script> 1192 1213 <form action="index2.php" method="post" name="adminForm"> 1193 1214 <table class="adminheading"> … … 1204 1225 <td width="20%" valign="top" align="right"><?php echo $l->m("user") ?>:</td> 1205 1226 <td width="80%"><?php echo $user->id; ?>: <?php echo $user->name; ?> (<?php echo $user->username; ?>)</td> 1227 </tr> 1228 <tr> 1229 <td width="20%" valign="top" align="right"><?php echo $l->m("barcodes") ?>:</td> 1230 <td width="80%"> 1231 <ol> 1232 <?php 1233 foreach($barcodes as $code) { 1234 echo "<li>".$code->code."</li>\n"; 1235 } 1236 ?> 1237 </ol> 1238 </td> 1206 1239 </tr> 1207 1240 <?php … … 1224 1257 <tr> 1225 1258 <td width="20%" valign="top" align="right"><?php echo $l->m("barcode") ?> 1:</td> 1226 <td width="80%"><input class="text_area" id="barcode1" type="text" name="barcodes[]" size="10" maxlength="12" value="" onChange=" document.getElementById('barcode2').focus()" /></td>1259 <td width="80%"><input class="text_area" id="barcode1" type="text" name="barcodes[]" size="10" maxlength="12" value="" onChange="verifyCode(this.value);document.getElementById('barcode2').focus()" /></td> 1227 1260 </tr> 1228 1261 <tr> 1229 1262 <td width="20%" valign="top" align="right"><?php echo $l->m("barcode") ?> 2:</td> 1230 <td width="80%"><input class="text_area" id="barcode2" type="text" name="barcodes[]" size="10" maxlength="12" value="" onChange=" document.getElementById('barcode3').focus()" /></td>1263 <td width="80%"><input class="text_area" id="barcode2" type="text" name="barcodes[]" size="10" maxlength="12" value="" onChange="verifyCode(this.value);document.getElementById('barcode3').focus()" /></td> 1231 1264 </tr> 1232 1265 <tr> 1233 1266 <td width="20%" valign="top" align="right"><?php echo $l->m("barcode") ?> 3:</td> 1234 <td width="80%"><input class="text_area" id="barcode3" type="text" name="barcodes[]" size="10" maxlength="12" value="" onChange=" document.getElementById('barcode4').focus()" /></td>1267 <td width="80%"><input class="text_area" id="barcode3" type="text" name="barcodes[]" size="10" maxlength="12" value="" onChange="verifyCode(this.value);document.getElementById('barcode4').focus()" /></td> 1235 1268 </tr> 1236 1269 <tr> 1237 1270 <td width="20%" valign="top" align="right"><?php echo $l->m("barcode") ?> 4:</td> 1238 <td width="80%"><input class="text_area" id="barcode4" type="text" name="barcodes[]" size="10" maxlength="12" value="" onChange=" document.getElementById('barcode5').focus()" /></td>1271 <td width="80%"><input class="text_area" id="barcode4" type="text" name="barcodes[]" size="10" maxlength="12" value="" onChange="verifyCode(this.value);document.getElementById('barcode5').focus()" /></td> 1239 1272 </tr> 1240 1273 <tr> 1241 1274 <td width="20%" valign="top" align="right"><?php echo $l->m("barcode") ?> 5:</td> 1242 <td width="80%"><input class="text_area" id="barcode5" type="text" name="barcodes[]" size="10" maxlength="12" value="" /></td>1275 <td width="80%"><input class="text_area" id="barcode5" type="text" name="barcodes[]" size="10" maxlength="12" value="" onChange="verifyCode(this.value);" /></td> 1243 1276 </tr> 1244 1277 <tr> … … 1248 1281 </table> 1249 1282 <input type="hidden" name="userid" value="<?php echo $user->id; ?>" /> 1250 <input type=" text" name="eventid" value="<?php echo $event->id; ?>" />1283 <input type="hidden" name="eventid" value="<?php echo $event->id; ?>" /> 1251 1284 <input type="hidden" name="option" value="<?php echo $option; ?>" /> 1252 1285 <input type="hidden" name="act" value="<?php echo $act; ?>" /> branches/com_mls_events/barcodes/admin.mls_events.php
r111 r112 356 356 //Payback list 357 357 $lists["payback"] = mosHTML::yesnoRadioList('payback', ' class="inputbox"', '1'); 358 359 //Load barcodes 360 $database->setQuery( "SELECT `code` FROM `#__mls_events_barcodes` WHERE `userid`='".$user->id."' AND `status`='1'" ); 361 $barcodes = $database->loadObjectList(); 358 362 } else { 359 363 $lists = array(); 360 364 } 361 HTML_MLS_events_checkin::checkoutForm( $user, $event, $ lists, $option, $act );365 HTML_MLS_events_checkin::checkoutForm( $user, $event, $barcodes, $lists, $option, $act ); 362 366 } else { 363 367 HTML_MLS_events_checkin::checkinForm( $user, $event, $option, $act ); … … 442 446 if(count($wrongcodes)) { 443 447 //There were some wrong codes 444 mosRedirect( "index2.php?option=$option&act=$act", $l->m("err_codes_mismatch","general") );448 mosRedirect( "index2.php?option=$option&act=$act", sprintf($l->m("err_codes_mismatch","general"),implode( ',', $wrongcodes )) ); 445 449 } else { 446 450 //All codes ok, disable codes branches/com_mls_events/barcodes/lang/english.php
r111 r112 52 52 "msg_barcode_saved" => "Barcode saved!", 53 53 "err_please_select_user" => "Please select User!", 54 "err_codes_mismatch" => "Some of the codes entered mismatch! ",54 "err_codes_mismatch" => "Some of the codes entered mismatch! Wrong codes entered: %s", 55 55 "msg_user_checked_out" => "The user has been checked out!", 56 "msg_user_checked_out_payback" => "The user has been checked out! Please Pay %s back to user!"); 56 "msg_user_checked_out_payback" => "The user has been checked out! Please Pay %s back to user!", 57 "msg_code_wrong" => "This code is not assigned to this user or does not exist in the database!"); 57 58 58 59 $lang_data["events"] = array( … … 247 248 "user" => "User", 248 249 "event" => "Event", 249 250 "save" => "Save", 250 251 "name" => "Name", 251 252 "username" => "Username", … … 268 269 "user" => "User", 269 270 "barcode" => "Barcode", 271 "barcodes" => "Barcodes", 270 272 "save" => "Save", 271 273 "checkin" => "Checkin",