<th>Name</th> <th>Main Agent</th> <th>Email</th> <th>Code</th> <th>Res. No</th> <th>Ofc. No</th> <th></th> </tr> </tfoot> <tbody> '; foreach ($sub_agents as $key => $data) { echo '<tr>'; echo '<td><input type="checkbox" name="ids" value="' . $data['id'] . '" /></td>'; echo '<td>' . $data['name'] . '</td>'; echo '<td>' . getAgent($data['agent_id']) . '</td>'; echo '<td>' . $data['email'] . '</td>'; echo '<td>' . $data['code'] . '</td>'; echo '<td>' . $data['res_phone'] . '</td>'; echo '<td>' . $data['ofc_phone'] . '</td>'; echo '<td><a title="Edit" href="new.php?id=' . $data['id'] . '"><span class="text-success glyphicon glyphicon-pencil" aria-hidden="true"></span></a> | <a title="Delete" class="confirmation" href="' . HTTP_PATH . '/sub_agents/index.php?did=' . $data['id'] . '"><span class="text-danger glyphicon glyphicon-remove" aria-hidden="true"></span></a></td>'; echo '</tr>'; } echo '</tbody></table>'; } else { echo '<p class="text-center">No Record Found!</p>'; } ?> </div> </div> <form id="hiddenFrm" method="post">
function createMenu($id, $name, $items, $activeItem = '', $additionalElements = '', $zIndex = 100, $width = 42) { if (strpos(getAgent(), 'Internet Explorer') === 0) { $width_new = $width + 5; } else { $width_new = $width - 1; } ksort($items); $length = count($items) - 1; $items_tmp = array_reverse($items, false); $openList = array(); for ($i = 0; $i <= $length; $i++) { $openList[$i] = 0; } $lastLevel = 0; $items = array(); foreach ($items_tmp as $dn => $cn) { $dn = strstr($dn, 'cn='); $level = count(explode(',', $dn)) - 1; $img = array(); if ($level > $lastLevel) { $openList[$lastLevel]++; } if ($level >= 1) { for ($i = 1; $i <= $level; $i++) { if ($openList[$i] > 0 and $i != $level) { $img[] = '<img src="img/bar.jpg" style="border:none;">'; } elseif ($openList[$i] === 0 and $i != $level) { $img[] = '<img src="img/blank.jpg" style="border:none;">'; } elseif ($i == $level) { if ($level == $lastLevel or $openList[$level] > 0) { $img[] = '<img src="img/arrow2.jpg" style="border:none;">'; } else { $img[] = '<img src="img/arrow.jpg" style="border:none;">'; } } } } if ($level < $lastLevel and $openList[$level] > 0) { $openList[$level]--; } $items[$cn] = $img; $lastLevel = $level; } $additionalElementsSize = 0; if (is_array($additionalElements) and count($additionalElements) >= 1) { foreach ($additionalElements as $key => $val) { $items[$val] = array(); } $additionalElementsSize = count($additionalElements); } $items = array_reverse($items, true); if (!array_key_exists($activeItem, $items)) { $activeItem = getFirstKey($items); } $length = count($items); echo '<div class="menu" style="z-index:' . $zIndex . ';' . ($width != 42 ? 'width:' . $width_new . 'px;margin-right:4px;' : '') . '">'; echo '<ul' . ($width != 42 ? ' style="width:' . $width_new . 'px;" ' : '') . '>'; //echo '<li'.(($width!=42)?' style="width:'.$width_new.'px;" ':'').'><a class="hide"'.(($width!=42)?' style="width:'.$width_new.'px;" ':'').' id='.$id.'-activeItem style="vertical-align:middle;" href=# onclick="dropdownOpen(\''.$id.'\');">'.$activeItem.'</a>'; echo '<li' . ($width != 42 ? ' style="width:' . $width_new . 'px;" ' : '') . '><a class="hide"' . ($width != 42 ? ' style="width:' . $width_new . 'px;" ' : '') . ' id=' . $id . '-activeItem style="vertical-align:middle;" href=# onclick="document.getElementById(\'' . $id . '\').style.display=\'block\';">' . $activeItem . '</a>'; // onclick="dropdownOpen(\''.$id.'\');" echo '<ul id=' . $id . '>'; $index = 1; foreach ($items as $cn => $img) { if ($additionalElementsSize == $index) { $addStyle = 'style="background:#ffffff;border-bottom:1px dashed #6699cc;"'; } else { $addStyle = ''; } if ($index < $length) { echo '<li><div class=defaultElement ' . $addStyle . '>'; } else { echo '<li><div class=bottomElement>'; } echo '<table cellpadding=0 cellspacing=0 border=0 style="background:#ffffff;"><tr>'; foreach ($img as $key => $val) { echo '<td style="width:10px;height:15px;">' . $val . '</td>'; } //echo '<td style="height:15px;vertical-align:middle;"><a href=# title="'.$cn.'" onclick="dropdownClose(\''.$id.'\', \''.$name.'\', \''.$cn.'\');" style="border:none;text-align:left;padding-left:0px;">'.$cn.'</a></td></tr></table></div>'; echo '<td style="height:15px;vertical-align:middle;"><a href=# title="' . $cn . '" onclick="document.getElementById(\'' . $id . '\').style.display=\'none\'; document.getElementById(\'' . $id . '-activeItem\').innerHTML=\'' . $cn . '\'; document.getElementById(\'' . $name . '\').value=\'' . $cn . '\';" style="border:none;text-align:left;padding-left:0px;">' . $cn . '</a></td></tr></table></div>'; $index++; } echo '</ul>'; echo '</li>'; echo '</ul>'; echo '</div>'; echo '<input type=hidden id=' . $name . ' name=' . $name . ' value=' . $activeItem . '>'; }
<?php global $userProfile; global $user; $agent = getAgent(); ?> <div id="loginPage" style="margin-left: auto; margin-right: auto; width: 100%; max-width: 992px;"> <h2>Mein Profil</h2> <div style="width: 100%; margin: auto; max-width: 400px;"> <p>Hallo <?php echo $userProfile->displayName; ?> ,</p> <div class="button"> <form action="" method="POST"> <p> <input type="text" value="Name: <?php echo $userProfile->displayName; ?> " class="form-control" disabled /> </p> <p> <input type="text" value="E-Mail: <?php echo $userProfile->email; ?>
try { $connection = new PDO($host, $user, $pass); $connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $e) { echo 'Connection failed: ' . $e->getMessage(); } // Retrieve and return an agent whose is active ( active = 1) and with oldest/lease modified date function getAgent($connection) { $query = $connection->prepare("SELECT * FROM agents WHERE active=1 ORDER BY modified ASC LIMIT 1"); $query->execute(); $row = $query->fetch(); return $row; } // Get an agent to assign to this lead $agent = getAgent($connection); // Lead details obtained from form $first_name = $_POST['fname']; $last_name = $_POST['lname']; $email = $_POST['email']; $mobile = $_POST['mobile']; $message = $_POST['message']; $datetime = date("Y-m-d H:m:s", time()); if (empty($first_name) || empty($last_name) || strlen($mobile) < 8 || empty($message) || filter_var($email, FILTER_VALIDATE_EMAIL) == false) { header('Location: index.php?status=invalid'); } //If agent is available if (isset($agent['id'])) { //Insert lead into the database ( assigned to retrieved agent ) $query = $connection->prepare("INSERT INTO leads (agent_id, first_name, last_name, email, mobile, message, created, modified ) VALUES (:agent_id, :first_name, :last_name, :email, :mobile, :message, :created, :modified)"); $query->bindParam(':agent_id', $agent['id']);