Ejemplo n.º 1
0
 function jsonMethodList()
 {
     $entrance = $this->req->post['entrance'];
     $role_id = $this->req->post['role_id'];
     $permission = array();
     if (!empty($role_id)) {
         $role = $this->load->model('role')->findById($role_id);
         if ($role) {
             if (!empty($role['permission'])) {
                 $permission = unserialize($role['permission']);
             }
         }
     }
     header("Content-type: text/html");
     $methodList = array();
     if ($entrance == 'front') {
         $methodList = getMethodList(FRONT);
     } else {
         if ($entrance == 'backstage') {
             $methodList = getMethodList(CONTROLLER);
         }
     }
     $html = "";
     // echo empty($permission);
     foreach ($methodList as $key => $value) {
         if (in_array($value, $permission)) {
             $ht = sprintf('<p><label for="%s">%s</label><input checked="checked" id="%s" type="checkbox" name="checkbox[]" value="%s" /></p>', $value, $value, $value, $value);
         } else {
             $ht = sprintf('<p><label for="%s">%s</label><input id="%s" type="checkbox" name="checkbox[]" value="%s" /></p>', $value, $value, $value, $value);
         }
         $html = $html . $ht;
     }
     echo $html;
 }
Ejemplo n.º 2
0
                    HTTP Method
                </div>
                <div class="filterRight">
                    Not 
                    <?php 
if (isset($_SESSION['filter']['Not_method']) and $_SESSION['filter']['Not_method'] == 1) {
    print "<input type=\"checkbox\" name=\"Not_method\" value=\"1\" class=\"text ui-widget-content ui-corner-all\" checked>";
} else {
    print "<input type=\"checkbox\" name=\"Not_method\" value=\"1\" class=\"text ui-widget-content ui-corner-all\">";
}
?>
                  
                    <select name="method" size="1" style="width: 165px" class="text ui-widget-content ui-corner-all ">
                    <option value="x">All Method</option>
                    <?php 
$methodList = getMethodList();
foreach ($methodList[0] as $met) {
    if ($_SESSION['filter']['method'] == $met['b_method']) {
        print "<option selected value=\"" . $met['b_method'] . "\">" . headerprintnobr($met['b_method']) . "</option>";
    } else {
        print "<option value=\"" . $met['b_method'] . "\">" . headerprintnobr($met['b_method']) . "</option>";
    }
}
?>
                    </select>
                </div>
            </label>
            <div class="filterClear"></div>
        </div>

        <div class="filterRow">