Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function ListUsersDataAction() {
- $result = $this->getDoctrine()->getManager();
- $person_data = $result->createQueryBuilder()
- ->select('u.id,u.email, u.phone_number,u.buy_min,u.buy_max,u.sell_min,u.sell_max,u.status,u.start_date,u.end_date')
- ->from('AcmeBitcoinBundle:AlertData', 'u')
- ->orderBy('u.id', 'asc')
- ;
- //$sql=$results->getQuery();
- //echo $sql->getSql();
- $data = $person_data->getQuery()->getResult();
- $json = '[';
- $first = 0;
- foreach ($data as $v) {
- if ($first++)
- $json .= ',';
- $json .= '["' . $v['id'] . '",
- "' . $v['email'] . '",
- "' . $v['phone_number'] . '"]';
- }
- $json .= ']';
- return $this->render('AcmeBitcoinBundle:Datatable:list.html.twig', array(
- 'json_data' => $json
- ));
- }
- [
- [ "3","***@gmail.com","***"],
- ["4","**@gmail.com","43534654"]
- ]
- var dataSet={{json_data}}
- $(document).ready(function() {
- $('#example').dataTable( {
- "data": dataSet,
- "columns": [
- { "title": "Engine" },
- { "title": "Browser" },
- { "title": "Platform" }
- ]
- } );
- } );
- </script>
- <script>
- var dataSet=[["3",
- "hhh@gmail.com",
- "24354"],["4",
- "25435@gmail.com",
- "43534654"]]
- $(document).ready(function() {
- $('#example').dataTable( {
- "data": dataSet,
- "columns": [
- { "title": "Engine" },
- { "title": "Browser" },
- { "title": "Platform" }
- ]
- } );
- var dataSet= {{ json_data|json_encode() }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement