| 1 | <?php  | 
            ||
| 15 | class transactions  | 
            ||
| 16 | { | 
            ||
| 17 | protected $container;  | 
            ||
| 18 | protected $db;  | 
            ||
| 19 | protected $ppde_transactions_log_table;  | 
            ||
| 20 | |||
| 21 | /**  | 
            ||
| 22 | * Constructor  | 
            ||
| 23 | *  | 
            ||
| 24 | * @param ContainerInterface $container Service container interface  | 
            ||
| 25 | * @param \phpbb\db\driver\driver_interface $db Database connection  | 
            ||
| 26 | * @param string $ppde_transactions_log_table Table name  | 
            ||
| 27 | *  | 
            ||
| 28 | * @access public  | 
            ||
| 29 | */  | 
            ||
| 30 | public function __construct(ContainerInterface $container, \phpbb\db\driver\driver_interface $db, $ppde_transactions_log_table)  | 
            ||
| 36 | |||
| 37 | /**  | 
            ||
| 38 | * SQL Query to return Transaction log data table  | 
            ||
| 39 | *  | 
            ||
| 40 | * @param $transaction_id  | 
            ||
| 41 | *  | 
            ||
| 42 | * @return string  | 
            ||
| 43 | * @access public  | 
            ||
| 44 | */  | 
            ||
| 45 | public function build_sql_data($transaction_id = 0)  | 
            ||
| 69 | |||
| 70 | /**  | 
            ||
| 71 | * Returns the SQL Query for generation the donors list  | 
            ||
| 72 | *  | 
            ||
| 73 | * @param int $max_txn_id Identifier of the transaction logged in the DB  | 
            ||
| 74 | * @param string $order_by  | 
            ||
| 75 | *  | 
            ||
| 76 | * @return array  | 
            ||
| 77 | * @access public  | 
            ||
| 78 | */  | 
            ||
| 79 | public function get_sql_donorlist_ary($max_txn_id = 0, $order_by = '')  | 
            ||
| 112 | |||
| 113 | /**  | 
            ||
| 114 | * SQL Query to return donors list details  | 
            ||
| 115 | *  | 
            ||
| 116 | * @param array $sql_donorlist_ary  | 
            ||
| 117 | *  | 
            ||
| 118 | * @return string  | 
            ||
| 119 | * @access public  | 
            ||
| 120 | */  | 
            ||
| 121 | public function build_sql_donorlist_data($sql_donorlist_ary)  | 
            ||
| 126 | |||
| 127 | /**  | 
            ||
| 128 | * Returns total entries of selected field  | 
            ||
| 129 | *  | 
            ||
| 130 | * @param array $count_sql_ary  | 
            ||
| 131 | * @param string $selected_field  | 
            ||
| 132 | *  | 
            ||
| 133 | * @return int  | 
            ||
| 134 | * @access public  | 
            ||
| 135 | */  | 
            ||
| 136 | public function query_sql_count($count_sql_ary, $selected_field)  | 
            ||
| 151 | |||
| 152 | /**  | 
            ||
| 153 | * Returns the SQL Query for displaying simple transactions details  | 
            ||
| 154 | *  | 
            ||
| 155 | * @param string $keywords  | 
            ||
| 156 | * @param string $sort_by  | 
            ||
| 157 | * @param integer $log_time  | 
            ||
| 158 | *  | 
            ||
| 159 | * @return array  | 
            ||
| 
                                                                                                    
                         1 ignored issue 
                            –
                            show
                         | 
                |||
| 160 | * @access public  | 
            ||
| 161 | */  | 
            ||
| 162 | public function get_logs_sql_ary($keywords, $sort_by, $log_time)  | 
            ||
| 189 | |||
| 190 | /**  | 
            ||
| 191 | * Generates a sql condition for the specified keywords  | 
            ||
| 192 | *  | 
            ||
| 193 | * @param string $keywords The keywords the user specified to search for  | 
            ||
| 194 | 	 * @param string $statement_operator The operator used to prefix the statement ('AND' by default) | 
            ||
| 195 | *  | 
            ||
| 196 | * @return string Returns the SQL condition searching for the keywords  | 
            ||
| 197 | * @access private  | 
            ||
| 198 | */  | 
            ||
| 199 | private function generate_sql_keyword($keywords, $statement_operator = 'AND')  | 
            ||
| 226 | |||
| 227 | /**  | 
            ||
| 228 | * Returns user information based on the ID of the donor or they email  | 
            ||
| 229 | *  | 
            ||
| 230 | * @param string $type  | 
            ||
| 231 | * @param int $arg  | 
            ||
| 232 | *  | 
            ||
| 233 | * @return array|bool  | 
            ||
| 234 | * @access public  | 
            ||
| 235 | */  | 
            ||
| 236 | public function query_donor_user_data($type = 'user', $arg = 1)  | 
            ||
| 258 | |||
| 259 | /**  | 
            ||
| 260 | * Returns simple details of all PayPal transactions logged in the database  | 
            ||
| 261 | *  | 
            ||
| 262 | * @param array $get_logs_sql_ary  | 
            ||
| 263 | * @param array $url_ary  | 
            ||
| 264 | * @param int $limit  | 
            ||
| 265 | * @param int $last_page_offset  | 
            ||
| 266 | *  | 
            ||
| 267 | * @return array $log  | 
            ||
| 268 | * @access public  | 
            ||
| 269 | */  | 
            ||
| 270 | public function build_log_ary($get_logs_sql_ary, $url_ary, $limit = 0, $last_page_offset = 0)  | 
            ||
| 296 | |||
| 297 | /**  | 
            ||
| 298 | * Build transaction url for placing into templates.  | 
            ||
| 299 | *  | 
            ||
| 300 | * @param int $id The users transaction id  | 
            ||
| 301 | * @param string $txn_id The txn number id  | 
            ||
| 302 | * @param string $custom_url optional parameter to specify a profile url. The transaction id get appended to this  | 
            ||
| 303 | 	 *                           url as &id={id} | 
            ||
| 304 | * @param bool $colour  | 
            ||
| 305 | *  | 
            ||
| 306 | * @return string A string consisting of what is wanted.  | 
            ||
| 307 | * @access private  | 
            ||
| 308 | */  | 
            ||
| 309 | private function build_transaction_url($id, $txn_id, $custom_url = '', $colour = false)  | 
            ||
| 337 | |||
| 338 | /**  | 
            ||
| 339 | * Returns SQL WHERE clause for all marked items  | 
            ||
| 340 | *  | 
            ||
| 341 | * @param $marked  | 
            ||
| 342 | *  | 
            ||
| 343 | * @return string  | 
            ||
| 344 | * @access public  | 
            ||
| 345 | */  | 
            ||
| 346 | public function build_marked_where_sql($marked)  | 
            ||
| 356 | |||
| 357 | /**  | 
            ||
| 358 | * Build SQL query for updating stats  | 
            ||
| 359 | *  | 
            ||
| 360 | * @param string $type  | 
            ||
| 361 | * @param bool $test_ipn  | 
            ||
| 362 | *  | 
            ||
| 363 | * @return string  | 
            ||
| 364 | * @access public  | 
            ||
| 365 | */  | 
            ||
| 366 | public function sql_build_update_stats($type, $test_ipn)  | 
            ||
| 397 | |||
| 398 | /**  | 
            ||
| 399 | * Make body of SQL query for stats calculation.  | 
            ||
| 400 | *  | 
            ||
| 401 | * @param string $field_name Name of the field  | 
            ||
| 402 | *  | 
            ||
| 403 | * @return array  | 
            ||
| 404 | * @access private  | 
            ||
| 405 | */  | 
            ||
| 406 | private function sql_select_stats_main($field_name)  | 
            ||
| 413 | }  | 
            ||
| 414 | 
This check looks for the generic type
arrayas a return type and suggests a more specific type. This type is inferred from the actual code.