Add php files
This commit is contained in:
34
modules/EcmReportsBackUp20151106/helper.php
Executable file
34
modules/EcmReportsBackUp20151106/helper.php
Executable file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('-1');
|
||||
if (!$_POST['job'] || $_POST['job']=='') die ('-1');
|
||||
switch ($_POST['job']) {
|
||||
case 'getDes': getDes($_POST['id']); break;
|
||||
}
|
||||
|
||||
function getDes($id){
|
||||
$db = $GLOBALS ['db'];
|
||||
$data = array();
|
||||
$queryraport = "
|
||||
SELECT
|
||||
CONCAT(u.first_name, ' ', u.last_name) AS name,
|
||||
d.user_id as userid,
|
||||
d.accepted AS accepted,
|
||||
d.accepted_description AS accepteddes
|
||||
FROM
|
||||
documents_user d
|
||||
left join users u on u.id = d.user_id
|
||||
WHERE
|
||||
d.document_id = '".$id."'";
|
||||
$tmp = $db->query($queryraport);
|
||||
if($tmp->num_rows == 0){
|
||||
$data = -1;
|
||||
}else{
|
||||
while($tmp2 = $db->fetchByAssoc($tmp)){
|
||||
$data[]=$tmp2;
|
||||
};
|
||||
}
|
||||
|
||||
echo json_encode($data);
|
||||
return;
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user