Jump to content

Zergman

Members
  • Posts

    243
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Zergman's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  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?
×
×
  • 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.