Jump to content

I-AM-OBODO

Members
  • Posts

    439
  • Joined

  • Last visited

Everything posted by I-AM-OBODO

  1. hi requinix. having same issue again. but registered with the username obodo. thanks
  2. Hello admin still no word about fixing my old account login?
  3. Thanks a zillion dozen times
  4. thanks alot. i tried to make the input field mandatory but to no avail. also i have a couple of other places i'd like to initial and instead of initialing them one by one, i'd like to initial just one and it will affect the whole three fields. thanks
  5. Thanks a zillion dozen times. I have modified my code to use sql but i read somewhere that sql dates are not to be trusted! which is better? thanks
  6. there's no way i could pm you cos it's not highlighted. i had this issue before and requinix fix it for me. my display name is Mr Chidi. thanks
  7. the sql you suggested takes care for only when month is the pay frequency. what can be done on sql to accommodate for both bi-weekly, weekly and monthly? thanks
  8. Hello admin. i cannot login to my old account. help pls thanks
  9. could you pls help with example cos i don't know nada on javascript. thanks
  10. Thanks all. I ended up using php date/time function instead of mysql. I have my logics right just as i stated earlier but i have two issues. (1) i'd like to get rid of the + sign in from of date_diff (2) just as scootstah noted; not all months are 30 days, there February and others that have 31 days. How do i get it so that it works for all the months. Thanks my code $pay_frequency = "Monthly"; $first_payday = 10; //date of transaction $today = date('Y-m-d'); if($pay_frequency == "Monthly"){ $new_pay_frequency = 30; }elseif($pay_frequency == "Twice_monthly"){ $new_pay_frequency = 14; }elseif($pay_frequency == "Weekly"){ $new_pay_frequency = 7; } // make date for current month $make_date = date('Y-m-01'); //payment frequency echo "Payment frequency: " . $new_pay_frequency ; echo "<br>"; //first payday echo "First payday: " . $first_payday; echo "<br>"; //add payment frequency to first payday to get next payday in days $next_payday = $new_pay_frequency + $first_payday; echo "Next payday(in days): " . $next_payday; echo "<br>"; //get next payday in date format $date = date_create($make_date); date_add($date, date_interval_create_from_date_string($next_payday.'days')); $nu = date_format($date, 'Y-m-d'); echo "Next payday date: " . $nu; echo "<br>"; // difference between date of transaction and next payday $datetime1 = date_create($today); $datetime2 = date_create($nu); $interval = date_diff($datetime1, $datetime2); echo "Date difference: ". $interval->format('%R%a days');
  11. hello. why does the site keep logging me out even when the details provided are correct? i even asked for a reset and no mail was sent to me but it recognizes my email address. thanks
  12. hi all i dont know what it is called so i dont know what to goggle cos all my search result have not yielded desired result. i have a table and space for initials. i want so that when i type on the form field it will display on the table. just like the example used on jquery modal form thanks
  13. ok thanks. will put your suggestion into consideration but that is not my problem just yet. i need to express next payday in dates. and mind you the payment frequency could be weekly or twice weekly. thanks
  14. hi all. having a hard time figuring this out. i have: Payment frequency: weekly(7days) twice-monthly(14days) monthly(30days) First payday: 8th Next payday: first payday + payment frequency Date of transaction: 2015-07-14 (today) Date difference: difference between date of transaction(today) and next payday: Due date ? For argument sake: Payment frequency = 30(Monthly) First payday = 8th Next payday = 38th ( 8th of next month) Date of transaction: 2015-07-14 (today) Date difference = 8th next month - today My problem is how to express 8th of next month in date format. Thanks $first_payday = 8; $today = date('Y-m-d'); if($pay_frequency == "Monthly"){ $new_pay_frequency = 30; }elseif($pay_frequency == "Twice_monthly"){ $new_pay_frequency = 14; }elseif($pay_frequency == "Weekly"){ $new_pay_frequency = 7; } echo "Payment frequency: " . $new_pay_frequency; echo "<br>"; echo "First payday: " . $first_payday; echo "<br>"; $next_payday = $new_pay_frequency + $first_payday; echo "Next payday: " .$next_payday;
  15. thanks. will give it another shot and see.
  16. Mr-chidi is my display name, emails not allowed!
  17. thanks all. i knw where the problem is, the thing is i do not know how to fix it. mac_givers, thanks for the link, will study it but for now, it wont solve my situation or ut will take some time. thanks anyway
  18. there's no way to pm u. if its ok i will post it here?
  19. Hi. I tried to login to my account but it say i am not recognised but i am sure my password is correct. i tried to reset the password via forgot password. after filling the form no reset mail was sent to me. tried it a couple of times still no reset mail and so i had to open a new account. can my old account be retrieved back? i'd loved badly to have my account back. my username is funkyfela. i had to add 2 to the new one to differentiate with old one. thanks
  20. Hi all. my pagination does not show the info on next page? believe the problem is that the value of my $_GET[id] is not parse to the next page. but i dont know how to solve it. the error is unidentified id thanks my code $agent= $_GET['id']; $stmt = $pdo->prepare("SELECT surname, firstname FROM confirmed WHERE username = '$agent'"); $stmt->execute(); $row = $stmt->fetch(PDO::FETCH_ASSOC); $_SESSION['ref_agent'] = $row['surname'] . " ". $row['firstname']; error_reporting(E_ALL & ~E_NOTICE); /* Place code to connect to your DB here. */ // include your code to connect to DB. $tbl_name="processed"; //your table name // How many adjacent pages should be shown on each side? $adjacents = 5; /* First get total number of rows in data table. If you have a WHERE clause in your query, make sure you mirror it here. */ $stmt = $pdo->prepare("SELECT COUNT(*) as num FROM $tbl_name WHERE invitee = '$agent'"); $stmt->execute(); $total_pages = $stmt->fetch(PDO::FETCH_ASSOC); $total_pages = $total_pages['num']; /* Setup vars for query. */ $targetpage = "view-commission.php"; //your file name (the name of this file) $limit = 3; //how many items to show per page $page = $_GET['page']; if($page) $start = ($page - 1) * $limit; //first item to display on this page else $start = 0; //if no page var is given, set start to 0 /* Get data. */ $stmt = $pdo->prepare("SELECT * FROM $tbl_name WHERE invitee = '$agent' ORDER BY date_processed DESC LIMIT $start, $limit"); $stmt->execute(); //$num_rows = $stmt->rowCount(); //print "<p>$num_rows Record(s) Found.</p>"; /* Setup page vars for display. */ if ($page == 0) $page = 1; //if no page var is given, default to 1. $prev = $page - 1; //previous page is page - 1 $next = $page + 1; //next page is page + 1 $lastpage = ceil($total_pages/$limit); //lastpage is = total pages / items per page, rounded up. $lpm1 = $lastpage - 1; //last page minus 1 /* Now we apply our rules and draw the pagination object. We're actually saving the code to a variable in case we want to draw it more than once. */ $pagination = ""; if($lastpage > 1) { $pagination .= "<div class=\"pagination\">"; //previous button if ($page > 1) $pagination.= "<a href=\"$targetpage?page=$prev\">« previous</a>"; else $pagination.= "<span class=\"disabled\">« previous</span>"; //pages if ($lastpage < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up { for ($counter = 1; $counter <= $lastpage; $counter++) { if ($counter == $page) $pagination.= "<span class=\"current\">$counter</span>"; else $pagination.= "<a href=\"$targetpage?page=$counter\">$counter</a>"; } } elseif($lastpage > 5 + ($adjacents * 2)) //enough pages to hide some { //close to beginning; only hide later pages if($page < 1 + ($adjacents * 2)) { for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++) { if ($counter == $page) $pagination.= "<span class=\"current\">$counter</span>"; else $pagination.= "<a href=\"$targetpage?page=$counter\">$counter</a>"; } $pagination.= "..."; $pagination.= "<a href=\"$targetpage?page=$lpm1\">$lpm1</a>"; $pagination.= "<a href=\"$targetpage?page=$lastpage\">$lastpage</a>"; } //in middle; hide some front and some back elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2)) { $pagination.= "<a href=\"$targetpage?page=1\">1</a>"; $pagination.= "<a href=\"$targetpage?page=2\">2</a>"; $pagination.= "..."; for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++) { if ($counter == $page) $pagination.= "<span class=\"current\">$counter</span>"; else $pagination.= "<a href=\"$targetpage?page=$counter\">$counter</a>"; } $pagination.= "..."; $pagination.= "<a href=\"$targetpage?page=$lpm1\">$lpm1</a>"; $pagination.= "<a href=\"$targetpage?page=$lastpage\">$lastpage</a>"; } //close to end; only hide early pages else { $pagination.= "<a href=\"$targetpage?page=1\">1</a>"; $pagination.= "<a href=\"$targetpage?page=2\">2</a>"; $pagination.= "..."; for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++) { if ($counter == $page) $pagination.= "<span class=\"current\">$counter</span>"; else $pagination.= "<a href=\"$targetpage?page=$counter\">$counter</a>"; } } } //next button if ($page < $counter - 1) $pagination.= "<a href=\"$targetpage?page=$next\">next »</a>"; else $pagination.= "<span class=\"disabled\">next »</span>"; $pagination.= "</div>\n"; } echo "<table width='100%' class='table table-striped'>"; echo "<tr> <th bgcolor='#444444' align='center'><font color='#fff'> one</th> <th bgcolor='#444444' align='center'><font color='#fff'> two</font></th> <th bgcolor='#444444' align='center'><font color='#fff'> three</font></th> </tr>"; // keeps getting the next row until there are no more to get while($row = $stmt->fetch(PDO::FETCH_ASSOC)) { // Print out the contents of each row into a table echo "<tr><td>"; echo $row['trans_ref']; echo "</td><td>"; echo ucwords($row['payee']); echo "</td><td>"; echo number_format($row['amount'],2); echo "</tr></td>"; } echo "</table>"; <?php echo $pagination ?> thanks
  21. Hi all. I have two tables where the username is what they have in common. i want to perform a join for both tables but i'm having problems with mysql joins. //to get the desire result individually i did //table one $stmt = $pdo->query("SELECT * FROM tableone WHERE username = '$_GET[id]'"); $row = $stmt->fetch(PDO::FETCH_ASSOC); $credit_score = $row['credit_score']; $acct_num = $row['acct_num']; $acct_name = ucwords($row['surname']) ." ". ucwords($row['firstname']); $username = $row['username']; if($credit_score ==3){ $bill_limits = 2000; }elseif($credit_score ==2){ $bill_limits = 1000; }elseif($credit_score ==1){ $bill_limits = 500; } //table two $stmt=$pdo->query("SELECT SUM(amt) as bill FROM tabletwo WHERE username = '$_GET[id]' AND relationship = 'PARENT'"); $row = $stmt->fetch(PDO::FETCH_ASSOC); $bill = $row['bill']; $service_charge_for_limits = '0.05' * $bill; $tax_rate_for_limits = '0.13' * $service_charge_for_limits; $bill_sum = $tax_rate_for_limits + $service_charge_for_limits + $bill; Approved Bill Limits = $<?php echo number_format($bill_limits,2); ?> <br> Bill Limits Used = $<?php echo number_format($bill_sum,2); ?> <br> <?php $available_limits = $bill_limits - $bill_sum; ?> Bill Limits Available = $<?php echo number_format($available_limits,2); ?> The above gives me the correct result, but now i have another page where i want to all the clients and their corresponding available limits, used limits and approve limits form table two and other information from table one On the page i have $stmt = $pdo->prepare("SELECT * FROM tableone WHERE status = 'COMPLETED' ORDER BY id DESC LIMIT $start, $limit"); $stmt->execute(); $num_rows = $stmt->rowCount(); echo "<table width='100%' class='table-responsive table-hover table-condensed table-striped'>"; echo "<tr> <th bgcolor='#444444' align='center'><font color='#fff'>Account Number</th> <th bgcolor='#444444' align='center'><font color='#fff'>Subscriber's Name</font></th> <th bgcolor='#444444' align='center'><font color='#fff'>Username</font></th> <th bgcolor='#444444' align='center'><font color='#fff'>Limits ($)</font></th> <th bgcolor='#444444' align='center'><font color='#fff'>View Profile</font></th> <th bgcolor='#444444' align='center'><font color='#fff'>Delete Account</font></th> </tr>"; // keeps getting the next row until there are no more to get while($row = $stmt->fetch(PDO::FETCH_ASSOC)) { // Print out the contents of each row into a table echo "<tr><td>"; echo $row['acct_num']; echo "</td><td>"; echo ucwords($row['surname']." ". $row['firstname']); echo "</td><td>"; echo $row['username']; echo "</td><td>"; $credit_score = $row['credit_score']; if($credit_score ==3){ $bill_limits = 2000; }elseif($credit_score ==2){ $bill_limits = 1000; }elseif($credit_score ==1){ $bill_limits = 500; } echo number_format($bill_limits, 2); echo "</td><td>"; echo "<a href='view-client-profile.php?id={$row['username']}'>view more</a>"; echo "</td><td>"; echo "<a href='delete-account.php?id={$row['username']}'>Delete Account</a>"; echo "</td></tr>"; //echo "</td><td>"; //echo "<a href='settle.php?id={$row['acct_num']}'>Points</a>"; } echo "</table>"; How ca i join tableone and tabletwo (plus sum)
  22. yeah. u are right. the only relationship with both tables is the username. a table may have more info on it than the other. thanks
×
×
  • 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.