Subversion Repositories VORC

Rev

Rev 197 | Rev 203 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 197 Rev 199
Line 243... Line 243...
243
  my $orderby = shift;
243
  my $orderby = shift;
244
  my $curpage = shift; $curpage = 1 unless $curpage;
244
  my $curpage = shift; $curpage = 1 unless $curpage;
245
  my $pagelimit = shift // "All";
245
  my $pagelimit = shift // "All";
Line 246... Line 246...
246
  
246
  
-
 
247
  my $selected = '*';
-
 
248
  if ($table eq "v_class") {
-
 
249
    foreach (@{$whereClause}) {
-
 
250
      /^RCid = \d+$/ and $table = "v_class_signup";
-
 
251
    }
-
 
252
    
247
  my $selected = '*';
253
  }
Line 248... Line 254...
248
  $whereClause = scalar @{$whereClause} > 0 ? "where ".join (" and ", @{$whereClause}) : '';
254
  $whereClause = scalar @{$whereClause} > 0 ? "where ".join (" and ", @{$whereClause}) : '';
249
  
255
  
250
  if ($orderby eq "dayofweek") {
256
  if ($orderby eq "dayofweek") {
Line 263... Line 269...
263
  } else {
269
  } else {
264
    $curpage = ($curpage - 1) * $pagelimit;
270
    $curpage = ($curpage - 1) * $pagelimit;
265
    $getMe = "select distinct * from $table $whereClause $orderby limit $curpage, $pagelimit";
271
    $getMe = "select distinct * from $table $whereClause $orderby limit $curpage, $pagelimit";
266
  }
272
  }
267
  my ($totalcount) = @{$internalDBH->selectrow_arrayref ("select distinct count(*) from $table $whereClause")};
273
  my ($totalcount) = @{$internalDBH->selectrow_arrayref ("select distinct count(*) from $table $whereClause")};
268
  # warn $getMe;
274
#  warn $getMe;
269
  my $limhan = $internalDBH->prepare($getMe);     # Get the tickets from the DB
275
  my $limhan = $internalDBH->prepare($getMe);     # Get the tickets from the DB
270
  $limhan->execute();
276
  $limhan->execute();
Line 271... Line 277...
271
  
277
  
272
  my @results = ();
278
  my @results = ();
Line 492... Line 498...
492
  }
498
  }
Line 493... Line 499...
493
  
499
  
494
  # "Shift Include" shows a checkbox to include a users shifts at the top of the page
500
  # "Shift Include" shows a checkbox to include a users shifts at the top of the page
495
  my $SIChecked;
501
  my $SIChecked;
-
 
502
  if ($showMyShiftsOption) {
496
  if ($showMyShiftsOption) {
503
    my $things = $DBTABLE eq "v_class" ? "classes" : "shifts";
497
    if ($FORM{shiftinclude}) {
504
    if ($FORM{shiftinclude}) {
498
      $SIChecked = "Show my shifts: ".$h->input ({ type=>"checkbox", name=>"shiftinclude", value=>"true", checked=>[], onClick=>'submit();' });
505
      $SIChecked = "Show my $things: ".$h->input ({ type=>"checkbox", name=>"shiftinclude", value=>"true", checked=>[], onClick=>'submit();' });
499
    } else {
506
    } else {
500
      $SIChecked = "Show my shifts: ".$h->input ({ type=>"checkbox", name=>"shiftinclude", value=>"true", onClick=>'submit();' });
507
      $SIChecked = "Show my $things: ".$h->input ({ type=>"checkbox", name=>"shiftinclude", value=>"true", onClick=>'submit();' });
501
    }
508
    }
Line 502... Line 509...
502
  }
509
  }
503
  
510