noalyss Version-9
operation_exercice.inc.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * NOALYSS is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * NOALYSS is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with NOALYSS; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19// Copyright Author Dany De Bontridder danydb@aevalys.eu 6/01/24
20/*!
21 * \file
22 * \brief For opening or closing exercice , operation needed
23 */
24
26if ( $http->request("sa","string","") == "" )
27{
30 return;
31
32}
33if ( $http->request("sa","string" ) == "remove" )
34{
35 Operation_Exercice::delete($http->post("operation_list"));
38 return;
39}
40if ( $http->request("sa") == "opening")
41{
42
43 $operation_exercice_id= $http->get("operation_exercice_id","number",-1);
44 $operation_opening=new Operation_Opening($operation_exercice_id);
45 try {
46 if ( $operation_exercice_id == -1 ) {
47 // take data from request
48 $operation_opening->from_request();
49 $operation_opening->insert();
50 }
51 // Display result
52 $operation_opening->display_result();
53 $operation_opening->input_transfer();
54 } catch (\Exception $e) {
55 echo $e->getMessage();
56 }
57 return;
58}
59if ( $http->request("sa") == "closing")
60{
61
62 $operation_exercice_id= $http->get("operation_exercice_id","number",-1);
63 $operation_closing=new Operation_Closing($operation_exercice_id);
64 try {
65 if ( $operation_exercice_id == -1 ) {
66 // take data from request
67 $operation_closing->from_request();
68 $operation_closing->insert();
69 }
70 // Display result
71 $operation_closing->display_result();
72 $operation_closing->input_transfer();
73 } catch (\Exception $e) {
74 echo $e->getMessage();
75 }
76 return;
77}
manage the http input (get , post, request) and extract from an array
static input_source()
input the source of the data : folder, exercice, closing or opening operation
static delete($aOperation_id)