-
Notifications
You must be signed in to change notification settings - Fork 0
/
dns-new.php
150 lines (121 loc) · 4.42 KB
/
dns-new.php
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
<?php include 'header.php';
if(isset($_POST['btnSave'])){
$txtDNS = post('txtDNS');
$txtFromDate = post('txtFromDate');
$txtToDate = post('txtToDate');
$txtLiveTime = post('txtLiveTime');
$txtCusName = post('txtCusName');
$txtPhone = post('txtPhone');
$txtAddress = post('txtAddress');
$txtDesc = post('txtDesc');
$thisy = date("Y") + $txtToDate;
$thism = date('m');
$thisd = date('d');
$Thisyear = $thisy.'-'.$thism.'-'.$thisd;
$tCusName = encrypt_decrypt('encrypt', $txtCusName);
if($txtLiveTime == 'Yes')
{
//cRedirect('http://google.com/');
$insert=$db->query("INSERT INTO tbldns
(dnsID, dnsName, DateFrom, DateTo, IsLiveTime, CusName, CusPhone, CusAddress, CusDesc)
VALUES(
'".time()."',
N'".sql_quote($txtDNS)."',
N'".sql_quote($txtFromDate)."',
N'2100-01-01',
N'2100-01-01',
N'".sql_quote($tCusName)."',
N'".sql_quote($txtPhone)."',
N'".sql_quote($txtAddress)."',
N'".sql_quote($txtDesc)."'
)");
if($insert){
cRedirect('dns.php');
}
}
else
{
$insert=$db->query("INSERT INTO tbldns
(dnsID, dnsName, DateFrom, DateTo, IsLiveTime, CusName, CusPhone, CusAddress, CusDesc)
VALUES(
'".time()."',
N'".sql_quote($txtDNS)."',
N'".sql_quote($txtFromDate)."',
N'".sql_quote($Thisyear)."',
N'',
N'".sql_quote($tCusName)."',
N'".sql_quote($txtPhone)."',
N'".sql_quote($txtAddress)."',
N'".sql_quote($txtDesc)."'
)");
if($insert){
cRedirect('dns.php');
}
}
$error = "Error for Create New User.";
}
?>
<body class="skin-blue">
<!-- header logo: style can be found in header.less -->
<?php include 'nav.php';?>
<!-- Left side column. contains the logo and sidebar -->
<?php include 'menu.php';?>
<!-- Right side column. Contains the navbar and content of the page -->
<aside class="right-side">
<!-- Content Header (Page header) -->
<section class="content-header">
<div class="row">
<div class="col-xs-8">
<form role="form" method="post" enctype="multipart/form-data">
<div class="form-group">
<label>DNS Name:</label>
<input name="txtDNS" class="form-control" placeholder="Enter text" required />
</div>
<div class="form-group">
<label>Start Date:</label>
<div class="input-group">
<div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
<input type="text" name="txtFromDate" class="form-control pull-right" id="datemask"/>
</div><!-- /.input group -->
</div><!-- /.form group -->
<div class="form-group">
<label>Choose Year</label>
<select class="form-control" name="txtToDate">
<option value="1">1 Year</option>
<option value="2">2 Years</option>
<option value="3">3 Years</option>
</select>
</div>
<div class="form-group">
<label>Is Live Time:</label>
<div class="input-group">
<input type="checkbox" name="txtLiveTime" value="Yes" /> Click Here.
</div><!-- /.input group -->
</div><!-- /.form group -->
<div class="form-group">
<label>Customer Name:</label>
<input name="txtCusName" class="form-control" placeholder="Enter text" />
</div>
<div class="form-group">
<label>Phone Number:</label>
<input name="txtPhone" class="form-control" placeholder="Enter text" />
</div>
<div class="form-group">
<label>Address:</label>
<input name="txtAddress" class="form-control" placeholder="Enter text" />
</div>
<div class="form-group">
<label>Description:</label>
<input name="txtDesc" class="form-control" placeholder="Enter text" />
</div>
</form>
</div>
</div>
</section>
<!-- Main content -->
</aside><!-- /.right-side -->
</div><!-- ./wrapper -->
<!-- add new calendar event modal -->
<?php include 'footer.php';?>