我想将Excel文件上传到我们的网页,然后将相应的数据存储在数据库中.然后我想检索所有数据并以表格格式显示它.我有一个代码,但使用它我无法上传所有Excel文件.只能上传一种格式.
以下是功能.但是有一些限制.
public function check_excel($filename)
{
$path='./assets/uploads/excel/'.$filename;
$this->load->library('excel');
$inputFileType = PHPExcel_IOFactory::identify($path);
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = PHPExcel_IOFactory::load($path);
$sheet = $objPHPExcel->getSheet(0);
$highestRow = $sheet->getHighestRow();
$highestColumn = $sheet->getHighestColumn();
$xf[]='';
$result[]='';
$first_check='';
$var_check=0;
for ($row = 13; $row <= $highestRow; $row++)
{
$xf[$row]=$objPHPExcel->getActiveSheet()->getCell('A'.$row)->getXfIndex(); // Get sheet index value
if($row>13 && $row<16) //This block check first kpi data expand or not
{
if($xf[$row-1]==$xf[$row]) //check parent and child sheet index value same
$first_check='false';
if ($row==15)
{
if($xf[$row]==$xf[$row-1] || $xf[$row]==$xf[$row-2]) // check the grand-child sheet index …Run Code Online (Sandbox Code Playgroud) 我有一个应用程序,当连接/断开蓝牙设备时打开警报对话框. 警报对话框由连接蓝牙设备的BroadcastReceiver触发.
我想打开一个警告对话框,如果我打开我的应用程序(应用程序A)>长按主页>转到另一个应用程序(应用程序B),蓝牙设备已连接 - >我的应用程序A 警报将显示在顶部应用B.
现在发生的事情是,如果我回到应用程序A,我只能看到对话框
我目前的代码:
final AlertDialog.Builder dialog = new AlertDialog.Builder(activity,
AlertDialog.THEME_DEVICE_DEFAULT_DARK);
... some setting here
final AlertDialog alert = dialog.create();
alert.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
alert.show();
Run Code Online (Sandbox Code Playgroud) 我有来自和来的日期范围.我想将它转换为几周.假设从日期是1-10-2014,到目前为止是2014年10月31日
然后结果是:
第1周:2014年1月1日至2014年10月4日第2期:05-102014至2014年10月11日第3期:2014年10月12日至2014年10月18日第4期:2014年10月19日至25日至10月10日2014年5月:2014年10月26日至2014年10月31日
在php.I尝试几个代码,但没有给出绝对结果只给01到7,8到14等请帮助.
我已经尝试过了答案
Get the date of one week from today with PHP in stack overflow
date("Y-m-d",strtotime("+1 week"));
Run Code Online (Sandbox Code Playgroud) 我创建了一个应用程序,因为有一个文本框用于从表中搜索信息.虽然我在搜索文本框中输入字符时编写了代码,但在接受一个字符控件后,文本框中没有.这是我的搜索代码
<script type="text/javascript">
$(document).ready(function()
{
var minlength = 1;
$("#searchTerm").keyup(function () {
value = $(this).val();
if (value.length > minlength )
{
searchTable(value);
}
else if(value.length < minlength)
{
searchTable("");
}
});
});
function searchTable(value)
{
$.ajax({
type: "GET",
url: "dispatient.php",
data:({search_keyword: value}),
success: function(success)
{
window.location.href = "dispatient.php?search_keyword="+value;
$("#searchTerm").focus();
},
error: function()
{
alert("Error occured.please try again");
},
complete: function(complete)
{
$("#searchTerm").focus();
},
});
}Run Code Online (Sandbox Code Playgroud)
<input id="searchTerm" Type="text" class="search_box" placeholder="Search"
value = <?php echo $_GET['search_keyword'] ?> >Run Code Online (Sandbox Code Playgroud)
"请建议我..
提前致谢..
在codeigniter中jquery分页出错.
if per_page=5;
total number 6 and total page 2
but the pagination like below
Showing 6 to 6 of 6 | < 1 2
But only 5 is shown and last one show in 2nd page.
Run Code Online (Sandbox Code Playgroud)
嗨朋友,我陷入了这个bug.这个节目在每一页.Pls给我一个解决方案,以获得正确的分页
下面的代码正在使用:
$config['base_url'] = site_url('settings/view_leave_reason_ajax/');
$config['total_rows'] = $this->leav->getLvReasonCount();
$config['per_page'] = 5;
$config['anchor_class'] = 'ajax_links';
$config['show_count'] = true;
$config['div'] = '#list_view';
$this->jquery_pagination->initialize($config);
$page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;
$data["links"] = $this->jquery_pagination->create_links();
$data['page'] = $page;
$data['result'] = $this->leav->getLvReason($config["per_page"], $page);
Run Code Online (Sandbox Code Playgroud)
关于以下ci分页的问题:
https://github.com/neotohin/CodeIgniter-Ajax-pagination-Library
查看页面:
<?php if($result=="") …Run Code Online (Sandbox Code Playgroud) 我有一些PHP代码,我用它来发送电子邮件到特定的电子邮件地址.但是,我想在PHP发送它时在PHP中包含更多的电子邮件地址.当我试着显示以下内容时
错误:邮件程序错误:您必须至少提供一个收件人电子邮件地址.
码
include "class.phpmailer.php"; // include the class file name
$mail = new PHPMailer(); // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
//$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
$mail->Host = "mail.authsmtp.com";
$mail->Port = "25"; // or 587
$mail->IsHTML(true);
$mail->Username = "xxxxx";
$mail->Password = "xxxxx";
$mail->SetFrom("cpn@xxxxxxx.com");
$mail->Subject = $sub1;
$mail->Body = $text_mail;
$mail->AddAddress("xxxxxxx@gmail.com;aral@xxxxxx.com;akhader@xxxxxx.com");
if(!$mail->Send()){
echo …Run Code Online (Sandbox Code Playgroud) 
我的android-studio logcat没有显示过滤器选项.我认为一些设置已经改变.
我想在高图中增加x轴标题与x轴的距离.
以下是我的x轴代码.但使用此代码标题太靠近x轴.
我尝试使用x和y值,但输出没有差异.
xAxis:
{
categories: [<?php echo $ffdat;?>],
title:
{
text: 'Overall Average Mean Time Between Failures: <?php echo round($avg, 2);?> Hrs.'
},
},
Run Code Online (Sandbox Code Playgroud) 在我的组合框中某些条件我禁用了组合框.但是我想访问控制器中的值.现在我无法得到它.实际上没有工作
<select class="select2" id="branch" name="branch" required="required" onchange="getDept();" <?php if(!empty($detailone)){?> disabled="true" <?php } ?>>
Run Code Online (Sandbox Code Playgroud) 我们可以在php页面中使用include(page.php)两次.任何错误的可能性
例如:
include(page.php);
-------
--------
--------
--------
include(page.php);
Run Code Online (Sandbox Code Playgroud) 我有一个事件后生成的表.它包含以下类型的链接<td> :
<a class="link-capacity" href="#" id="1234">Capacity</a>
Run Code Online (Sandbox Code Playgroud)
我想在这些链接上使用JQuery捕获click事件,所以我编写了这个函数:
$(".link-capacity").click(function () {
console.log("OK");
});
Run Code Online (Sandbox Code Playgroud)
在表生成之前加载此函数.
当我点击我的链接时,从不调用该函数.我错过了什么吗?我可以在加载JQuery函数后创建类吗?
php ×9
codeigniter ×3
jquery ×3
ajax ×2
mysql ×2
android ×1
click ×1
date ×1
email ×1
excel ×1
highcharts ×1
html ×1
hyperlink ×1
pagination ×1