Ejemplo n.º 1
0
function _mip_forms_abstract_simple_sql_app($in, $sql, $sql_val, $sql_val_desc, $user_desc = '', $user_val = '')
{
    global $db, $client, $cms_db, $con_lang;
    // Check Cache and give output if true
    $cache_string = md5($in['flag'] . $in['type'] . $in['output_cat'] . $in['cat']);
    $cache_container_desc = $cache_string . 'desc';
    $cache_container_val = $cache_string . 'val';
    if (mip_forms_check_cache($cache_container_val) && 1 == 2) {
        $in['option_desc'] = mip_forms_get_cache($cache_container_desc);
        $in['option_val'] = mip_forms_get_cache($cache_container_val);
    } else {
        $i = 0;
        if (is_array($user_desc)) {
            $c = count($user_desc);
            for ($i = 0; $i < $c; $i++) {
                $in['option_desc'][$i] = $user_desc[$i];
                $in['option_val'][$i] = $user_val[$i];
            }
        }
        $db->query($sql);
        //echo $sql;
        while ($db->next_record()) {
            $in['option_desc'][$i] = $db->f($sql_val_desc);
            $in['option_val'][$i] = $db->f($sql_val);
            $i++;
        }
        //write cache
        mip_forms_write_cache($cache_container_desc, $in['option_desc']);
        mip_forms_write_cache($cache_container_val, $in['option_val']);
    }
    $in['cat'] = $in['output_cat'];
    $to_return = mip_forms($in);
    return $to_return;
}
Ejemplo n.º 2
0
function mip_formsp($in)
{
    global $mip_forms_to_array;
    if ($mip_forms_to_array === true) {
        return mip_forms($in);
    } else {
        echo mip_forms($in);
    }
}