function get_deal_properties($d_id) { $sql = "SELECT * FROM DEALS WHERE D_ID=" . $d_id . ";"; $result = $this->mysqli->query($sql); if ($result) { $row = $result->fetch_row(); $deal['id'] = $d_id; $deal['type_id'] = $row[1]; $deal['type'] = trade::get_deal_type_by_type_id($row[1]); $deal['date'] = $row[2]; $deal['desc'] = $row[3]; $deal['status_id'] = $row[4]; $deal['status'] = trade::get_deal_status_name($row[4]); $deal['p_id'] = $row[5]; $deal['usr_id'] = $row[6]; $deal['2p_id'] = $row[7]; $deal['num'] = $row[8]; } return $deal; }
function partner_deals($dt_id, $p_id) { // deal type properties $d_type = trade::get_deal_type_by_type_id((int) $dt_id); // head $ans .= "<div class='headpost' align=center >" . $d_type['name'] . "</div>"; $sql = "SELECT \n\t\tDEALS.D_ID,\n\t\tUSERS.USR_LOGIN,\n\t\tDEALS.D_DATE,\n\t\tDEALS.D_DESC,\n\t\tDEALS.D_NR\n\t\tFROM DEALS\n\t\tINNER JOIN USERS ON USERS.USR_ID=DEALS.D_USR_ID\n\t\tWHERE DEALS.D_DT_ID=" . $dt_id . " AND D_2P_ID =" . $p_id . " ORDER BY D_ID DESC;"; $result = $this->mysqli->query($sql); if ($result) { while ($row = $result->fetch_row()) { if ($style == 'multitable2' or $style == '') { $style = 'multitable1'; } else { $style = 'multitable2'; } $d_id = $row[0]; $d_usr_login = $row[1]; $d_date = $this->fdate($row[2]); $d_desc = $row[3]; $d_num = $row[4]; $d_num_msg = $d_num ? $d_id . " (" . $d_num . ")" : $d_id; $action = "onclick=\"x_cl_call2('trade','edit_deal_selector','" . $d_id . "','" . $dt_id . "','bottom_block')\""; $deal_link = "<a href='trade&deal=" . $d_id . "'><img class='menu_img' src='img/site/business-contact.png'></a>"; $tbl .= "<tr class='" . $style . "' " . $action . "><td>" . $d_num_msg . "</td><td>" . $d_usr_login . "</td><td>" . $d_date . "</td><td>" . $d_desc . "</td><td>" . $deal_link . "</td></tr>"; } } $out .= $ans; $out .= $tbl ? "<table id='multutable' class='multitable'><tr><th width=30px>№</th><th width=90px>Пользователь</th><th>Дата</th><th>Пометка</th><th>переход</th></tr>" . $tbl . "</table>" : "Список пуст"; return $out; }