Example #1
0
        } else {
            $page = 1;
        }
        $_POST[pr_criterio] = strtoupper($_POST[pr_criterio]);
        $error = check_form($thisform, $_POST, $page);
        if ($error == 1) {
            $_POST[pr_data_mod] = date("Y-m-d");
            $manage = manage_post($thisform, $error, $_POST, $_GET[id]);
        } else {
            print draw_form($thisform, $module, $error, $_POST, $page);
        }
        if ($manage == 1) {
            $page = $_POST[form_page] + 1;
            print draw_form($thisform, $module, $error, $_POST, $page);
        } elseif ($manage > 1) {
            $PAGE_ELEMENT[PAGE][1][0][param] = $manage;
            insert_last_viewed($manage, $module);
            header("location: pratiche_show.php?id={$manage}&actdone={$ad}");
            die;
            $response[text] .= "    " . make_button("pratiche_show.php?id={$manage}", PRATICHE_BACK_SHOW);
            print draw_response($response);
        }
    } else {
        print draw_form($thisform, $module, "", $result);
    }
}
$PAGE[PAGE_CONTENT] = ob_get_contents();
ob_end_clean();
$PAGE_ELEMENT[PAGE][1][0][param] = $_GET[id];
template_define_elements();
final_render();
Example #2
0
//echo $maildefault;
// Define page specific text for template
$PAGE[TXT_TITLE] = PRATICHE_MENU_0;
$PAGE[PAGE_INTITLE] = PRATICHE_MENU_0 . " \n&nbsp;&nbsp;<span >\n<a href=\"javascript:NuovaMail()\"><img src=\"/template/skin_sutti/images/ico/mail4.png\" width=\"24\" height=\"24\" border=\"0\" align=\"\\absmiddle\"></a>\n\n<a target=\"\" href=\"#\" onclick=\"javascript:StampaPratica('{$pippo1}','{$pippo2}','{$pippo3}','{$pippo3a}','{$pippo4}','{$pippo5}','{$pippo6}','{$pippo6a}','{$pippo7}','{$pippo8}','{$pippo9}','{$pippo10}')\"><img src=\"/template/skin_sutti/images/ico/print1.png\" width=\"24\" height=\"24\" border=\"0\" align=\"\\absmiddle\"></a>\n</span >\n\n";
$PAGE[PAGE_PICTITLE] = "ico_prat_med.gif";
if ($_SESSION[mobile] == true) {
    template_init(6);
    //mobile=6 - normale=2
} else {
    template_init();
    //mobile=6 - normale=2
}
//template_init(); //mobile=6 - desktop =()
ob_start();
//Update last viewed
insert_last_viewed($_GET[id], $module);
if ($_GET[actdone] == "upd") {
    $rspact[title] = PRATICHE_UPD_DONE;
    print draw_response($rspact);
} elseif ($_GET[actdone] == "add") {
    $rspact[title] = PRATICHE_ADD_DONE;
    print draw_response($rspact);
}
if (check_perm_obj($module, $_GET[id], "r")) {
    $PAGE_ELEMENT[PAGE][1][0][param] = $_GET[id];
    if (!isset($_GET[action])) {
        $thisobj = load_fwobject("show", "pratiche", 0);
        if (($_SESSION[user][admin] == 1 || $_SESSION[user][move_prat] == 1) && $_SESSION[history] == 0) {
            $thisobj["Fields"]["button_m"] = make_button("pratiche_show.php?action=hist&id=" . $_GET[id], PRATICHE_TOHIST);
        } elseif (($_SESSION[user][admin] == 1 || $_SESSION[user][move_prat] == 1) && $_SESSION[history] == 1) {
            $thisobj["Fields"]["button_m"] = make_button("pratiche_show.php?action=rest&id=" . $_GET[id], PRATICHE_TOCURR);
                $str_prima_nota = $CONF[url_base] . $CONF[dir_modules] . "prestazioni/pages/prima_nota_view.php?form_id=listprestaz&form_page=1&ref_id[text]=&ref_id[realval]=" . $result[ref_id] . "&action=del&id=" . $_GET[id] . "&ref_parent=" . $result[ref_id] . "&operatore[text]=" . $_SESSION[user][codice] . "&sp_studio=0&primanota=1&day_from[day]=01&day_from[month]=10&day_from[year]=" . $TY . "&day_to[day]=31&day_to[month]=12&day_to[year]=" . $TY . "&fltr=4trim";
            }
        }
    }
}
ob_start();
$rs = $DB->Execute("SELECT * FROM {$module} WHERE id=" . $_GET[id]);
if (!($result = $rs->FetchRow())) {
    $response[title] = FW_ERROR_NO_PERM;
    $response[text] = FW_ERROR_NO_PERM_TXT;
    $iserror = 1;
    print draw_response($response);
} else {
    $PAGE_ELEMENT[PAGE][1][0][param] = $result[ref_id];
    if (check_perm_obj("pratiche", $result[ref_id], "r")) {
        insert_last_viewed($result[ref_id], "pratiche");
        $thisobj = load_fwobject("show", "prestazioni", 1);
        if ($_SESSION[history] == 0) {
            $thisobj["Fields"]["button_w"] = make_button("new_spesa_studio.php?id=" . $_GET[id], FW_MODIFY);
        } else {
            $thisobj["Fields"]["button_w"] = FW_MODIFY;
        }
        $thisobj["Fields"]["button_d"] = make_button_del($str_prima_nota, FW_DELETE);
        print draw_object($thisobj, intval($_GET[id]), $module);
    } else {
        $response[title] = FW_ERROR_NO_PERM;
        $response[text] = FW_ERROR_NO_PERM_TXT;
        $iserror = 1;
        print draw_response($response);
    }
}
        ////CONTINUA AD INSERIRE NUOVE PRESTAZIONI
        //$thisform[Fields][continuaIns][title]=PRESTAZIONI_CONTINUA_INS_TIT;
        //$thisform[Fields][continuaIns][content]="checkbox||||opt::".PRESTAZIONI_CONTINUA_INS."=>1;;size::1";
    } else {
        $response[title] = FW_ERROR_NO_PERM;
        $response[text] = FW_ERROR_NO_PERM_TXT;
        $iserror = 1;
        print draw_response($response);
    }
} elseif (isset($_GET[ref_id]) && $_POST[form_id] != $thisform["name"]) {
    //NUOVA PRESTAZ QUESTA E' QUELLA NORMALE
    $PAGE[PAGE_INTITLE] = STUDIO_ADD_SPESA;
    $PAGE[TXT_TITLE] = STUDIO_ADD_SPESA;
    $PAGE_ELEMENT[PAGE][1][0][param] = $_GET[ref_id];
    if (check_perm_obj("pratiche", $_GET[ref_id], "w")) {
        insert_last_viewed($_GET[ref_id], "pratiche");
        $rs2 = $DB->Execute("SELECT * FROM pratiche WHERE id=" . $_GET[ref_id]);
        $result_prat = $rs2->FetchRow();
        $thisform[Fields][title_pratica][title] = PRESTAZIONI_REF_PRATICA;
        $thisform[Fields][title_pratica][content] = "text||" . $result_prat[pr_codice] . "||wid::40;;disab::1";
        $thisform[Fields][ref_id][content] = "hidden||" . $result_prat[id] . "||";
        $result[ref_id] = $result_prat[id];
        $thisform[Fields][valore_pratica][content] = "hidden||" . $result_prat[pr_valore] . "||";
        $thisform[Fields][tipo_pratica][content] = "hidden||" . $result_prat[pr_comp_cod] . "||";
        $CONF[key] = $_GET[ref_id];
        if ($result[criterio] == "") {
            $result[criterio] = $result_prat[pr_criterio];
        }
        //CONTINUA AD INSERIRE NUOVE PRESTAZIONI
        //$thisform[Fields][continuaIns][title]=PRESTAZIONI_CONTINUA_INS_TIT;
        //$thisform[Fields][continuaIns][content]="checkbox||||opt::".PRESTAZIONI_CONTINUA_INS."=>1;;size::1";