Advertisement
Guest User

Untitled

a guest
Jun 10th, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.02 KB | None | 0 0
  1. <?
  2.  
  3. require('session.php');
  4. require('init.php');
  5.  
  6.  
  7. $offset = $_GET['offset'];
  8. $sortDirection = $_GET['sortDirection'];
  9. $sortType = $_GET['sortType'];
  10.  
  11. error_log("sortType: " . $sortType);
  12.  
  13. $providerObj = new provider();
  14.  
  15. if ($sortType == "name"){
  16.   $distributorObjArr = $providerObj->getDistributorsBySort($sortType, $sortDirection, $offset);
  17.   $_SESSION["distributorSortType"] = $sortType;
  18.   $_SESSION["distributorSortDirection"] = $sortDirection;
  19. }
  20. else{
  21.   $distributorObjArr = $providerObj->getDistributorsByPage($offset);
  22. }
  23.  
  24. ?>
  25.  
  26.   <thead>
  27. <tr>
  28.     <th onclick="sortName()"><?=$languageDB->berkGet("content_name");?></th>
  29.     <th title="<?=$languageDB->berkGet("tool_tip_action_distributor_remove");?>"><?=$languageDB->berkGet("content_action");?> <i class="fa fa-question-circle"></i></th>
  30.     <th onclick="sortBrand()"><?=$languageDB->berkGet("content_brand_url");?></th>
  31. </tr>
  32. </thead>
  33. <tbody>
  34.  
  35.  
  36. <?
  37. foreach ($distributorObjArr as $distributorObj) {
  38.   try{
  39.     $brandObjArray = $distributorObj->getMyBrands();
  40.     $brandObj = $brandObjArray[0];
  41.     $landingUrl = $brandObj->get('landingUrl');
  42.   }catch(Exception $e){
  43.     $landingUrl = 'No Brands';
  44.   }
  45.  
  46.   try {
  47.     $foundActiveVm = count($distributorObj->getMyPartners(null,'AC'));
  48.   } catch(Exception $e) {
  49.     continue;
  50.   }
  51. ?>
  52.   <tr>
  53.     <td><?=$distributorObj->get('name'); ?></td>
  54.     <td><a class="btn btn-reverse btn-tiny" href="/distributorModify.php?id=<?=$distributorObj->get('id')?>"><?=$languageDB->berkGet("action_view");?></a> <a class="btn btn-reverse btn-tiny" href="/distributorLogin.php?id=<?=$distributorObj->get('id');?>" target ="_blank"><?=$languageDB->berkGet("action_login");?></a> <?if(!$foundActiveVm){?> <a class="btn btn-reverse btn-tiny" href = "/processRemoveDistributor.php?id=<?=$distributorObj->get('id')?>" onclick="return confirm('<?=$languageDB->berkGet("content_confirm_remove_distributor")?>')"><?=$languageDB->berkGet("action_remove");?></a><?}?></td>
  55.     <td><?=$landingUrl?></td>
  56.   </tr>
  57. <?
  58. }
  59. ?>
  60. <tbody>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement