Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- require('session.php');
- require('init.php');
- $offset = $_GET['offset'];
- $sortDirection = $_GET['sortDirection'];
- $sortType = $_GET['sortType'];
- error_log("sortType: " . $sortType);
- $providerObj = new provider();
- if ($sortType == "name"){
- $distributorObjArr = $providerObj->getDistributorsBySort($sortType, $sortDirection, $offset);
- $_SESSION["distributorSortType"] = $sortType;
- $_SESSION["distributorSortDirection"] = $sortDirection;
- }
- else{
- $distributorObjArr = $providerObj->getDistributorsByPage($offset);
- }
- ?>
- <thead>
- <tr>
- <th onclick="sortName()"><?=$languageDB->berkGet("content_name");?></th>
- <th title="<?=$languageDB->berkGet("tool_tip_action_distributor_remove");?>"><?=$languageDB->berkGet("content_action");?> <i class="fa fa-question-circle"></i></th>
- <th onclick="sortBrand()"><?=$languageDB->berkGet("content_brand_url");?></th>
- </tr>
- </thead>
- <tbody>
- <?
- foreach ($distributorObjArr as $distributorObj) {
- try{
- $brandObjArray = $distributorObj->getMyBrands();
- $brandObj = $brandObjArray[0];
- $landingUrl = $brandObj->get('landingUrl');
- }catch(Exception $e){
- $landingUrl = 'No Brands';
- }
- try {
- $foundActiveVm = count($distributorObj->getMyPartners(null,'AC'));
- } catch(Exception $e) {
- continue;
- }
- ?>
- <tr>
- <td><?=$distributorObj->get('name'); ?></td>
- <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>
- <td><?=$landingUrl?></td>
- </tr>
- <?
- }
- ?>
- <tbody>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement