Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
resiliencia
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
publico
resiliencia
Commits
84d10964
Commit
84d10964
authored
Sep 26, 2019
by
Irving Sánchez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update files documents
parent
4f3ad461
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
1 deletion
+63
-1
BasesEncuestasController.php
...ed/modules/panel/controllers/BasesEncuestasController.php
+31
-0
DocumentosController.php
protected/modules/panel/controllers/DocumentosController.php
+32
-1
No files found.
protected/modules/panel/controllers/BasesEncuestasController.php
View file @
84d10964
...
@@ -418,6 +418,37 @@ class BasesEncuestasController extends CrController
...
@@ -418,6 +418,37 @@ class BasesEncuestasController extends CrController
//if(!isset($_GET['ajax']))return false;
//if(!isset($_GET['ajax']))return false;
$data
=
array
(
"check"
=>
"0"
);
$data
=
array
(
"check"
=>
"0"
);
$dir
=
$_SERVER
[
'DOCUMENT_ROOT'
]
.
Yii
::
app
()
->
request
->
baseUrl
.
'/archivos'
;
$servername
=
"localhost"
;
$username
=
"sec_user"
;
$password
=
"Resilencia19@"
;
$dbname
=
"ppd"
;
// Create connection
$conn
=
new
mysqli
(
$servername
,
$username
,
$password
,
$dbname
);
// Check connection
if
(
$conn
->
connect_error
)
{
die
(
"Connection failed: "
.
$conn
->
connect_error
);
}
$sql
=
"SELECT * FROM `tbl_bases_archivos` where id_base_encuesta="
.
$id
;
$result
=
$conn
->
query
(
$sql
);
if
(
$result
->
num_rows
>
0
)
{
// output data of each row
while
(
$row
=
$result
->
fetch_assoc
())
{
if
(
$row
[
'archivo'
]
!=
''
)
{
unlink
(
$dir
.
'/'
.
$row
[
'archivo'
]);
}
}
}
mysqli_close
(
$conn
);
$model
=
$this
->
loadModel
(
$id
);
$model
=
$this
->
loadModel
(
$id
);
$columnas
=
'enc_'
.
$model
->
tabla
;
$columnas
=
'enc_'
.
$model
->
tabla
;
...
...
protected/modules/panel/controllers/DocumentosController.php
View file @
84d10964
...
@@ -156,6 +156,37 @@ class DocumentosController extends CrController{
...
@@ -156,6 +156,37 @@ class DocumentosController extends CrController{
public
function
actionDelete
(
$id
){
public
function
actionDelete
(
$id
){
//if(!isset($_GET['ajax']))return false;
//if(!isset($_GET['ajax']))return false;
$data
=
array
(
"check"
=>
"0"
);
$data
=
array
(
"check"
=>
"0"
);
$dir
=
$_SERVER
[
'DOCUMENT_ROOT'
]
.
Yii
::
app
()
->
request
->
baseUrl
.
'/documentos'
;
$servername
=
"localhost"
;
$username
=
"sec_user"
;
$password
=
"Resilencia19@"
;
$dbname
=
"ppd"
;
// Create connection
$conn
=
new
mysqli
(
$servername
,
$username
,
$password
,
$dbname
);
// Check connection
if
(
$conn
->
connect_error
)
{
die
(
"Connection failed: "
.
$conn
->
connect_error
);
}
$sql
=
"SELECT * FROM `tbl_documentos` where id_documento="
.
$id
;
$result
=
$conn
->
query
(
$sql
);
if
(
$result
->
num_rows
>
0
)
{
// output data of each row
while
(
$row
=
$result
->
fetch_assoc
())
{
if
(
$row
[
'archivo'
]
!=
''
)
{
unlink
(
$dir
.
'/'
.
$row
[
'archivo'
]);
}
}
}
mysqli_close
(
$conn
);
if
(
$this
->
loadModel
(
$id
)
->
delete
())
$data
=
array
(
"check"
=>
"1"
);
if
(
$this
->
loadModel
(
$id
)
->
delete
())
$data
=
array
(
"check"
=>
"1"
);
echo
json_encode
(
$data
);
echo
json_encode
(
$data
);
exit
();
exit
();
...
@@ -230,4 +261,4 @@ class DocumentosController extends CrController{
...
@@ -230,4 +261,4 @@ class DocumentosController extends CrController{
}
}
}
}
}
}
?>
?>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment