Jump to content

mcerveni

Members
  • Posts

    87
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mcerveni's Achievements

Member

Member (2/5)

0

Reputation

  1. I have a an index.php page that shows a table, and my jquery functions work. Example: When you hover over a row, it'll highlight that row. When I run an ajax function that calls another page - my jquery functions do not work. I don't get any errors or anything. header code: <?php session_start(); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <?php include('config.inc.php'); include('functions.inc.php'); ?> <head> <script type="text/javascript" src="scripts/jquery-1.3.2.js"> </script> <script type="text/javascript" src="scripts/func.js"> </script> <link rel="stylesheet" type="text/css" href="style/style.css"> <title> Quality Tracker </title> </head> <body> <DIV id=uberbar> <input type="submit" value="Add Record" class="searchBtn2"> <input type="submit" value="Multiple Filter" class="searchBtn2" onclick="filterColumn();"> <input type="submit" value="Clear Filters" class="searchBtn2" onclick="clearFilters();"> </DIV> <div id="dim"> </div> My index.php has include('include/header.php'); When i call an ajax function that calls another page, that page has: include('header.php');
  2. I'm trying to send multiple emails from $row['email']. When i run the script, none of the echo statements show. It also doesn't email anything. Code shown below: <?php if( $dbc = @mysql_connect('localhost','user', 'pass') ){ //connect to myblog database if( !@mysql_select_db ('stats') ){ $diestring = '<p> Could not select the database because: <b>' .mysql_error().'</b> </p>'; die ($diestring); } } else { $diestring = '<p> Could not connect to MySQL because: <b>' .mysql_error().'</b> </p>'; die($diestring); } } $sql = "SELECT * FROM stats.employee_compo LEFT JOIN stats.sched ON employee_compo.EmpID = sched.empID "; $result = mysql_query($sql) or die(mysql_error()); $row= mysql_fetch_array($result); $agentName = $row['agentName']; $sunday = $row['sunday']; $monday = $row['monday']; $tuesday = $row['tuesday']; $wednesday = $row['wednesday']; $thursday = $row['thursday']; $friday = $row['friday']; $saturday = $row['saturday']; foreach($result as $row) { echo $row['email'].","; $to = $row['email']; $subject = "Your New Scheduale"; $body = " $agentName, <br><br> Your new scheduale is shown below: <br><br> <table style='border:1px solid black; text-align:center' > <tr><th> Sunday </th> <th> Monday </th> <th>Tuesday </th> <th> Wednesday </th> <th> Thursday</th> <th> Friday </th> <th> Saturday </th> </tr> <tr> <td> $sunday </td> <td> $monday </td> <td> $tuesday </td> <td> $wednesday </td> <td> $thursday </td> <td> $friday </td> <td> $saturday </td> </tr> </table> "; if (mail($to, $subject, $body)) { echo("<p>Scheduales have been sent!</p>"); } else { echo("<p>Message delivery failed...</p>"); } } ?>
  3. Below shows the AHT (average handling time), avg acw, and avg. hold time. I used the AVG(field) sql function. The problem? --> It doesn't count the seconds properly. also, i haven't figured out a way to format it as a timestamp yet. Query is below: $sql3 = "SELECT TeamLeader, AgentName, EmpID, AvayaID, date, SUM(StaffedTime), AVG(AHT) , ACDCalls, SUM(ACDTime) , AvgACDTime, SUM(ACWTime), AVG(AvgACWTime), HoldCalls, HoldTime, AVG(AvgHoldTime), OutboundCalls , SUM(OutboundTime) , SUM(AvailTime), RingTime, AvgRingTime, AVG(utilization), SUM(aux1), SUM(aux2), SUM(aux7), SUM(aux8), SUM(aux9) FROM import_stats WHERE EmpID = '$agent' and import_stats.date BETWEEN '$start' AND '$end' GROUP BY AgentName"; $result3 = mysql_query($sql3) or die(mysql_error()); $row3= mysql_fetch_array($result3); //AVERAGES $utilization = $row3['AVG(utilization)']; $aht = $row3['AVG(AHT)']; $acw = $row3['AVG(AvgACWTime)']; $holdtime = $row3['AVG(AvgHoldTime)']; $util = round($utilization); $aht = round($aht); $acw = round($acw); $holdtime = round($holdtime);
  4. I am writing a news feed with a heading (v_toggle0,1,2,3) that slides a div of text down when clicked on(vertical_slide0,1,2,3) using Mootools. The function works if I do not use a loop and simply hardcode the values. In fact, It works if I keep everything the same and change myVerticalSlide[num].toggle() to myVerticalSlide[0].toggle() or myVerticalSlide[1].toggle(); Seems like this should not be a problem at all but myVerticalSlide[num].toggle(); returns an error. Any help would be appreciated. ____________________________________________________________________ window.addEvent('domready', function() { var myVerticalSlide=new Array(); for (var num=0;num<=1;num++){ myVerticalSlide[num] = new Fx.Slide('vertical_slide'+num); $('v_toggle'+num).addEvent('click', function(e){ e.stop(); myVerticalSlide[num].toggle(); }); } }); ________________________________________________________
  5. Ok thanks, and no i haven't done EXPLAIN. I actually never heard of it until now. To be honest..i don't have indexes on every table. I never understood how dramatic the difference is with having an index. For one of my tables called 'transfers' i don't have an index ...but i could apply it to my 'ticket_id' field, since there shouldnt be identical ticket numbers anyway.
  6. also..when i press a button called Issue Tracker, it hangs as well. there isn't even any data in the table lol. it's been getting worse and worse as i've been adding more functions to it.
  7. one example is a a Fetch Transfers button: ajax code stat_loader(); timeInterval = setInterval('getTransfers_refresh();', 5000); getTransfers_refresh(); } function getTransfers_refresh() { http.open('get', 'include/getTransfers.php'); http.onreadystatechange = gettransfer; http.send(null); function gettransfer() { if(http.readyState == 4){ var response = http.responseText; document.getElementById('mainContent').innerHTML = ' ' +response+ ''; } } } php code //DATE FINDER $month_num= date('m'); $start_year = "2009"; $start_month = $month_num; $start_day = date('d'); $end_year = "2009"; $end_month = $month_num; $end_day = date('d'); $start = $start_year . "-" . $start_month ."-".$start_day; $end = $end_year . "-" . $end_month ."-".$end_day; mysql_select_db($agentcenter_database); mysql_query("USE agentcenter"); $sql = "SELECT * FROM transfer WHERE date BETWEEN '$start' AND '$end' ORDER BY time DESC"; $result = mysql_query($sql); $num_rows = mysql_num_rows($result); ?> <span id="updateDay" > <div align="center"> <h2> Transfers </h2> </div> <?php showTotalIssues_transfers(); ?> <div align="left"> Total # of Transfers: <?php echo $num_rows; ?> </div> <br> <table id="hor-minimalist-b" summary="Employee Pay Sheet" style="width:820px"> <thead> <tr> <th> Agent Name </th> <th> CA Number </th> <th> Ticket ID</th> <th> Time </th> <th> Transfer To </th> <th> Reason </th> <th> Approved By </th> </tr> </thead> <?php while($row= mysql_fetch_array($result)) { //loop record. ?> <tbody> <tr> <td> <?php echo $row['agentName'];?> </td> <td> <?php echo $row['empID'];?> </td> <td> <?php echo $row['ticket_id'];?> </td> <td> <?php echo $row['time'];?> </td> <td> <?php echo $row['transfer_to'];?> </td> <td> <?php echo $row['reason'];?> </td> <td> <?php echo $row['approved_by'];?> </td> </tr> </tbody> <?php } ?> </table> </span> I should point out, i have a setinterval that calls the function every 5 seconds to show any updates in the table. I also have a ajax function that checks every few seconds for a break...it's called breakRequest() as an onload in the body
  8. I built a website for my work where over 130 people use to track their phone calls. At first, calling the functions to grab the mysql data was very quick. Now? there are over 3000 records in one of my tables and pressing any button to grab data from the database, it just hangs..i have to press it 2 times for it to work... why is that??
  9. I need to clearInterval, and instead it keeps looping. Any reason why?? code below. function requestforbreak(id,name) { requestbreak(id,name); empid=id; interval = setInterval("checkforbreaks();",1000); } function requestbreak(id,name){ http.open('get', '../../queuecenter/include/requestBreak.php?empID='+id+'&agentName='+name); http.onreadystatechange = function(){ if(http.readyState == 4){ var response = http.responseText; document.getElementById('breakreqmsg').innerHTML = ' ' +response+ ''; } } http.send(null); } function checkforbreaks(){ http.open('get', '../../queuecenter/include/breakPending.php?empID='+empid); http.onreadystatechange = function(){ if(http.readyState == 4){ var response = http.responseText; if(response == 'false'){ clearInterval(interval); document.getElementById('breakreqmsg').innerHTML ='Done'; } document.getElementById('breakreqmsg').innerHTML = ' ' +response+ ''; } } http.send(null); }
  10. So I have a website that over 80 users access throughout the day. They are logged in for a 9 hour shift. When i first launched the site, after about 3.5 - 4 hours, the session expired and logged them out. Now, after a week of it being used..after an hour the session expires, becomes blank, and the user has to log out again. I have this on the top of my header include file: session_start(); ini_set("session.cookie_lifetime", 86400); i now changed that to: ini_set('session.gc_maxlifetime', 86400); so i hope this will work... any suggestions??
  11. I have a login page that creates 2 sessions. $_SESSION['empID'] = $row['empID']; $_SESSION['agentName'] = $row['AgentName']; I have over 80 employees login to the website. And for the most part, they are logged in for over 4-5 hours, and after that time, I've seen those 2 sessions become blank... how should I make those sessions not expire at all???
  12. Here's the example site: www.rimdev.sgspoint.com/agentcenter username: CA705556 leave the password blank, press login. create a password and press finish. it does nothing...lol whyyy. i can't figure it out. i'm connecting to 2 different databases. the username/pass for them are in a functions include page i have. code below: <?php include("header.php"); $ca = $_GET['ca']; $pass = $_GET['pass']; $date = date('l F j, Y'); $handle = mysql_connect($host,$user,$pwd); mysql_select_db($stats, $handle); mysql_query("USE $stats",$handle); $query = "SELECT * FROM employee_compo WHERE EmpID = '$ca'"; $result = mysql_query($query) or die(mysql_error()); $row=mysql_fetch_array($result); $agentName = $row['AgentName']; $email = $row['email']; $empID = $ca; if($row['Email'] == $email && $row['Position'] == "FLA" || $row['Position'] == "PRS" ) { $picture = "pic"; $activated = "yes"; $handle2 = mysql_connect($host,$user,$pwd); mysql_select_db($agentcenter_database, $handle2); mysql_query("USE $agentcenter_database",$handle2); $sql = "INSERT INTO users ( user_id, email, empID, AgentName, password, date, activated, picture) VALUES(0, '$email', '$empID', '$agentName', '$pass', '$date', '$activated', '$picture')"; $insertUser = mysql_query($sql) or die(mysql_error()); $to= "mcervena@sympatico.ca"; $subject = "Activation Email"; $body= "<br><br> You have recently registered to the Agent Support Center. <b> Activate your account below. </b> <br> <br> "; $headers = "From: Agent Support Center \r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; mail($to, $subject, $body, $headers); echo "You have been sent an email to activate your account! "; } else { echo $ca; echo $pass; echo " <br> <br> <span style='font-size:17px'> <img src='images/invalid.JPG'> <center><a href='index.php'> Error: Try Again </a> </center> </span> "; } ?>
  13. updated code below: <?php include('header.php'); $ca = $_GET['ca']; $pass = $_GET['pass']; $position = "FLA"; $caNum = strtoupper($ca); $query = "SELECT * FROM users WHERE empID = '$caNum' && password = '$pass' "; $result = mysql_query($query) or die(mysql_error()); $row= mysql_fetch_array($result); if($row['empID'] == $caNum && $row['password'] == $pass && $row['activated'] == "yes") { $empID = $row['empID']; $_SESSION['agent_logged_in'] = TRUE; $handle2 = mysql_connect($host,$user,$pwd); mysql_select_db($stats, $handle2); mysql_query("USE $stats",$handle2); $sql1 = "SELECT * FROM employee_compo WHERE EmpID = '$empID'"; $result1 = mysql_query($sql1) or die(mysql_error()); $row1= mysql_fetch_array($result1); $agentName = $row1['AgentName']; $_SESSION['agentName'] = $agentName; $_SESSION['empID'] = $empID; $picture = $row['picture']; echo '<center> <img src="images/badge_pics/'.$picture.'" style="border:1px solid black"> </center>'; echo '<span style="font-size:18px"><b>'. $agentName .'</b> </span>'; echo '<br><span style="font-size:18px"><b> <i> RIM </i> </b> </span>'; echo '<br> <b> <a href="index.php"> Continue </b> </a>'; } else { $handle3 = mysql_connect($host,$user,$pwd); mysql_query("USE $agentcenter_database",$handle3); $query3 = "SELECT * FROM users WHERE empID = '$caNum'"; $result3 = mysql_query($query3) or die(mysql_error()); $row3= mysql_fetch_array($result3); if ($row3['empID'] != $caNum) { echo '<input type="submit" value="Create Account" class="loginBtn" onclick="createAccount();"> '; } else { echo " <br> <br> <span style='font-size:17px'> <img src='images/invalid.JPG'> <center><a href='index.php'> Try Again </a> </center> </span> "; } } ?>
  14. Alright, so i'm getting lost in my own code lol i can't understand why it doesn't work..and i really need this done by tonight... i got it working a bit..it gets stuck when it sees the correct username and password, it tries to log in, but says: Table 'agentcenter.employee_compo' doesn't exist username: CA705572 pass: test Someonone please help me figure out my code regarding connecting to 2 different databases. and how to do it properly. code below: <?php include('header.php'); $ca = $_GET['ca']; $pass = $_GET['pass']; $position = "FLA"; $caNum = strtoupper($ca); $handle = mysql_connect($host,$user,$pwd); mysql_select_db($stats, $handle); mysql_query("USE $stats",$handle); $query = "SELECT * FROM users WHERE empID = '$caNum' && password = '$pass' "; $result = mysql_query($query) or die(mysql_error()); $row= mysql_fetch_array($result); if($row['empID'] == $caNum && $row['password'] == $pass && $row['activated'] == "yes") { $empID = $row['empID']; $_SESSION['agent_logged_in'] = TRUE; $handle2 = mysql_connect($host,$user,$pwd); mysql_select_db($stats, $handle2); mysql_query("USE $stats",$handle2); $sql1 = "SELECT * FROM employee_compo WHERE EmpID = '$empID'"; $result1 = mysql_query($sql1) or die(mysql_error()); $row1= mysql_fetch_array($result1); $agentName = $row1['AgentName']; $_SESSION['agentName'] = $agentName; $_SESSION['empID'] = $empID; $picture = $row['picture']; echo '<center> <img src="images/badge_pics/'.$picture.'" style="border:1px solid black"> </center>'; echo '<span style="font-size:18px"><b>'. $agentName .'</b> </span>'; echo '<br><span style="font-size:18px"><b> <i> RIM </i> </b> </span>'; echo '<br> <b> <a href="index.php"> Continue </b> </a>'; } else { $query3 = "SELECT * FROM users WHERE empID = '$caNum'"; $result3 = mysql_query($query3) or die(mysql_error()); $row3= mysql_fetch_array($result3); if ($row3['empID'] != $caNum) { echo '<input type="submit" value="Create Account" class="loginBtn" onclick="createAccount();"> '; } else { echo " <br> <br> <span style='font-size:17px'> <img src='images/invalid.JPG'> <center><a href='index.php'> Try Again </a> </center> </span> "; } } ?>
  15. when i put that after the query, it says "Table 'stats.users' doesn't exist"
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.