Example #1
0
file_put_contents($file_path, $xls_content);
//Сохраняем
if (!file_exists($file_path)) {
    exit('File does not exist');
}
$objPHPExcel = $objReader->load($file_path);
$sheetData = $objPHPExcel->getActiveSheet()->toArray(null, true, false, true);
$datearr = array_shift($sheetData);
//slice the heads
$datestring = $datearr['A'];
//print_r($sheetData);exit;
if ($datestring) {
    require_once __DIR__ . '/db/sqlite.php';
    $db = new Model();
    $date = date('Ymd');
    $existing = $db->checkPrevious($datestring, $date);
} else {
    $existing = true;
}
if ($sheetData && !$existing) {
    /*
     * Профессия
     * Организация
     * Дополнительные пожелания
     * З/П руб.
     * Адрес организации
     * Контактные данные
     */
    $try_count = 5;
    //max num of rows, which script will skip
    do {