Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*case 'ext':
- /* search code using phone extension */
- /* select data from PHONES table
- $sql = "SELECT * FROM phones WHERE ";
- $ext = $search_string;
- for ($x = 1; $x <= 4; x++) {
- $sql .= "ext$x = \'$ext\' || ";
- }
- $sql = substr($sql, 0, -4);
- echo $sql;
- // $sql .="ext = " . $ext ."";
- /*
- $sql = "SELECT * FROM phones WHERE ext = " . $uid . "";
- $result = mysql_query($sql, $conn);
- if (!$result) {
- die("<b>ERROR:</b> Unable to select user's phone information." . mysql_error());
- }
- while($row = mysql_fetch_array($result))
- {
- $phone_ip = $row['phone_ip'];
- $phone_model = $row['model'];
- $phone_type = $row['type'];
- $phone_ext1 = $row['ext1'];
- $phone_ext2 = $row['ext2'];
- $phone_ext3 = $row['ext3'];
- $phone_ext4 = $row['ext4'];
- $cable_id = $row['cable_id'];
- $location_id = $row['lid'];
- }
- /* select data from USERS table
- $sql = "SELECT * FROM users WHERE lid= '$search_string'";
- $result = mysql_query($sql, $conn);
- if (!$result) {
- die("<b>ERROR:</b> Unable to select Location ID." . mysql_error());
- }
- $num_rows = mysql_num_rows($result);
- while($row = mysql_fetch_array($result))
- {
- /* grab identifiers
- $uid = $row['uid'];
- $first = $row['first'];
- $last = $row['last'];
- $user = $row['username'];
- $password = $row['password'];
- $title = $row['title'];
- $cell_phone = $row['cell_phone'];
- $cell_type = $row['cell_type'];
- $printer1 = $row['printer1'];
- $printer2 = $row['printer2'];
- $pc_name = $row['pc_name'];
- $cell_number = $row['cell_number'];
- $full_name = $first . " " . $last;
- }
- /* select data from NETWORK table
- $sql = "SELECT * FROM network WHERE uid = " . $uid . "";
- $result = mysql_query($sql, $conn);
- if (!$result) {
- die("<b>ERROR:</b> Unable to select user's network information." . mysql_error());
- }
- while($row = mysql_fetch_array($result))
- {
- $lid = $row['lid'];
- $equpment_type = $row['equipment_type'];
- $equipment_func = $row['equipment_func'];
- $cableid = $row['cable_id'];
- }
- break;*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement