fixed display of non-calendar providers in the Billing Report page
[openemr.git] / interface / batchcom / settingsnotification.php
blobb9a4edb12765677128f2d8980b6b27718e5b6b06
1 <?php
2 //INCLUDES, DO ANY ACTIONS, THEN GET OUR DATA
3 include_once("../globals.php");
4 include_once("$srcdir/registry.inc");
5 include_once("$srcdir/sql.inc");
6 include_once("../../library/acl.inc");
7 include_once("batchcom.inc.php");
9 // gacl control
10 $thisauth = acl_check('admin', 'notification');
12 if (!$thisauth) {
13 echo "<html>\n<body>\n";
14 echo "<p>".xl('You are not authorized for this.','','','</p>')."\n";
15 echo "</body>\n</html>\n";
16 exit();
19 $type = 'SMS/Email Settings';
20 // process form
21 if ($_POST['form_action']=='Save')
23 if ($_POST['Send_SMS_Before_Hours']=="") $form_err.=xl('Empty value in "SMS Hours"','','<br>');
24 if ($_POST['Send_Email_Before_Hours']=="") $form_err.=xl('Empty value in "Email Hours"','','<br>');
25 if ($_POST['SMS_gateway_username']=="") $form_err.=xl('Empty value in "Username"','','<br>');
26 if ($_POST['SMS_gateway_password']=="") $form_err.=xl('Empty value in "Password"','','<br>');
27 //process sql
28 if (!$form_err)
30 $sql_text=" ( `SettingsId` , `Send_SMS_Before_Hours` , `Send_Email_Before_Hours` , `SMS_gateway_password` , `SMS_gateway_apikey` , `SMS_gateway_username` , `type` ) ";
31 $sql_value=" ( '".$_POST[SettingsId]."' , '".$_POST[Send_SMS_Before_Hours]."' , '".$_POST[Send_Email_Before_Hours]."' , '".$_POST[SMS_gateway_password]."' , '".$_POST[SMS_gateway_apikey]."' , '".$_POST[SMS_gateway_username]."' , '".$type."' ) ";
32 $query = "REPLACE INTO `notification_settings` $sql_text VALUES $sql_value";
33 //echo $query;
34 $id = sqlInsert($query);
35 $sql_msg="ERROR!... in Update";
36 if($id) $sql_msg="SMS/Email Alert Settings Updated Successfully";
40 // fetch data from table
41 $sql="select * from notification_settings where type='$type'";
42 $result = sqlQuery($sql);
43 if($result)
45 $SettingsId = $result[SettingsId];
46 $Send_SMS_Before_Hours = $result[Send_SMS_Before_Hours];
47 $Send_Email_Before_Hours = $result[Send_Email_Before_Hours];
48 $SMS_gateway_password=$result[SMS_gateway_password];
49 $SMS_gateway_username=$result[SMS_gateway_username];
50 $SMS_gateway_apikey=$result[SMS_gateway_apikey];
52 //my_print_r($result);
53 //START OUT OUR PAGE....
55 <html>
56 <head>
57 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
58 <link rel="stylesheet" href="batchcom.css" type="text/css">
59 <script type="text/javascript" src="../../library/overlib_mini.js"></script>
60 <script type="text/javascript" src="../../library/calendar.js"></script>
63 </head>
64 <body class="body_top">
65 <span class="title"><?php include_once("batch_navigation.php");?></span>
66 <span class="title"><?php xl('SMS/Email Alert Settings','e')?></span>
67 <br><br>
68 <!-- for the popup date selector -->
69 <div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
70 <FORM name="select_form" METHOD=POST ACTION="">
71 <input type="Hidden" name="type" value="<?php echo $type;?>">
72 <input type="Hidden" name="SettingsId" value="<?php echo $SettingsId;?>">
73 <div class="text">
74 <div class="main_box">
75 <?php
76 if ($form_err) {
77 echo ("The following errors occurred<br>$form_err<br><br>");
79 if ($sql_msg) {
80 echo ("$sql_msg<br><br>");
83 <?php xl('SMS send before','e')?> :
84 <INPUT TYPE="text" NAME="Send_SMS_Before_Hours" size="10" maxlength="3" value="<?php echo $Send_SMS_Before_Hours?>"> <strong>Hrs.</strong>
85 <br>
86 <?php xl('Email send before','e')?> :
87 <INPUT TYPE="text" NAME="Send_Email_Before_Hours" size="10" maxlength="3" value="<?php echo $Send_Email_Before_Hours?>"> <strong>Hrs.</strong>
88 <br>
89 <?php xl('Username for SMS Gateway','e')?> :
90 <INPUT TYPE="password" NAME="SMS_gateway_username" size="40" value="<?php $SMS_gateway_username?>">
91 <br>
92 <?php xl('Password for SMS Gateway','e')?> :
93 <INPUT TYPE="password" NAME="SMS_gateway_password" size="40" value="<?php $SMS_gateway_password?>">
94 <br>
95 <?php xl('SMS Gateway API key','e')?> :
96 <INPUT TYPE="text" NAME="SMS_gateway_apikey" size="40" value="<?php $SMS_gateway_apikey?>">
98 <br><br>
99 <INPUT TYPE="submit" name="form_action" value="Save">
100 </div>
101 </div>
102 </FORM>