PageRenderTime 75ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/osj-osj2dapplicationsdelete.php

http://osjobber.googlecode.com/
PHP | 649 lines | 482 code | 79 blank | 88 comment | 76 complexity | 565d52c1a2e73e685942ad878780b0b6 MD5 | raw file
Possible License(s): LGPL-2.1, AGPL-1.0
  1. <?php
  2. define("EW_PAGE_ID", "delete", TRUE); // Page ID
  3. define("EW_TABLE_NAME", 'osj-applications', TRUE);
  4. ?>
  5. <?php
  6. session_start(); // Initialize session data
  7. ob_start(); // Turn on output buffering
  8. ?>
  9. <?php include "osj-ewcfg50.php" ?>
  10. <?php include "osj-ewmysql50.php" ?>
  11. <?php include "osj-phpfn50.php" ?>
  12. <?php include "osj-osj2dapplicationsinfo.php" ?>
  13. <?php include "osj-userfn50.php" ?>
  14. <?php include "osj-osj2dusersinfo.php" ?>
  15. <?php
  16. header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
  17. header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified
  18. header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1
  19. header("Cache-Control: post-check=0, pre-check=0", false);
  20. header("Pragma: no-cache"); // HTTP/1.0
  21. ?>
  22. <?php
  23. // Open connection to the database
  24. $conn = ew_Connect();
  25. ?>
  26. <?php
  27. $Security = new cAdvancedSecurity();
  28. ?>
  29. <?php
  30. if (!$Security->IsLoggedIn()) $Security->AutoLogin();
  31. $Security->LoadCurrentUserLevel('osj-applications');
  32. if (!$Security->IsLoggedIn()) {
  33. $Security->SaveLastUrl();
  34. Page_Terminate("osj-login.php");
  35. }
  36. if (!$Security->CanDelete()) {
  37. $Security->SaveLastUrl();
  38. Page_Terminate("osj-osj2dapplicationslist.php");
  39. }
  40. if ($Security->IsLoggedIn() && $Security->CurrentUserID() == "") {
  41. $_SESSION[EW_SESSION_MESSAGE] = "You do not have the right permission to view the page";
  42. Page_Terminate("osj-login.php");
  43. }
  44. ?>
  45. <?php
  46. // Common page loading event (in userfn*.php)
  47. Page_Loading();
  48. ?>
  49. <?php
  50. // Page load event, used in current page
  51. Page_Load();
  52. ?>
  53. <?php
  54. $osj2Dapplications->Export = @$_GET["export"]; // Get export parameter
  55. $sExport = $osj2Dapplications->Export; // Get export parameter, used in header
  56. $sExportFile = $osj2Dapplications->TableVar; // Get export file, used in header
  57. ?>
  58. <?php
  59. // Load Key Parameters
  60. $sKey = "";
  61. $bSingleDelete = TRUE; // Initialize as single delete
  62. $arRecKeys = array();
  63. $nKeySelected = 0; // Initialize selected key count
  64. $sFilter = "";
  65. if (@$_GET["application_id"] <> "") {
  66. $osj2Dapplications->application_id->setQueryStringValue($_GET["application_id"]);
  67. if (!is_numeric($osj2Dapplications->application_id->QueryStringValue)) {
  68. Page_Terminate($osj2Dapplications->getReturnUrl()); // Prevent sql injection, exit
  69. }
  70. $sKey .= $osj2Dapplications->application_id->QueryStringValue;
  71. } else {
  72. $bSingleDelete = FALSE;
  73. }
  74. if ($bSingleDelete) {
  75. $nKeySelected = 1; // Set up key selected count
  76. $arRecKeys[0] = $sKey;
  77. } else {
  78. if (isset($_POST["key_m"])) { // Key in form
  79. $nKeySelected = count($_POST["key_m"]); // Set up key selected count
  80. $arRecKeys = ew_StripSlashes($_POST["key_m"]);
  81. }
  82. }
  83. if ($nKeySelected <= 0) Page_Terminate($osj2Dapplications->getReturnUrl()); // No key specified, exit
  84. // Build filter
  85. foreach ($arRecKeys as $sKey) {
  86. $sFilter .= "(";
  87. // Set up key field
  88. $sKeyFld = $sKey;
  89. if (!is_numeric($sKeyFld)) {
  90. Page_Terminate($osj2Dapplications->getReturnUrl()); // Prevent sql injection, exit
  91. }
  92. $sFilter .= "`application_id`=" . ew_AdjustSql($sKeyFld) . " AND ";
  93. if (substr($sFilter, -5) == " AND ") $sFilter = substr($sFilter, 0, strlen($sFilter)-5) . ") OR ";
  94. }
  95. if (substr($sFilter, -4) == " OR ") $sFilter = substr($sFilter, 0, strlen($sFilter)-4);
  96. // Set up filter (Sql Where Clause) and get Return Sql
  97. // Sql constructor in osj2Dapplications class, osj2Dapplicationsinfo.php
  98. $osj2Dapplications->CurrentFilter = $sFilter;
  99. // Get action
  100. if (@$_POST["a_delete"] <> "") {
  101. $osj2Dapplications->CurrentAction = $_POST["a_delete"];
  102. } else {
  103. $osj2Dapplications->CurrentAction = "I"; // Display record
  104. }
  105. switch ($osj2Dapplications->CurrentAction) {
  106. case "D": // Delete
  107. $osj2Dapplications->SendEmail = TRUE; // Send email on delete success
  108. if (DeleteRows()) { // delete rows
  109. $_SESSION[EW_SESSION_MESSAGE] = "Delete Successful"; // Set up success message
  110. Page_Terminate($osj2Dapplications->getReturnUrl()); // Return to caller
  111. }
  112. }
  113. // Load records for display
  114. $rs = LoadRecordset();
  115. $nTotalRecs = $rs->RecordCount(); // Get record count
  116. if ($nTotalRecs <= 0) { // No record found, exit
  117. $rs->Close();
  118. Page_Terminate($osj2Dapplications->getReturnUrl()); // Return to caller
  119. }
  120. ?>
  121. <?php include "osj-header.php" ?>
  122. <script type="text/javascript">
  123. <!--
  124. var EW_PAGE_ID = "delete"; // Page id
  125. var EW_SHOW_HIGHLIGHT = "Show highlight";
  126. var EW_HIDE_HIGHLIGHT = "Hide highlight";
  127. //-->
  128. </script>
  129. <script language="JavaScript" type="text/javascript">
  130. <!--
  131. // Write your client script here, no need to add script tags.
  132. // To include another .js script, use:
  133. // ew_ClientScriptInclude("my_javascript.js");
  134. //-->
  135. </script>
  136. <p><span class="phpmaker">Delete from TABLE: Applications<br><br><a href="<?php echo $osj2Dapplications->getReturnUrl() ?>">Go Back</a></span></p>
  137. <?php
  138. if (@$_SESSION[EW_SESSION_MESSAGE] <> "") {
  139. ?>
  140. <p><span class="ewmsg"><?php echo $_SESSION[EW_SESSION_MESSAGE] ?></span></p>
  141. <?php
  142. $_SESSION[EW_SESSION_MESSAGE] = ""; // Clear message
  143. }
  144. ?>
  145. <form action="osj-osj2dapplicationsdelete.php" method="post">
  146. <p>
  147. <input type="hidden" name="a_delete" id="a_delete" value="D">
  148. <?php foreach ($arRecKeys as $sKey) { ?>
  149. <input type="hidden" name="key_m[]" id="key_m[]" value="<?php echo ew_HtmlEncode($sKey) ?>">
  150. <?php } ?>
  151. <table class="ewTable">
  152. <tr class="ewTableHeader">
  153. <td valign="top">User ID</td>
  154. <td valign="top">Resume</td>
  155. <td valign="top">Post ID</td>
  156. <td valign="top">Application Date</td>
  157. <td valign="top">Application Email</td>
  158. <td valign="top">Application Comments</td>
  159. <td valign="top">Application Attachment</td>
  160. <td valign="top">Application File Name</td>
  161. </tr>
  162. <?php
  163. $nRecCount = 0;
  164. $i = 0;
  165. while (!$rs->EOF) {
  166. $nRecCount++;
  167. // Set row class and style
  168. $osj2Dapplications->CssClass = "ewTableRow";
  169. $osj2Dapplications->CssStyle = "";
  170. // Display alternate color for rows
  171. if ($nRecCount % 2 <> 1) {
  172. $osj2Dapplications->CssClass = "ewTableAltRow";
  173. }
  174. // Get the field contents
  175. LoadRowValues($rs);
  176. // Render row value
  177. $osj2Dapplications->RowType = EW_ROWTYPE_VIEW; // view
  178. RenderRow();
  179. ?>
  180. <tr<?php echo $osj2Dapplications->DisplayAttributes() ?>>
  181. <td<?php echo $osj2Dapplications->user_id->CellAttributes() ?>>
  182. <div<?php echo $osj2Dapplications->user_id->ViewAttributes() ?>><?php echo $osj2Dapplications->user_id->ViewValue ?></div>
  183. </td>
  184. <td<?php echo $osj2Dapplications->resume_id->CellAttributes() ?>>
  185. <div<?php echo $osj2Dapplications->resume_id->ViewAttributes() ?>><?php echo $osj2Dapplications->resume_id->ViewValue ?></div>
  186. </td>
  187. <td<?php echo $osj2Dapplications->post_id->CellAttributes() ?>>
  188. <div<?php echo $osj2Dapplications->post_id->ViewAttributes() ?>><?php echo $osj2Dapplications->post_id->ViewValue ?></div>
  189. </td>
  190. <td<?php echo $osj2Dapplications->application_date->CellAttributes() ?>>
  191. <div<?php echo $osj2Dapplications->application_date->ViewAttributes() ?>><?php echo $osj2Dapplications->application_date->ViewValue ?></div>
  192. </td>
  193. <td<?php echo $osj2Dapplications->application_email->CellAttributes() ?>>
  194. <div<?php echo $osj2Dapplications->application_email->ViewAttributes() ?>><?php echo $osj2Dapplications->application_email->ViewValue ?></div>
  195. </td>
  196. <td<?php echo $osj2Dapplications->application_text->CellAttributes() ?>>
  197. <div<?php echo $osj2Dapplications->application_text->ViewAttributes() ?>><?php echo $osj2Dapplications->application_text->ViewValue ?></div>
  198. </td>
  199. <td<?php echo $osj2Dapplications->application_file->CellAttributes() ?>>
  200. <?php if ($osj2Dapplications->application_file->HrefValue <> "") { ?>
  201. <?php if (!is_null($osj2Dapplications->application_file->Upload->DbValue)) { ?>
  202. <a href="<?php echo $osj2Dapplications->application_file->HrefValue ?>" target="_blank"><?php echo $osj2Dapplications->application_file->ViewValue ?></a>
  203. <?php } ?>
  204. <?php } else { ?>
  205. <?php if (!is_null($osj2Dapplications->application_file->Upload->DbValue)) { ?>
  206. <?php echo $osj2Dapplications->application_file->ViewValue ?>
  207. <?php } ?>
  208. <?php } ?>
  209. </td>
  210. <td<?php echo $osj2Dapplications->application_file_name->CellAttributes() ?>>
  211. <div<?php echo $osj2Dapplications->application_file_name->ViewAttributes() ?>><?php echo $osj2Dapplications->application_file_name->ViewValue ?></div>
  212. </td>
  213. </tr>
  214. <?php
  215. $rs->MoveNext();
  216. }
  217. $rs->Close();
  218. ?>
  219. </table>
  220. <p>
  221. <input type="submit" name="Action" id="Action" value="Confirm Delete">
  222. </form>
  223. <script language="JavaScript" type="text/javascript">
  224. <!--
  225. // Write your table-specific startup script here
  226. // document.write("page loaded");
  227. //-->
  228. </script>
  229. <?php include "osj-footer.php" ?>
  230. <?php
  231. // If control is passed here, simply terminate the page without redirect
  232. Page_Terminate();
  233. // -----------------------------------------------------------------
  234. // Subroutine Page_Terminate
  235. // - called when exit page
  236. // - clean up connection and objects
  237. // - if url specified, redirect to url, otherwise end response
  238. function Page_Terminate($url = "") {
  239. global $conn;
  240. // Page unload event, used in current page
  241. Page_Unload();
  242. // Global page unloaded event (in userfn*.php)
  243. Page_Unloaded();
  244. // Close Connection
  245. $conn->Close();
  246. // Go to url if specified
  247. if ($url <> "") {
  248. ob_end_clean();
  249. header("Location: $url");
  250. }
  251. exit();
  252. }
  253. ?>
  254. <?php
  255. // ------------------------------------------------
  256. // Function DeleteRows
  257. // - Delete Records based on current filter
  258. function DeleteRows() {
  259. global $conn, $Security, $osj2Dapplications;
  260. $DeleteRows = TRUE;
  261. $sWrkFilter = $osj2Dapplications->CurrentFilter;
  262. if ($Security->CurrentUserID() <> "" && !$Security->IsAdmin()) { // Non system admin
  263. $sWrkFilter = $osj2Dapplications->AddUserIDFilter($sWrkFilter, $Security->CurrentUserID()); // Add User ID filter
  264. }
  265. // Set up filter (Sql Where Clause) and get Return Sql
  266. // Sql constructor in osj2Dapplications class, osj2Dapplicationsinfo.php
  267. $osj2Dapplications->CurrentFilter = $sWrkFilter;
  268. $sSql = $osj2Dapplications->SQL();
  269. $conn->raiseErrorFn = 'ew_ErrorFn';
  270. $rs = $conn->Execute($sSql);
  271. $conn->raiseErrorFn = '';
  272. if ($rs === FALSE) {
  273. return FALSE;
  274. } elseif ($rs->EOF) {
  275. $_SESSION[EW_SESSION_MESSAGE] = "No records found"; // No record found
  276. $rs->Close();
  277. return FALSE;
  278. }
  279. $conn->BeginTrans();
  280. WriteAuditTrailDummy("*** batch delete begin ***"); // Batch delete begin
  281. // Clone old rows
  282. $rsold = ($rs) ? $rs->GetRows() : array();
  283. if ($rs) $rs->Close();
  284. // Call row deleting event
  285. if ($DeleteRows) {
  286. foreach ($rsold as $row) {
  287. $DeleteRows = $osj2Dapplications->Row_Deleting($row);
  288. if (!$DeleteRows) break;
  289. }
  290. }
  291. if ($DeleteRows) {
  292. $sKey = "";
  293. foreach ($rsold as $row) {
  294. $sThisKey = "";
  295. if ($sThisKey <> "") $sThisKey .= EW_COMPOSITE_KEY_SEPARATOR;
  296. $sThisKey .= $row['application_id'];
  297. $conn->raiseErrorFn = 'ew_ErrorFn';
  298. $DeleteRows = $conn->Execute($osj2Dapplications->DeleteSQL($row)); // Delete
  299. $conn->raiseErrorFn = '';
  300. if ($DeleteRows === FALSE)
  301. break;
  302. if ($sKey <> "") $sKey .= ", ";
  303. $sKey .= $sThisKey;
  304. }
  305. } else {
  306. // Set up error message
  307. if ($osj2Dapplications->CancelMessage <> "") {
  308. $_SESSION[EW_SESSION_MESSAGE] = $osj2Dapplications->CancelMessage;
  309. $osj2Dapplications->CancelMessage = "";
  310. } else {
  311. $_SESSION[EW_SESSION_MESSAGE] = "Delete cancelled";
  312. }
  313. }
  314. if ($DeleteRows) {
  315. $conn->CommitTrans(); // Commit the changes
  316. if ($DeleteRows) {
  317. foreach ($rsold as $row) {
  318. WriteAuditTrailOnDelete($row);
  319. }
  320. }
  321. WriteAuditTrailDummy("*** batch delete success ***"); // Batch delete success
  322. } else {
  323. $conn->RollbackTrans(); // Rollback changes
  324. WriteAuditTrailDummy("*** batch delete rollback ***"); // Batch delete rollback
  325. }
  326. // Call recordset deleted event
  327. if ($DeleteRows) {
  328. foreach ($rsold as $row) {
  329. $osj2Dapplications->Row_Deleted($row);
  330. }
  331. }
  332. return $DeleteRows;
  333. }
  334. ?>
  335. <?php
  336. // Load recordset
  337. function LoadRecordset($offset = -1, $rowcnt = -1) {
  338. global $conn, $osj2Dapplications;
  339. // Call Recordset Selecting event
  340. $osj2Dapplications->Recordset_Selecting($osj2Dapplications->CurrentFilter);
  341. // Load list page sql
  342. $sSql = $osj2Dapplications->SelectSQL();
  343. if ($offset > -1 && $rowcnt > -1) $sSql .= " LIMIT $offset, $rowcnt";
  344. // Load recordset
  345. $conn->raiseErrorFn = 'ew_ErrorFn';
  346. $rs = $conn->Execute($sSql);
  347. $conn->raiseErrorFn = '';
  348. // Call Recordset Selected event
  349. $osj2Dapplications->Recordset_Selected($rs);
  350. return $rs;
  351. }
  352. ?>
  353. <?php
  354. // Load row based on key values
  355. function LoadRow() {
  356. global $conn, $Security, $osj2Dapplications;
  357. $sFilter = $osj2Dapplications->SqlKeyFilter();
  358. if (!is_numeric($osj2Dapplications->application_id->CurrentValue)) {
  359. return FALSE; // Invalid key, exit
  360. }
  361. $sFilter = str_replace("@application_id@", ew_AdjustSql($osj2Dapplications->application_id->CurrentValue), $sFilter); // Replace key value
  362. if ($Security->CurrentUserID() <> "" && !$Security->IsAdmin()) { // Non system admin
  363. $sFilter = $osj2Dapplications->AddUserIDFilter($sFilter, $Security->CurrentUserID()); // Add User ID filter
  364. }
  365. // Call Row Selecting event
  366. $osj2Dapplications->Row_Selecting($sFilter);
  367. // Load sql based on filter
  368. $osj2Dapplications->CurrentFilter = $sFilter;
  369. $sSql = $osj2Dapplications->SQL();
  370. if ($rs = $conn->Execute($sSql)) {
  371. if ($rs->EOF) {
  372. $LoadRow = FALSE;
  373. } else {
  374. $LoadRow = TRUE;
  375. $rs->MoveFirst();
  376. LoadRowValues($rs); // Load row values
  377. // Call Row Selected event
  378. $osj2Dapplications->Row_Selected($rs);
  379. }
  380. $rs->Close();
  381. } else {
  382. $LoadRow = FALSE;
  383. }
  384. return $LoadRow;
  385. }
  386. // Load row values from recordset
  387. function LoadRowValues(&$rs) {
  388. global $osj2Dapplications;
  389. $osj2Dapplications->application_id->setDbValue($rs->fields('application_id'));
  390. $osj2Dapplications->user_id->setDbValue($rs->fields('user_id'));
  391. $osj2Dapplications->resume_id->setDbValue($rs->fields('resume_id'));
  392. $osj2Dapplications->post_id->setDbValue($rs->fields('post_id'));
  393. $osj2Dapplications->application_date->setDbValue($rs->fields('application_date'));
  394. $osj2Dapplications->application_email->setDbValue($rs->fields('application_email'));
  395. $osj2Dapplications->application_text->setDbValue($rs->fields('application_text'));
  396. $osj2Dapplications->application_file->Upload->DbValue = $rs->fields('application_file');
  397. $osj2Dapplications->application_file_name->setDbValue($rs->fields('application_file_name'));
  398. }
  399. ?>
  400. <?php
  401. // Render row values based on field settings
  402. function RenderRow() {
  403. global $conn, $Security, $osj2Dapplications;
  404. // Call Row Rendering event
  405. $osj2Dapplications->Row_Rendering();
  406. // Common render codes for all row types
  407. // user_id
  408. $osj2Dapplications->user_id->CellCssStyle = "";
  409. $osj2Dapplications->user_id->CellCssClass = "";
  410. // resume_id
  411. $osj2Dapplications->resume_id->CellCssStyle = "";
  412. $osj2Dapplications->resume_id->CellCssClass = "";
  413. // post_id
  414. $osj2Dapplications->post_id->CellCssStyle = "";
  415. $osj2Dapplications->post_id->CellCssClass = "";
  416. // application_date
  417. $osj2Dapplications->application_date->CellCssStyle = "";
  418. $osj2Dapplications->application_date->CellCssClass = "";
  419. // application_email
  420. $osj2Dapplications->application_email->CellCssStyle = "";
  421. $osj2Dapplications->application_email->CellCssClass = "";
  422. // application_text
  423. $osj2Dapplications->application_text->CellCssStyle = "";
  424. $osj2Dapplications->application_text->CellCssClass = "";
  425. // application_file
  426. $osj2Dapplications->application_file->CellCssStyle = "";
  427. $osj2Dapplications->application_file->CellCssClass = "";
  428. // application_file_name
  429. $osj2Dapplications->application_file_name->CellCssStyle = "";
  430. $osj2Dapplications->application_file_name->CellCssClass = "";
  431. if ($osj2Dapplications->RowType == EW_ROWTYPE_VIEW) { // View row
  432. // user_id
  433. $osj2Dapplications->user_id->ViewValue = $osj2Dapplications->user_id->CurrentValue;
  434. $osj2Dapplications->user_id->CssStyle = "";
  435. $osj2Dapplications->user_id->CssClass = "";
  436. $osj2Dapplications->user_id->ViewCustomAttributes = "";
  437. // resume_id
  438. if (!is_null($osj2Dapplications->resume_id->CurrentValue)) {
  439. $sSqlWrk = "SELECT `resume_title` FROM `osj-resumes` WHERE `resume_id` = " . ew_AdjustSql($osj2Dapplications->resume_id->CurrentValue) . "";
  440. $sSqlWrk .= " AND (" . "`user_id` = ".CurrentUserID()."" . ")";
  441. $sSqlWrk .= " ORDER BY `resume_title` Asc";
  442. $rswrk = $conn->Execute($sSqlWrk);
  443. if ($rswrk) {
  444. if (!$rswrk->EOF) {
  445. $osj2Dapplications->resume_id->ViewValue = $rswrk->fields('resume_title');
  446. }
  447. $rswrk->Close();
  448. } else {
  449. $osj2Dapplications->resume_id->ViewValue = $osj2Dapplications->resume_id->CurrentValue;
  450. }
  451. } else {
  452. $osj2Dapplications->resume_id->ViewValue = NULL;
  453. }
  454. $osj2Dapplications->resume_id->CssStyle = "";
  455. $osj2Dapplications->resume_id->CssClass = "";
  456. $osj2Dapplications->resume_id->ViewCustomAttributes = "";
  457. // post_id
  458. $osj2Dapplications->post_id->ViewValue = $osj2Dapplications->post_id->CurrentValue;
  459. $osj2Dapplications->post_id->CssStyle = "";
  460. $osj2Dapplications->post_id->CssClass = "";
  461. $osj2Dapplications->post_id->ViewCustomAttributes = "";
  462. // application_date
  463. $osj2Dapplications->application_date->ViewValue = $osj2Dapplications->application_date->CurrentValue;
  464. $osj2Dapplications->application_date->ViewValue = ew_FormatDateTime($osj2Dapplications->application_date->ViewValue, 6);
  465. $osj2Dapplications->application_date->CssStyle = "";
  466. $osj2Dapplications->application_date->CssClass = "";
  467. $osj2Dapplications->application_date->ViewCustomAttributes = "";
  468. // application_email
  469. $osj2Dapplications->application_email->ViewValue = $osj2Dapplications->application_email->CurrentValue;
  470. $osj2Dapplications->application_email->CssStyle = "";
  471. $osj2Dapplications->application_email->CssClass = "";
  472. $osj2Dapplications->application_email->ViewCustomAttributes = "";
  473. // application_text
  474. $osj2Dapplications->application_text->ViewValue = $osj2Dapplications->application_text->CurrentValue;
  475. if (!is_null($osj2Dapplications->application_text->ViewValue)) $osj2Dapplications->application_text->ViewValue = str_replace("\n", "<br>", $osj2Dapplications->application_text->ViewValue);
  476. $osj2Dapplications->application_text->CssStyle = "";
  477. $osj2Dapplications->application_text->CssClass = "";
  478. $osj2Dapplications->application_text->ViewCustomAttributes = "";
  479. // application_file
  480. if (!is_null($osj2Dapplications->application_file->Upload->DbValue)) {
  481. $osj2Dapplications->application_file->ViewValue = "Application Attachment";
  482. } else {
  483. $osj2Dapplications->application_file->ViewValue = "";
  484. }
  485. $osj2Dapplications->application_file->CssStyle = "";
  486. $osj2Dapplications->application_file->CssClass = "";
  487. $osj2Dapplications->application_file->ViewCustomAttributes = "";
  488. // application_file_name
  489. $osj2Dapplications->application_file_name->ViewValue = $osj2Dapplications->application_file_name->CurrentValue;
  490. $osj2Dapplications->application_file_name->CssStyle = "";
  491. $osj2Dapplications->application_file_name->CssClass = "";
  492. $osj2Dapplications->application_file_name->ViewCustomAttributes = "";
  493. // user_id
  494. $osj2Dapplications->user_id->HrefValue = "";
  495. // resume_id
  496. $osj2Dapplications->resume_id->HrefValue = "";
  497. // post_id
  498. $osj2Dapplications->post_id->HrefValue = "";
  499. // application_date
  500. $osj2Dapplications->application_date->HrefValue = "";
  501. // application_email
  502. $osj2Dapplications->application_email->HrefValue = "";
  503. // application_text
  504. $osj2Dapplications->application_text->HrefValue = "";
  505. // application_file
  506. if (!is_null($osj2Dapplications->application_file->Upload->DbValue)) {
  507. $osj2Dapplications->application_file->HrefValue = "osj-osj2dapplications_application_file_bv.php?application_id=" . $osj2Dapplications->application_id->CurrentValue;
  508. if ($osj2Dapplications->Export <> "") $osj2Dapplications->application_file->HrefValue = ew_ConvertFullUrl($osj2Dapplications->application_file->HrefValue);
  509. } else {
  510. $osj2Dapplications->application_file->HrefValue = "";
  511. }
  512. // application_file_name
  513. $osj2Dapplications->application_file_name->HrefValue = "";
  514. } elseif ($osj2Dapplications->RowType == EW_ROWTYPE_ADD) { // Add row
  515. } elseif ($osj2Dapplications->RowType == EW_ROWTYPE_EDIT) { // Edit row
  516. } elseif ($osj2Dapplications->RowType == EW_ROWTYPE_SEARCH) { // Search row
  517. }
  518. // Call Row Rendered event
  519. $osj2Dapplications->Row_Rendered();
  520. }
  521. ?>
  522. <?php
  523. // Write Audit Trail start/end for grid update
  524. function WriteAuditTrailDummy($typ) {
  525. $table = 'osj-applications';
  526. // Write Audit Trail
  527. $filePfx = "log";
  528. $curDate = date("Y/m/d");
  529. $curTime = date("H:i:s");
  530. $id = ew_ScriptName();
  531. $user = CurrentUserID();
  532. $action = $typ;
  533. ew_WriteAuditTrail($filePfx, $curDate, $curTime, $id, $user, $action, $table, "", "", "", "");
  534. }
  535. ?>
  536. <?php
  537. // Write Audit Trail (delete page)
  538. function WriteAuditTrailOnDelete(&$rs) {
  539. global $osj2Dapplications;
  540. $table = 'osj-applications';
  541. // Get key value
  542. $key = "";
  543. if ($key <> "") $key .= EW_COMPOSITE_KEY_SEPARATOR;
  544. $key .= $rs['application_id'];
  545. // Write Audit Trail
  546. $filePfx = "log";
  547. $curDate = date("Y/m/d");
  548. $curTime = date("H:i:s");
  549. $id = ew_ScriptName();
  550. $user = CurrentUserID();
  551. $action = "D";
  552. $newvalue = "";
  553. foreach (array_keys($rs) as $fldname) {
  554. if ($osj2Dapplications->fields[$fldname]->FldDataType <> EW_DATATYPE_BLOB) { // Ignore Blob Field
  555. $oldvalue = ($osj2Dapplications->fields[$fldname]->FldDataType == EW_DATATYPE_MEMO) ? "<MEMO>" : $rs[$fldname]; // Memo Field
  556. ew_WriteAuditTrail($filePfx, $curDate, $curTime, $id, $user, $action, $table, $fldname, $key, $oldvalue, $newvalue);
  557. }
  558. }
  559. }
  560. ?>
  561. <?php
  562. // Page Load event
  563. function Page_Load() {
  564. //echo "Page Load";
  565. }
  566. // Page Unload event
  567. function Page_Unload() {
  568. //echo "Page Unload";
  569. }
  570. ?>