コード例 #1
0
 function get_form_sel()
 {
     global $harvest_notice_tpl, $harvest_notice_tpl_error;
     //Je regarde si la notice à un isbn
     $req = "SELECT code FROM notices WHERE notice_id='" . $this->id . "'";
     $res = pmb_mysql_query($req);
     if (pmb_mysql_num_rows($res) && (isISBN(pmb_mysql_result($res, 0, 0)) || isEAN(pmb_mysql_result($res, 0, 0)))) {
         $tpl = $harvest_notice_tpl;
         $harvests = new harvests();
         $tpl = str_replace('!!sel_harvest!!', $harvests->get_sel('harvest_id', 0), $tpl);
         $h = new harvest_profil_imports();
         $tpl = str_replace('!!sel_profil!!', $h->get_sel('profil_id', 0), $tpl);
         $tpl = str_replace('!!notice_id!!', $this->id, $tpl);
     } else {
         $tpl = $harvest_notice_tpl_error;
     }
     return $tpl;
 }
コード例 #2
0
ファイル: build.inc.php プロジェクト: noble82/proyectos-ULS
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
require_once $class_path . "/harvest.class.php";
switch ($action) {
    case 'form':
        $harvest = new harvest($id_harvest);
        print $harvest->get_form();
        break;
    case 'save':
        $harvest = new harvest($id_harvest);
        $data['name'] = $name;
        print $harvest->save($data);
        $harvests = new harvests();
        print $harvests->get_list();
        break;
    case 'delete':
        $harvest = new harvest($id_harvest);
        print $harvest->delete();
        $harvests = new harvests();
        print $harvests->get_list();
        break;
    case 'test':
        $harvest = new harvest($id_harvest);
        print $harvest->havest_notice();
        break;
    default:
        $harvests = new harvests();
        print $harvests->get_list();
        break;
}