Jump to content

Zyncmaster2006

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Posts posted by Zyncmaster2006

  1. Hi guys can you help me on this one? I have this function called ColApprovalInsert() and 2 files are using it namely col_approve.php and my dblib.inc and i can't figure out what made it to make such an error. Here they are---

    col_approve.php:
    <?php
    //include("libs/loanlib.inc");
    include("libs/dblib.inc");

    $_SESSION['memID'] = $_GET['memID'];
    $_SESSION['amount'] = $_GET['amount'];
    $_SESSION['principal'] = $_GET['principal'];
    $_SESSION['or_no'] = $_GET['or_no'];
    $_SESSION['loan_accnt_ID'] = $_GET['loan_accnt_ID'];
    $_SESSION['col_date'] = $_GET['col_date'];
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Cooperative Software v1.0::Loan Collection</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <?php include ("styles/mystyles.css"); ?>
    <?php include ("libs/publicnav.inc"); ?>
    </head>
    <body>
    <p align="center">Data is Stored!! Thank You!</p>
    <p align="center"><a href="personal_or.php">Personal OR</a></p>
    <?php
              $memID = $_GET['memID'];
              $amount = $_GET['amount'];
              $principal = $_GET['principal'];
              $or_no= $_GET['or_no'];
              $loan_accnt_ID = $_GET['loan_accnt_ID'];
              $col_date = $_GET['col_date'];
    ColApprovalInsert($memID,$amount,$principal,$or_no,$loan_accnt_ID,$col_date,$loan_type_ID);
    ?>
    <div id="footer"><?php include "footer.php"; ?></div>
    </body>
    </html>

    dblib.inc:

    function ColApprovalInsert($memID,$amount,$principal,$or_no,$loan_accnt_ID,$col_date,$loan_type_ID)
      {
      global $link;
      $query ="INSERT INTO loan_collection(members_ID,loan_type_ID,loan_accnt_ID,date,amount,principal,or_no)
    VALUES ($memID, $loan_type_ID, $loan_accnt_ID, $col_date, $pay_period, $amount, $principal, $or_no ) ";
    $result($query,$link);
      }

      Can you tell where did I go wrong? Pls help me...
  2. Hi i got a foreach script that displays a something like this:

    ----------------------------------------------------------------------------------------------------
    | | | | |
    |  Name    | Monthly Payment      | Principal Amount  Interest    |
    | | | | |
    -----------------------------------------------------------------------------------------------------
    | |
    | ARON Jeff | 76125371273571253   |  1231231231    |        0.18  |
    | | | | |
    |Davis Genn | 89089808098098908   |  6786283764   |        0.18 |
    | | | | |
    | | | | |
    |Steel, Max | 9787879797123423   | 2234587345  |        0.12 |
    | | | | |
    | | | | |
    ----------------------------------------------------------------------------------------------------

    The reason why display it like that because i can't seem to attach the pciture version. Anyway, I created that form by using foreach. what i want to happen is how can i submit all that data althogether and store it in their designated tables in the database as shown above. 

    here is the code:
    <?php
    global $session;

        $loan_type_ID = $_GET['loan_type_ID'];
    $loan_accnt_ID = $_GET['loan_accnt_ID'];
    $monthly = $_GET['amount_of_loan'];
    $amount = $_GET['amount'];
    $or_no = $_GET['or_no'];
    $members = getMembers($session[loan_type_ID],$session[loan_accnt_ID]);

    if(!$members)
    {
    print "No members yet.<p>";
    return;
    }

    print"
    <table width='852' border='0' cellspacing='2' cellpadding='4' class = 'header2'>
    <tr>
        <td colspan='6'>OR no: $or_no </td>
      </tr>
      <tr><td width='68'><div align='center'>Paid</div></td>
        <td width='285'><div align='center'>Name</div></td>
        <td width='132'><div align='center'>Monthly Payment</div></td>
        <td width='110'><div align='center'>Principal</div></td>
        <td width='111'><div align='center'>Interest</div></td></tr>
      <tr>";
    foreach ($members as $row)
    {
    print "<td><div align='center'>
              <input type='checkbox' name='col_paid' value='paid' />
          </div></td><td align='center'>
    $row[last_name], $row[first_name] $row[mid_name] <br></a></td>
        <td><div align='center'><input name='form[amount]' type='text' class='ctrl' id='form[amount]' size='20' ></div></td>
        <td><div align='center'>$row[amount_of_loan]</div></td>
        <td><div align='center'><input name='form[interest_rate]' type='text' class='ctrl' id='form[interest_rate]' size='20' value=' $row[interest_rate]'></div></td>
    </tr></form>";
    }

    echo "<tr>
        <td colspan='6'><div align='right'><a href=''></a>
          <label>
          <input type='submit' name='Submit' value='Submit' />
          </label>
        </div></td>
      </tr>
    </table>";
    ?>

    can it be done? or is there another way? pls help me.


  3. hey guys can you help me? do you have a sample script where the data of a textbox in a foreach loop can display it to the next page and after that stores it in the database. I just wana ask if this is possible? i've been trying to program the script but so far nothing happens... help me please...
  4. I have a problem on this script. i think its not working...

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
    result resource in /home/digital/up51/libs/dblib.inc on line 356

    here is the script:

    **=======================================================================//
    // Get Members based on their individual loans
    // Files which uses this function: form_collections.php
    //========================================================================*/


    function getMembers($loan_type_ID,$loan_accnt_ID)

    {
    global $link;
    $new_temp = "CREATE TABLE temp_collections TYPE=InnoDB SELECT * FROM upcoop.loans_outstanding WHERE loan_type_ID ='$loan_type_ID'";
    $resulta = mysql_query($new_temp,$link);

    $new_query = "SELECT * FROM temp_collections";
    $resultb = mysql_query($new_query,$link);


    while ($row = mysql_fetch_array($resultb,MYSQL_ASSOC) ){





    $query = "SELECT members.members_ID, members.first_name,members.mid_name,members.last_name,
    temp_collections.loan_accnt_ID,temp_collections.monthly_amornt FROM members LEFT JOIN temp_collections ON
    members.members_ID = temp_collections.members_ID
    WHERE temp_collections.loan_type_ID = '$row[loan_type_ID]'ORDER BY last_name";




    $result = @mysql_query($query,$link);
    if (!$result)
    die ("getMembers fatal error: ".mysql_error());
    $ret = array();
    while ($row = mysql_fetch_array($result) )
    array_push($ret,$row);
    return $ret;
    }
    }
×
×
  • 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.