在codeigniter中提交表单后无法获取post值

时间:2017-04-06 11:50:47

标签: php jquery html forms codeigniter

查看页面 - > create_event.php

    <?php
$mainmenu ="create_event";
?>

<html lang="en"><head>
<title>KONNECT</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/konnect1/css/bootstrap.min.css">
<link rel="stylesheet" href="/konnect1/css/bootstrap-responsive.min.css">
<link rel="stylesheet" href="/konnect1/css/matrix-style.css">
<link rel="stylesheet" href="/konnect1/css/matrix-media.css">
<link rel="stylesheet" href="/konnect1/css/colorpicker.css">
<link rel="stylesheet" href="/konnect1/css/eventinfo.css">
<link href="/konnect1/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">

<link rel="stylesheet" href="/konnect1/css/bootstrap-wysihtml5.css">
<link rel="stylesheet" href="/konnect1/css/htmlbox.css">
<link href="/konnect1/font-awesome/css/font-awesome.css" rel="stylesheet">
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,700,800" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/konnect1/js/jquery-1.8.3.min.js" charset="UTF-8"></script>
<!--<script src="../js/jquery.min.js"></script> 
-->
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<script src="/konnect1/js/bootstrap.min.js"></script> 
<script src="/konnect1/js/jquery.ui.custom.js"></script> 
<script src="/konnect1/js/matrix.js"></script> 
<script type="text/javascript" src="/konnect1/js/bootstrap-datetimepicker.js" charset="UTF-8"></script>
<script type="text/javascript" src="/konnect1/js/bootstrap-datetimepicker.fr.js" charset="UTF-8"></script>
<script type="text/javascript" src="/konnect1/js/htmlbox.colors.js"></script>
<script type="text/javascript" src="/konnect1/js/htmlbox.styles.js"></script>
<script type="text/javascript" src="/konnect1/js/htmlbox.syntax.js"></script>
<script type="text/javascript" src="/konnect1/js/htmlbox.undoredomanager.js"></script>
<script type="text/javascript" src="/konnect1/js/htmlbox.min.js"></script>
<script type="text/javascript" src="/konnect1/js/htmlbox.full.js"></script>

<style>
 <!--@media (min-width: 1200px) {    .btnj{      margin-top:10px;        margin-left: 446px;         width:90px;             background-color: #006dcc;              border: 1px solid #006dcc;    color: #fff;  }   .radios{           margin-left: 50px;  }    .span11{        width: 74.3% !important;        margin-left: 4.5% !important;       margin-top: 1%;         background-color:#FFF;  }   .eventinfoj{       margin-left: 36px;} .widgetstyle{   padding-bottom:12px !important;}.control-label{ margin-left:-29px;}.table-sortable tbody tr {    cursor: move;}.tab-content {overflow: hidden;margin-left:27px;}.form-actions{  background-color:#F9F9F9 !important;}.datetimepicker {  margin-left: 17% !important;    margin-top: 2% !important;}.datetimepicker .prev th{    background-color:#eee !important;} } /* Landscape tablets and medium desktops */ @media (min-width: 992px) and (max-width: 1199px) {     .btnj{      margin-top:10px;        margin-left: 45%;       width:90px;             background-color: #006dcc;              border: 1px solid #006dcc;    color: #fff;      }   .span11{        width: 70.6% !important;        margin-left: 2.4% !important;       margin-top: 1%;         background-color:#FFF;  }.widgetstyle{     padding-bottom:12px !important;}.table-sortable tbody tr {    cursor: move;}.tab-content {overflow: hidden;margin-left:27px;}.form-actions{ background-color:#F9F9F9 !important;}.datetimepicker {  margin-left: 17% !important;    margin-top: 2% !important;}.datetimepicker .prev th{    background-color:#eee !important;}   } /* Portrait tablets and small desktops */ @media (min-width: 768px) and (max-width: 991px) { .btnj{       margin-top:10px;        margin-left: 290px;         width:90px;             background-color: #006dcc;              border: 1px solid #006dcc;    color: #fff; }   .radios{            margin-left: 50px;  }   .span11{         width: 63.5% !important;        margin-left: 3% !important;         margin-top: 1%;         background-color:#FFF;  }.widgetstyle{ padding-bottom:12px !important;}.table-sortable tbody tr {    cursor: move;}.tab-content {overflow: hidden;margin-left:27px;}.form-actions{ background-color:#F9F9F9 !important;}.datetimepicker {  margin-left: 17% !important;    margin-top: 2% !important;}.datetimepicker .prev th{    background-color:#eee !important;}  } /* Landscape phones and portrait tablets */@media (max-width: 767px) {    .btnj{       margin-top:10px;        margin-left: 40%;       width:90px;             background-color: #006dcc;              border: 1px solid #006dcc;    color: #fff; }   .radios{            margin-left: 50px;  }.span11{        width: 54.5% !important;        margin-left: 3.8% !important;       margin-top: 1%;         background-color:#FFF;  }  .widgetstyle{   padding-bottom:12px !important;}.table-sortable tbody tr {    cursor: move;}.tab-content {overflow: hidden;margin-left:27px;}.form-actions{ background-color:#F9F9F9 !important;}.datetimepicker {  margin-left: 17% !important;    margin-top: 2% !important;}.datetimepicker .prev th{    background-color:#eee !important;}  } /* Portrait phones and smaller */ @media (max-width: 480px) { .btnj{       margin-top:10px;        margin-left: 67px;      width:90px;             background-color: #006dcc;              border: 1px solid #006dcc;    color: #fff;  }  .radios{            margin-left: 50px;  }.span11{        width: 67.3% !important;        margin-left: 13% !important;        margin-top: 1%;         background-color:#FFF;  }.eventinfoj{      margin-left: 0px;}  .control-label{ margin-left:0px;}.widgetstyle{  padding-bottom:12px !important;}.table-sortable tbody tr {    cursor: move;}.tab-content {overflow: hidden;margin-left:27px;}.form-actions{ background-color:#F9F9F9 !important;}.datetimepicker {  margin-left: 17% !important;    margin-top: 2% !important;}.datetimepicker .prev th{    background-color:#eee !important;}}-->

 .startimecl{
     margin-top: 3%;
 }
 .addrowbtn{
     border-radius:50%;
     background-color:#51a351;
     color:#FFFFFF;
     width: 14px;
     margin-right: 6%;
 }
 .addicon{
     font-size:28px;
     margin-left: -4px;
 }
 .reviewcl{

     margin-left: 26%;
     height:auto;
 }
 .reviewcardcl{
     height:auto;
     background-color: #FFFFFF;
     margin-top: -2%;
 }
 .agendacl{
     margin-top: -2%;

 }
 .publiccl{
     margin-top: -40%;
    margin-left: 48%;
 }
 .publiccl1{
     margin-top: -38%;
    margin-left: 74%;
 }
 .datetimepicker {
    margin-left: 5% !important;
    margin-top: 2% !important;
 }
 .addrowbtn {
    background-color: #8bbcb0;
 }
 </style>
</head>
<body>
<!--Header-part-->
<?php include 'header.php'; ?>
<!--Header-part-->
<!--main-container-part-->
<div id="content">
  <div id="content-header">
    <div id="breadcrumb"> <a href="index" class="tip-bottom" data-original-title="Go to Home"><i class="icon-home"></i> Home</a> <a href="admin_c/create_event" class="current">Create Events</a> </div>
    <br>
    <div class="stepwizard col-md-3">
    <div class="stepwizard-row setup-panel">
    <div class="stepwizard-step">
    <a href="#step-1" type="button" class="btn btn-circle btnopacity btn-primary" >1</a>
    <p>Event Info</p>
    </div>
    <div class="stepwizard-step">
        <a href="#step-2" type="button" id="click" class="btn btn-default btn-circle btnopacity" >2</a>
    <p>Schedule</p>
    </div>
    <div class="stepwizard-step">
        <a href="#step-3" type="button" class="btn btn-default btn-circle btnopacity" >3</a>
    <p>Agenda</p>
    </div>
    <div class="stepwizard-step">
        <a href="#step-4" type="button" class="btn btn-default btn-circle btnopacity " >4</a>
    <p>Review</p>
    </div>
    </div>
    </div>
  </div>
  <div class="container-fluid">
    <hr>
    <div class="row-fluid">
      <div class="span12">
        <div class="widget-box">
          <div class="widget-content widgetstyle">

    <!--<form role="form" action="" method="post" class="form-horizontal">-->

    <?php echo form_open('admin_c/create_event1','class="form-horizontal"','method=post','role=form');?>

    <div class="setup-content" id="step-1" style="display: none;"><div class="eventinfoj">
          <h3> Event Information</h3></div>
                <div class="control-group" style="margin-bottom:10px;"> 
                <label class="control-label" style="font-weight:600px !important;">Select a Category</label>
                <div class="controls">
                    <select name="ecategory" style="margin-left:0;width:91.38% !important;">
                    <option>Conference</option>
                    <option>Second option</option>
                    <option>Third option</option>
                    <option>Fourth option</option>
                    <option>Fifth option</option>
                    <option>Sixth option</option>
                    <option>Seventh option</option>
                    <option>Eighth option</option>
                    </select>
                </div>
                </div>

            <div class="control-group" style="margin-bottom:10px;"> 
             <div class="controls" style="padding: 0%;">
                <label class="control-label" style="margin-left: -30.5%;">Event Type</label>

                <font style="display:inline-block!important;margin-top: 1.45%;" >
                  <input name="etype" value="public" type="radio"  style="margin-top: 21%;" >
                  <p class="publiccl">Public</p></font>
                <font style="display:inline-block!important;margin-left: 4%;">
                  <input name="etype" value="private" type="radio" style="margin-left: 14px;">
                <p class="publiccl1"> Private </p>
                 </font>

              </div>
              </div>
             <div class="control-group" style="margin-bottom:10px;">
              <label class="control-label" style="margin-left:-62px;">Event Name</label>
              <div class="controls">
                <input name="ename" type="text" class="span11" placeholder="Event name" style="width:91.5% !important;margin-left: 0px !important;">
              </div>
             </div>

             <div class="control-group" style="margin-bottom:10px;">
              <label class="control-label " style="margin-left:-47px;" >Date and Time</label>
              <div class="input-group date form_datetime" data-date="1979-09-16T05:25:07Z" data-date-format="dd MM yyyy - HH:ii p" data-link-field="dtp_input1"  >
              <input name="edat_time" type="text" class="span11" style="background-color: #FFF;width: 74.8% !important;margin-left: 6% !important;" placeholder="Date and Time" readonly >
                    <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                    <span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
              </div>
              <input type="hidden" id="dtp_input1" value="" /><br/>
             </div>
             <div class="control-group" style="margin-bottom:10px;">
              <label class="control-label" style="margin-left:-100px;">Venue</label>
              <div class="controls">
                <textarea name="evenue" class="span12" style="max-width:91.45% !important;margin-left:0%;" placeholder="Venue"></textarea>
              </div>
            </div>
                      <center><button class="btn btn-primary nextBtn btn-lg" type="button">Next</button></center>



    </div>



    <div class="setup-content" id="step-2" style="display: none !important;">
          <h3 style="margin-left: 2%;"> Create Schedule</h3>
        <table class="table table-bordered table-hover table-sortable" id="tab_logic" style="width: 97%;margin-left: 1.5%;">
                <thead>
                    <tr >
                        <th class="text-center" style="font-size:15px;padding:7px 0px;text-align: center;">
                            Event
                        </th>
                        <th class="text-center" style="font-size:15px;padding:7px 0px;text-align: center;">
                            Speaker
                        </th>
                        <th class="text-center" style="font-size:15px;padding:7px 0px;text-align: center;">
                            Start Time
                        </th>
                        <th class="text-center" style="font-size:15px;padding:7px 0px;text-align: center;">
                            End Time
                        </th>
                        <th class="text-center" style="font-size:15px;padding:7px 0px;text-align: center;">
                            Venue
                        </th>

                    </tr>
                </thead>
                <tbody>
                    <tr class="ui-droppable" id='addr0' data-id="0" >

                        <td data-name="sch_name" >
                            <input name='sch_name' type="text" placeholder='Event Name' class="form-control" style="text-align:center;margin-left:10%;margin-top:10px;height: 29px;width: 85.4%;padding:17px;   "/>
                        </td>

                        <td data-name="speaker_name" >
                            <input name='speaker_name' type="text" placeholder='Speaker' class="form-control" style="text-align:center;margin-left:16%;margin-top:10px;height: 29px;width: 68.4%;padding:17px;   "/>
                        </td>

                        <td data-name="" data-id="sch_stime">

                        <div id="sch_stime" class="input-group date form_datetime startimecl" data-date="1979-09-16T05:25:07Z" data-date-format="dd MM yyyy - HH:ii p" data-link-field="dtp_input1" style="width: 100.4%;text-align:center;">
                        <input name="sch_stime" type="text" class="span11" style="background-color: #FFF;margin-top: 3%;height: 37px;width: 69%;text-align: center;" placeholder="Start Time" >
                         <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                         <span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
                         </div>

                         <input type="hidden" id="dtp_input1" name='sch_stime' value="" /><br/>    
                        </td>

                        <td data-name="" data-id="sch_etime">
                        <div class="input-group date form_datetime startimecl " data-date="1979-09-16T05:25:07Z" data-date-format="dd MM yyyy - HH:ii p" data-link-field="dtp_input1" style="width: 100.4%;text-align:center;">
                        <input name="sch_etime" type="text" class="span11" style="background-color: #FFF;margin-top: 3%;height: 37px;width: 69%;text-align: center;" placeholder='End Time'>
                         <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                         <span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
                         </div>
                         <input type="hidden" id="dtp_input1" name="sch_etime" value="" /><br/>    

                        </td>

                        <td data-name="sch_venue" >
                            <input name='sch_venue' type="text" placeholder="Venue" class="form-control" style="text-align:center;margin-left:16%;margin-top:10px;height: 29px;width: 68.4%;padding:17px;   "/>
                        </td>

                    </tr>

                </tbody>
            </table>

        <a name="add_row" id="add_row" value="+" class="btn btn-default btn-lg pull-right addrowbtn" style=""><i class="fa fa-plus addicon" aria-hidden="true"></i></a>
        <input name="counter" id="counter" value="0" type="text">

        <br><br><br><hr>
          <button class="btn btn-primary nextBtn btn-lg" type="button" style="margin-bottom: 14px;margin-left: 446px;width:90px;">Next</button>


    </div>


    <div class="setup-content" id="step-3" style="display: none !important;margin-left:3.7%;">
          <h3> Create Agenda</h3>
          <div class="container">
            <div class="row-fluid">
            <div class="span6"> 

            <textarea name="agenda_desc" id="htmlbox_silk_icon_set_blue">Type Here....</textarea> 
            </div>
            </div>
            </div>
          <button class="btn btn-primary nextBtn btn-lg" type="submit" style="margin-top: 19px;margin-bottom: 9px;margin-left: 446px;width:90px;">Next</button>
            <br>
    </div>
    <input type="text" name="results" id="results" value="0">
    <?php echo form_close(); ?>



    <div class="setup-content" id="step-4" style="display: none !important;">
          <h3 style="margin-left: 28px;"> Review</h3>
            <div class="container-fluid">
            <div class="row-fluid">
            <div class="span12">
            <div class="card reviewcardcl">
            <div class="card-content">
            <div class="container-fluid">
                <div class="row-fluid">
                <div class="span12">
                <img class="span2 offset1" src="/konnect1/user_images/tedx.png">
                <br>
                <table class="reviewcl">
                <tbody>
                <tr>
                <td>
                <p style="font-size: 20px;margin-left: 84px;font-weight: bold;"> Event-Name: </p>
                </td>
                <td style="margin-left: -4px;">
                <p style="font-size: 20px;margin-left:10px;"> TedEx</p>
                </td>
                </tr>
                <tr>
                <td>
                <p style="font-size: 20px;margin-left: 84px;font-weight: bold;"> Event-Venue: </p>
                </td>
                <td style="margin-left: -4px;">
                <p style="font-size: 20px;margin-left:10px;">St Regis, Banquet 5 , Lower Parel , Mumbai-09</p>
                </td>
                </tr>
                <tr>
                <td>
                <p style="font-size: 20px;margin-left: 84px;font-weight: bold;"> Event-Type: </p>
                </td>
                <td style="margin-left: -4px;">
                <p style="font-size: 20px;margin-left:10px;;"> Private</p>
                </td>
                </tr>
                <tr>
                <td>
                <p style="font-size: 20px;margin-left: 84px;font-weight: bold;"> Date &amp; Time: </p>
                </td>

                <td style="margin-left: -4px;">
                <p style="font-size: 20px;margin-left:10px;"> 30-01-2016 3.00 PM</p>
                </td>
                </tr>
                </tbody>
                </table>
                </div>
                </div>
                </div>
                </div>  
           </div>
      </div>
    </div>
   </div>
      <div class="container-fluid">
            <div class="row-fluid">
            <div class="span6">
            <div class="card" style="height:auto;background-color: #FFFFFF;">
            <div class="card-content">
            <div class="container-fluid">
                <div class="row-fluid">
                <div class="span10">
                <br><br><br>
                <p style="font-size: 46px;margin-left: 25%;font-weight: bold;text-align: center;
                padding-bottom: 25%;"> Credits <br><br><br> 13 </p>
                </div>
                </div>
            </div>
           </div>
           </div>
      </div>
        <div class="span6">
            <div class="card" style="height:auto%;background-color:#FFFFFF;">
            <div class="card-content" style="padding-bottom:151px !important;">
            <div class="container-fluid">
                <div class="row-fluid">
                <div class="span10">
                 <br><br><br><br>
                <a style="font-size: 41px;margin-left: 13%;font-weight: bold;text-align: center;
                padding-bottom: 33px;width:100%;" href="admin_c/create_event"> Create Event </a>
                </div>
                </div>
            </div>

            </div>
           </div>
      </div>
    </div>
   </div>

        <br>
    </div>
  <!--</form>-->
</div></div>
        </div>  
    </div>         
    </div>
        </div>
<!--main-container-part-->
<!--Footer-part-->
<div class="row-fluid">
  <div id="footer" class="span12"> 2016 KONNECT. </div>
</div>
<!--end-Footer-part-->
<script>


$(document).ready(function () 
{






  var navListItems = $('div.setup-panel div a'),
          allWells = $('.setup-content'),
          allNextBtn = $('.nextBtn');

  allWells.hide();

  navListItems.click(function (e) 
   {
      e.preventDefault();
      var $target = $($(this).attr('href')),
              $item = $(this);

      if (!$item.hasClass('disabled')) 
      {
          navListItems.removeClass('btn-primary').addClass('btn-default');
          $item.addClass('btn-primary');
          allWells.hide();
          $target.show();
          $target.find('input:eq(0)').focus();
      }
  });

  allNextBtn.click(function()
  {
      var curStep = $(this).closest(".setup-content"),
          curStepBtn = curStep.attr("id"),
          nextStepWizard = $('div.setup-panel div a[href="#' + curStepBtn + '"]').parent().next().children("a"),
          curInputs = curStep.find("input[type='text'],input[type='url']"),
          isValid = true;

      $(".control-group").removeClass("has-error");

      for(var i=0; i<curInputs.length; i++)
      {
          if (!curInputs[i].validity.valid)
          {
              isValid = false;
              $(curInputs[i]).closest(".control-group").addClass("has-error");
          }
      }

      if (isValid)
          nextStepWizard.removeAttr('disabled').trigger('click');
  });

  $('div.setup-panel div a.btn-primary').trigger('click');

  $("#add_row").on("click", function() 
  {
        // Dynamic Rows Code

        // Get max row id and set new id
        var newid = 0;
        $.each($("#tab_logic tr"), function() 
        {
            if (parseInt($(this).data("id")) > newid) 
            {
                newid = parseInt($(this).data("id"));
            }
        });
        newid++;

        var tr = $("<tr></tr>", 
        {
            id: "addr"+newid,
            "data-id": newid
        });


        // loop through each td and create new elements with name of newid
        $.each($("#tab_logic tbody tr:nth(0) td"), function() 
        {
            var cur_td = $(this);

            var children = cur_td.children();

            var child = cur_td.children().children();

            // add new td and element if it has a nane
            if ($(this).data("name") != "") 
            {
                var td = $("<td></td>", 
                {
                    "data-name": $(cur_td).data("name")
                });

                var c = $(cur_td).find($(children[0]).prop('tagName')).clone().val("");
                c.attr("name", $(cur_td).data("name") + newid);
                c.appendTo($(td));
                td.addClass("drop").appendTo($(tr));
            }


            if($(this).data("name") == "")
            {
                    var td = $("<td></td>", 
                    {
                        "data-id": $(cur_td).data("id")
                    });

                    var d = $(cur_td).find($(child[0]).prop('tagName')).clone().val("");
                    d.attr("name", $(cur_td).data("id") + newid);
                    d.appendTo($(td));
                    td.appendTo($(tr));

            }




        });






        // add delete button and td
        /*
        $("<td></td>").append(
            $("<button class='btn btn-danger glyphicon glyphicon-remove row-remove'></button>")
                .click(function() {
                    $(this).closest("tr").remove();
                })
        ).appendTo($(tr));
        */


        // add the new row
        $(tr).addClass("ui-droppable").appendTo($('#tab_logic'));

        $(tr).find("td button.row-remove").on("click", function() 
        {
             $(this).closest("tr").remove();
        });
});

  // Sortable Code
    var fixHelperModified = function(e, tr) 
    {
        var $originals = tr.children();
        var $helper = tr.clone();

        $helper.children().each(function(index) 
        {
            $(this).width($originals.eq(index).width())
        });

        return $helper;
    };

    $(".table-sortable tbody").sortable({
        helper: fixHelperModified      
    }).disableSelection();

    $(".table-sortable thead").disableSelection();



    $("#add_row").trigger("click");

    /* End Schedule step javascript to add row */
    $(".stepwizard-step").on('click',  function()
    {
        $(this).prop('disabled', true);
    });

 $('.form_datetime').datetimepicker({
        //language:  'fr',
        weekStart: 1,
        todayBtn:  1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        forceParse: 0,
        showMeridian: 1
    });


    $('#add_row').click(function()
    {
        var counter = $('#counter').val();
        counter++;
        //alert(counter);
        $('#counter').val(counter);

        $('#tab_logic .ui-droppable[id]').each(function()
        {
            var d = $(this).attr("data-id");
            alert(d);
            //$(this).css({color:'red'});

            var data = d;

            $.post("create_event1", { vardata: data }).done(function(data) 
            { 
              $('#results').val(data);    
            });

        }); 



    });





});
/* End Wizard  javascript to enable and disable tab*/
/* Schedule step javascript to add row */






</script>



<script src="/konnect1/js/bootstrap-colorpicker.js"></script> 
<script src="/konnect1/js/masked.js"></script> 
<script src="/konnect1/js/jquery.uniform.js"></script> 
<script src="/konnect1/js/jquery.peity.min.js"></script> 
<script src="/konnect1/js/bootstrap-wysihtml5.js"></script> 
<script src="/konnect1/js/wysihtml5-0.3.0.js"></script> 
<script src="/konnect1/js/select2.min.js"></script> 
<script type="text/javascript" src="/konnect1/js/htmlbox.content.js"></script> 


<ul class="typeahead dropdown-menu"></ul>
<ul class="typeahead dropdown-menu"></ul>
<ul class="typeahead dropdown-menu"></ul>

</body>
</html>

控制器页面 - &gt; admin_c.php

<?php 

   class Admin_c extends CI_Controller 
   {

      function __construct() 
      { 
        parent::__construct(); 
        $this->load->helper('url'); 
        $this->load->helper('form');
        $this->load->model('admin_m');
        session_start();
      } 

      public function index() 
      { 
        $this->load->view('admin/index');
      } 

      public function create_event()
      {
        $this->load->view('admin/create_event.php');
      }

      public function edit_event()
      {
        $this->load->view('admin/edit_event.php'); 
      }

      public function event_list()
      {
        $this->load->view('admin/event_list.php');
      }

      public function invites()
      {
        $this->load->view('admin/invites.php');
      }

      public function past_events()
      {
        $this->load->view('admin/past_events.php');
      }

      public function current_events()
      {
        $this->load->view('admin/current_events.php');
      }

      public function messages()
      {
        $this->load->view('admin/messages.php');
      }

      public function create_event1()
      {
        if(isset($_POST['counter']))
        {
            $count = $_POST['counter'];
            $c = $count;
            //echo $c;          


        if($this->input->is_ajax_request())
        {
            $vardata    =   $this->input->post('vardata');
            echo $vardata;

        } 

        if(isset($_POST['results']))
        {
            $g = $_POST['results'];
            //echo $g;

            foreach($_POST as $key => $value)
            {
                if($value =='')
                {
                    echo 'POST field "'.$key . '" is empty<br />';

                    $a_error[] = $key;
                }
                else
                {
                    echo 'POST field "'.$key . '" is not empty<br />';
                }
            }


        } 

        }

        die();


        $etype = $_REQUEST['etype'];
        $ecategory = $_REQUEST['ecategory'];
        $ename = $_REQUEST['ename'];
        $edat_time = $_REQUEST['edat_time'];
        $evenue = $_REQUEST['evenue'];
        $sch_name = $_REQUEST['sch_name'];
        $speaker_name = $_REQUEST['speaker_name'];
        $sch_stime = $_REQUEST['sch_stime'];
        $sch_etime = $_REQUEST['sch_etime'];
        $sch_venue = $_REQUEST['sch_venue'];
        $sch_stime1 = $_REQUEST['sch_stime1'];
        $sch_etime1 = $_REQUEST['sch_etime1'];
        $sch_venue1 = $_REQUEST['sch_venue1'];
        $agenda_desc = $_REQUEST['agenda_desc'];

        $data = array(
           'etype' => $etype ,
           'ecategory' => $ecategory ,
           'ename' => $ename,
           'edat_time' => $edat_time,
           'evenue' => $evenue,
           'sch_name' => $sch_name,
           'speaker_name' => $speaker_name,
           'sch_stime' => $sch_stime,
           'sch_etime' => $sch_etime,
           'sch_venue' => $sch_venue,
           'sch_stime1' => $sch_stime1,
           'sch_etime1' => $sch_etime1,
           'sch_venue1' => $sch_venue1,
           'agenda_desc' => $agenda_desc
        );






        $res = $this->admin_m->insert($data);

        if($res == true)
        {
            echo "Data submitted";
        }
        else
        {
            echo "Error in submitting data";
        }
      }





   } 
?>

在视图页面中 - &gt;创建计划页面 - &gt;显示输入字段,其中名称=“sch_stime1”,name =“sch_stime2”name =“sch_etime1”,name =“sch_etime2”等的输入字段未提交给php端。错误也不会显示。我觉得问题可能出在jquery函数中(点击add_row),因为生成了name =“sch_stime1”。但我不确定究竟是什么导致了这个问题。请帮忙。

2 个答案:

答案 0 :(得分:0)

查看被检查地点的图像,您对多个输入使用相同的名称(sch_stime1)。第二个输入处于隐藏状态。

enter image description here

答案 1 :(得分:0)

使用$all_post_data=$this->input->post();获取控制器中的帖子数据