-
Notifications
You must be signed in to change notification settings - Fork 0
/
1_old_4-9-15_managecontacts.php
184 lines (179 loc) · 6.04 KB
/
1_old_4-9-15_managecontacts.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<?php
include("includes/config.inc.php");
include("includes/crosssite.inc.php");
if ( isset ( $_GET['logout'] ) && $_GET['logout'] ==1 ) {
session_destroy();
header("location: index.php?token=".$token);
}
if (isset($_SESSION) && $_SESSION['login']=='')
{
session_destroy();
header("location: index.php?token=".$token);
}
//Delete single record
if(isset($_GET['id']))
{
$id = $_GET['id'];
$delete_single_row = "DELETE FROM tblcallingdata WHERE id='$id'";
$delete = mysql_query($delete_single_row);
}
if($delete)
{
echo "<script> alert('Record Delted Successfully'); </script>";
}
//End
//Delete multiple records
if(count($_POST['delete_selected'])>0 && (isset($_POST['delete_selected'])) )
{
if(isset($_POST['linkID']))
{
foreach($_POST['linkID'] as $chckvalue)
{
$sql = "DELETE FROM tblcallingdata WHERE id='$chckvalue'";
$result = mysql_query($sql);
}
if($result)
{
echo "<script> alert('Records Deleted Successfully'); </script>";
}
}
}
//End
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="images/ico.png" type="image/x-icon">
<title><?=SITE_PAGE_TITLE?></title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-submenu.min.css">
<link rel="stylesheet" href="css/custom.css">
<script type="text/javascript" src="js/checkbox.js"></script>
</head>
<body>
<!--open of the wraper-->
<div id="wraper">
<!--include header-->
<?php include_once('includes/header.php');?>
<!--end-->
<!--open of the content-->
<div class="row" id="content">
<div class="col-md-12">
<h3>Lead Details</h3>
<hr>
</div>
<div class="col-md-12">
<div class="col-md-4 btn_grid">
<form method="post" name="frm_delete">
<input type='button' name='cancel' class="btn btn-primary" value="Add New" onClick="window.location.replace('contacts.php?token=<?php echo $token ?>')"/>
<input type="submit" name="delete_selected" onClick="return confirm('Are you sure you want to delete?')" class="btn btn-primary" value="Delete Selected">
</form>
</div>
</div>
<div class="col-md-12">
<div class="table-responsive">
<table class="table table-hover table-bordered ">
<?php
$where='';
$linkSQL="";
if(!isset($linkSQL) or $linkSQL =='')
$linkSQL = "select * from tblcallingdata where 1=1 $where order by id desc";
$pagerstring = Pages($linkSQL,PER_PAGE_ROWS,'managecontacts.php?',$token);
if(isset($_SESSION['linkSQL']))
$mSQL=$_SESSION['linkSQL']." ".$_SESSION['limit'];
$oRS = mysql_query($mSQL);
?>
<form name='fullform' method='post' onSubmit="return confirmdelete()">
<input type="hidden" name="token" value="<?php echo $token; ?>" />
<input type='hidden' name='pagename' value='users'>
<?php if($_SESSION['sess_msg']!=''){?>
<center>
<div style="color:#009900; padding:0px 0px 10px 0px; font-weight:bold;"><?php echo $_SESSION['sess_msg'];$_SESSION['sess_msg']='';?></div>
</center>
<?php } ?>
<tr>
<th>S. No.</th>
<th>Name</th>
<th>Company Name</th>
<th>Phone</th>
<th>Mobile</th>
<th>Data Source</th>
<th>Actions
<a href='#' onClick="SetAllCheckBoxes('fullform','linkID[]',true)" style="color:#fff; font-size:11px;">Check All </a>
<a href='#' onClick="SetAllCheckBoxes('fullform','linkID[]',false)" style="color:#fff; font-size:11px;">Uncheck All </a>
</th>
</tr>
<?php
$kolor=1;
if(isset($_GET['page']) and is_null($_GET['page']))
{
$kolor = 1;
}
elseif(isset($_GET['page']) and $_GET['page']==1)
{
$kolor = 1;
}
elseif(isset($_GET['page']) and $_GET['page']>1)
{
$kolor = ((int)$_GET['page']-1)* PER_PAGE_ROWS+1;
}
if(mysql_num_rows($oRS)>0)
{
while ($row = mysql_fetch_array($oRS))
{
if($kolor%2==0)
$class="bgcolor='#ffffff'";
else
$class="bgcolor='#fff'";
?>
<tr <?php print $class?>>
<td><?php print $kolor++;?>.</td>
<td><?php echo stripslashes($row["First_Name"]." ".$row["Last_Name"]);?></td>
<td><?php echo stripslashes($row["Company_Name"]);?></td>
<td><?php echo stripslashes($row["Phone"]);?></td>
<td><?php echo stripslashes($row["Mobile"]);?></td>
<td><?php echo stripslashes($row["data_source"]);?></td>
<td><?php if($row["id"]!=1){?>
<a href="#" onClick="if(confirm('Do you really want to delete this record?')){ window.location.href='managecontacts.php?id=<?php echo $row["id"]; ?>&type=del&token=<?php echo $token ?>' } " >
<img src="images/drop.png" title="Delete" border="0" /></a>
<?php } ?>
<?php if($row["id"]!=1){?>
<a href="branch_type.php?id=<?php echo $row["id"] ?>&token=<?php echo $token ?>">
<a href="edit_contacts.php?id=<?php echo $row["id"] ?>&token=<?php echo $token ?>">
<img src='images/edit.png' title='Edit' border='0' /></a>
<?php } else {?>
<a href="edit_contacts.php?cid=<?php echo $row["id"] ?>&token=<?php echo $token ?>"><img src='images/edit.png' title='Edit' border='0' /></a>
<?php } ?> <?php if($row["id"]!=1){?>
<input type='checkbox' name='linkID[]' value='<?php echo $row["id"]; ?>'><?php } ?></td>
</tr>
<?php }
echo $pagerstring;
}
else
echo "<tr><td colspan=6 align=center><h3>No records found!</h3></td><tr/></table>";
?>
</form>
</table>
</div>
</div>
</div>
<!--end of the content-->
<!--open of the footer-->
<div class="row" id="footer">
<div class="col-md-12">
<p>Copyright © 2015 INDIAN TRUCKERS, All rights reserved.</p>
</div>
</div>
<!--end footer-->
</div>
<!--end wraper-->
<!-------Javascript------->
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>