Jump to content

Zergman

Members
  • Posts

    243
  • Joined

  • Last visited

    Never

Everything posted by Zergman

  1. Raw query as in non-active records?
  2. sorry but i'm not sure what you mean by table description
  3. Still working on this but i'm finding the way i'm querying is just not efficient. Doing as follows. Sorry for the codeigniter queries //Get phone numbers for the entire month $this->db->select('stn, submit_time'); $this->db->select('COUNT(stn) AS TOTAL'); $this->db->like('submit_date', YEAR_PREV_MONTH, 'after'); $this->db->not_like('level1', 'Abandon'); $this->db->not_like('stn', '9999999999'); $this->db->not_like('employee_id', '00000000'); $this->db->group_by("stn", "asc"); $data = $this->db->get('data'); $total_for_month = $data->num_rows(); $i = 0; foreach ($data->result() as $row) { if($row->TOTAL > 1) { $start = $row->submit_time - 604800; $end = $row->submit_time; $dateRange = "submit_time BETWEEN '$start' and '$end'"; $this->db->select('data_id'); $this->db->where($dateRange, NULL); $this->db->where('stn', $row->stn); $query = $this->db->get('data'); $stn_data = $query->row(); $i++; } } echo "Total Individual STN's Found = ".$total_for_month; echo "<br>"; echo "Incidents found with duplicate within 7 days = ".$i; echo "<br>"; $total_distinct = $total_for_month - $i; echo "Incidents with FCR = ".$total_distinct; echo "<br>"; $a = $total_distinct * 100; $b = $a / $total_for_month; echo "<br><b>Group FCR for current Month = ".round($b, 2)."%</b>"; echo "<br><br>This shows the FCR for all calls for the current month for the entire group."; echo "<hr />"; die(); I know this is the wrong way to do this, but for the life of me, can't figure out any other way. With it like this, its running like 20,000 queries
  4. I'm done with this project, losing my mind and need help. DB table has a column with phone numbers in it along with dates it was submitted. Was asked to get a percentage of repeat incidents based on the phone numbers within 7 days of the first incident. So i need to [*]Get all phone numbers for the given month [*]Check each phone number for repeat entries [*]Get a tally of how many phone numbers have repeat entries [*]Calculate a percentage for the month of phone numbers that have repeat entries compared to the total for the month. Been working on this and have no code to show for it cause nothing I write can do this without killing the server or give me what I want. Using codeigniter if that matters. Can anyone get me started?!
  5. well now I really give up. Got it working using POST and no change. WTF lmao
  6. Did more looking and think this is how it should look, but yet, not working. function showUser(str) { var xmlhttp; if (str=="") { document.getElementById('txtHint').innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById('txtHint').innerHTML=xmlhttp.responseText; } } xmlhttp.open("POST","http://mysite.com/site/assets/includes/get_template.php",true); xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlhttp.send(str); } Changed the get_template to $q = $_POST["str"]; Any ideas?
  7. Was wondering if it was due to it being contained in div tags, nope. Made it it's own window, same thing.
  8. I have and it checked fine. I built a small test app that does the same thing and it worked fine. Couple things that are different in the above is that im using fancybox to show the div in a popup. Also using Codeigniter. hmmmm
  9. I tested this by adding a new entry right through phpmyadmin into the database 1 2 3 a b c So there's no special characters or anything. Firefox 1 2 3 a b c IE 1 2 3 a b c Could this just be IE being stupid?
  10. Here's is one of the templates Firefox TT#: Please be sure to check for open/pending tickets before beginning a new Trouble Ticket. For more information please refer to xxxx regarding Second or Subsequent Call - How to add Activities to an Existing TT: http://long_url TT#: Please be sure to check for open/pending tickets before beginning a new Trouble Ticket. For more information please refer to the xxxx regarding Second or Subsequent Call - How to add Activities to an Existing TT: http://long_url IE TT#: Please be sure to check for open/pending tickets before beginning a new Trouble Ticket. For more information please refer to xxxx regarding Second or Subsequent Call - How to add Activities to an Existing TT: http://long_url Should also mention i've tried setting the mysql field type to blob to text, neither seemed to make a difference.
  11. Only possible causes I found was that someone mentioned that IE has issues with large text using GET and suggested using POST but i couldn't figure out how to modify my code to use POST.
  12. Using ajax to perform a simple query using a dropdown that retrieves a template from the mysql table and loads that template into a textarea. When it loads into the textarea, the formatting is kept in FF perfectly. In all versions of IE, it loses the formatting. Example Firefox 1 2 3 Internet Explorer 1 2 3 The textarea <textarea name="coach_details" id="txtHint" class="textareastyle" style="width:99%;" rows="20" ><?php echo set_value('coach_details');?></textarea> Javascript function showUser(str) { if (str=="") { document.getElementById('txtHint').innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById('txtHint').innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","get_template.php?q="+str,true); xmlhttp.send(); } get_template.php <?php $q=$_GET["q"]; $con = mysql_connect('localhost', 'username', 'password'); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("db", $con); $sql=" SELECT template FROM coaching WHERE menu_id = '$q' "; $result = mysql_query($sql); $row = mysql_fetch_array($result); $template = $row['template']; echo $template; mysql_close($con); ?> I'm so stuck. Sadly though our company still uses IE alot so has to work for both. Suggestions?
  13. Well got the div submitting <div onclick="document.form_hidden.submit();"><?php echo $this->pagination->create_links(); ?></div> but it's not submitting the form when the pagination links are clicked. If I add something else in the div it works when TestTestTestTest is clicked. <div onclick="document.form_hidden.submit();">TestTestTestTest<?php echo $this->pagination->create_links(); ?></div> Arg....
  14. Wasn't sure where to post this but this is an issue with CodeIgniter Pagination. I have a big search form. I enter search criteria and it works and returns my results along with working Pagination. Problem is when I click on a pagination link, the page reloads but it submits an open query with no criteria so it searches all records and the pagination breaks. Solution i'm trying to impliment is to have a hidden form that stores the search criteria so when a pagination link is clicked, it submits the hidden form. Problem i'm having is making the pagination links submit the hidden form. I'm trying to wrap it with a div tag and add an onclick to it but it isn't working. How would I do this?
  15. Here's the code i'm currently working on. $username = $_SESSION['logged_user']; $time = date ("H:i:s"); $e_city = $_GET['e_city']; mysql_query(" INSERT INTO surveys (employee_city, ttime, Agent_id) VALUES ('$e_city', '$time', '$username') "); On different page To display the results SELECT employee_city, ttime, Agent_id FROM surveys Employee City: <?php echo $row['employee_city']; ?> Logged Time: <?php echo $row['time']; ?> Agent: <?php echo $row['Agent_id']; ?>
  16. I'm using a very simple mysql insert statement posting the value directly into the database. I also have the mysql column set to TIME type if that matters. For the longest time, I had the H:i:s in single quotes but someone mentioned that might be the problem and suggested double quotes. Not sure honestly
  17. So I’ve noticed that when I use $time = date(“H:i:s”); The time should echo 21:57:49 In a 24hr format and it works except for when it turns 12pm till 1pm. Im checking my database and see 11:57:49 then 00:00:47 until 13:01:44 comes. So it’s showing 12pm as 12am in 24hr clock for some reason. I’ve googled this a lot and can’t find a reason. Any idea?!
  18. All getusers.php does is a mysql query and echo right now 1 value. echo $row_rsagentquery1['employee_id']; Want to use other values from that query to update other fields in the parent page. No worries that you have to run, I'll keep picking and learning with this
  19. document.getElementById("agentID").value=xmlhttp.responseText; Worked like a charm! Thanks gamesmstr! Here's something else im wondering. How would I had more fields to this? Say I need my getusers.php to not only fill in the agentID field, but say 2 or 3 more with info from the same query? One thing i'm not sure of is do I need to echo the variable on the getusers.php page for it to show on the parent page?
  20. Just doesn't make sense. I've gone over the code and I thought I understood it, but there has got to be more to it than I can see. Good learning experience though!
  21. The PHP file will echo anything fine on the getusers.php from my query on both the php file and inside the <div> on the parent page.
  22. Tried what you suggested gamesmstr but the box doesn't populate. Once the script fires, only thing that happens is the cursor moves to the agentID field but it's empty.
  23. Still working on this, but just can't get it to go. Can't get the data returned by getuser.php to show up on parent page. I tried attaching it to a form element value but the value remains empty. Really having touched the javascript on parent page <script type="text/javascript"> function showUser(str) { if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","getuser.php?q="+str,true); xmlhttp.send(); } </script> Here's my form <form> <table align="center" cellpadding="2" cellspacing="0" border="0"> <tr> <td align="right"><label>Find Agent Info :</label></td> <td align="left"><input type="text" name="findagentid" id="findagentid" class="textboxstyle" size="15" maxlength="8" value="" onchange="showUser(this.value)" /></td> </tr> <tr align="left"> <td align="right"><input type="text" name="agentID" id="agentID" class="textboxstyle" size="10" maxlength="8" value="" /></td> <td><div id="txtHint"></div></td> </tr> </form> Trying to get the results from getuser.php to show in the agentID field. getuser.php just echos value echo $row_rsagentquery1['employee_id']; Ajax is cool, but tough to learn lol
  24. Im with ya gamesmstr. So understand the info from getusers.php is echoed and displayed in the <div> tag on the parent page, but how would i echo the same info inside a form element? Would I put the form element code on the getusers.php page? Sorry but ajax is really new to me
×
×
  • 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.