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");
10 $thisauth = acl_check('admin', 'notification');
13 echo "<html>\n<body>\n";
14 echo "<p>".xl('You are not authorized for this.','','','</p>')."\n";
15 echo "</body>\n</html>\n";
19 $type = 'SMS/Email Settings';
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>');
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";
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);
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....
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
>
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
>
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;?>">
74 <div
class="main_box">
77 echo ("The following errors occurred<br>$form_err<br><br>");
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
>
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
>
89 <?php
xl('Username for SMS Gateway','e')?
> :
90 <INPUT TYPE
="password" NAME
="SMS_gateway_username" size
="40" value
="<?php $SMS_gateway_username?>">
92 <?php
xl('Password for SMS Gateway','e')?
> :
93 <INPUT TYPE
="password" NAME
="SMS_gateway_password" size
="40" value
="<?php $SMS_gateway_password?>">
95 <?php
xl('SMS Gateway API key','e')?
> :
96 <INPUT TYPE
="text" NAME
="SMS_gateway_apikey" size
="40" value
="<?php $SMS_gateway_apikey?>">
99 <INPUT TYPE
="submit" name
="form_action" value
="Save">