Jump to content

thomasw_lrd

Members
  • Posts

    71
  • Joined

  • Last visited

Everything posted by thomasw_lrd

  1. You are correct. Once I chagned it to a foreach loop, it displays just like it should. Thank you very much for all your help.
  2. Yeah, I keep forgetting about the error reporting. I really need to turn that on. I found the problem. My date is not being selected correctly. Out of $getEvent_res is Array ( [0] => Array ( [0] => Test [cal_title] => Test [1] => Tesing [cal_description] => Tesing [2] => 1:00 AM [fmt_date] => 1:00 AM ) [1] => Array ( [0] => 1 [cal_title] => 1 [1] => 1 [cal_description] => 1 [2] => 1:00 AM [fmt_date] => 1:00 AM ) [2] => Array ( [0] => 1 [cal_title] => 1 [1] => 1 [cal_description] => 1 [2] => 1:00 AM [fmt_date] => 1:00 AM ) [3] => Array ( [0] => 1 [cal_title] => 1 [1] => 1 [cal_description] => 1 [2] => 4:00 AM [fmt_date] => 4:00 AM ) $getEvent_sql = "SELECT cal_title, cal_description, date_format(cal_start_time, '%l:%i %p') as fmt_date FROM calendar WHERE month(cal_start_time) = '".$m."' AND dayofmonth(cal_start_time) = '".$d."' AND year(cal_start_time)= '".$y."' ORDER BY cal_start_time"; The preceding code is supposed to select the date, but it only selects the time. I'm starting on it right now, but any suggestions are greatly appreciated.
  3. Here is my code // Show the events for this day: $getEvent_sql = "SELECT cal_title, cal_description, date_format(cal_start_time, '%l:%i %p') as fmt_date FROM calendar WHERE month(cal_start_time) = '".$m."' AND dayofmonth(cal_start_time) = '".$d."' AND year(cal_start_time)= '".$y."' ORDER BY cal_start_time"; $getEvent_res = myload($getEvent_sql); echo "<pre>"; print_r($getEvent_res); echo "</pre>"; if (count($getEvent_res) > 0){ $event_txt = "<ul>"; while($ev = mysql_fetch_array($getEvent_res)){ echo "Inside"; echo $ev; $event_title = stripslashes($ev["cal_title"]); $event_shortdesc = stripslashes($ev["cal_description"]); $fmt_date = $ev["fmt_date"]; $event_txt .= "<li><strong>".$fmt_date."</strong>: ".$event_title."<br/>".$event_shortdesc."</li>"; echo $event_title; } $event_txt .="</ul>"; mysql_free_result($getEvent_res); } else { $event_txt = ""; } if ($event_txt != ""){ echo "<p><strong>Today's Events:</strong></p> $event_txt <hr/>"; } I can't get inside the while loop. The array is populated, I've checked that. The count of $getEvent_res = 3. echo "Inside", and echo $ev give me nothing. Any ideas what I'm doing wrong? $getEvent_res = myload($getEvent_sql); The myload is a custom function that just works, I didn't write it, but I know it works.
  4. Thank you for your reply. We are currently working on a database engine to replace our current inefficient use of spreadsheets. I was given a copy of a spreadsheet, and I need to use the spreadsheet as a template. (Not go from a webpage to an excel spreadsheet). I was just wondering if anybody had used anything in the past they liked to convert the formatting from a spreadsheet into a webpage?
  5. I've already made this work, but I'm wondering if anybody has any different/better ideas. I have an excel spreadsheet that we want to turn into a dynamically created webpage. I used excels export to a webpage, and I used yellowpipe.com to convert the source to php, so I didn't have to hand code the entire table. This works just fine. I'm currently going through the entire page to add the actual database calls. Just wondering if somebody with more experience has ever tried to do something similar? Any pros/cons, different ways to accomplish this are welcome.
  6. You sir are a genius. That was it. Thank you so much. What's the best way to mark a thread as solved?
  7. I'm sure this is just a stupid mistake, but can someone please help me figure it out? I have one page with a dropdown that is populated from our database, I have submit to pull through to the next page but nothing shows up on the next page (app/approval). I've tried adding some echo statments, but they all show up blank. <? require ('includes/getconfig.inc'); require ('includes/auth.inc'); require ('includes/dbfunctions.inc'); include (dirname(__FILE__).'/../includes/menuhead.inc'); include ('apptable_functions.inc'); $sql="SELECT pol_id, pol_policy_number FROM policies"; $result=myload($sql); $items = count($result); $options=""; for($x=0; $x<=$items; $x++) { $id=$result[$x]['pol_id']; $thing=$result[$x]['pol_policy_number']; $options.="<OPTION VALUE=\"$id\">".$thing; } ?> Select a case number to see the payout approval. <br> <form action="app/approval.php" method='post'> <SELECT NAME=pol_policy_number> <?=$options?> </SELECT> <input name="Submit" type="submit" Value="Submit Policy Number"/> </form> <br> <? require ('includes/getconfig.inc'); require ('includes/auth.inc'); require ('includes/dbfunctions.inc'); $pol_number = $_POST['pol_policy_number']; echo "$pol_number"; ?>
  8. Looks like an app to find my cell phone. This is a quick 30 second look at it. On a longer look, I agree that the footer is too high.
  9. The way I've been handling this is to actually put html in a function, and call that function to return the html with the new values. There might be a better way. switch ($action){ case 'step1': echo page_update_form($result); break; function page_update_form($result){ global $config; $ret.=' <form> <table> </table> </form>'; return $ret; }
  10. It helps me, it's on my to do list, but very low on the priority. Now I can look like a genius for the boss.
  11. You need to look into using includes. I use a file called header.inc. This contains my menu. All my other pages have include header.inc
  12. All good ideas. I actually wrote an update query that should have worked, but I don't have shell access, only mysqladmin (which sucks btw). I'll probably just have to delete the data, and insert it again. Not my preffered way to work, but sometimes you've got to do what you've got to do.
  13. I am currently working on a very large project for my job. We have four databases on one server that are identical except for the data contained within. We have a web front end written in php. The menu for the front end is dynamically created by a table in the database. I need to update this table (tbl_menu_items) on 3 of the databases with the data from our development database. I know I can use Update to do this, but I was wondering if it was possible to use wildcards, rather than have to spell out each column in the database. I've been googling all day, and I know I can spell out each column that needs to be updated. Something similar to this below? UPDATE items,month SET items.*=month.* WHERE items.id=month.id;
  14. Thank you very much. That worked perfectly. Now can you please explain it to me? I really want to understand why it works like that versus, why mine didn't. I think it's because of the UPDATE clause?
  15. Thank you, I was hoping there was a work around. Some articles I read said that I could use new.field_name, to do it, but I guess there is no way to do it?
  16. Hello, I'm a trying to create a trigger to divide two fields and update them. It keeps failing with a ERROR 1442: Can't update table 'transactions' in stored function/trigger because it is already used by statement which invoked this stored function/trigger I've read where you can do this with new.fieldname. Which I have, any ideas? Here is what I have CREATE DEFINER=`access`@`%` TRIGGER `portal_sosha`.`testTrigger` AFTER UPDATE ON `portal_sosha`.`transactions` FOR EACH ROW UPDATE transactions SET NEW.tr_transaction_pct_paid_to_company = tr_transaction_dol_paid_to_ngfg/tr_premium_or_basis_amount;
  17. I've attached screenshots. The first one is obviously wrong, while the second one is how I would like it to look. [attachment deleted by admin]
  18. //policies subreport function opportunity_sub_report($business_contact_id){ global $edit, $styles; $sql="Select * from opportunities WHERE op_business_contact_id='$business_contact_id'"; $rs=myload($sql); echo '<table>'; if (count($rs)>0){ // print a header row echo '<tr> <td>Opportunity ID</td> <td>Category</td> <td>Agent</td> <td>Opportunity Name</td> <td>Priority</td> <td>Assigned To</td> <td>Opportunity Type</td> <td>Opporunity Status</td> <td>Opportunity Submission</td> <td>Due Date</td> <td>Contracting Recieved(Y or N)?</td> <td>New Business</td> <td>Notes</td> <td>Business Contact ID</td> </tr>'; // print all data rows foreach ($rs as $r){ echo '<tr> <td>'.display_field('', $p,$r['op_id']).'</td> <td>'.display_field('',$p,$r['op_category']).'</td> <td>'.display_field('', $p,$r['op_agent_id']).'</td> <td>'.display_field('', $p, $r['op_opportunity_name']).'</td> <td>'.display_field('', $p, $r['op_priority']).'</td> <td>'.display_field('', $p, $r['op_assigned_to']).'</td> <td>'.display_field('', $p, $r['op_opportunity_type']).'</td> <td>'.display_field('', $p, $r['op_status']).'</td> <td>'.display_field('', $p, $r['op_submission_date']).'</td> <td>'.display_field('', $p, $r['op_due_date']).'</td> <td>'.display_field('', $p, $r['op_contracting_received_y_or_n']).'</td> <td>'.display_field('', $p, $r['op_new_business_app_received_y_or_n']).'</td> <td>'.display_field('', $p, $r['op_wholesaler_notes']).'</td> <td>'.display_field('', $p, $r['op_business_contact_id']).'</td> </tr>'; } } echo '</table>'; } I'm having some trouble with some code I'm tasked with maintaining. This code works, but it doesn't return the information in a tab. I'm using tabber.js It's being called here echo ' <tr> <td class="timegrid" colspan=5> <div class="tabber"> <div class="tabbertab" title="Contracting"></div> <div class="tabbertab" title="Licensing"></div> <div class="tabbertab" title="Cases"></div> <div class="tabbertab" title="Commissions"></div> <div class="tabbertab" title="Opportunities">'.opportunity_sub_report($rs[0][bc_business_contact_id]).'</div> <div class="tabbertab" title="Tasks"></div> <div class="tabbertab" title="Calendar"></div> <div class="tabbertab" title="Attachments">'.agent_detail_attachments($rec_id).'</div> </div> </td> </tr>'; echo '</table>'; I've tried changing it from echo to return, but I'm not sure how to keep the foreach loop intact in such a way. I'm trying to create subreports in a web app, that would act like access. Any help would be much appreciated.
  19. I really hope that works can't test till I get to work but thank you very much. I tried escaping just about everything else but those quotes
  20. I need some help. I'm having trouble calling a javascript function from a php script <?php include ('security.inc'); include ('head.inc'); echo ' <table class="menutable"> <tr> <td nowrap> <div id="sidemenu" style="display:block;"> <ul id="navbar">'; // database-driven menu groups // get the menu items and groups that this user has access to if (!isset($_SESSION['usergroupsin']) || $_SESSION['usergroupsin']==''){ $menurs=array(); } else { $sql="SELECT mg_name, mg_desc, mi_name, mi_desc, mi_link, mi_external_link, mgg_gr_id, mig_gr_id FROM tbl_menu_items INNER JOIN tbl_menu_groups ON mi_mg_id=mg_id AND mg_active='y' LEFT JOIN tbl_menu_groups_groups ON mgg_mg_id=mg_id AND mgg_active='y' LEFT JOIN tbl_menu_items_groups ON mig_mi_id=mi_id AND mig_active='y' WHERE ( mgg_gr_id IN (".$_SESSION['usergroupsin'].") OR mig_gr_id IN (".$_SESSION['usergroupsin'].") OR mi_secure='n' ) AND mi_active='y' AND mg_left_menu='y' GROUP BY mg_name, mg_desc, mi_name, mi_desc, mi_link, mi_external_link ORDER BY mg_sort, mi_sort"; $menurs=myload($sql); } $last_mg_name=''; if (count($menurs)>0){ foreach ($menurs as $m){ // show the group heading if we haven't already shown it if ($m['mg_name']<>$last_mg_name){ echo '<li><strong> <br>'.$m['mg_name'].'</strong></li>'; $last_mg_name=$m['mg_name']; } // determine whether this is a system link or not if ($m['mi_external_link']=='y'){ $thisurl=$m['mi_link']; } else { $thisurl=$config['system_url_root'].$m['mi_link']; } echo '<li><a title="'.$m['mi_desc'].'" href="'.$thisurl.'"><strong> - '.$m ['mi_name'].'</strong></a></li>'; } } echo ' </ul> </div> </td> [b]<input class="button" type="button" value="Hide Menu" onclick="setTable('sidemenu');return true">[/b] <td width="100%"> <div id="mainwindow"> <!-- BEGIN PAGE CONTENT --> '; ?> My javacscipt function is in the head.inc. I can post that if needed. The bolded part is what I'm having trouble with. Specifically, the onclick. Without that, my script works, if I have the onclick in there, I get a blank page. I'm trying to hide/show the div=sidemenu. If anybody has any suggestions, I'm open to it.
×
×
  • 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.