ThinkPHP交流群:49404422已废弃转移新群

浏览:558 发布日期:2014/05/10 分类:技术分享
原先的群,从1000人群变成了200人群,为了大家更好的沟通交流,现转移到335152754, 这个2000人群.~<script type="text/javascript">
//全选
$('#select_all').click(function(){
    $( "input[name=course_id]").each(function (){
        if($( this).prop('checked')){
            $( this).prop('checked',false);
        }else{
            $( this).prop('checked',true);
        }
    });
});
//入库
$('#addCourese').click(function(){
    var elective_course_id = parseInt($.trim("{$Think.get.elective_course_id}"));
    var course_id_arr = new Array();
    var k = 0;
    $( "input[name=course_id]").each(function (){
        if($( this).prop('checked')){
            course_id_arr[k] = $(this).val();
            k ++;
        }
    });
    if(course_id_arr.length<1){
        art.dialog({content:'你没有选择任何操作数据.~',time:1});
        return false;
    }
    var course_str_ids = implode( ',', course_id_arr);
    var json_data ={
                elective_course_id:elective_course_id,
                course_str_ids:course_str_ids
            };
    $.post("{:U('ElectiveCourse/addCourseToElectiveCourse')}",json_data,function(call_back){
         if (call_back.status==1) {
            art.dialog({content:call_back.info,time:1});
            setTimeout(function(){
               window.location.href=call_back.url;
           },1500);
        }else{
           art.dialog({content:call_back.info,time:1});
        }
     });
     return false;
});
//js下数组分割
function implode(glue, pieces) {
    var i = '', retVal='', tGlue='';
    if(arguments.length === 1) {
         pieces = glue;
       glue = '';
    }
    if(typeof(pieces) === 'object') {
       if(pieces instanceof Array) {
              return pieces.join(glue);
         } else {
              for(i in pieces) {
                   retVal += tGlue + pieces[i];
                   tGlue = glue;
              }
              return retVal;
         }
    } else {
       return pieces;
    }
}
</script>
最佳答案
评论( 相关
后面还有条评论,点击查看>>