Exemplo n.º 1
0
                    </tr>
                    <?php 
    }
}
?>
        </table>
    </div>
    <h3><?php 
echo Language::string(696);
?>
</h3>
    <div>
        <table class='fullWidth'>
            <?php 
$count = 0;
$sql = "SELECT `" . Ini::$db_master_name . "`.`" . RDocFunction::get_mysql_table() . "`.`id`,\r\n                            `" . Ini::$db_master_name . "`.`" . UserFunction::get_mysql_table() . "`.`id`\r\n                            FROM `" . Ini::$db_master_name . "`.`" . UserFunction::get_mysql_table() . "` \r\n                            LEFT JOIN `" . Ini::$db_master_name . "`.`" . RDocFunction::get_mysql_table() . "` \r\n                                ON `" . Ini::$db_master_name . "`.`" . RDocFunction::get_mysql_table() . "`.`id`=`" . Ini::$db_master_name . "`.`" . UserFunction::get_mysql_table() . "`.`RDocFunction_id`\r\n                            WHERE `" . Ini::$db_master_name . "`.`" . UserFunction::get_mysql_table() . "`.`User_id`=" . $logged_user->id . "\r\n                            ORDER BY `" . Ini::$db_master_name . "`.`" . RDocFunction::get_mysql_table() . "`.`name` ASC";
$z = mysql_query($sql);
while ($r = mysql_fetch_array($z)) {
    $func = RDocFunction::from_mysql_id($r[0]);
    $count++;
    $doc = RDoc::from_mysql_id($func->RDoc_id);
    $lib = RDocLibrary::from_mysql_id($func->RDocLibrary_id);
    $doc_html = "";
    if ($doc != null) {
        $doc_html = $doc->HTML;
    }
    ?>
                <tr onmouseover='Test.uiMouseOverFunctionToolbarTr(<?php 
    echo $count;
    ?>
)'>
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 as published by the Free Software Foundation; version 2
 of the License, and not any of the later versions.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
if (!isset($ini)) {
    require_once '../../Ini.php';
    $ini = new Ini();
}
$logged_user = User::get_logged_user();
if ($logged_user == null) {
    echo json_encode(array("result" => -1));
    exit;
}
$uf = UserFunction::from_mysql_id($_POST['oid']);
if ($uf == null || $logged_user->id != $uf->User_id) {
    echo json_encode(array("result" => -2));
    exit;
}
$uf->mysql_delete();
echo json_encode(array("result" => 0));
Exemplo n.º 3
0
<?php

include_once 'includes/connection.php';
include_once 'includes/database.class.php';
/************ Class Object Define ***************/
$DBObj = new DBConnection();
$MSObj = new FuncMySql();
$ErObj = new Error();
$ThubObj = new UserFunction();
/************************************************/
$DBObj->Connect($SERVER_HOST, $SERVER_USER, $SERVER_PASSWORD, $SERVER_DATABASE);
$fid = $_POST['fid'];
$donation_amount = $_POST['donation_amount'];
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$email = $_POST['email'];
$message = $_POST['message'];
$donation_amount = number_format($donation_amount, 2, '.', '');
$mycharityfees = $donation_amount * 5.9 / 100;
$mycharityfees = number_format($mycharityfees, 2, '.', '');
//$centplus=(($donation_amount*0.30)/100);
$centplus = '0.30';
//$centplus=number_format($centplus, 2, '.', '');
$mycharityfees = $mycharityfees + $centplus;
$total_donation = $donation_amount - $mycharityfees;
$status = '0';
$insert_date = date('Y-m-d h:i:s');
$query = sprintf("INSERT into cha_donation SET\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfid = %d,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdonation_amount='%s',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfirstname='%s',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlastname='%s',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\temail='%s',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmessage='%s',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmycharityfees='%s',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttotal_donation='%s',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tinsert_date='%s',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstatus='%s'\n\t\t\t", $fid, $donation_amount, $firstname, $lastname, $email, $message, $mycharityfees, $donation_amount, $insert_date, $status);
$Query = $MSObj->Query($query);
$id = mysql_insert_id();
/*##################################################################################################
Exemplo n.º 4
0
 public function get_functions()
 {
     return UserFunction::from_property(array("User_id" => $this->id));
 }
 as published by the Free Software Foundation; version 2
 of the License, and not any of the later versions.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
if (!isset($ini)) {
    require_once '../../Ini.php';
    $ini = new Ini();
}
$logged_user = User::get_logged_user();
if ($logged_user == null) {
    echo json_encode(array("result" => -1));
    exit;
}
$uf = UserFunction::from_property(array("User_id" => $logged_user->id, "RDocFunction_id" => $_POST['oid']), false);
if ($uf != null) {
    echo json_encode(array("result" => 1));
    exit;
}
$nuf = new UserFunction();
$nuf->RDocFunction_id = $_POST['oid'];
$nuf->User_id = $logged_user->id;
$nuf->mysql_save();
echo json_encode(array("result" => 0));