• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP SSP类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中SSP的典型用法代码示例。如果您正苦于以下问题:PHP SSP类的具体用法?PHP SSP怎么用?PHP SSP使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了SSP类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: ajax_list

 public function ajax_list($limit = 0)
 {
     $post = $this->input->post();
     $export = false;
     if (isset($post["isExport"])) {
         $post = json_decode($post["lastPost"], true);
         $export = $post["export"] = true;
     }
     $columns = array(array('db' => 'name', 'dt' => 0), array('db' => 'role', 'dt' => 1), array('db' => 'email', 'dt' => 2), array('db' => 'creation_date', 'dt' => 3, 'formatter' => function ($d, $row) {
         return date('jS M y', strtotime($d));
     }), array('db' => 'id', 'dt' => 4, 'formatter' => function ($d, $row) {
         $op = array();
         if (hasAccess("adminusers", "edit")) {
             $op[] = '<a href="' . site_url('admin/adminusers/edit/' . $d) . '" class="fa fa-edit"></a> ';
         }
         /*if (hasAccess("adminusers","delete"))
         		$op[] = '<a href="javascript:void(0);" onclick="delete_user('.$d.')" class="fa fa-trash-o"></a>';*/
         return implode(" / ", $op);
     }));
     if (!$export) {
         echo json_encode(SSP::simple($post, ADMIN, "id", $columns));
         exit;
     } else {
         $exportColumns = array("name" => "Name", "role" => "Role", "email" => "Email");
         $data = SSP::simple($post, ADMIN, "id", $columns);
         $this->load->library("excel");
         $this->excel->setActiveSheetIndex(0);
         $this->excel->stream('adminusers.xls', $data, $exportColumns);
     }
 }
开发者ID:niravpatel2008,项目名称:ubiquitous-octo-tatertot,代码行数:30,代码来源:adminusers.php


示例2: ajax_list

 public function ajax_list($limit = 0)
 {
     $post = $this->input->post();
     $export = false;
     if (isset($post["isExport"])) {
         $post = json_decode($post["lastPost"], true);
         $export = $post["export"] = true;
     }
     $i = 0;
     $columns = array(array('db' => 'cm_uname', 'dt' => $i++), array('db' => 'cm_uemail', 'dt' => $i++), array('db' => 'cm_umobile', 'dt' => $i++), array('db' => 'cm_ucity', 'dt' => $i++), array('db' => 'cm_ucomment', 'dt' => $i++), array('db' => 'cm_date', 'dt' => $i++, 'formatter' => function ($d, $row) {
         return date('jS M y', strtotime($d));
     }), array('db' => 'cm_id', 'dt' => $i++, 'formatter' => function ($d, $row) {
         $op = array();
         if (hasAccess("contactrequest", "view")) {
             $op[] = '<a href="javascript:void(0);" onclick="view_contact(' . $d . ')" class="fa fa-list-alt"></a>';
         }
         if (hasAccess("contactrequest", "delete")) {
             $op[] = '<a href="javascript:void(0);" onclick="delete_contact(' . $d . ')" class="fa fa-trash-o"></a>';
         }
         return implode(" / ", $op);
     }));
     if (!$export) {
         echo json_encode(SSP::simple($post, CONTACT, "cm_id", $columns));
         exit;
     } else {
         $exportColumns = array("cm_uname" => "Name", "cm_uemail" => "Email", "cm_umobile" => "Mobile number", "cm_ucity" => "City", "cm_ucomment" => "Message", "cm_date" => "Date");
         $data = SSP::simple($post, CONTACT, "cm_id", $columns);
         $this->load->library("excel");
         $this->excel->setActiveSheetIndex(0);
         $this->excel->stream('contact_request.xls', $data, $exportColumns);
     }
 }
开发者ID:niravpatel2008,项目名称:ubiquitous-octo-tatertot,代码行数:32,代码来源:contactrequest.php


示例3: getdata

 public function getdata()
 {
     $table = '`group`';
     $primaryKey = 'id';
     $columns = array(array('db' => 'id', 'dt' => 'DT_RowId', 'formatter' => function ($d, $row) {
         return 'row_' . $d;
     }, 'field' => 'id'), array('db' => 'id', 'dt' => 0, 'field' => 'id'), array('db' => 'name', 'dt' => 1, 'field' => 'name'), array('db' => 'null', 'dt' => 2));
     require 'ssp.ado.class.php';
     echo json_encode(SSP::simple($this->cfg->dbcnx, $_GET, $table, $primaryKey, $columns, $joinQuery));
 }
开发者ID:vlad433,项目名称:universityd,代码行数:10,代码来源:group.php


示例4: get_remote

 public function get_remote()
 {
     $table = 'access_level';
     // Table's primary key
     $primaryKey = 'id';
     // Array of database columns which should be read and sent back to DataTables.
     // The `db` parameter represents the column name in the database, while the `dt`
     // parameter represents the DataTables column identifier. In this case simple
     // indexes
     $columns = array(array('db' => 'level_name', 'dt' => 0), array('db' => 'description', 'dt' => 1), array('db' => 'indicator', 'dt' => 2));
     // SQL server connection information
     $CI =& get_instance();
     $sql_details = array('user' => $CI->db->username, 'pass' => $CI->db->password, 'db' => $CI->db->database, 'host' => $CI->db->hostname);
     echo json_encode(SSP::simple($_GET, $sql_details, $table, $primaryKey, $columns));
 }
开发者ID:jgat2012,项目名称:hp_oms,代码行数:15,代码来源:datagrid.php


示例5: mysql_error

        if (!$result_sql) {
            echo 'Invalid query: ' . mysql_error();
        } else {
            echo "success";
        }
    } else {
        echo 'Invalid query: ' . mysql_error();
    }
}
if ($type == 'get_button_list') {
    $table = 'share_buttons';
    $primaryKey = 'bid';
    $columns = array(array('db' => 'b_title', 'dt' => 'b_title'), array('db' => 'b_target_id', 'dt' => 'b_target_id'), array('db' => 'b_content', 'dt' => 'b_content'), array('db' => 'page_id', 'dt' => 'page_id'), array('db' => 'bid', 'dt' => 'bid'));
    $extraWhere = " shop='" . mysql_real_escape_string($shop) . "' ";
    require 'ssp.class.php';
    $arr = SSP::complex($_POST, $sql_details, $table, $primaryKey, $columns, null, $extraWhere);
    $json = $arr;
    print_r(json_encode($json));
}
if ($type == 'search_p') {
    $search_text = trim($_REQUEST['ss']);
    $search_collection_id = trim($_REQUEST['sc']);
    $search_type = trim($_REQUEST['st']);
    $page = trim($_REQUEST['page']);
    $limit_str = 10;
    if ($search_type == "all_coll") {
        $search_peram = "?limit=" . $limit_str . "&page=" . $page;
        $search_products_data = $sc->call('GET', '/admin/products.json?collection_id=' . $search_collection_id . $search_peram);
        $total_prod_count = $sc->call('GET', '/admin/products.json?collection_id=' . $search_collection_id);
        $total_prod_count = intval($total_prod_count);
    } else {
开发者ID:borisnogindev,项目名称:Share-Viewer,代码行数:31,代码来源:ajax.php


示例6: array

// DB table to use
$table = 'modx_activations';
// Table's primary key
$primaryKey = 'id';
// Array of database columns which should be read and sent back to DataTables.
// The `db` parameter represents the column name in the database, while the `dt`
// parameter represents the DataTables column identifier. In this case simple
// indexes
$columns = array(array('db' => 'id', 'dt' => 'DT_RowId', 'formatter' => function ($d, $row) {
    // Technically a DOM id cannot start with an integer, so we prefix
    // a string. This can also be useful if you have multiple tables
    // to ensure that the id is unique with a different prefix
    return 'row_' . $d;
}), array('db' => 'act_date', 'dt' => 0, 'formatter' => function ($d, $row) {
    return !empty($d) ? date('d.m.Y', $d) : "";
}), array('db' => 'pc_id', 'dt' => 1, 'formatter' => function ($d, $row) {
    global $modx;
    return $modx->runSnippet('pdoField', array('id' => $d, 'field' => 'pagetitle'));
}), array('db' => 'abonent', 'dt' => 2), array('db' => 'bonus_set', 'dt' => 3, 'formatter' => function ($d, $row) {
    return !empty($d) ? $d . " руб." : "";
}));
// SQL server connection information
$sql_details = array('user' => 'mgmbee', 'pass' => 'mB915009', 'db' => 'mgm', 'host' => 'node100241-blogger.jelastic.regruhosting.ru');
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * If you just want to use the basic configuration for DataTables with PHP
 * server-side, there is no need to edit below this line.
 */
require MODX_CORE_PATH . 'components/datatables/server_side/scripts/ssp.class.php';
$beeWhere = array($_POST['beeWhere']);
echo json_encode(SSP::complex($_POST, $sql_details, $table, $primaryKey, $columns, null, $beeWhere));
开发者ID:antoncom,项目名称:messenger,代码行数:30,代码来源:server_side_blg_pcode_activations.php


示例7: array

        $columns = array(array('db' => 'id', 'dt' => 0), array('db' => 'original_id', 'dt' => 1), array('db' => 'addres', 'dt' => 2), array('db' => 'start_date', 'dt' => 3), array('db' => 'end_date', 'dt' => 4), array('db' => 'task_type_name', 'dt' => 5), array('db' => 'shabloni_name', 'dt' => 6), array('db' => 'first_last_name', 'dt' => 7), array('db' => 'person_name', 'dt' => 8), array('db' => 'prio_name', 'dt' => 9), array('db' => 'note', 'dt' => 10));
        // SQL server connection information
        $sql_details = array('user' => 'root', 'pass' => 'Gl-1114', 'db' => 'asteriskcdrdb', 'host' => 'localhost');
        /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         * If you just want to use the basic configuration for DataTables with PHP
         * server-side, there is no need to edit below this line.
         */
        mysql_close();
        require '../../../../includes/ssp.class.php';
        if ($_REQUEST[check] != '') {
            $dadebit = "";
        } else {
            $dadebit = "";
        }
        $where_param = "";
        $data = SSP::simple($_GET, $sql_details, $table, $primaryKey, $columns, $where_param);
        break;
    case 'delete_file':
        mysql_query("DELETE FROM file WHERE id = {$delete_id}");
        $increm = mysql_query("\tSELECT  `name`,\r\n        \t\t\t`rand_name`,\r\n        \t\t\t`id`\r\n        \t\t\tFROM \t`file`\r\n        \t\t\tWHERE   `task_id` = {$edit_id}\r\n        \t\t\t");
        $data1 = '';
        while ($increm_row = mysql_fetch_assoc($increm)) {
            $data1 .= '<tr style="border-bottom: 1px solid #85b1de;">
				          <td style="width:110px; display:block;word-wrap:break-word;">' . $increm_row[name] . '</td>
        			<td ><button type="button" value="media/uploads/file/' . $increm_row[rand_name] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none;background-image:url(\'media/images/get.png\');" id="download" ></button><input type="text" style="display:none;" id="download_name" value="' . $increm_row[rand_name] . '"> </td>
        					<td ><button type="button" value="' . $increm_row[id] . '" style="cursor:pointer; border:none; margin-top:25%; display:block; height:16px; width:16px; background:none; background-image:url(\'media/images/x.png\');" id="delete"></button></td>
 					  </tr>';
        }
        $data = array('page' => $data1);
        break;
    case 'up_now':
开发者ID:GeoPvN,项目名称:mspy,代码行数:31,代码来源:outgoing_tab8.action.php


示例8: get_table_group

 function get_table_group($table, $primaryKey, $columns, $where, $group)
 {
     $config = new config();
     $sql_details = $config->sql_details();
     require 'ssp.class.php';
     echo json_encode(SSP::simplewheregroup($_POST, $sql_details, $table, $primaryKey, $columns, $where, $group));
 }
开发者ID:datadigicore,项目名称:admin_cat,代码行数:7,代码来源:datatable.php


示例9: get_table_join

 function get_table_join($table, $table2, $primaryKey, $columns, $on, $where, $group, $dataArray)
 {
     $config = new config();
     $sql_details = $config->sql_details();
     require 'ssp.class.php';
     echo json_encode(SSP::complexjoin($_POST, $sql_details, $table, $table2, $primaryKey, $columns, $on, $where, $group, $dataArray));
 }
开发者ID:datadigicore,项目名称:siprisdik,代码行数:7,代码来源:datatable.php


示例10: galleries_table

 function galleries_table()
 {
     //ajax call function
     if (!$_REQUEST) {
         return false;
     }
     $baseSql = "\n\t\t\tSELECT \n\t\t\t\tCASE g.type \n\t\t\t\t\tWHEN 1 THEN 'Gallery 1'\n\t\t\t\t\tWHEN 2 THEN 'Gallery 2'\n\t\t\t\t\tWHEN 3 THEN 'Gallery 3'\n\t\t\t\t\tWHEN 4 THEN 'Gallery 4'\n\t\t\t\t\tELSE 'Gallery'\n\t\t\t\tEND AS 'Type',\n\t\t\t\tg.gallery_id,\n\t\t\t\tg.gallery_title as 'Title',\n\t\t\t\tg.url as 'URL',\n\t\t\t\tg.category as 'Category',\n\t\t\t\tg.author_id,\n\t\t\t\tg.created as 'Date Created',\n\t\t\t\tu.username as 'Author',\n\t\t\t\t'' as 'Image'\n\t\t\tFROM\n\t\t\t\tgallery g\n\t\t\tLEFT JOIN\n\t\t\t\tusername u\n\t\t\tON\n\t\t\t\tg.user_id = u.id\n\t\t";
     //List all of your columns here
     $columns = array('Title', 'URL', 'Type', 'Category', 'Author', 'Image', 'Date Created');
     $functions = array();
     /*
      * adding functions is not required. This is just a way to run functions on the data if you wish.
      * This will take the target which is the Image row from the query, and change it to the "replace" string.
      * You can use part of the query to build the replace using {} and passing them in the params.
      */
     $functions[] = array('function' => 'editRow', 'target' => 'Image', 'replace' => '<img src="www.mysite.com/{gallery_id}" alt="{Title}">', 'params' => array('gallery_id', 'Title'));
     /*
      * Add this to change the date format. Simply put in the date format
      * of your column in the format_from value, and put the
      * desired date format in the format_to value
      * 20150101 becomes Thu: 01-01-15
      */
     $functions[] = array('function' => 'date_format', 'format_to' => 'D: m-d-y', 'format_from' => 'Ymd', 'columns' => array('Date Created'));
     /*
      * list any columns you want to be "searchable".
      * you can also list non visable data here to be searchable, such as the gallery_id.
      */
     $searchable = array('Title', 'URL', 'Author', 'Category');
     echo json_encode(SSP::buildTable($this->Model, $_REQUEST, $baseSql, $columns, $searchable, $functions));
 }
开发者ID:jccultima123,项目名称:datatables-1,代码行数:30,代码来源:controller.php


示例11: menucat_list

 public function menucat_list()
 {
     $sql = 'select menu_category_id,menu_category_name from menu_category';
     $sql_data = $this->usermenumodel->columns($sql);
     $ssp_file = 'IncludeViews/ssp.php';
     require $ssp_file;
     echo json_encode(SSP::simple($_POST, $sql_data['sql_details'], $sql, $sql_data['columns']));
 }
开发者ID:aakash5792,项目名称:sample,代码行数:8,代码来源:menucat-1.php


示例12: zone_list

 public function zone_list()
 {
     $sql = 'select * from country_zone';
     $sql_data = $this->usermenumodel->columns($sql);
     $ssp_file = 'IncludeViews/ssp.php';
     require $ssp_file;
     echo json_encode(SSP::simple($_POST, $sql_data['sql_details'], $sql, $sql_data['columns']));
 }
开发者ID:aakash5792,项目名称:sample,代码行数:8,代码来源:zone.php


示例13: usermaster_list

 public function usermaster_list()
 {
     $sql = $this->usermastermodel->index();
     $sql_data = $this->usermenumodel->columns($sql);
     $ssp_file = 'IncludeViews/ssp.php';
     require $ssp_file;
     echo json_encode(SSP::simple($_POST, $sql_data['sql_details'], $sql, $sql_data['columns']));
 }
开发者ID:aakash5792,项目名称:sample,代码行数:8,代码来源:usermaster.php


示例14: ajax

 function ajax()
 {
     $table = 'v_asignaturas';
     $primaryKey = 'codigo';
     $columns = array(array('db' => 'nombre_area_administrativa', 'dt' => 0), array('db' => 'codigo', 'dt' => 1), array('db' => 'nombre', 'dt' => 2), array('db' => 'codigo', 'dt' => 3, 'formatter' => function ($d, $row) {
         return '<input type="checkbox" name="asignatura_ciclo" value="' . $d . '" onclick="$.ajax({method: \'POST\', url: \'/asignaturas_ciclo/asociar_asignatura_ciclo\', data: { asignatura: \'' . $d . '\'}})">';
     }));
     $sql_details = array('user' => 'root', 'pass' => 'root', 'db' => 'simapro', 'host' => 'localhost');
     require 'ssp.class.php';
     echo json_encode(SSP::simple($_GET, $sql_details, $table, $primaryKey, $columns));
 }
开发者ID:juan-gamez,项目名称:simapro,代码行数:11,代码来源:Asignaturas_ciclo.php


示例15: ajax_list

 public function ajax_list($limit = 0)
 {
     $post = $this->input->post();
     $columns = array(array('db' => 'name', 'dt' => 0), array('db' => 'email', 'dt' => 1), array('db' => 'creation_date', 'dt' => 2, 'formatter' => function ($d, $row) {
         return date('jS M y', strtotime($d));
     }), array('db' => 'id', 'dt' => 3, 'formatter' => function ($d, $row) {
         $op = array();
         $op[] = '<a href="' . site_url('/users/edit/' . $d) . '" class="fa fa-edit"></a> ';
         $op[] = '<a href="javascript:void(0);" onclick="delete_user(' . $d . ')" class="fa fa-trash-o"></a>';
         return implode(" / ", $op);
     }));
     echo json_encode(SSP::simple($post, USER, "id", $columns));
     exit;
 }
开发者ID:niravpatel2008,项目名称:yummy-wookie,代码行数:14,代码来源:users.php


示例16: getOrder

 public function getOrder()
 {
     $table = 'tx_order';
     $primaryKey = 'id';
     $columns = array(array('db' => '`o`.`id`', 'dt' => 'id', 'formatter' => function ($d, $row) {
         return 'row_' . $d;
     }, 'field' => 'id'), array('db' => '`o`.`show_id`', 'dt' => 'show_id', 'field' => 'show_id'), array('db' => '`o`.`order_time`', 'dt' => 'order_time', 'field' => 'order_time'), array('db' => '`o`.`order_mobile`', 'dt' => 'mobile1', 'field' => 'order_mobile'), array('db' => '`o`.`cared_name`', 'dt' => 'cared_name', 'field' => 'cared_name'), array('db' => '`o`.`cared_gender`', 'dt' => 'cared_gender', 'field' => 'cared_gender'), array('db' => '`h`.`hospital_name`', 'dt' => 'hospital_name', 'field' => 'hospital_name'), array('db' => '`u`.`mobile`', 'dt' => 'mobile2', 'field' => 'mobile'), array('db' => '`o`.`status`', 'dt' => 'status', 'field' => 'status'), array('db' => '`o`.`cid`', 'dt' => 'cid', 'field' => 'cid'));
     $sql_details = array('user' => 'root', 'pass' => 'root', 'db' => 'taixin', 'host' => 'localhost');
     require 'ssp.customized.class.php';
     $joinQuery = "FROM `tx_order` AS `o` JOIN `tx_user` AS `u` ON (`u`.`id` = `o`.`uid`) JOIN  `tx_hospital` AS `h` ON (`h`.`id` = `o`.`hospital_id`)";
     //$extraWhere = "`u`.`salary` >= 90000";
     $extraWhere = '';
     echo json_encode(SSP::simple($_GET, $sql_details, $table, $primaryKey, $columns, $joinQuery, $extraWhere));
 }
开发者ID:wjyGamedev,项目名称:xuezhiweb,代码行数:14,代码来源:db.php


示例17: ajax_list

 public function ajax_list($limit = 0)
 {
     $post = $this->input->post();
     $export = false;
     if (isset($post["isExport"])) {
         $post = json_decode($post["lastPost"], true);
         $export = $post["export"] = true;
     }
     $columns = array(array('db' => 'ad.ad_title', 'dt' => 0), array('db' => 'ad.ad_image', 'dt' => 1), array('db' => 'ad.ad_link', 'dt' => 2), array('db' => 'ad.ad_ispaid', 'dt' => 3), array('db' => 'ad.ad_show_on_page', 'dt' => 4), array('db' => 'ad.ad_created_date', 'dt' => 5, 'formatter' => function ($d, $row) {
         return date('jS M y', strtotime($d));
     }), array('db' => 'ad.ad_active', 'dt' => 6, 'formatter' => function ($d, $row) {
         $status = '';
         if ($d == 1) {
             $status = 'Active';
         }
         if ($d == 0) {
             $status = 'Inactive';
         }
         return $status;
     }), array('db' => 'ad.ad_id', 'dt' => 7, 'formatter' => function ($d, $row) {
         $op = array();
         if (hasAccess("advertise", "view")) {
             $op[] = '<a href="javascript:void(0);" onclick="view_ad(' . $d . ')" class="fa fa-list-alt"></a>';
         }
         if (hasAccess("advertise", "edit")) {
             $op[] = '<a href="' . site_url('/admin/advertise/edit/' . $d) . '" class="fa fa-edit"></a>';
         }
         if (hasAccess("advertise", "delete")) {
             $op[] = '<a href="javascript:void(0);" onclick="delete_ad(' . $d . ')" class="fa fa-trash-o">';
         }
         return implode(" / ", $op);
     }));
     #$join[] = array(USER_U,"u.u_id = ad.ad_uid");
     if (!$export) {
         echo json_encode(SSP::simple($post, ADVERTISE_AD, "ad.ad_id", $columns));
         exit;
     } else {
         $exportColumns = array("ad_title" => "Title", "ad_link" => "Link", "ad_ispaid" => "Is Paid", "ad_show_on_page" => "On Page", "ad_active" => "Status", "ad_created_date" => "Created At");
         $data = SSP::simple($post, ADVERTISE_AD, "ad.ad_id", $columns);
         $this->load->library("excel");
         $this->excel->setActiveSheetIndex(0);
         $this->excel->stream('advertise.xls', $data, $exportColumns);
     }
 }
开发者ID:niravpatel2008,项目名称:ubiquitous-octo-tatertot,代码行数:44,代码来源:advertise.php


示例18: ajax_list

 public function ajax_list($limit = 0)
 {
     $post = $this->input->post();
     $export = false;
     if (isset($post["isExport"])) {
         $post = json_decode($post["lastPost"], true);
         $export = $post["export"] = true;
     }
     $columns = array(array('db' => 'ad.clad_title', 'dt' => 0), array('db' => 'u.u_fname', 'dt' => 1), array('db' => 'r.report_text', 'dt' => 2), array('db' => 'r.created_on', 'dt' => 3, 'formatter' => function ($d, $row) {
         return date('jS M y', strtotime($d));
     }), array('db' => 'r.report_id,r.report_clad_id,ad.clad_active', 'dt' => 4, 'formatter' => function ($d, $row) {
         $report_id = $row['report_id'];
         $clad_id = $row['report_clad_id'];
         $clad_active = $row['clad_active'];
         $op = array();
         if (hasAccess("report", "view")) {
             $op[] = '<a href="javascript:void(0);" onclick="view_ad(' . $clad_id . ')"  title="View" class="fa fa-file-text-o"></a> ';
         }
         if (hasAccess("report", "delete")) {
             $op[] = '<a href="javascript:void(0);" onclick="delete_report(' . $report_id . ')" title="Delete" class="fa fa-trash-o"></a>';
         }
         if (hasAccess("classifiedad", "toggleStatus")) {
             if ($clad_active) {
                 $op[] = '<a href="javascript:void(0);" onclick="toggle_status(' . $clad_id . ')" title="Ad is active" class="fa fa-pause"></a>';
             } else {
                 $op[] = '<a href="javascript:void(0);" onclick="toggle_status(' . $clad_id . ')" title="Ad is inactive" class="fa fa-play"></a>';
             }
         }
         return implode("  &nbsp;&nbsp;  ", $op);
     }));
     $join[] = array(CLASSIFIEDAD_AD, "ad.clad_id = r.report_clad_id");
     $join[] = array(USER_U, "u.u_id = ad.clad_uid");
     if (!$export) {
         echo json_encode(SSP::simple($post, REPORTAD_R, "r.report_id", $columns, $join));
         exit;
     } else {
         $exportColumns = array("clad_title" => "Classified Title", "u_fname" => "User", "report_text" => "Comment", "created_on" => "Reported At", "clad_active" => "Classified Status");
         $data = SSP::simple($post, REPORTAD_R, "r.report_id", $columns, $join);
         $this->load->library("excel");
         $this->excel->setActiveSheetIndex(0);
         $this->excel->stream('report.xls', $data, $exportColumns);
     }
 }
开发者ID:niravpatel2008,项目名称:ubiquitous-octo-tatertot,代码行数:43,代码来源:report.php


示例19: getContact

 public function getContact($type = "")
 {
     if (isset($type) && $type != "") {
         $extraWhere = 'type =' . $type;
     } else {
         $extraWhere = '';
     }
     $table = 'inv_contact';
     $primaryKey = 'id';
     $columns = array(array('db' => 'name', 'dt' => 0, 'field' => 'name', 'searchable' => 'name', 'formatter' => function ($d, $row) {
         return '<a href="contact/item/' . $row['id'] . '" style="color:blue;">' . $d . '</a>';
     }), array('db' => 'type', 'dt' => 1, 'field' => 'type', 'formatter' => function ($d, $row) {
         $a = $d == 1 ? 'Client' : 'Supplier';
         return $a;
     }), array('db' => 'phone', 'dt' => 2, 'field' => 'phone', 'searchable' => 'phone'), array('db' => 'email', 'dt' => 3, 'field' => 'email', 'searchable' => 'email'), array('db' => 'country', 'dt' => 4, 'field' => 'country', 'searchable' => 'country'), array('db' => 'id', 'dt' => 5, 'field' => 'action', 'formatter' => function ($d, $row) {
         return '<a href="contact/edit/' . $d . '" class="btn btn-xs show-tooltip" title="" data-original-title="Edit"><span class="fa fa-edit"></span></a>';
     }));
     $joinQuery = 'SELECT * FROM inv_contact $where $order $limit';
     echo json_encode(SSP::simple1($_REQUEST, $this->_sql_details, $table, $primaryKey, $columns, $joinQuery, $extraWhere));
 }
开发者ID:nikunj1806,项目名称:product-manager,代码行数:20,代码来源:datatable.class.php


示例20: get_json

 public function get_json()
 {
     $table = 'view_products';
     // Table's primary key
     $primaryKey = 'id';
     // Array of database columns which should be read and sent back to DataTables.
     // The `db` parameter represents the column name in the database, while the `dt`
     // parameter represents the DataTables column identifier. In this case simple
     // indexes
     $columns = array(array('db' => 'id', 'dt' => 0), array('db' => 'name', 'dt' => 1, 'formatter' => function ($d, $row) {
         return ucfirst($d);
     }), array('db' => 'sku', 'dt' => 2, 'formatter' => function ($d, $row) {
         return ucfirst($d);
     }), array('db' => 'price', 'dt' => 3, 'formatter' => function ($d, $row) {
         return 'Rs. ' . number_format($d, 2);
     }), array('db' => 'category_name', 'dt' => 4, 'formatter' => function ($d, $row) {
         return ucfirst($d);
     }), array('db' => 'weight', 'dt' => 5), array('db' => 'is_instock', 'dt' => 6, 'formatter' => function ($d, $row) {
         $class = $d == 0 || $d == '' ? 'btn-danger' : 'btn-success';
         $value = $d == 0 || $d == '' ? 0 : 1;
         $result = "<button class='change-stock btn btn-xs btn-status btn-outline " . $class . "''>" . $this->config->item("stock_" . $value) . "</button>";
         return $result;
     }), array('db' => 'is_active', 'dt' => 7, 'formatter' => function ($d, $row) {
         $class = $d == 0 || $d == '' ? 'btn-danger' : 'btn-success';
         $value = $d == 0 || $d == '' ? 0 : 1;
         $result = "<button class='change-status btn btn-xs btn-status " . $class . "''>" . $this->config->item("status_" . $value) . "</button>";
         return $result;
     }), array('db' => 'id', 'dt' => 8, 'formatter' => function ($d, $row) {
         $links = '<a href="' . base_url() . "products/edit/" . base64_encode($d) . '" class="btn btn-info btn-circle" type="button" title="Edit"><i class="fa fa-pencil"></i></a>
                                     <a href="' . base_url() . 'products/delete/' . base64_encode($d) . '" class="delete btn btn-danger btn-circle" type="button" title="Delete"><i class="fa fa-trash"></i></a>';
         return $links;
     }));
     // SQL server connection information
     $sql_details = array('user' => 'root', 'pass' => '', 'db' => 'trade_plus', 'host' => 'localhost');
     /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
      * If you just want to use the basic configuration for DataTables with PHP
      * server-side, there is no need to edit below this line.
      */
     echo json_encode(SSP::simple($_GET, $sql_details, $table, $primaryKey, $columns));
 }
开发者ID:krhknoxpo,项目名称:tradePlus,代码行数:40,代码来源:products.php



注:本文中的SSP类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP SSViewer类代码示例发布时间:2022-05-23
下一篇:
PHP SR_Player类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap