예제 #1
0
    ?>
>
    <input type='hidden' name='action' value=<?php 
    echo $form_action;
    ?>
>
    <?php 
    if ($action == 'edit') {
        echo "<input type='hidden' name='id' value={$id}>";
    }
    ?>
    <input type='hidden' name='cat' value=<?php 
    echo $cat;
    ?>
 >
    <td colspan="2"><br><h6><input name="submit" type="submit" value="<?php 
    echo _("Submit");
    ?>
" tabindex="<?php 
    echo ++$tabindex;
    ?>
"></h6></td>
</form>
<?php 
}
// end edit cause
if ($action == 'conf_edit') {
    $fields = "recording_id = {$recording_id}";
    fbilling_edit('causes', $fields, $id);
    redirect_standard('cat');
}
예제 #2
0
    if ($insert_ok > 0) {
        // if there is permission with requested name check whether it's not permission we are editing
        $permission_data = fbilling_get_data_by_id($cat, $id);
        if ($permission_data['name'] == $name) {
            $insert_ok = 0;
        } else {
            $insert_ok = 1;
        }
    }
    if ($insert_ok > 0) {
        echo _("Permission with specified name already exists in database, please provide different name, and try again");
        echo "<a href='javascript:history.go(-1)''> Go Back</a>";
        return true;
    } else {
        $fields = "name = '{$name}', is_active = {$is_active}";
        fbilling_edit($cat, $fields, $id);
        // update permission details
        fbilling_del('permission_weights', 'permission_id', $id);
        // delete all weight relationships for this permission
        $fields = array('permission_id', 'weight_id');
        foreach ($weight_id as $w) {
            $values[] = array($name, $w);
        }
        fbilling_add('permission_weights', $fields, $values);
        // insert new weight relationships for this permission
        redirect_standard('cat');
    }
}
?>