File: handler.vspx

package info (click to toggle)
virtuoso-opensource 6.1.6%2Bdfsg2-4
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 260,992 kB
  • ctags: 125,220
  • sloc: ansic: 652,748; sql: 458,419; xml: 282,834; java: 61,031; sh: 40,031; cpp: 36,890; cs: 25,240; php: 12,692; yacc: 9,523; lex: 7,018; makefile: 6,157; jsp: 4,484; awk: 1,643; perl: 1,013; ruby: 1,003; python: 326
file content (157 lines) | stat: -rw-r--r-- 4,738 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?xml version="1.0"?>
<!--
 -  
 -  $Id$
 -
 -  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
 -  project.
 -  
 -  Copyright (C) 1998-2012 OpenLink Software
 -  
 -  This project is free software; you can redistribute it and/or modify it
 -  under the terms of the GNU General Public License as published by the
 -  Free Software Foundation; only version 2 of the License, dated June 1991.
 -  
 -  This program is distributed in the hope that it will be useful, but
 -  WITHOUT ANY WARRANTY; without even the implied warranty of
 -  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 -  General Public License for more details.
 -  
 -  You should have received a copy of the GNU General Public License along
 -  with this program; if not, write to the Free Software Foundation, Inc.,
 -  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 -  
 -  
-->
<html>

	<head>
		<title>Table manipulations calling CLR functions</title>
	</head>

	<body>
           <v:page name="sms_handler" xmlns:v="http://www.openlinksw.com/vspx/" xmlns:xhtml="http://www.w3.org/1999/xhtml">
		<h2>Table manipulations calling CLR functions</h2>

		    <v:login name="loginc" realm="vspx" mode="url" user-password="sql_user_password" user-password-check="sql_user_password_check" >
		    <v:template type="if-no-login" redirect="ho_s_5.vspx">
		    </v:template>

		    <v:login-form name="loginf" required="1" title="Login" user-title="User Name" password-title="Password" submit-title="Login" >
		    </v:login-form>

		    <v:template type="if-login">
		      <P>
			SID: <?vsp http (self.sid); ?>
		      </P>
		      <P>
			UID: <?vsp http_value (connection_get ('vspx_user')); ?>
		      </P>
		      <P> ClientSerialNo : <?vsp http_value (connection_get ('ho_s_3.Redcoal.ClientSerialNo')); ?> </P>
		      <P> SMSKey : <?vsp http_value (connection_get ('ho_s_3.Redcoal.SMSKey')); ?> </P>
		      <P> MGRPhone : <?vsp http_value (connection_get ('ho_s_3.MGRPhone')); ?> </P>

		<?vsp
     declare params any;
     params := (self.vc_event).ve_params;
     dbg_obj_print (params);
   {
     declare _ClientSerialNo, _SMSKey, _Recepient varchar;


     _ClientSerialNo := connection_get ('ho_s_3.Redcoal.ClientSerialNo');
     _SMSKey := connection_get ('ho_s_3.Redcoal.SMSKey');
     _recepient := connection_get ('ho_s_3.MGRPhone');

     if (isstring (_ClientSerialNo) and isstring (_SMSKey) and isstring (_recepient) and
	  length (_ClientSerialNo) > 0 and length (_SMSKey) > 0 and length (_recepient) > 0)
       {
?>
		<p><i>SMS Sending <v:url name="on_url" url="--'setup_sms.vspx'" format="%s" value="--'on'" /></i></p>
		<?vsp
    } else {
?>
		<p><i>SMS Sending <v:url name="off_url" url="--'setup_sms.vspx'" format="%s" value="--'off'" /></i></p>
		<?vsp
    }
   }
?><?vsp
  declare _add_it, _delete_it integer;
  declare _supplier_id varchar;

  declare exit handler for sqlstate '*' {
?>
		<hr />
		<table>
			<tr>
				<td>SQL State</td>
				<td><?V __SQL_STATE ?></td>
			</tr>
			<tr>
				<td>SQL Message</td>
				<td><?V __SQL_MESSAGE ?></td>
			</tr>
		</table>
		<hr />
		<?vsp
     goto page_start;
  };

      _add_it := trim (get_keyword ('add_it', params, ''));
      _delete_it := trim (get_keyword ('delete_it', params, ''));

      _supplier_id := trim (get_keyword ('supplier_id', params, ''));
      if (_add_it <> '')
        {
	  insert soft CLR1..Suppliers (SupplierID) values (cast (_supplier_id as integer));
?>
		<hr />
		<p>Added : SupplierID <b><?V cast (_supplier_id as integer) ?></b>.</p>
		<hr />
		<?vsp
	}
      else if (_delete_it <> '')
        {
          _supplier_id := trim (get_keyword ('supplier_id1', params, ''));
	  delete from CLR1..Suppliers where SupplierID = cast (_supplier_id as integer);
?>
		<hr />
		<p>Deleted : SupplierID <b><?V cast (_supplier_id as integer) ?></b>.</p>
		<hr />
		<?vsp
	}
page_start:
?>
		<v:form action="handler.vspx" name="delate_form">
			<table>
				<tr>
					<td>SupplierID</td>
					<td><select name="supplier_id1" value="<?V _supplier_id ?>">
							<?vsp
            for select SupplierID as supp_id from CLR1..Suppliers do {
?>
							<option label="<?V supp_id ?>" value="<?V supp_id ?>"><?V supp_id ?></option><?vsp       }
?>
						</select></td>
					<td><input type="submit" name="delete_it" value="Delete" /></td>
				</tr>
			</table>
		</v:form>
		<hr />
		<v:form action="handler.vspx" name="add_form">
			<table>
				<tr>
					<td>New SupplierID</td>
					<td><input type="text" name="supplier_id" value="<?V _supplier_id ?>" /></td>
					<td><input type="submit" name="add_it" value="Add" /></td>
				</tr>
			</table>
		</v:form>

		    </v:template>

		    </v:login>
          </v:page>
	</body>

</html>