-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathclienti.server.php
More file actions
68 lines (64 loc) · 2.41 KB
/
Copy pathclienti.server.php
File metadata and controls
68 lines (64 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
session_start();
header("Cache-control: private"); // IE 6 Fix
require_once("clienti.common.php");
$mysql = new MySQL();
$html = new Html;
function lista($litera = null, $filtre = array())
{
global $mysql;
$objResponse = new xajaxResponse();
$cls = new Clienti($mysql);
if (!$filtre) {
if (!$litera) {
$nr_r = $cls -> find(array("ORDER BY", "denumire", "ASC"));
} else {
$nr_r = $cls -> find(array("WHERE", "denumire like '$litera%'", "ORDER BY", "denumire", "ASC"));
}
} else {
$nr_r = $cls -> find(array("WHERE", $filtre['dupa'], "like", "'%". $filtre['txtSearch'] ."%'", "ORDER BY", "denumire", "ASC"));
}
if ($nr_r) {
$gv = new GridView;
$gv -> tableOptions['tag'] = array("width" => "100%", "border" => 0, "cellspacing" => 0, "cellpadding"=>0, "align"=>"left");
$gv -> tableOptions['head'] = array("class"=> "rowhead");
$gv -> columns = array("Denumire", "REG COM");
$gv -> tableOptions['ColWidth'] = array("50%", "50%");
for ($i=0; $i<$nr_r; $i++) {
$obj = $cls -> objects[$i];
$gv -> dataTable[$i]['data'] = array($obj -> denumire, $obj -> reg_com);
if ($i%2==0) {
$class = "roweven";
} else {
$class = "rowodd";
}
$gv -> dataTable[$i]['tag'] = array("class"=>$class,
"onMouseOver"=>"$(this).addClass('rowhover')",
"onMouseOut"=>"$(this).removeClass('rowhover')",
"onClick"=>"$('#listaObiecte tr').removeClass('rowclick');$(this).addClass('rowclick');xajax_loadForm(". $obj -> client_id .")",
);
}
$objResponse -> assign("listaObiecte", "innerHTML", $gv -> getTable());
} else {
$objResponse -> assign("listaObiecte", "innerHTML", "NU SUNT INREGISTRARI");
}
return $objResponse;
}
function loadForm($client_id)
{
global $mysql;
$objResponse = new xajaxResponse();
$obj = new Clienti($mysql, $client_id);
$objResponse -> assign("divForm", "innerHTML", $obj -> frmClient());
return $objResponse;
}
function btnSave($frmValues)
{
global $mysql;
$obj = new Clienti($mysql);
$obj -> salveazaClient($frmValues);
$objResponse = lista(substr($frmValues['denumire'], 0, 1));
$objResponse -> assign("divForm", "innerHTML", "");
return $objResponse;
}
$xajax->processRequest();