Category : PHP

EmailPlease follow the coding using our project folder and Create the files name like  .htaccess and file  the past this file and run the code and remove all .php and other   RewriteCond %{HTTP_HOST} !^$ RewriteCond %{HTTP_HOST} !^www. [NC] RewriteCond %{HTTPS}s ^on(s)| RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^([^.]+)$ $1…

Read more

Email inserting value of radio buttons in database? .php$employee_id = $_POST[’employee_id’];$chk = $_POST[‘chk’]; sql $sql1=”update work_order_verification_details set billing_address=’$brDetails’, business_relationship_no=’$br’, address_line1=’$address_line1′, address_line2=’$address_line2′, city=’$city’, state=’$state’, gstin=’$gstin’, name=’$name’, designation=’$designation’, company_name = ‘$company_name’, employee_id =’$employee_id’, chk =’$chk’ where auto_id_work_order=..

Read more

Emailhow to import csv file in mysql using php <?php include_once ‘dbconfig.php’;if(isset($_POST[“importSubmit”])){$csvMimes = array(‘application/vnd.ms-excel’,’text/plain’,’text/csv’,’text/tsv’);if(!empty($_FILES[‘file’][‘name’]) && in_array($_FILES[‘file’][‘type’],$csvMimes)){if(is_uploaded_file($_FILES[‘file’][‘tmp_name’])){$csvFile = fopen($_FILES[‘file’][‘tmp_name’], ‘r’);fgetcsv($csvFile);while(($line = fgetcsv($csvFile))!== FALSE){$mysql_insert=”INSERT INTO fa_customer_receipts(created_timestamp,business_relationship_no,mode_of_payment ,cheque_or_dd_no,cheque_or_dd_date,issuing_bank,issuing_branch,receipt_amount,tds_receivable_amount, receipt_amount_in_inr, transaction_reference,amount_received_on_date ) VALUES ( ‘”.$line[0].”‘, ‘”.$line[1].”‘, ‘”.$line[2].”‘,'”.$line[3].”‘, ‘”.$line[4].”‘, ‘”.$line[5].”‘, ‘”.$line[6].”‘, ‘”.$line[7].”‘, ‘”.$line[8].”‘,'”.$line[9].”‘, ‘”.$line[10].”‘, ‘”.$line[11].”‘)” ; mysqli_query($db, $mysql_insert) ordie(“database error:”. mysqli_error($db)); } fclose($csvFile); $qstring = ‘?status=succ’; }else{ $qstring = ‘?status=err’; ..

Read more

Email$sql = “SELECT distinct(a.employee_id) as ’employee_id’, CONCAT(a.first_name,’ ‘, a.middle_name,’ ‘,a.last_name) as employee_namefrom employee_information a join master_role_mapping bon (a.employee_id = b.employee_id)and b.master_role_auto_id IN (’11’,’12’)and a.employee_id NOT IN (6,231,12,91,204,349,363,432)and a.status = ‘ACTIVE’order by a.employee_id”; $result = getResult($sql);while($row = mysqli_fetch_assoc($result)){$employee_id = $row[“employee_id”];$employee_name = $row[’employee_name’];$boxHtml .= ‘<option value=”‘.$employee_id.'”>’.$employee_name.'</option..

Read more

Emailinclude_once(‘../PHPExcel/Classes/PHPExcel.php’);include_once(‘../PHPExcel/Classes/PHPExcel/Writer/Excel2007.php’);$objPHPExcel = new PHPExcel();header(‘Content-Type: application/vnd.ms-excel; charset=utf-8’);header(‘Content-Disposition: attachment;filename=”helloworld.xlsx”‘);$objPHPExcel->setActiveSheetIndex(0);$objPHPExcel->getActiveSheet()->getCell(‘A20’)->setValue(“TEST PHPEXCEL”);$objPHPExcel->getActiveSheet()->setTitle(‘Chesse1’); $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, ‘Excel2007’);ob_end_clean();$objWriter->save(‘php:/..

Read more

Emailpublic function runmocktest($sub_coures_id){if ($this->session->userdata(‘dqsuser_id’) != ”){$data = [‘dqsuser_id’ => $this->session->userdata(‘dqsuser_id’) ];// $sub_coures_id=$this->input->get(‘$sub_coures_id’);$data[“results”] = $this->usermodel->fetch_data($sub_coures_id);$this->load->view(‘front/header’, $data);$this->load->view(“users/runmocktest”, $data);} }   $query = $this->db->query(“select * from dqs_question_table where sub_coures_id = ‘”.$sub_coures_id.”‘”);return ..

Read more

Emailpublic function all_question_menu_list(){$query= $this->db->select(“dqs_question_menu.coures_name,dqs_question_sub_menu.sub_menu_name,manageexamination.*”)->from(‘dqs_question_menu’)->join(‘dqs_question_sub_menu’,’dqs_question_menu.dqs_auto_id=dqs_question_sub_menu.coures_id’)     public function all_question_menu_list(){ if($this->session->userdata(‘dqsaccount_id’) !=”){$data = [‘dqsaccount_id’ => $this->session->userdata(‘dqsaccount_id’,’dqsaccount_id’)];$data[‘view_mage’]=$this->adminloginmodel->all_question_menu_list();$this->load->view(‘front/dqs-admin-header’,$data);$this->load->view(‘dqs-admin/all_question_menu_list’,$data);$this->load->view(‘front/dqs-admin-footer’,$data); }}     <?php$i=1;foreach ($view_mage->result() as $v_test) { ?><tr><td><?php echo $i; ?></td><td><?php echo $v_test->sub_menu_name; ?></td><td><?php echo $v_test->coures_name; ?></td><td><?php echo $v_test->test_name; ?></td><td><?php echo $v_test->pear_question_marks;?></td> <td><?php echo $v_test->minimum_marks;?></td><td><?php echo $v_test->maximum_marks;?></td><td><?php echo $v_test->exam_time;?></td><td><?php echo $v_test->total_number_question;?></td><td>Delete</td></tr><?php $i++; ?><?php } ?>->join(‘manageexamination’,’dqs_question_sub_menu.dqs_auto_id=manageexamination.sub_catalog_id’)->get();return $query;}       ..

Read more

EmailModel // this subcatalogu view deatilspublic function sub_catalog_user_list(){$query= $this->db->select(“dqs_question_menu.coures_name,dqs_question_sub_menu.sub_menu_name”)->from(‘dqs_question_menu’)->join(‘dqs_question_sub_menu’,’dqs_question_menu.dqs_auto_id=dqs_question_sub_menu.coures_id’)->get();return $query;}   control : public function sub_catalog_user_list() { if($this->session->userdata(‘dqsaccount_id’)!=”){$data = [‘dqsaccount_id’ =>$this->session->userdata(‘dqsaccount_id’,’dqsaccount_id’)];$data[‘view_sub’]=$this->adminloginmodel->sub_catalog_user_list();$this->load->view(‘front/dqs-admin-header’,$data);$this->load->view(‘dqs-admin/sub_catalog_user_list’,$data);$this->load->view(‘front/dqs-admin-footer’,$data);} }   view :   <?php$i=1;foreach ($view_sub->result() as $v_test) { ?><tr><td><?php echo $i; ?></td><td><?php echo $v_test->sub_menu_name; ?></td><td><?php echo $v_test->coures_name; ?></td></tr><?php $i++; ?><?php ..

Read more

Emailmodule coding function all_admin_user(){$query = $this->db->get(‘dqs_user_admin_login’);return $query;}   controller public function dqs_user_admin_list(){if($this->session->userdata(‘dqsaccount_id’) != ”){$data = [ ‘dqsaccount_id’ =>$this->session->userdata(‘dqsaccount_id’,’dqsaccount_id’) ]; $data[‘user_admin’]= $this->adminloginmodel->all_admin_user();$this->load->view(‘front/dqs-admin-header’,$data);$this->load->view(‘dqs-admin/dqs_user_admin_list’,$data);$this->load->view(‘front/dqs-admin-footer’,$data);}else{ redirect(base_url() . ‘admin’); }}   view <?php$i=1;foreach ($dqs_register->result() as $v_test) { ?><tr><td><?php echo $i; ?></td><td><?php echo $v_test->dqsaccount_id; ?></td><td><?php echo $v_test->dqs_user_name; ?></td></tr><?php $i++; ?>&lt..

Read more

EmailModule coding  function all_dqs_user_count(){$query = $this->db->query(“SELECT COUNT(*) as total FROM dqs_user_admin_login”);return $query->row_array(); } Controller public function profile(){if($this->session->userdata(‘dqsaccount_id’) != ”){$data = [ ‘dqsaccount_id’ =>$this->session->userdata(‘dqsaccount_id’,’dqsaccount_id’) ];$this->load->view(‘front/dqs-admin-header’,$data);$this->load->view(‘dqs-admin/profile’,$data);$this->load->view(‘front/dqs-admin-footer’,$data);}else{ redirect(base_url() . ‘admin’); } view Coding : <div class=”info-box-content”><span class=”info-box-text”>No Of Comapny</span><span class=”info-box-number”><?php echo $h[‘total’]; ?> <small>%</small></span> </..

Read more

EmailHow to visits Count  using php PDO Create table first and use this coding $ip = $_SERVER[‘REMOTE_ADDR’];                             $sql = “Select id From Counter WHERE ip=’$ip'”;                             $fetch_cat=$con->prepare($sql);                             $fetch_cat->execute();                             $CheckIp=$fetch_cat->rowCount();                             if($CheckIp==0)                             {                                 $query =”insert into Counter(id,ip) VALUES(‘NULL’,’$ip’) “;                                 $fetch_cat=$con->prepare($query);                                 $fetch_cat->execute();                             }                             $number=$con->prepare(“select ip from Counter”);                             $number->execute();                             $vis=$number->rowCount();                          ..

Read more

EmailYou  the user name and password  with in single quotes   <?php $servername = ‘localhost’;$username = ‘user nam’;$password = ‘password’; try {$con= new PDO(“mysql:host=$servername;dbname=databasename”,$username,$password); $con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);//echo “Connected successfully”;}catch(PDOException $e){echo “Connection failed: ” . $e->getMess..

Read more

Email <?php $servername = “localhost”; $username = “root”; $password = “”; try { $con = newPDO(“mysql:host=$servername;dbname=#”, $username, $password);   $con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // echo “Connected successfully”; } catch(PDOException $e) { echo”Connection failed: “.$e->getMessage(..

Read more

EmailThis not error but is the Deprecated mysql_connect(); setp1: you using mysql are mysqli for exp: mysql_connect($host,$username,$password); @mysql_select_db($database) or die( “Unable to select database”); 2) You connect the data base like Answer 3) mysqli_connect($host,$username,$password); @mysqli_select_db($database) or die( “Unable to select database”); &nb..

Read more

Email<?php $error = “”;if(isset($_POST[‘createpdf’])){$post = $_POST; if(extension_loaded(‘zip’)){ if(isset($post[‘files’])){ $zip = new ZipArchive();$zip_name = date(‘m-d-Y_hia’).”.zip”;if($zip->open($zip_name, ZIPARCHIVE::CREATE)!==TRUE){ $error .= “* Sorry ZIP creation failed at this time”;}foreach($post[‘files’] as $file){$zip->addFile(‘datafiles/’.$file,$file);}$zip->close();if(file_exists($zip_name)){ header(‘Content-type: application/zip’);header(‘Content-Disposition: attachment; filename=”‘.$zip_name.'”‘);readfile($zip_name); unlink($zip_name);}} }else{$error .= “* You dont have ZIP extension”;}}?><html><head><title>dfgdfg</title> </head><body><div class=”container”><br /><br /><br /><form method=”post”><?php echo $error; ?><table class=”table table-bordered”><tr> <th>File Name</th></tr> <tr><td><input name=”files[]” ..

Read more