Exemple #1
0
<?php

# Show a list of thedesired ac-codes. Which ac_code is set by the variable "showac". I am not sure
# why this variable has not to be defined as global
require "accrp.php";
session_start();
require "security/secure.php";
beginDocument($lCustomerProfile, $sess_user);
$db = getDBConnection();
if (!$showac) {
    $showac = 1;
}
$lastditch_result = mysql_query("select * from AC_CODE{$showac} order by AC_ID{$showac}", $db);
checkMySQLError();
if ($lastditch_row = mysql_fetch_array($lastditch_result)) {
    beginPrettyTable("4", "AC_CODE{$showac}");
    beginBorderedTable("4");
    echo "<tr>\n";
    echo " <td><b>AC_ID</b></td> <td><b>AC_DESC</b></td> \n <td><b>{$lActions}</b></td>\n </tr>\n";
    do {
        if ($class == "odd") {
            $class = "even";
        } else {
            $class = "odd";
        }
        printf(" <tr class='{$class}'>\n  <td><a href='%s?CustomerID=%s'>%s</td> <td>%s</td>\n <td align='center'><a href='confirm.php?action=deletecustomer&CustomerID=%s'><img src='images/delete.gif' height=24 width=24 border=0 alt='Delete this Customer'></a></td></tr>\n", $PHP_SELF, $lastditch_row["AC_ID1"], $lastditch_row["AC_ID{$showac}"], $lastditch_row["AC{$showac}_DESC"], "empty", $lastditch_row["AC_ID1"]);
    } while ($lastditch_row = mysql_fetch_array($lastditch_result));
    endPrettyTable();
    endBorderedTable();
} else {
    echo "{$lNoProfilesFound}...\n";
Exemple #2
0
<?php

# This form allows to enter a date. After submitting, all Bank and Cash Account-balances get
# printed seperated by Projects.
session_start();
require "accrp.php";
require "security/secure.php";
beginDocument("list Cash and Bank", $sess_user);
if ($date) {
    $ac1 = get_ac_array(1);
    foreach ($ac1 as $key => $prj_desc) {
        $accounts = new BankAndCashAccounts_byProject($key, $date, "c");
        beginPrettyTable(4, "{$prj_desc}");
        printRow(array("Account", "Balance"));
        while ($row = $accounts->getNext()) {
            printRow(array($row["AC5_DESC"], $accounts->getActualBalance() . "&nbsp;"), "irgendwas");
        }
        printRow(array("Sum", $accounts->getSum()));
        endPrettyTable();
    }
} else {
    openForm("enter Date", $PHP_SELF);
    beginPrettyTable("2", "list bank and cash");
    makeTextField("date", get_today_hrd_string(), "Date:");
    makeSubmitter();
    endPrettyTable();
    closeForm();
}
endDocument();
Exemple #3
0
?>
       		<tr>
 		 <td><a href='index.php'><?php 
echo $lLogout;
?>
</a></td>
   <?php 
endPrettyTable();
?>
  </td>
  <td valign=top align=center width='65%'>
   <table cellpadding=0 cellspacing=0 border=0 width='75%'>
    <tr>
     <td>
      <?php 
beginPrettyTable("1", "News");
?>
      <tr><td>
	<b>Yeah!</b><br>
	<li>And here, one can give special Informations about Reports !<br>
      </td></tr>
      <?php 
endPrettyTable();
?>
     </td>
    </tr>
   </table>
  </td>
   </tr>
</table>
<?php 
        }
        $amount = $_POST[$field_name];
        $vr_no = get_new_vrno();
        # insert voucher
        $query = $query_part1 . "('{$vr_no}','{$today}','CR','{$ac1}', '{$ac2}','{$ac3}','{$ac4}','{$ac5}','D','','{$amount}','','opening Balance','{$today}','')";
        $result = mysql_query($query, $db);
        checkMySQLError();
        # insert counterbooking
        $query = $query_part1 . "('{$vr_no}','{$today}','CR','0', '5','0','0','0','C','','{$amount}','','opening Balance','{$today}','')";
        $result = mysql_query($query, $db);
        checkMySQLError();
    }
    report(1, "Everything seems to be fine. Check via Bank and Cash Report!");
} else {
    $db = getDBConnection();
    $result = mysql_query("Select * FROM TRANS");
    if (mysql_num_rows($result) != 0) {
        report(0, "Sorry, opening balance can only be performed when you have no Vouchers entered");
    }
    $accounts_array = get_ac5_sc_array("5(1)", "B");
    beginPrettyTable("2", "enter opening balances");
    openForm("openingbalance", $PHP_SELF);
    makeHiddenField("submitnow", 0);
    foreach ($accounts_array as $ac5 => $desc) {
        makeTextField("account_field_" . $ac5, "", $desc);
    }
    makeSpecialSubmitter("submit", "onClick='this.form.submitnow.value=\"1\"'");
    closeForm();
    endPrettyTable();
}
endDocument();
Exemple #5
0
} else {
    beginDocument("Login", "Not Logged In");
    session_destroy();
    ?>
<form name='login' method='POST' action='<?php 
    $PHP_SELF;
    ?>
'>
<?php 
    openForm("login", $PHP_SELF);
    ?>
<table width='100%' height='50%' cellpadding=0 cellspacing=0 border=0>
 <tr>
  <td valign='center' align='center'>
<?php 
    beginPrettyTable("2", $lLogin);
    ?>
<tr>
 <td>Username:</td>
 <td><input type='text' name='username' value=''></td>
</tr>
<tr>
 <td>Password:</td>
 <td><input type='password' name='password' value=''></td>
</tr>
<?php 
    makeSubmitter();
    endPrettyTable();
    ?>
  </td>
 </tr>
Exemple #6
0
    ?>
	   </tr>
	   <tr>
	    <td><hr color='black'></td>
	   </tr>
	   <?php 
    endPrettyTable();
    # it just print out some HTML
    ?>
	  </td>
	  <td valign=top align=center width='65%'>
	<?php 
    $db = getDBConnection();
    $employer_array = get_personal_array();
    openForm("loan_form", $PHP_SELF, "onSubmit=\"return confirmSubmit()\"");
    beginPrettyTable("2", "enter {$loan_type} entry");
    makeHiddenField("type", $type);
    makeDropBox("emp_id3", $employer_array, "Employers Name");
    startRow();
    makePlainTextField("loan_dt", "", "Loan Santion Dt.", 10);
    makePlainTextField("loan_start", "", "Deduction Start Dt.", 10, "onChange=\"checkdate(this.value) && updateFields()\"");
    endRow();
    startRow();
    makePlainTextField("inst_no", "", "Instalment No", 6, "onChange=\"updateFields()\"");
    makePlainStaticField("loan_end", "", "Loan End Dt.", 10);
    endRow();
    makeStaticField("interest_rate", "{$interest_rate}" . "%", "Interest Rate", 6);
    startRow();
    makePlainTextField("loan_amt", "", "Loan Amount", 10, "onChange=\"updateFields()\"");
    makePlainStaticField("int_amt", "", "Total Interest", 10);
    endRow();
Exemple #7
0
<?php

# This chunk of code checks to see if a customer has been registered in the
# session, if not, it dies.  Security!
if (!session_is_registered("sess_customer") and !session_is_registered("sess_user")) {
    beginDocument("Security", "Not Logged In");
    beginPrettyTable(1, "Security");
    echo "<tr><td class='data'>You are not logged in.  Please <a href='index.php'>Login</a></td></tr>";
    endPrettyTable();
    die;
}
<?php

# List all Employees-salary
require "accrp.php";
session_start();
require "security/secure.php";
beginDocument($lCustomerProfile, $sess_user);
$db = getDBConnection();
$sal_el_array = get_salary_elements_array();
$sal_el_count = get_salary_elements_count();
reset($sal_el_array);
$personal_array = get_personal_array();
beginPrettyTable("5", "PERSONAL SALARY");
#$header["EMP_ID3"] = "ID";
#$header["EMP_NAME"] = "NAME";
$query = "select * FROM PERSONAL LEFT JOIN EMP_SAL USING (EMP_ID3) ORDER BY EMP_SAL.EMP_ID3, EMP_SAL.SAL_ID";
$result = mysql_query($query, $db);
$printrow = array();
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
    if (!isset($emp_name)) {
        $emp_name = $row["EMP_NAME"];
    }
    # ToDo: should get treated as well
    #if ($row["SAL_ID"]==NULL) {
    #	#continue;
    #	for ($i=0;$i<14;$i++) $printrow[]="0";
    #	printRow($printrow);
    #	reset($sal_el_array);
    #	unSet($printrow);
    #
    #	continue;
Exemple #9
0
    $orderby = "EMP_ID3";
}
# calculate received money by Employees
$result = mysql_query("select SUM(AMOUNT),AC_ID5 from TRANS WHERE AC_ID3=30 AND DR_CR='C' GROUP BY AC_ID5 order by PARTY", $db);
checkMySQLError();
while ($row = mysql_fetch_array($result)) {
    $receive_array[$row["AC_ID5"]] = $row["SUM(AMOUNT)"];
}
# calculate paid_back money
$result = mysql_query("select SUM(AMOUNT),PARTY, AC_ID5 from TRANS WHERE AC_ID3=30 AND DR_CR='D' GROUP BY PARTY order by PARTY", $db);
checkMySQLError();
while ($row = mysql_fetch_array($result)) {
    if (array_key_exists($row["AC_ID5"], $receive_array)) {
        $receive_array[$row["AC_ID5"]] -= $row["SUM(AMOUNT)"];
    }
}
beginPrettyTable("1", "Schedule of Advance as on " . get_today_hrd_string());
if (isset($receive_array)) {
    printRow(array("Code", "Employer's name", "Amount"));
    foreach ($receive_array as $key => $value) {
        if ($value != 0) {
            printRow(array("{$key}", get_ac5_desc_of($key), 0 - $value), "something");
        }
        $sum += 0 - $value;
    }
    printRow(array("", "Sum", $sum));
} else {
    printRow(array("No Advance-money at anybody!"), "");
}
endPrettyTable();
endDocument();
Exemple #10
0
$personal_array = get_personal_array();
echo "<h2>Centre for the rehabilitation of the paralysed - CRP</h2>";
echo "<div align=center>" . ($type == "PF" ? "Provident " : "Credit Union ") . "Fund Statement for the month of ";
echo get_month_name($ref_date) . " " . get_year($ref_date) . "</div>";
if ($type == "PF") {
    $loan_table = "PF_LOAN";
} else {
    if ($type == "CUF") {
        $loan_table = "CUF_LOAN";
    } else {
        die("Loantype unspecified !");
    }
}
$result = mysql_query("select * from {$loan_table}", $db);
checkMySQLError();
beginPrettyTable("4", "{$loan_table}");
printRow(array("Emp_ID3", "Emp. Name", "LoanStart", "LoanEnd", "Loan-Amt", "Instalment", "Tot_Amt", "Due", "Balance"));
while ($row = mysql_fetch_array($result)) {
    $name = $personal_array[$row["EMP_ID3"]];
    $rest_inst_no = datediff("m", $ref_date, $row["LOAN_END"]);
    $rest_amount = $rest_inst_no * $row["INT_RATE"];
    if ($rest_inst_no < 0) {
        continue;
    }
    $inst_sum += $rest_inst_no;
    $rest_amount_sum += $rest_amount;
    $loan_amount_sum += $row["LOAN_AMT"];
    printRow(array($row["EMP_ID3"], $name, conv_to_hrd($row["LOAN_START"]), conv_to_hrd($row["LOAN_END"]), $row["LOAN_AMT"], $row["INT_RATE"], $row["TOT_AMT"], $rest_inst_no, $rest_amount), "fluct");
}
printRow(array("", "", "Loan-Amt-Sum: ", $loan_amount_sum), "", "3,2");
printRow(array("", "", "Inst-Sum: ", "", $inst_sum), "", "3,2");
Exemple #11
0
           <tr>
            <td><input type='text' name='tosearch' value=''></td>
            <td><input type='image' src='images/go.gif' value='submit' border=0></td>
           </tr>
         <?php 
endPrettyTable();
?>
         </form>
        </td>
       </tr>
       <tr>
        <td valign=top>
         <form name='getuser' action='search.php'>
				 <input type='hidden' name='searcher' value='address'>
         <?php 
beginPrettyTable("2", $lSearchByAddress);
?>
          <tr>
           <td><input type='text' name='tosearch' value=''></td>
           <td><input type='image' src='images/go.gif' value='submit' border=0></td>
          </tr>
         <?php 
endPrettyTable();
?>
         </form>
        </td>
       </tr>
      </table>
     </td>
    </tr>
   </table>
Exemple #12
0
session_start();
require "accrp.php";
require "security/secure.php";
beginDocument($lCustomerProfile, $sess_user);
$db = getDBConnection();
$ac1_array = get_ac_array(1);
$ac2_array = get_ac_array(2);
$ac3_array = get_ac_array(3);
$ac4_array = get_ac_array(4);
if (!isset($orderby)) {
    $orderby = "AC_ID5";
}
$lastditch_result = mysql_query("select * from AC_CODE5 order by {$orderby}", $db);
checkMySQLError();
if ($lastditch_row = mysql_fetch_array($lastditch_result)) {
    beginPrettyTable("4", "AC_CODE5");
    beginBorderedTable("4");
    ?>
		<tr>
		
		
		<td><b><a href='<?php 
    echo "{$PHP_SELF}";
    ?>
?orderby=AC_ID5<?php 
    if ($orderby == "AC_ID5") {
        echo " DESC";
    }
    ?>
'>AC_ID5</a></b></td> 
		<td><b><a href='<?php 
Exemple #13
0
    deldir("/tmp/ac4ngosdata/");
    # 0333 does not work properly :-( so chmod ...
    $filename = $_FILES['dbdumpfile']['tmp_name'];
    move_uploaded_file($filename, "/tmp/ac4ngosimport.tar.gz") || die("Something wrong with the uploaded file ...");
    exec("cd /tmp; tar -xzf ac4ngosimport.tar.gz;chmod -R o+r ac4ngosdata");
    $result = mysql_query("SHOW TABLES FROM {$DBNAME}");
    checkMySQLError();
    while ($row = mysql_fetch_array($result, $db)) {
        $tablename = $row["Tables_in_{$DBNAME}"];
        $query = "DELETE FROM {$tablename}";
        $result2 = mysql_query($query, $db);
        checkMySQLError($query);
        $filename = "/tmp/accrpdata/" . $tablename . ".txt";
        if (file_exists($filename)) {
            $query = "LOAD DATA INFILE '{$filename}' INTO TABLE `{$tablename}`";
            $result2 = mysql_query($query, $db);
            checkMySQLError($query);
        }
    }
    deldir("/tmp/ac4ngosdata/");
    die("finished");
} else {
    beginPrettyTable(2, "Restore Backup");
    openForm("uploadfile", "{$PHP_SELF}", "form enctype=\"multipart/form-data\" accept\"application/x-tgz\"");
    makeHiddenField("MAX_FILE_SIZE", "30000");
    echo "Send this file: <input name=\"dbdumpfile\" type=\"file\">";
    makePlainSpecialSubmitter("Send File");
    closeForm();
    endPrettyTable();
}
endDocument();
Exemple #14
0
<?php

# List all Employees
require "accrp.php";
session_start();
require "security/secure.php";
beginDocument($lCustomerProfile, $sess_user);
$desig_array = get_designation_array();
if (!isset($orderby)) {
    $orderby = "EMP_ID3";
}
$db = getDBConnection();
$result = mysql_query("select * from PERSONAL order by {$orderby}", $db);
checkMySQLError();
beginPrettyTable("5", "PERSONAL");
#we have the following columns
$columns = array("EMP_ID3" => "EMP_ID3", "EMP_NAME" => "EMP_NAME", "DESIG_ID" => "DESIG_ID", "STATUS" => "STATUS", "AC_NO" => "AC_NO", "CONF_DT" => "CONF_DT", "JOIN_DT" => "JOIN_DT");
# now a very fancy piece of code :-)
$columns[$orderby] .= " DESC";
# wasn't it fancy ;-)
# now something not very fancy :-(
$id = $columns["EMP_ID3"];
$name = $columns["EMP_NAME"];
$desig = $columns["DESIG_ID"];
$status = $columns["STATUS"];
$conf_dt = $columns["CONF_DT"];
$join_dt = $columns["JOIN_DT"];
$ac_no = $columns["AC_NO"];
printRow(array("<b><a href='{$PHP_SELF}?orderby={$id}'>EMP_ID3</a></b>", "<b><a href='{$PHP_SELF}?orderby={$name}'>EMP_NAME</a></b>", "<b><a href='{$PHP_SELF}?orderby={$desig}'>DESIGNATION</a></b>", "<b><a href='{$PHP_SELF}?orderby={$status}'>STATUS</a></b>", "<b><a href='{$PHP_SELF}?orderby={$ac_no}'>AC_NO</a></b>", "<b><a href='{$PHP_SELF}?orderby={$conf_dt}'>CONF_DT</a></b>", "<b><a href='{$PHP_SELF}?orderby={$join_dt}'>JOIN_DT</a></b>"));
while ($row = mysql_fetch_array($result)) {
    printRow(array("<a href=enter_personal.php?EMP_ID3='" . $row["EMP_ID3"] . "'>" . $row["EMP_ID3"] . "</a>", $row["EMP_NAME"], $desig_array[$row["DESIG_ID"]], $row["STATUS"], $row["AC_NO"], $row["CONF_DT"], $row["JOIN_DT"]), "fluct");
Exemple #15
0
	  <td valign=top width='15%'>
	
           <?php 
    beginPrettyTable("1");
    ?>
	   <tr>
	    <?php 
    echo "<td><a href='list_desig.php'>show List</a></td>";
    ?>
	   </tr>
	   <tr>
	    <td><hr color='black'></td>
	   </tr>
	   <?php 
    endPrettyTable();
    ?>
	  </td>
	  <td valign=top align=center width='65%'>
	     <?php 
    openForm("enterDESIGNATION", $PHP_SELF);
    beginPrettyTable("2", "enter Designation");
    makeTextField("desig_desc", "", "Designation");
    makeSubmitter();
    endPrettyTable();
    closeForm();
    ?>
	</td>
	  </table>
	  <?php 
}
endDocument();
Exemple #16
0
    ?>
	   <tr>
	    <?php 
    echo "<td><a href='list_ac5.php'>show List</a></td>";
    ?>
	   </tr>
	   <tr>
	    <td><hr color='black'></td>
	   </tr>
	   <?php 
    endPrettyTable();
    ?>
	  </td>
	  <td valign=top align=center width='65%'>
	<?php 
    openForm("enterAC_CODE5", $PHP_SELF);
    beginPrettyTable("2", $lEnterCustomer);
    makeDropBox("ac_id1", $ac1_array, "AC_CODE1");
    makeDropBox("ac_id2", $ac2_array, "AC_CODE2");
    makeDropBox("ac_id3", $ac3_array, "AC_CODE3");
    makeDropBox("ac_id4", $ac4_array, "AC_CODE4");
    makeTextField("ac5_desc", "", "AC_CODE5");
    makeSubmitter();
    endPrettyTable();
    closeForm();
    ?>
	   </td>
	  </table>
	  <?php 
}
endDocument();
Exemple #17
0
$result = mysql_query("SHOW TABLES FROM {$DBNAME}");
checkMySQLError();
while ($row = mysql_fetch_array($result, $db)) {
    $tablename = $row["Tables_in_{$DBNAME}"];
    $filename = "/tmp/ac4ngosdata/" . $tablename . ".txt";
    $query = "SELECT * FROM {$tablename} INTO OUTFILE \"{$filename}\"";
    $result2 = mysql_query($query, $db);
    checkMySQLError($query);
}
$today = get_today_srd_string();
$backup_filename = "ac4ngos-datadump-{$today}.tar.gz";
exec("cd /tmp; tar -czf {$backup_filename} ac4ngos/*");
$doc_root = $_SERVER["DOCUMENT_ROOT"];
copy("/tmp/{$backup_filename}", "{$doc_root}/crp/backups/{$backup_filename}");
echo "<a href=\"backups/{$backup_filename}\"> click here to download datadump</a>";
endPrettyTable();
beginPrettyTable("2", "the following datadumps are available as well:");
$handle = opendir("{$doc_root}/crp/backups/");
while (false !== ($filename = readdir($handle))) {
    if (is_file("{$doc_root}/crp/backups/{$filename}")) {
        printRow(array("<a href=\"backups/{$filename}\">{$filename}</a>"), "fluct");
    }
}
closedir($handle);
## This is easier but it works only for > PHP 4.3.0
#chdir("$doc_root/crp/backups/");
#foreach (glob("*") as $filename) {
#	printRow(array("<a href=\"backups/$filename\">$filename</a>"),"fluct");
#}
endPrettyTable();
endDocument();
Exemple #18
0
	
           <?php 
    beginPrettyTable("1");
    ?>
	   <tr>
	    <?php 
    echo "<td><a href='list_acs.php?showac={$ac}'>show List</a></td>";
    ?>
	   </tr>
	   <tr>
	    <td><hr color='black'></td>
	   </tr>
	   <?php 
    endPrettyTable();
    ?>
	  </td>
	  <td valign=top align=center width='65%'>
	   <?php 
    openForm("enterAC_CODE{$ac}", $PHP_SELF);
    beginPrettyTable("2", "enter AC_CODE{$ac}");
    makeHiddenField("ac", $ac);
    makeTextField("ac_desc", "", "AC_CODE{$ac}");
    makeSubmitter();
    endPrettyTable();
    closeForm();
    ?>
	   </td>
	  </table>
	  <?php 
}
endDocument();
    }
    printRow(array("", "<b>total Receipts<b>", "<b>" . $transactions->getTotalReceipts() . "</b>"));
    endPrettyTable();
    # Payments
    # generate Transaction-object
    if ($ac_id1 != 0) {
        $transactions = new Transactions($ac_id1, $startdate, $enddate);
    } else {
        $transactions = new Transactions_byProject("1", $startdate, $enddate);
    }
    beginPrettyTable("4", "Payments");
    printRow(array("Code Number", "Description", "Amount", "VR-Type"));
    while ($row = $transactions->getNextPayment()) {
        printRow($row, "fluct");
    }
    printRow(array("", "<b>total Payments</b>", "<b>" . $transactions->getTotalPayments() . "</b>"));
    printRow(array("", "<b>closing Balance:</b> ", "<b>" . $transactions->getClosingBalance() . "</b>"));
    endPrettyTable();
} else {
    $ac_array = get_ac_array(1);
    $ac_array[0] = "ALL PROJECTS";
    openForm("enter Date", $PHP_SELF);
    beginPrettyTable("2", "Project Transactions");
    makeDropBox("ac_id1", $ac_array, "Project");
    makeTextField("startdate", get_today_hrd_string(), "Start Date:");
    makeTextField("enddate", get_today_hrd_string(), "End Date:");
    makeSubmitter();
    endPrettyTable();
    closeForm();
}
endDocument();
Exemple #20
0
	   </tr>
	   <tr>
	    <td><hr color='black'></td>
	   </tr>
	   <?php 
    endPrettyTable();
    # it just print out some HTML
    ?>
	  </td>
	  <td valign=top align=center width='65%'>
	     <?php 
    # Ok, we are again in PHP-Mode
    # Prints all that HTML-stuff, we don't want to deal with
    openForm("enterDEPARTMENT", $PHP_SELF);
    # Prints all that HTML-stuff, we don't want to deal with
    beginPrettyTable("2", "enter DEPARTMENT");
    # makeHiddenField("dept_id", $edit["DEPT_ID"]); This one, we perhaps use it later
    # "dept_name" is the name of the form (see html-page)
    # It will get a variable if this Program is called once again
    # (see upper "if"-Statement)
    makeTextField("dept_name", $edit["DEPT_NAME"], "Department");
    # print out the code for that "submit"-Button
    makeSubmitter();
    # Prints all that HTML-stuff, we don't want to deal with
    endPrettyTable();
    # Prints all that HTML-stuff, we don't want to deal with
    closeForm();
    # sometimes, we have to print it out directly with "echo"
    echo "</td> </table>";
}
# Prints all that HTML-stuff, we don't want to deal with
Exemple #21
0
<?php

# Show Profile shows all the Customer Info, Invoices, Payments, Tickets,
# and a balance.
session_start();
require "accrp.php";
require "security/secure.php";
beginDocument($lCustomerProfile, $sess_user);
$db = getDBConnection();
#$result = mysql_query("select * from SAL_ID", $db);
#checkMySQLError();
beginPrettyTable("4", "Salary Elements");
#printRow(array("SAL_ID","Description","Income/Expense"));
$result = mysql_query("DROP TABLE test");
checkMySQLError();
$result = mysql_query("CREATE TABLE test (dummy int) TYPE=HEAP SELECT PERSONAL.EMP_ID3, EMP_NAME, SAL_ID FROM PERSONAL, SAL_ID");
checkMySQLError();
$query = "select * from test LEFT OUTER JOIN EMP_SAL USING(EMP_ID3, SAL_ID) ORDER BY test.EMP_ID3, test.SAL_ID";
$result = mysql_query($query, $db);
checkMySQLError();
while ($row = mysql_fetch_array($result)) {
    unset($printrow);
    $printrow["Name"] = $row["EMP_NAME"];
    for ($i = 0; $i < 14; $i++, $row = mysql_fetch_array($result)) {
        $printrow[] = $row["SAL_AMT"];
    }
    printRow($printrow);
}
endPrettyTable();
endDocument();
Exemple #22
0
	
           <?php 
        beginPrettyTable("1");
        ?>
	   <tr>
	    <?php 
        echo "<td><a href='not_existing.php'>bad link here</a></td>";
        ?>
	   </tr>
	   <tr>
	    <td><hr color='black'></td>
	   </tr>
	   <?php 
        endPrettyTable();
        ?>
	  </td>
	  <td valign=top align=center width='65%'>
	     <?php 
        openForm("removevoucher_form", $PHP_SELF);
        beginPrettyTable("2", "enter Voucher-No");
        maketextfield("vr_no", "", "Voucher Number");
        makeSubmitter();
        endPrettyTable();
        closeForm();
        ?>
	</td>
	  </table>
	  <?php 
    }
}
endDocument();
Exemple #23
0
    if ($vr_tp != "JV") {
        makePlainTextField("chq_no", "", "Chq-No.:", 10);
    }
    makeTextField("remarks", "", "Narration:");
    endPrettyTable();
    # Start now with that second part of the story
    if ($vr_tp == "DB") {
        $ac_array = get_ac5_sc_array("5(1/2)", "");
    } elseif ($vr_tp == "CR") {
        $ac_array = get_ac5_sc_array("5(1/2)", "");
    } elseif ($vr_tp == "JV") {
        $ac_array = get_ac5_sc_array("5(1/2)", "");
    } else {
        die("Unknown Voucher-type: ({$vr_tp})");
    }
    beginPrettyTable("1", "I call it \"Counterbooking\"");
    ?>
 <tr><td>AccountName</td><td>Narration</td><td>Dept</td><td>Amount</td></tr><?php 
    for ($i = 0; $i < $ac_count; $i++) {
        startRow();
        makePlainDropBox("ac_name_{$i}", $ac_array);
        makePlainTextField("remarks_{$i}", "", "", 20);
        makePlainDropBox("dept_{$i}", $dept_array, $edit["DEPT_ID"]);
        makePlainTextField("amount_{$i}", "");
        endRow();
    }
    $ac_count++;
    makeSpecialSubmitter("moreRows", "onClick='this.form.ac_count.value={$ac_count}'");
    endPrettyTable();
    makeSpecialSubmitter("submit", "onClick='this.form.submitnow.value=\"1\"'");
    closeForm();
            makeTextField("salary_field_" . $key, $edit_salary["{$key}"], "{$value}", 10, "onFocus=\"editIncomeField(this.value)\" onChange=\"changedIncomeField(this.value) \"");
            $income_sum += $edit_salary["{$key}"];
        }
        makeStaticField("income_sum", $income_sum, "Income Sum:", "", 11);
        # Expense-Positions
        printRow(array("<div align=\"center\"><h2>EXPENSE</h2></div>"), "", "1,2");
        foreach ($expense_salary_elements_array_desc as $key => $value) {
            makeTextField("salary_field_" . $key, $edit_salary["{$key}"], "{$value}", 10, "onFocus=\"editExpenseField(this.value)\" onChange=\"changedExpenseField(this.value) \"");
            $expense_sum += $edit_salary["{$key}"];
        }
        makeStaticField("expense_sum", $expense_sum, "Expense Sum:", "", 11);
        printRow(array("<hr>"), "", "1,2");
        makeStaticField("total_sum", $income_sum - $expense_sum, "Total Sum:", "", 14);
        makeSpecialSubmitter("submit", "onClick='this.form.submitnow.value=\"1\"'");
        endPrettyTable();
        closeForm();
        ?>
	</td>
	  </table>
	  <?php 
    } else {
        $personal_array = get_personal_array();
        openForm("selectemployee", $PHP_SELF);
        beginPrettyTable("2", "select Employee");
        makeDropBox("emp_id3", $personal_array, "Employer Name");
        makeSubmitter();
        endPrettyTable();
        closeForm();
    }
}
endDocument();
Exemple #25
0
<?php

# Show Profile shows all the Customer Info, Invoices, Payments, Tickets,
# and a balance.
require "accrp.php";
session_start();
require "security/secure.php";
beginDocument($lCustomerProfile, $sess_user);
$db = getDBConnection();
$result = mysql_query("select * from DESIG order by DESIG_ID", $db);
checkMySQLError();
if ($result_row = mysql_fetch_array($result)) {
    beginPrettyTable("4", "DESIGNATIONS");
    beginBorderedTable("4");
    echo "<tr>\n";
    echo " <td><b>DESIG_ID</b></td> <td><b>DESIG_DESC</b></td> \n <td><b>{$lActions}</b></td>\n </tr>\n";
    do {
        if ($class == "odd") {
            $class = "even";
        } else {
            $class = "odd";
        }
        printf(" <tr class='{$class}'>\n  <td><a href='%s?CustomerID=%s'>%s</td> <td>%s</td>\n <td align='center'><a href='confirm.php?action=deletecustomer&CustomerID=%s'><img src='images/delete.gif' height=24 width=24 border=0 alt='Delete this Customer'></a></td></tr>\n", $PHP_SELF, $result_row["DESIG_ID"], $result_row["DESIG_ID"], $result_row["DESIG_DESC"], $result_row["DESIG_ID"]);
    } while ($result_row = mysql_fetch_array($result));
    endPrettyTable();
    endBorderedTable();
} else {
    echo "No Designations Found...\n";
}
endDocument();
Exemple #26
0
function searchBar()
{
    global $lSearch, $lLast, $lAddress, $lEmail;
    openForm("searcher", "search.php");
    beginPrettyTable("2");
    echo "<tr><td>\n";
    echo "<b>{$lSearch}</b>: <input name='tosearch' type='text'>\n";
    echo "</td><td valign='center'>\n";
    echo "<select name='searcher' type='text'>\n";
    echo " <option value='last'>{$lLast}\n";
    echo " <option value='address'>{$lAddress}\n";
    echo " <option value='email'>{$lEmail}\n";
    echo "</select>\n";
    echo "<input type='image' align='center' src='images/go.gif' value='submit' border=0>\n";
    echo "</td></tr>\n";
    endPrettyTable();
    closeForm();
}
Exemple #27
0
<?php

session_start();
require "accrp.php";
require "security/secure.php";
beginDocument("Main", $sess_user);
$db = getDBConnection();
beginPrettyTable("2", "Backup");
deldir("/tmp/accrpexport/");
mkdir("/tmp/accrpexport", 0333);
# 0333 does not work properly :-( so chmod ...
chmod("/tmp/accrpexport", 0733);
$result = mysql_query("SHOW TABLES FROM {$DBNAME}");
checkMySQLError();
while ($row = mysql_fetch_array($result, $db)) {
    $tablename = $row["Tables_in_accrp"];
    $filename = "/tmp/accrpexport/" . $tablename . ".txt";
    $query = "SELECT * FROM {$tablename} INTO OUTFILE \"{$filename}\"";
    $result2 = mysql_query($query, $db);
    checkMySQLError($query);
}
$today = get_today_srd_string();
$backup_filename = "accrp-datadump-{$today}.tar.gz";
exec("tar -czf /tmp/accrpexport/{$backup_filename} /tmp/accrpexport/*");
$doc_root = $_SERVER["DOCUMENT_ROOT"];
copy("/tmp/accrpexport/{$backup_filename}", "{$doc_root}/crp/backups/{$backup_filename}");
echo "<a href=\"backups/{$backup_filename}\"> click here to download datadump</a>";
endDocument();
	
           <?php 
    beginPrettyTable("1");
    ?>
	   <tr>
	    <?php 
    echo "<td><a href='list_salary_elements.php'>show List</a></td>";
    ?>
	   </tr>
	   <tr>
	    <td><hr color='black'></td>
	   </tr>
	   <?php 
    endPrettyTable();
    ?>
	  </td>
	  <td valign=top align=center width='65%'>
	     <?php 
    openForm("salaryelement_form", $PHP_SELF);
    beginPrettyTable("2", "enter salary element");
    makeTextField("sal_desc", "", "Salary Description");
    makeDropBox("id_tp", array("I" => "I", "E" => "E"), "Expenses/Income");
    makeSubmitter();
    endPrettyTable();
    closeForm();
    ?>
	</td>
	  </table>
	  <?php 
}
endDocument();
Exemple #29
0
	   <tr>
	    <?php 
    echo "<td><a href='list_personal.php'>show List</a></td>";
    ?>
	   </tr>
	   <tr>
	    <td><hr color='black'></td>
	   </tr>
	   <?php 
    endPrettyTable();
    ?>
	  </td>
	  <td valign=top align=center width='65%'>
	     <?php 
    openForm("enter Personal", $PHP_SELF);
    beginPrettyTable("2", "enter Personal");
    makeHiddenField("emp_id3", $edit["EMP_ID3"]);
    makeTextField("emp_name", $edit["EMP_NAME"], "Employer Name");
    makeDropBox("desig_id", $desig_array, "Designation", $edit["DESIG_ID"]);
    makeDropBox("status", array("Y" => "Y", "N" => "N", "UNKNOWN" => ""), "Status", $edit["STATUS"]);
    makeTextField("ac_no", $edit["AC_NO"], "Account Number");
    makeTextField("conf_dt", $edit["CONF_DT"], "Conf_Date");
    makeTextField("join_dt", $edit["JOIN_DT"], "Join Date");
    makeSubmitter();
    endPrettyTable();
    closeForm();
    ?>
	</td>
	  </table>
	  <?php 
}
    beginPrettyTable("4", "Receipts");
    printRow(array("Code Number", "Description", "Amount"));
    while ($receiptsAccounts->getNext()) {
        if ($receiptsAccounts->getActualBalance() == "") {
            continue;
        }
        printRow(array($receiptsAccounts->getActualCodeString(), $receiptsAccounts->getActualCodeName(), $receiptsAccounts->getActualBalance()), "abwechselnd");
    }
    printRow(array("", "Total", $receiptsAccounts->getSum()));
    endPrettyTable();
    # Closing Balance
    beginPrettyTable("4", "Closing Balance");
    printRow(array("Code Number", "Description", "Amount"));
    while ($closingAccounts->getNext()) {
        printRow(array($closingAccounts->getActualCodeString(), $closingAccounts->getActualCodeName(), $closingAccounts->getActualBalance()), "abwechselnd");
    }
    printRow(array("", "Total", $closingAccounts->getSum()));
    endPrettyTable();
} else {
    $ac_array = get_ac_array(1);
    $ac_array[0] = "ALL PROJECTS";
    openForm("enter Date", $PHP_SELF);
    beginPrettyTable("2", "Project Balances");
    makeDropBox("ac_id1", $ac_array, "Project");
    makeTextField("startdate", get_today_hrd_string(), "Start Date:");
    makeTextField("enddate", get_today_hrd_string(), "End Date:");
    makeSubmitter();
    endPrettyTable();
    closeForm();
}
endDocument();