110 |
Commit($cn); |
Commit($cn); |
111 |
} |
} |
112 |
if ( isset ($_POST['is_paid'] )) |
if ( isset ($_POST['is_paid'] )) |
113 |
|
StartSql($cn); |
114 |
$Res=ExecSql($cn,"update jrn set jr_rapt='paid' where jr_id=".$_POST['jr_id']); |
$Res=ExecSql($cn,"update jrn set jr_rapt='paid' where jr_id=".$_POST['jr_id']); |
115 |
|
if ( isset ($_POST['to_remove'] )) { |
116 |
|
// Remove old document |
117 |
|
$ret=ExecSql($cn,"select jr_pj from jrn where jr_id=".$_POST['jr_id']); |
118 |
|
if (pg_num_rows($ret) != 0) { |
119 |
|
$r=pg_fetch_array($ret,0); |
120 |
|
$old_oid=$r['jr_pj']; |
121 |
|
if (strlen($old_oid) != 0) |
122 |
|
pg_lo_unlink($cn,$old_oid); |
123 |
|
ExecSql($cn,"update jrn set jr_pj=null, jr_pj_name=null, ". |
124 |
|
"jr_pj_type=null where jr_id=".$_POST['jr_id']); |
125 |
|
Commit($cn); |
126 |
|
} |
127 |
|
|
128 |
|
} |
129 |
echo ' <script> |
echo ' <script> |
130 |
window.close(); |
window.close(); |
131 |
self.opener.RefreshMe(); |
self.opener.RefreshMe(); |