public function check_dealers($dealer_infos, $did, $i, $dealer_list, $ld) { foreach ($dealer_infos[$did] as $aa) { $class_name = isset($dealer_infos[$aa]) ? 'foldbtn' : 'foldbtnnone'; $did = $aa; $aa = $dealer_list[$aa]; if ($aa['Dealer']['status'] == 1) { $img = parent::image('yes.gif', array('style' => 'cursor:pointer;', 'onclick' => 'listTable.toggle(this, "travel_hotels/toggle_on_status", ' . $aa['Dealer']['id'] . ')')); } elseif ($aa['Dealer']['status'] == 0) { $path = Configure::read('themes_host') . '/themed/admin/img/no.gif'; $img = parent::image($path, array('style' => 'cursor:pointer;', 'onclick' => 'listTable.toggle(this, "travel_hotels/toggle_on_status", ' . $aa['Dealer']['id'] . ')')); } $edit = parent::link($ld['edit'], "/dealers/view/{$aa['Dealer']['id']}"); $del = parent::link($ld['delete'], 'javascript:;', array('onclick' => "if(confirm('确认删除该经销商吗?')){list_delete_submit('/admin/dealers/remove/" . $aa['Dealer']['id'] . "');}")); $px = 20 * $i; echo "<tr class ='dr" . $i . "' style='display: none'><td style='padding-left:" . $px . "px'><span class=" . $class_name . ' id=' . $aa['Dealer']['id'] . '></span>' . $aa['Dealer']['name'] . '</td><td>' . $aa['Dealer']['contact_name'] . '</td><td>' . $aa['Dealer']['contact_email'] . '</td><td>' . $aa['Dealer']['contact_tele'] . '</td><td>' . $aa['Dealer']['discount'] . '</td><td>' . $img . '</td>'; if ($this->operator_privilege('dealer_edit') && $this->operator_privilege('dealer_remove') == false) { echo '<td>' . $edit . '</td>'; } elseif ($this->operator_privilege('dealer_remove') && $this->operator_privilege('dealer_edit') == false) { echo '<td>' . $del . '</td>'; } elseif ($this->operator_privilege('dealer_remove') && $this->operator_privilege('dealer_edit')) { echo '<td>' . $edit . $del . '</td>'; } echo '</tr>'; if (isset($dealer_infos[$did])) { $j = $i + 1; $this->check_dealers($dealer_infos, $did, $j, $dealer_list, $ld); } } return true; }